Scaled PWM range.
Increased PWM resolution. Added version file.
This commit is contained in:
parent
d5bd67ca79
commit
0084592880
198
.cproject
198
.cproject
|
@ -1,198 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
|
||||||
<cconfiguration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1087029614">
|
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1087029614" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
|
||||||
<externalSettings/>
|
|
||||||
<extensions>
|
|
||||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
</extensions>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1087029614" name="Debug" parent="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug">
|
|
||||||
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1087029614." name="/" resourcePath="">
|
|
||||||
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.965971668" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug">
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.389837761" name="MCU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32G473CEUx" valueType="string"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.28509403" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.642098940" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.1559488687" name="Floating-point unit" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.fpv4-sp-d16" valueType="enumerated"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.287232966" name="Floating-point ABI" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.540200906" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1766540292" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32G473CEUx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32G4xx_HAL_Driver/Inc | ../Drivers/STM32G4xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32G4xx/Include | ../Drivers/CMSIS/Include | ../USB_Device/App | ../USB_Device/Target | ../Middlewares/ST/STM32_USB_Device_Library/Core/Inc | ../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc || || || USE_HAL_DRIVER | STM32G473xx || || USB_Device | Drivers | Core/Startup | Middlewares | Core || || || ${workspace_loc:/${ProjName}/STM32G473CEUX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.1519307741" name="Cpu clock frequence" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="170" valueType="string"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex.1531095928" name="Convert to Intel Hex file (-O ihex)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.nanoprintffloat.128526410" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.nanoprintffloat" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
|
||||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1672076881" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
|
||||||
<builder buildPath="${workspace_loc:/SW}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1061053879" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1733517683" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.103420967" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3" valueType="enumerated"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.1691478105" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" valueType="definedSymbols">
|
|
||||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
|
||||||
</option>
|
|
||||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1137646235" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.876715449" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.1407100898" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.397294541" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.og" valueType="enumerated"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.1741795286" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
|
||||||
<listOptionValue builtIn="false" value="DEBUG"/>
|
|
||||||
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
|
||||||
<listOptionValue builtIn="false" value="STM32G473xx"/>
|
|
||||||
</option>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.950083243" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
|
|
||||||
<listOptionValue builtIn="false" value="../Core/Inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../Drivers/STM32G4xx_HAL_Driver/Inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../Drivers/STM32G4xx_HAL_Driver/Inc/Legacy"/>
|
|
||||||
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32G4xx/Include"/>
|
|
||||||
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
|
|
||||||
<listOptionValue builtIn="false" value="../USB_Device/App"/>
|
|
||||||
<listOptionValue builtIn="false" value="../USB_Device/Target"/>
|
|
||||||
<listOptionValue builtIn="false" value="../Middlewares/ST/STM32_USB_Device_Library/Core/Inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc"/>
|
|
||||||
</option>
|
|
||||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.2067940140" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1555556582" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.261099880" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.366134615" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.1555166666" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker">
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script.1762211078" name="Linker Script (-T)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script" value="${workspace_loc:/${ProjName}/STM32G473CEUX_FLASH.ld}" valueType="string"/>
|
|
||||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input.609777905" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input">
|
|
||||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
|
||||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
|
||||||
</inputType>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.1735764407" name="MCU G++ Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.1512892220" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.864451145" name="MCU Size" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.2050388145" name="MCU Output Converter list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.1736660640" name="MCU Output Converter Hex" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1774606938" name="MCU Output Converter Binary" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1172116575" name="MCU Output Converter Verilog" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.145991430" name="MCU Output Converter Motorola S-rec" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.1045639673" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
|
|
||||||
</toolChain>
|
|
||||||
</folderInfo>
|
|
||||||
<sourceEntries>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="USB_Device"/>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
|
|
||||||
</sourceEntries>
|
|
||||||
</configuration>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
|
||||||
</cconfiguration>
|
|
||||||
<cconfiguration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.415409921">
|
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.415409921" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
|
||||||
<externalSettings/>
|
|
||||||
<extensions>
|
|
||||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
|
||||||
</extensions>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.415409921" name="Release" parent="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release">
|
|
||||||
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.415409921." name="/" resourcePath="">
|
|
||||||
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release.65058078" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release">
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.351304393" name="MCU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32G473CEUx" valueType="string"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.1547574398" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1593715144" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.1637048195" name="Floating-point unit" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.fpv4-sp-d16" valueType="enumerated"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.1774667521" name="Floating-point ABI" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.286605184" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.277637299" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Release || false || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32G473CEUx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32G4xx_HAL_Driver/Inc | ../Drivers/STM32G4xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32G4xx/Include | ../Drivers/CMSIS/Include | ../USB_Device/App | ../USB_Device/Target | ../Middlewares/ST/STM32_USB_Device_Library/Core/Inc | ../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc || || || USE_HAL_DRIVER | STM32G473xx || || USB_Device | Drivers | Core/Startup | Middlewares | Core || || || ${workspace_loc:/${ProjName}/STM32G473CEUX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.174412304" name="Cpu clock frequence" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="170" valueType="string"/>
|
|
||||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1276504021" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
|
||||||
<builder buildPath="${workspace_loc:/SW}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.851512378" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1440075172" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.336919630" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
|
|
||||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.840898236" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.510800037" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.702845999" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.677780506" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.1363972371" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
|
||||||
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
|
||||||
<listOptionValue builtIn="false" value="STM32G473xx"/>
|
|
||||||
</option>
|
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1794347416" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
|
|
||||||
<listOptionValue builtIn="false" value="../Core/Inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../Drivers/STM32G4xx_HAL_Driver/Inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../Drivers/STM32G4xx_HAL_Driver/Inc/Legacy"/>
|
|
||||||
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32G4xx/Include"/>
|
|
||||||
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
|
|
||||||
<listOptionValue builtIn="false" value="../USB_Device/App"/>
|
|
||||||
<listOptionValue builtIn="false" value="../USB_Device/Target"/>
|
|
||||||
<listOptionValue builtIn="false" value="../Middlewares/ST/STM32_USB_Device_Library/Core/Inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc"/>
|
|
||||||
</option>
|
|
||||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.2137897206" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1019139798" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.1960990786" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.1517154445" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.value.os" valueType="enumerated"/>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.2002575487" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker">
|
|
||||||
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script.1784841676" name="Linker Script (-T)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script" value="${workspace_loc:/${ProjName}/STM32G473CEUX_FLASH.ld}" valueType="string"/>
|
|
||||||
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input.279421912" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input">
|
|
||||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
|
||||||
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
|
||||||
</inputType>
|
|
||||||
</tool>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.839147378" name="MCU G++ Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.1742242240" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.1464840379" name="MCU Size" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.1685311870" name="MCU Output Converter list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.918385293" name="MCU Output Converter Hex" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1903505935" name="MCU Output Converter Binary" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.839033064" name="MCU Output Converter Verilog" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.853480168" name="MCU Output Converter Motorola S-rec" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec"/>
|
|
||||||
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.90331714" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
|
|
||||||
</toolChain>
|
|
||||||
</folderInfo>
|
|
||||||
<sourceEntries>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="USB_Device"/>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/>
|
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
|
|
||||||
</sourceEntries>
|
|
||||||
</configuration>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
|
||||||
</cconfiguration>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
|
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
|
||||||
<project id="SW.null.473660571" name="SW"/>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
|
||||||
<storageModule moduleId="scannerConfiguration">
|
|
||||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1087029614;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1087029614.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.876715449;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.2067940140">
|
|
||||||
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.415409921;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.415409921.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.510800037;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.2137897206">
|
|
||||||
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
|
|
||||||
</scannerConfigBuildInfo>
|
|
||||||
</storageModule>
|
|
||||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
|
||||||
<configuration configurationName="Debug">
|
|
||||||
<resource resourceType="PROJECT" workspacePath="/SW"/>
|
|
||||||
</configuration>
|
|
||||||
<configuration configurationName="Release">
|
|
||||||
<resource resourceType="PROJECT" workspacePath="/SW"/>
|
|
||||||
</configuration>
|
|
||||||
</storageModule>
|
|
||||||
</cproject>
|
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -86,3 +86,8 @@ dkms.conf
|
||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
|
||||||
|
.settings
|
||||||
|
.vscode
|
||||||
|
build
|
||||||
|
/*.bak
|
||||||
|
/SW Debug.launch
|
||||||
|
|
54
.mxproject
Normal file
54
.mxproject
Normal file
File diff suppressed because one or more lines are too long
32
.project
32
.project
|
@ -1,32 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>SW</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
|
||||||
<triggers>clean,full,incremental,</triggers>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
|
||||||
<triggers>full,incremental,</triggers>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>com.st.stm32cube.ide.mcu.MCUProjectNature</nature>
|
|
||||||
<nature>com.st.stm32cube.ide.mcu.MCUCubeProjectNature</nature>
|
|
||||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
|
||||||
<nature>com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature</nature>
|
|
||||||
<nature>com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature</nature>
|
|
||||||
<nature>com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature</nature>
|
|
||||||
<nature>com.st.stm32cube.ide.mcu.MCURootProjectNature</nature>
|
|
||||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
|
||||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
68
CMakeLists.txt
Normal file
68
CMakeLists.txt
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
cmake_minimum_required(VERSION 3.22)
|
||||||
|
|
||||||
|
#
|
||||||
|
# This file is generated only once,
|
||||||
|
# and is not re-generated if converter is called multiple times.
|
||||||
|
#
|
||||||
|
# User is free to modify the file as much as necessary
|
||||||
|
#
|
||||||
|
|
||||||
|
# Setup compiler settings
|
||||||
|
set(CMAKE_C_STANDARD 11)
|
||||||
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_C_EXTENSIONS ON)
|
||||||
|
|
||||||
|
|
||||||
|
# Define the build type
|
||||||
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE "Debug")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Set the project name
|
||||||
|
set(CMAKE_PROJECT_NAME SW)
|
||||||
|
|
||||||
|
# Include toolchain file
|
||||||
|
include("cmake/gcc-arm-none-eabi.cmake")
|
||||||
|
|
||||||
|
# Enable compile command to ease indexing with e.g. clangd
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
|
||||||
|
|
||||||
|
# Enable CMake support for ASM and C languages
|
||||||
|
enable_language(C ASM)
|
||||||
|
|
||||||
|
# Core project settings
|
||||||
|
project(${CMAKE_PROJECT_NAME})
|
||||||
|
message("Build type: " ${CMAKE_BUILD_TYPE})
|
||||||
|
|
||||||
|
# Create an executable object type
|
||||||
|
add_executable(${CMAKE_PROJECT_NAME})
|
||||||
|
|
||||||
|
# Add STM32CubeMX generated sources
|
||||||
|
add_subdirectory(cmake/stm32cubemx)
|
||||||
|
|
||||||
|
# Link directories setup
|
||||||
|
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
|
# Add user defined library search paths
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add sources to executable
|
||||||
|
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
|
# Add user sources here
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add include paths
|
||||||
|
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
|
# Add user defined include paths
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add project symbols (macros)
|
||||||
|
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
|
# Add user defined symbols
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add linked libraries
|
||||||
|
target_link_libraries(${CMAKE_PROJECT_NAME}
|
||||||
|
stm32cubemx
|
||||||
|
|
||||||
|
# Add user defined libraries
|
||||||
|
)
|
61
CMakePresets.json
Normal file
61
CMakePresets.json
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
"hidden": true,
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/build/${presetName}",
|
||||||
|
"toolchainFile": "${sourceDir}/cmake/gcc-arm-none-eabi.cmake",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Debug",
|
||||||
|
"inherits": "default",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RelWithDebInfo",
|
||||||
|
"inherits": "default",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Release",
|
||||||
|
"inherits": "default",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MinSizeRel",
|
||||||
|
"inherits": "default",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "MinSizeRel"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"buildPresets": [
|
||||||
|
{
|
||||||
|
"name": "Debug",
|
||||||
|
"configurePreset": "Debug"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RelWithDebInfo",
|
||||||
|
"configurePreset": "RelWithDebInfo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Release",
|
||||||
|
"configurePreset": "Release"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MinSizeRel",
|
||||||
|
"configurePreset": "MinSizeRel"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
9
Core/Inc/version.h
Normal file
9
Core/Inc/version.h
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#ifndef _VERSION_H
|
||||||
|
|
||||||
|
#define _VERSION_H
|
||||||
|
#define VERSION_MAJOR (1)
|
||||||
|
#define VERSION_MINOR (0)
|
||||||
|
#define VERSION_PATCH (1)
|
||||||
|
#define VERSION_STR "V1.0.1"
|
||||||
|
|
||||||
|
#endif
|
468
Core/Src/main.c
468
Core/Src/main.c
|
@ -1,20 +1,20 @@
|
||||||
/* USER CODE BEGIN Header */
|
/* USER CODE BEGIN Header */
|
||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file : main.c
|
* @file : main.c
|
||||||
* @brief : Main program body
|
* @brief : Main program body
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
*
|
*
|
||||||
* Copyright (c) 2024 STMicroelectronics.
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This software is licensed under terms that can be found in the LICENSE file
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
* in the root directory of this software component.
|
* in the root directory of this software component.
|
||||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
*
|
*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
/* USER CODE END Header */
|
/* USER CODE END Header */
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -30,26 +30,28 @@
|
||||||
/* USER CODE BEGIN Includes */
|
/* USER CODE BEGIN Includes */
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "usbd_cdc_if.h"
|
#include "usbd_cdc_if.h"
|
||||||
|
#include "version.h"
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
/* Private typedef -----------------------------------------------------------*/
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
/* USER CODE BEGIN PTD */
|
/* USER CODE BEGIN PTD */
|
||||||
typedef struct EMA_Filter {
|
typedef struct EMA_Filter
|
||||||
float filtered_sample;
|
{
|
||||||
uint32_t last_sample;
|
float filtered_sample;
|
||||||
float coeff;
|
uint32_t last_sample;
|
||||||
|
float coeff;
|
||||||
} EMA_Filter_t;
|
} EMA_Filter_t;
|
||||||
/* USER CODE END PTD */
|
/* USER CODE END PTD */
|
||||||
|
|
||||||
/* Private define ------------------------------------------------------------*/
|
/* Private define ------------------------------------------------------------*/
|
||||||
/* USER CODE BEGIN PD */
|
/* USER CODE BEGIN PD */
|
||||||
#define NUM_SLIDERS (6u)
|
#define NUM_SLIDERS (6u)
|
||||||
#define SLIDER_COEFF 0.30f
|
#define SLIDER_COEFF 0.30f
|
||||||
|
|
||||||
#define MAX_PWM_VALUE (1000u)
|
#define MAX_PWM_VALUE (10000u)
|
||||||
|
|
||||||
#define BTN_POLL_TIME (100u)
|
#define BTN_POLL_TIME (100u)
|
||||||
#define UART_LOOP_TIME (1000u)
|
#define UART_LOOP_TIME (1000u)
|
||||||
/* USER CODE END PD */
|
/* USER CODE END PD */
|
||||||
|
|
||||||
/* Private macro -------------------------------------------------------------*/
|
/* Private macro -------------------------------------------------------------*/
|
||||||
|
@ -97,252 +99,255 @@ float map_clamp(float x, float in_min, float in_max, float out_min, float out_ma
|
||||||
/* USER CODE END 0 */
|
/* USER CODE END 0 */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The application entry point.
|
* @brief The application entry point.
|
||||||
* @retval int
|
* @retval int
|
||||||
*/
|
*/
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* USER CODE BEGIN 1 */
|
/* USER CODE BEGIN 1 */
|
||||||
uint32_t prev_uart_tick = UART_LOOP_TIME;
|
uint32_t prev_uart_tick = UART_LOOP_TIME;
|
||||||
uint32_t prev_btn_time = BTN_POLL_TIME;
|
uint32_t prev_btn_time = BTN_POLL_TIME;
|
||||||
/* USER CODE END 1 */
|
/* USER CODE END 1 */
|
||||||
|
|
||||||
/* MCU Configuration--------------------------------------------------------*/
|
/* MCU Configuration--------------------------------------------------------*/
|
||||||
|
|
||||||
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
|
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
|
||||||
HAL_Init();
|
HAL_Init();
|
||||||
|
|
||||||
/* USER CODE BEGIN Init */
|
/* USER CODE BEGIN Init */
|
||||||
|
|
||||||
/* USER CODE END Init */
|
/* USER CODE END Init */
|
||||||
|
|
||||||
/* Configure the system clock */
|
/* Configure the system clock */
|
||||||
SystemClock_Config();
|
SystemClock_Config();
|
||||||
|
|
||||||
/* USER CODE BEGIN SysInit */
|
/* USER CODE BEGIN SysInit */
|
||||||
|
|
||||||
/* USER CODE END SysInit */
|
/* USER CODE END SysInit */
|
||||||
|
|
||||||
/* Initialize all configured peripherals */
|
/* Initialize all configured peripherals */
|
||||||
MX_GPIO_Init();
|
MX_GPIO_Init();
|
||||||
MX_DMA_Init();
|
MX_DMA_Init();
|
||||||
MX_I2C1_Init();
|
MX_I2C1_Init();
|
||||||
MX_TIM1_Init();
|
MX_TIM1_Init();
|
||||||
MX_TIM2_Init();
|
MX_TIM2_Init();
|
||||||
MX_TIM3_Init();
|
MX_TIM3_Init();
|
||||||
MX_ADC1_Init();
|
MX_ADC1_Init();
|
||||||
MX_ADC2_Init();
|
MX_ADC2_Init();
|
||||||
MX_USART1_UART_Init();
|
MX_USART1_UART_Init();
|
||||||
MX_USB_Device_Init();
|
MX_USB_Device_Init();
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
// Initialize EMA filters
|
// Initialize EMA filters
|
||||||
for (uint32_t i = 0; i < NUM_SLIDERS; i++)
|
for (uint32_t i = 0; i < NUM_SLIDERS; i++)
|
||||||
{
|
{
|
||||||
m_slider_filters[i].last_sample = 0;
|
m_slider_filters[i].last_sample = 0;
|
||||||
m_slider_filters[i].coeff = SLIDER_COEFF;
|
m_slider_filters[i].coeff = SLIDER_COEFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ADC setup
|
// ADC setup
|
||||||
// Calibrate
|
// Calibrate
|
||||||
HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED);
|
HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED);
|
||||||
HAL_ADCEx_Calibration_Start(&hadc2, ADC_SINGLE_ENDED);
|
HAL_ADCEx_Calibration_Start(&hadc2, ADC_SINGLE_ENDED);
|
||||||
|
|
||||||
HAL_ADC_Start_DMA(&hadc1, (uint32_t *)m_adc1, 4);
|
HAL_ADC_Start_DMA(&hadc1, (uint32_t *)m_adc1, 4);
|
||||||
HAL_ADC_Start_DMA(&hadc2, (uint32_t *)m_adc2, 2);
|
HAL_ADC_Start_DMA(&hadc2, (uint32_t *)m_adc2, 2);
|
||||||
|
|
||||||
// PWM Setup
|
// PWM Setup
|
||||||
htim1.Instance->CCR1 = 0;
|
htim1.Instance->CCR1 = 0;
|
||||||
htim1.Instance->CCR2 = 0;
|
htim1.Instance->CCR2 = 0;
|
||||||
htim1.Instance->CCR3 = 0;
|
htim1.Instance->CCR3 = 0;
|
||||||
|
|
||||||
htim2.Instance->CCR1 = 0;
|
htim2.Instance->CCR1 = 0;
|
||||||
htim2.Instance->CCR2 = 0;
|
htim2.Instance->CCR2 = 0;
|
||||||
htim2.Instance->CCR3 = 0;
|
htim2.Instance->CCR3 = 0;
|
||||||
|
|
||||||
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);
|
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);
|
||||||
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_2);
|
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_2);
|
||||||
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_3);
|
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_3);
|
||||||
|
|
||||||
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);
|
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);
|
||||||
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2);
|
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2);
|
||||||
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_3);
|
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_3);
|
||||||
|
|
||||||
HAL_TIM_Base_Start(&htim3);
|
HAL_TIM_Base_Start(&htim3);
|
||||||
|
|
||||||
/* USER CODE END 2 */
|
/* USER CODE END 2 */
|
||||||
|
|
||||||
/* Infinite loop */
|
/* Infinite loop */
|
||||||
/* USER CODE BEGIN WHILE */
|
/* USER CODE BEGIN WHILE */
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if ((m_adc1_filtered_ready) == true && (m_adc2_filtered_ready == true))
|
if ((m_adc1_filtered_ready) == true && (m_adc2_filtered_ready == true))
|
||||||
{
|
{
|
||||||
// Map ADC value to PWM value
|
// Map ADC value to PWM value
|
||||||
for(uint32_t i = 0; i < NUM_SLIDERS; i++)
|
for (uint32_t i = 0; i < NUM_SLIDERS; i++)
|
||||||
{
|
{
|
||||||
m_sliders[i] = map_clamp(m_slider_filters[i].filtered_sample, 100.0f, 3900.0f, 0.0f, 100.0f);
|
m_sliders[i] = map_clamp(m_slider_filters[i].filtered_sample, 100.0f, 3900.0f, 0.0f, 100.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Channel 1 is master, Channels 2-6 are slaves
|
// Channel 1 is master, Channels 2-6 are slaves
|
||||||
for(uint32_t j = 1; j < NUM_SLIDERS; j++)
|
for (uint32_t j = 1; j < NUM_SLIDERS; j++)
|
||||||
{
|
{
|
||||||
m_sliders[j] = map_clamp(m_sliders[j], 0.0f, 100.0f, 0.0f, m_sliders[0]);
|
m_sliders[j] = map_clamp(m_sliders[j], 0.0f, 100.0f, 0.0f, m_sliders[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_pwm_outputs();
|
set_pwm_outputs();
|
||||||
|
|
||||||
m_adc1_filtered_ready = false;
|
m_adc1_filtered_ready = false;
|
||||||
m_adc2_filtered_ready = false;
|
m_adc2_filtered_ready = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((HAL_GetTick() - prev_uart_tick) >= UART_LOOP_TIME)
|
if ((HAL_GetTick() - prev_uart_tick) >= UART_LOOP_TIME)
|
||||||
{
|
{
|
||||||
prev_uart_tick = HAL_GetTick();
|
prev_uart_tick = HAL_GetTick();
|
||||||
|
|
||||||
int len = snprintf(buf, 128, "Master\tCh1\tCh2\tCh3\tCh4\t\r\n");
|
int len = snprintf(buf, 128, "Version: %s\r\n", VERSION_STR);
|
||||||
CDC_Transmit_FS((uint8_t *)buf, len);
|
CDC_Transmit_FS((uint8_t *)buf, len);
|
||||||
|
|
||||||
len = snprintf(buf, 128, "%03.1f\t%03.1f\t%03.1f\t%03.1f\t%03.1f\t\r\n",
|
len = snprintf(buf, 128, "Master\tCh1\tCh2\tCh3\tCh4\t\r\n");
|
||||||
m_sliders[0], m_sliders[1], m_sliders[2], m_sliders[3], m_sliders[4]);
|
CDC_Transmit_FS((uint8_t *)buf, len);
|
||||||
CDC_Transmit_FS((uint8_t *)buf, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((HAL_GetTick() - prev_btn_time) >= BTN_POLL_TIME)
|
len = snprintf(buf, 128, "%03.1f\t%03.1f\t%03.1f\t%03.1f\t%03.1f\t\r\n",
|
||||||
{
|
m_sliders[0], m_sliders[1], m_sliders[2], m_sliders[3], m_sliders[4]);
|
||||||
prev_btn_time = HAL_GetTick();
|
CDC_Transmit_FS((uint8_t *)buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
m_buttons |= (m_buttons & ~0x01) | HAL_GPIO_ReadPin(Btn_0_GPIO_Port, Btn_0_Pin);
|
if ((HAL_GetTick() - prev_btn_time) >= BTN_POLL_TIME)
|
||||||
m_buttons |= (m_buttons & ~0x02) | HAL_GPIO_ReadPin(Btn_1_GPIO_Port, Btn_1_Pin) << 1;
|
{
|
||||||
m_buttons |= (m_buttons & ~0x04) | HAL_GPIO_ReadPin(Btn_2_GPIO_Port, Btn_2_Pin) << 2;
|
prev_btn_time = HAL_GetTick();
|
||||||
m_buttons |= (m_buttons & ~0x08) | HAL_GPIO_ReadPin(Btn_3_GPIO_Port, Btn_3_Pin) << 3;
|
|
||||||
m_buttons |= (m_buttons & ~0x10) | HAL_GPIO_ReadPin(Btn_4_GPIO_Port, Btn_4_Pin) << 4;
|
|
||||||
m_buttons |= (m_buttons & ~0x20) | HAL_GPIO_ReadPin(Btn_5_GPIO_Port, Btn_5_Pin) << 5;
|
|
||||||
m_buttons |= (m_buttons & ~0x40) | HAL_GPIO_ReadPin(Btn_6_GPIO_Port, Btn_6_Pin) << 6;
|
|
||||||
m_buttons |= (m_buttons & ~0x80) | HAL_GPIO_ReadPin(Btn_7_GPIO_Port, Btn_7_Pin) << 7;
|
|
||||||
}
|
|
||||||
/* USER CODE END WHILE */
|
|
||||||
|
|
||||||
/* USER CODE BEGIN 3 */
|
m_buttons |= (m_buttons & ~0x01) | HAL_GPIO_ReadPin(Btn_0_GPIO_Port, Btn_0_Pin);
|
||||||
}
|
m_buttons |= (m_buttons & ~0x02) | HAL_GPIO_ReadPin(Btn_1_GPIO_Port, Btn_1_Pin) << 1;
|
||||||
/* USER CODE END 3 */
|
m_buttons |= (m_buttons & ~0x04) | HAL_GPIO_ReadPin(Btn_2_GPIO_Port, Btn_2_Pin) << 2;
|
||||||
|
m_buttons |= (m_buttons & ~0x08) | HAL_GPIO_ReadPin(Btn_3_GPIO_Port, Btn_3_Pin) << 3;
|
||||||
|
m_buttons |= (m_buttons & ~0x10) | HAL_GPIO_ReadPin(Btn_4_GPIO_Port, Btn_4_Pin) << 4;
|
||||||
|
m_buttons |= (m_buttons & ~0x20) | HAL_GPIO_ReadPin(Btn_5_GPIO_Port, Btn_5_Pin) << 5;
|
||||||
|
m_buttons |= (m_buttons & ~0x40) | HAL_GPIO_ReadPin(Btn_6_GPIO_Port, Btn_6_Pin) << 6;
|
||||||
|
m_buttons |= (m_buttons & ~0x80) | HAL_GPIO_ReadPin(Btn_7_GPIO_Port, Btn_7_Pin) << 7;
|
||||||
|
}
|
||||||
|
/* USER CODE END WHILE */
|
||||||
|
|
||||||
|
/* USER CODE BEGIN 3 */
|
||||||
|
}
|
||||||
|
/* USER CODE END 3 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief System Clock Configuration
|
* @brief System Clock Configuration
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void SystemClock_Config(void)
|
void SystemClock_Config(void)
|
||||||
{
|
{
|
||||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||||
|
|
||||||
/** Configure the main internal regulator output voltage
|
/** Configure the main internal regulator output voltage
|
||||||
*/
|
*/
|
||||||
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1_BOOST);
|
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1_BOOST);
|
||||||
|
|
||||||
/** Initializes the RCC Oscillators according to the specified parameters
|
/** Initializes the RCC Oscillators according to the specified parameters
|
||||||
* in the RCC_OscInitTypeDef structure.
|
* in the RCC_OscInitTypeDef structure.
|
||||||
*/
|
*/
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48|RCC_OSCILLATORTYPE_HSE;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_HSE;
|
||||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||||
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
|
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
|
||||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||||
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV4;
|
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV4;
|
||||||
RCC_OscInitStruct.PLL.PLLN = 85;
|
RCC_OscInitStruct.PLL.PLLN = 85;
|
||||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||||
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV4;
|
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV4;
|
||||||
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
|
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
|
||||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Initializes the CPU, AHB and APB buses clocks
|
/** Initializes the CPU, AHB and APB buses clocks
|
||||||
*/
|
*/
|
||||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
|
||||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
|
||||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
|
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
|
||||||
|
|
||||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK)
|
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK)
|
||||||
{
|
{
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* USER CODE BEGIN 4 */
|
/* USER CODE BEGIN 4 */
|
||||||
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc)
|
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc)
|
||||||
{
|
{
|
||||||
if (hadc->Instance == ADC1)
|
if (hadc->Instance == ADC1)
|
||||||
{
|
{
|
||||||
filter_adc1();
|
filter_adc1();
|
||||||
}
|
}
|
||||||
else if (hadc->Instance == ADC2)
|
else if (hadc->Instance == ADC2)
|
||||||
{
|
{
|
||||||
filter_adc2();
|
filter_adc2();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void filter_adc1(void)
|
void filter_adc1(void)
|
||||||
{
|
{
|
||||||
for (uint32_t i = 0; i < 4; i++)
|
for (uint32_t i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
// EMA
|
// EMA
|
||||||
m_slider_filters[i].filtered_sample = (m_adc1[i] * m_slider_filters[i].coeff) + ((1 - m_slider_filters[i].coeff) * m_slider_filters[i].last_sample);
|
m_slider_filters[i].filtered_sample = (m_adc1[i] * m_slider_filters[i].coeff) + ((1 - m_slider_filters[i].coeff) * m_slider_filters[i].last_sample);
|
||||||
// Store current sample for next time
|
// Store current sample for next time
|
||||||
m_slider_filters[i].last_sample = m_adc1[i];
|
m_slider_filters[i].last_sample = m_adc1[i];
|
||||||
|
|
||||||
m_adc1_filtered_ready = true;
|
m_adc1_filtered_ready = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void filter_adc2(void)
|
void filter_adc2(void)
|
||||||
{
|
{
|
||||||
for (uint32_t i = 4; i < NUM_SLIDERS; i++)
|
for (uint32_t i = 4; i < NUM_SLIDERS; i++)
|
||||||
{
|
{
|
||||||
// EMA
|
// EMA
|
||||||
m_slider_filters[i].filtered_sample = (m_adc2[i - 4] * m_slider_filters[i].coeff) + ((1 - m_slider_filters[i].coeff) * m_slider_filters[i].last_sample);
|
m_slider_filters[i].filtered_sample = (m_adc2[i - 4] * m_slider_filters[i].coeff) + ((1 - m_slider_filters[i].coeff) * m_slider_filters[i].last_sample);
|
||||||
// Store current sample for next time
|
// Store current sample for next time
|
||||||
m_slider_filters[i].last_sample = m_adc2[i - 4];
|
m_slider_filters[i].last_sample = m_adc2[i - 4];
|
||||||
|
|
||||||
m_adc2_filtered_ready = true;
|
m_adc2_filtered_ready = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void set_pwm_outputs(void)
|
void set_pwm_outputs(void)
|
||||||
{
|
{
|
||||||
htim1.Instance->CCR1 = (uint32_t)(MAX_PWM_VALUE * m_sliders[1]);
|
float ch1 = map_clamp(m_sliders[1], 0.0f, 100.0f, 0, MAX_PWM_VALUE * 0.02f);
|
||||||
htim1.Instance->CCR2 = (uint32_t)(MAX_PWM_VALUE * m_sliders[2]);
|
float ch2 = map_clamp(m_sliders[2], 0.0f, 100.0f, 0, MAX_PWM_VALUE * 0.02f);
|
||||||
htim1.Instance->CCR3 = (uint32_t)(MAX_PWM_VALUE * m_sliders[3]);
|
float ch3 = map_clamp(m_sliders[3], 0.0f, 100.0f, 0, MAX_PWM_VALUE * 0.02f);
|
||||||
|
float ch4 = map_clamp(m_sliders[4], 0.0f, 100.0f, 0, MAX_PWM_VALUE * 0.02f);
|
||||||
|
|
||||||
htim2.Instance->CCR1 = (uint32_t)(MAX_PWM_VALUE * m_sliders[4]);
|
htim1.Instance->CCR1 = (uint32_t)(ch1);
|
||||||
// htim2.Instance->CCR2 = (uint32_t)(MAX_PWM_VALUE * m_sliders[5]);
|
htim1.Instance->CCR2 = (uint32_t)(ch2);
|
||||||
//htim2.Instance->CCR3 = (uint32_t)(MAX_PWM_VALUE * m_sliders[5]);
|
htim1.Instance->CCR3 = (uint32_t)(ch3);
|
||||||
|
|
||||||
|
htim2.Instance->CCR1 = (uint32_t)(ch4);
|
||||||
|
// htim2.Instance->CCR2 = (uint32_t)(MAX_PWM_VALUE * m_sliders[5]);
|
||||||
|
// htim2.Instance->CCR3 = (uint32_t)(MAX_PWM_VALUE * m_sliders[5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
float map(float x, float in_min, float in_max, float out_min, float out_max)
|
float map(float x, float in_min, float in_max, float out_min, float out_max)
|
||||||
{
|
{
|
||||||
return ((x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min);
|
return ((x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -350,61 +355,60 @@ float map(float x, float in_min, float in_max, float out_min, float out_max)
|
||||||
*/
|
*/
|
||||||
float map_clamp(float x, float in_min, float in_max, float out_min, float out_max)
|
float map_clamp(float x, float in_min, float in_max, float out_min, float out_max)
|
||||||
{
|
{
|
||||||
float y = (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
float y = (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
||||||
|
|
||||||
if (out_min > y)
|
if (out_min > y)
|
||||||
y = out_min;
|
y = out_min;
|
||||||
else if (out_max < y)
|
else if (out_max < y)
|
||||||
y = out_max;
|
y = out_max;
|
||||||
|
|
||||||
return (y);
|
return (y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retargets the C library printf function to the USART.
|
* @brief Retargets the C library printf function to the USART.
|
||||||
* @param None
|
* @param None
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
PUTCHAR_PROTOTYPE
|
PUTCHAR_PROTOTYPE
|
||||||
{
|
{
|
||||||
/* Place your implementation of fputc here */
|
/* Place your implementation of fputc here */
|
||||||
/* e.g. write a character to the USART1 and Loop until the end of transmission */
|
/* e.g. write a character to the USART1 and Loop until the end of transmission */
|
||||||
HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xFFFF);
|
HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xFFFF);
|
||||||
|
|
||||||
return ch;
|
return ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* USER CODE END 4 */
|
/* USER CODE END 4 */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function is executed in case of error occurrence.
|
* @brief This function is executed in case of error occurrence.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void Error_Handler(void)
|
void Error_Handler(void)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN Error_Handler_Debug */
|
/* USER CODE BEGIN Error_Handler_Debug */
|
||||||
/* User can add his own implementation to report the HAL error return state */
|
/* User can add his own implementation to report the HAL error return state */
|
||||||
__disable_irq();
|
__disable_irq();
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
/* USER CODE END Error_Handler_Debug */
|
/* USER CODE END Error_Handler_Debug */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_FULL_ASSERT
|
#ifdef USE_FULL_ASSERT
|
||||||
/**
|
/**
|
||||||
* @brief Reports the name of the source file and the source line number
|
* @brief Reports the name of the source file and the source line number
|
||||||
* where the assert_param error has occurred.
|
* where the assert_param error has occurred.
|
||||||
* @param file: pointer to the source file name
|
* @param file: pointer to the source file name
|
||||||
* @param line: assert_param error line source number
|
* @param line: assert_param error line source number
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void assert_failed(uint8_t *file, uint32_t line)
|
void assert_failed(uint8_t *file, uint32_t line)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN 6 */
|
/* USER CODE BEGIN 6 */
|
||||||
/* User can add his own implementation to report the file name and line number,
|
/* User can add his own implementation to report the file name and line number,
|
||||||
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
|
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
|
||||||
/* USER CODE END 6 */
|
/* USER CODE END 6 */
|
||||||
}
|
}
|
||||||
#endif /* USE_FULL_ASSERT */
|
#endif /* USE_FULL_ASSERT */
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file syscalls.c
|
* @file syscalls.c
|
||||||
* @author Auto-generated by STM32CubeIDE
|
* @author Auto-generated by STM32CubeMX
|
||||||
* @brief STM32CubeIDE Minimal System calls file
|
* @brief Minimal System calls file
|
||||||
*
|
*
|
||||||
* For more information about which c-functions
|
* For more information about which c-functions
|
||||||
* need which of these lowlevel functions
|
* need which of these lowlevel functions
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/**
|
/**
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file sysmem.c
|
* @file sysmem.c
|
||||||
* @author Generated by STM32CubeIDE
|
* @author Generated by STM32CubeMX
|
||||||
* @brief STM32CubeIDE System Memory calls file
|
* @brief System Memory calls file
|
||||||
*
|
*
|
||||||
* For more information about which C functions
|
* For more information about which C functions
|
||||||
* need which of these lowlevel functions
|
* need which of these lowlevel functions
|
||||||
|
|
|
@ -45,9 +45,9 @@ void MX_TIM1_Init(void)
|
||||||
|
|
||||||
/* USER CODE END TIM1_Init 1 */
|
/* USER CODE END TIM1_Init 1 */
|
||||||
htim1.Instance = TIM1;
|
htim1.Instance = TIM1;
|
||||||
htim1.Init.Prescaler = 169;
|
htim1.Init.Prescaler = 16;
|
||||||
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||||
htim1.Init.Period = 999;
|
htim1.Init.Period = 9999;
|
||||||
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||||
htim1.Init.RepetitionCounter = 0;
|
htim1.Init.RepetitionCounter = 0;
|
||||||
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
|
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
|
||||||
|
@ -129,9 +129,9 @@ void MX_TIM2_Init(void)
|
||||||
|
|
||||||
/* USER CODE END TIM2_Init 1 */
|
/* USER CODE END TIM2_Init 1 */
|
||||||
htim2.Instance = TIM2;
|
htim2.Instance = TIM2;
|
||||||
htim2.Init.Prescaler = 169;
|
htim2.Init.Prescaler = 16;
|
||||||
htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
|
htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||||
htim2.Init.Period = 999;
|
htim2.Init.Period = 9999;
|
||||||
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||||
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
|
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
|
||||||
if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
|
if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
|
||||||
|
|
|
@ -1,57 +1,74 @@
|
||||||
/*
|
/*
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
**
|
**
|
||||||
** @file : LinkerScript.ld
|
|
||||||
|
** File : LinkerScript.ld
|
||||||
**
|
**
|
||||||
** @author : Auto-generated by STM32CubeIDE
|
** Author : STM32CubeMX
|
||||||
**
|
**
|
||||||
** @brief : Linker script for STM32G473CEUx Device from STM32G4 series
|
** Abstract : Linker script for STM32G473CEUx series
|
||||||
** 512KBytes FLASH
|
** 512Kbytes FLASH and 128Kbytes RAM
|
||||||
** 128KBytes RAM
|
|
||||||
**
|
**
|
||||||
** Set heap size, stack size and stack location according
|
** Set heap size, stack size and stack location according
|
||||||
** to application requirements.
|
** to application requirements.
|
||||||
**
|
**
|
||||||
** Set memory bank area and size if external memory is used
|
** Set memory bank area and size if external memory is used.
|
||||||
**
|
**
|
||||||
** Target : STMicroelectronics STM32
|
** Target : STMicroelectronics STM32
|
||||||
**
|
**
|
||||||
** Distribution: The file is distributed as is, without any warranty
|
** Distribution: The file is distributed “as is,” without any warranty
|
||||||
** of any kind.
|
** of any kind.
|
||||||
**
|
**
|
||||||
******************************************************************************
|
*****************************************************************************
|
||||||
** @attention
|
** @attention
|
||||||
**
|
**
|
||||||
** Copyright (c) 2024 STMicroelectronics.
|
** <h2><center>© COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
|
||||||
** All rights reserved.
|
|
||||||
**
|
**
|
||||||
** This software is licensed under terms that can be found in the LICENSE file
|
** Redistribution and use in source and binary forms, with or without modification,
|
||||||
** in the root directory of this software component.
|
** are permitted provided that the following conditions are met:
|
||||||
** If no LICENSE file comes with this software, it is provided AS-IS.
|
** 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
** this list of conditions and the following disclaimer.
|
||||||
|
** 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
** this list of conditions and the following disclaimer in the documentation
|
||||||
|
** and/or other materials provided with the distribution.
|
||||||
|
** 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||||
|
** may be used to endorse or promote products derived from this software
|
||||||
|
** without specific prior written permission.
|
||||||
**
|
**
|
||||||
******************************************************************************
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
**
|
||||||
|
*****************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Entry Point */
|
/* Entry Point */
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
/* Highest address of the user mode stack */
|
/* Highest address of the user mode stack */
|
||||||
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
|
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */
|
||||||
|
/* Generate a link error if heap and stack don't fit into RAM */
|
||||||
_Min_Heap_Size = 0x200; /* required amount of heap */
|
_Min_Heap_Size = 0x200; /* required amount of heap */
|
||||||
_Min_Stack_Size = 0x400; /* required amount of stack */
|
_Min_Stack_Size = 0x400; /* required amount of stack */
|
||||||
|
|
||||||
/* Memories definition */
|
/* Specify the memory areas */
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
|
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
|
||||||
FLASH (rx) : ORIGIN = 0x8010000, LENGTH = 256K
|
FLASH (rx) : ORIGIN = 0x8010000, LENGTH = 256K
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sections */
|
/* Define output sections */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
/* The startup code into "FLASH" Rom type memory */
|
/* The startup code goes first into FLASH */
|
||||||
.isr_vector :
|
.isr_vector :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
|
@ -59,7 +76,7 @@ SECTIONS
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
} >FLASH
|
} >FLASH
|
||||||
|
|
||||||
/* The program code and other data into "FLASH" Rom type memory */
|
/* The program code and other data goes into FLASH */
|
||||||
.text :
|
.text :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
|
@ -76,7 +93,7 @@ SECTIONS
|
||||||
_etext = .; /* define a global symbols at end of code */
|
_etext = .; /* define a global symbols at end of code */
|
||||||
} >FLASH
|
} >FLASH
|
||||||
|
|
||||||
/* Constant data into "FLASH" Rom type memory */
|
/* Constant data goes into FLASH */
|
||||||
.rodata :
|
.rodata :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
|
@ -85,74 +102,55 @@ SECTIONS
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
} >FLASH
|
} >FLASH
|
||||||
|
|
||||||
.ARM.extab (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
|
||||||
{
|
.ARM : {
|
||||||
. = ALIGN(4);
|
|
||||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
|
||||||
. = ALIGN(4);
|
|
||||||
} >FLASH
|
|
||||||
|
|
||||||
.ARM (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
|
||||||
{
|
|
||||||
. = ALIGN(4);
|
|
||||||
__exidx_start = .;
|
__exidx_start = .;
|
||||||
*(.ARM.exidx*)
|
*(.ARM.exidx*)
|
||||||
__exidx_end = .;
|
__exidx_end = .;
|
||||||
. = ALIGN(4);
|
|
||||||
} >FLASH
|
} >FLASH
|
||||||
|
|
||||||
.preinit_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
.preinit_array :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
|
||||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||||
KEEP (*(.preinit_array*))
|
KEEP (*(.preinit_array*))
|
||||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||||
. = ALIGN(4);
|
|
||||||
} >FLASH
|
} >FLASH
|
||||||
|
.init_array :
|
||||||
.init_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
|
||||||
PROVIDE_HIDDEN (__init_array_start = .);
|
PROVIDE_HIDDEN (__init_array_start = .);
|
||||||
KEEP (*(SORT(.init_array.*)))
|
KEEP (*(SORT(.init_array.*)))
|
||||||
KEEP (*(.init_array*))
|
KEEP (*(.init_array*))
|
||||||
PROVIDE_HIDDEN (__init_array_end = .);
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
. = ALIGN(4);
|
|
||||||
} >FLASH
|
} >FLASH
|
||||||
|
.fini_array :
|
||||||
.fini_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
|
||||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||||
KEEP (*(SORT(.fini_array.*)))
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
KEEP (*(.fini_array*))
|
KEEP (*(.fini_array*))
|
||||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||||
. = ALIGN(4);
|
|
||||||
} >FLASH
|
} >FLASH
|
||||||
|
|
||||||
/* Used by the startup to initialize data */
|
/* used by the startup to initialize data */
|
||||||
_sidata = LOADADDR(.data);
|
_sidata = LOADADDR(.data);
|
||||||
|
|
||||||
/* Initialized data sections into "RAM" Ram type memory */
|
/* Initialized data sections goes into RAM, load LMA copy after code */
|
||||||
.data :
|
.data :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_sdata = .; /* create a global symbol at data start */
|
_sdata = .; /* create a global symbol at data start */
|
||||||
*(.data) /* .data sections */
|
*(.data) /* .data sections */
|
||||||
*(.data*) /* .data* sections */
|
*(.data*) /* .data* sections */
|
||||||
*(.RamFunc) /* .RamFunc sections */
|
|
||||||
*(.RamFunc*) /* .RamFunc* sections */
|
|
||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_edata = .; /* define a global symbol at data end */
|
_edata = .; /* define a global symbol at data end */
|
||||||
|
|
||||||
} >RAM AT> FLASH
|
} >RAM AT> FLASH
|
||||||
|
|
||||||
/* Uninitialized data section into "RAM" Ram type memory */
|
|
||||||
|
/* Uninitialized data section */
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
.bss :
|
.bss :
|
||||||
{
|
{
|
||||||
/* This is used by the startup in order to initialize the .bss section */
|
/* This is used by the startup in order to initialize the .bss secion */
|
||||||
_sbss = .; /* define a global symbol at bss start */
|
_sbss = .; /* define a global symbol at bss start */
|
||||||
__bss_start__ = _sbss;
|
__bss_start__ = _sbss;
|
||||||
*(.bss)
|
*(.bss)
|
||||||
|
@ -164,7 +162,7 @@ SECTIONS
|
||||||
__bss_end__ = _ebss;
|
__bss_end__ = _ebss;
|
||||||
} >RAM
|
} >RAM
|
||||||
|
|
||||||
/* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
|
/* User_heap_stack section, used to check that there is enough RAM left */
|
||||||
._user_heap_stack :
|
._user_heap_stack :
|
||||||
{
|
{
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
|
@ -175,7 +173,9 @@ SECTIONS
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
} >RAM
|
} >RAM
|
||||||
|
|
||||||
/* Remove information from the compiler libraries */
|
|
||||||
|
|
||||||
|
/* Remove information from the standard libraries */
|
||||||
/DISCARD/ :
|
/DISCARD/ :
|
||||||
{
|
{
|
||||||
libc.a ( * )
|
libc.a ( * )
|
||||||
|
@ -185,3 +185,5 @@ SECTIONS
|
||||||
|
|
||||||
.ARM.attributes 0 : { *(.ARM.attributes) }
|
.ARM.attributes 0 : { *(.ARM.attributes) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
13
SW.ioc
13
SW.ioc
|
@ -267,11 +267,11 @@ ProjectManager.ProjectName=SW
|
||||||
ProjectManager.ProjectStructure=
|
ProjectManager.ProjectStructure=
|
||||||
ProjectManager.RegisterCallBack=
|
ProjectManager.RegisterCallBack=
|
||||||
ProjectManager.StackSize=0x400
|
ProjectManager.StackSize=0x400
|
||||||
ProjectManager.TargetToolchain=STM32CubeIDE
|
ProjectManager.TargetToolchain=CMake
|
||||||
ProjectManager.ToolChainLocation=
|
ProjectManager.ToolChainLocation=
|
||||||
ProjectManager.UAScriptAfterPath=
|
ProjectManager.UAScriptAfterPath=
|
||||||
ProjectManager.UAScriptBeforePath=
|
ProjectManager.UAScriptBeforePath=
|
||||||
ProjectManager.UnderRoot=true
|
ProjectManager.UnderRoot=false
|
||||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_I2C1_Init-I2C1-false-HAL-true,5-MX_TIM1_Init-TIM1-false-HAL-true,6-MX_TIM2_Init-TIM2-false-HAL-true,7-MX_TIM3_Init-TIM3-false-HAL-true,8-MX_ADC1_Init-ADC1-false-HAL-true,9-MX_ADC2_Init-ADC2-false-HAL-true,10-MX_USART1_UART_Init-USART1-false-HAL-true,11-MX_USB_Device_Init-USB_DEVICE-false-HAL-false
|
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_I2C1_Init-I2C1-false-HAL-true,5-MX_TIM1_Init-TIM1-false-HAL-true,6-MX_TIM2_Init-TIM2-false-HAL-true,7-MX_TIM3_Init-TIM3-false-HAL-true,8-MX_ADC1_Init-ADC1-false-HAL-true,9-MX_ADC2_Init-ADC2-false-HAL-true,10-MX_USART1_UART_Init-USART1-false-HAL-true,11-MX_USB_Device_Init-USB_DEVICE-false-HAL-false
|
||||||
RCC.ADC12Freq_Value=170000000
|
RCC.ADC12Freq_Value=170000000
|
||||||
RCC.ADC345Freq_Value=170000000
|
RCC.ADC345Freq_Value=170000000
|
||||||
|
@ -342,15 +342,15 @@ TIM1.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
||||||
TIM1.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
TIM1.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
||||||
TIM1.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
|
TIM1.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
|
||||||
TIM1.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3,Prescaler,PeriodNoDither,AutoReloadPreload
|
TIM1.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3,Prescaler,PeriodNoDither,AutoReloadPreload
|
||||||
TIM1.PeriodNoDither=999
|
TIM1.PeriodNoDither=9999
|
||||||
TIM1.Prescaler=169
|
TIM1.Prescaler=16
|
||||||
TIM2.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
|
TIM2.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
|
||||||
TIM2.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
TIM2.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
||||||
TIM2.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
TIM2.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
||||||
TIM2.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
|
TIM2.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
|
||||||
TIM2.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3,Prescaler,PeriodNoDither,AutoReloadPreload
|
TIM2.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3,Prescaler,PeriodNoDither,AutoReloadPreload
|
||||||
TIM2.PeriodNoDither=999
|
TIM2.PeriodNoDither=9999
|
||||||
TIM2.Prescaler=169
|
TIM2.Prescaler=16
|
||||||
TIM3.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
|
TIM3.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
|
||||||
TIM3.IPParameters=TIM_MasterOutputTrigger,Prescaler,PeriodNoDither,AutoReloadPreload
|
TIM3.IPParameters=TIM_MasterOutputTrigger,Prescaler,PeriodNoDither,AutoReloadPreload
|
||||||
TIM3.PeriodNoDither=999
|
TIM3.PeriodNoDither=999
|
||||||
|
@ -375,4 +375,3 @@ VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT
|
||||||
VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS.Mode=CDC_FS
|
VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS.Mode=CDC_FS
|
||||||
VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS.Signal=USB_DEVICE_VS_USB_DEVICE_CDC_FS
|
VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS.Signal=USB_DEVICE_VS_USB_DEVICE_CDC_FS
|
||||||
board=custom
|
board=custom
|
||||||
isbadioc=false
|
|
||||||
|
|
48
cmake/gcc-arm-none-eabi.cmake
Normal file
48
cmake/gcc-arm-none-eabi.cmake
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
set(CMAKE_SYSTEM_NAME Generic)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER_FORCED TRUE)
|
||||||
|
set(CMAKE_CXX_COMPILER_FORCED TRUE)
|
||||||
|
set(CMAKE_C_COMPILER_ID GNU)
|
||||||
|
set(CMAKE_CXX_COMPILER_ID GNU)
|
||||||
|
|
||||||
|
# Some default GCC settings
|
||||||
|
# arm-none-eabi- must be part of path environment
|
||||||
|
set(TOOLCHAIN_PREFIX arm-none-eabi-)
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
|
||||||
|
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
|
||||||
|
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)
|
||||||
|
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}g++)
|
||||||
|
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
|
||||||
|
set(CMAKE_SIZE ${TOOLCHAIN_PREFIX}size)
|
||||||
|
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX_ASM ".elf")
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX_C ".elf")
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf")
|
||||||
|
|
||||||
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
||||||
|
|
||||||
|
# MCU specific flags
|
||||||
|
set(TARGET_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard ")
|
||||||
|
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_FLAGS}")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic -fdata-sections -ffunction-sections")
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g3")
|
||||||
|
endif()
|
||||||
|
if(CMAKE_BUILD_TYPE MATCHES Release)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -g0")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp -MMD -MP")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions -fno-threadsafe-statics")
|
||||||
|
|
||||||
|
set(CMAKE_C_LINK_FLAGS "${TARGET_FLAGS}")
|
||||||
|
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -T \"${CMAKE_SOURCE_DIR}/STM32G473CEUx_FLASH.ld\"")
|
||||||
|
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} --specs=nano.specs")
|
||||||
|
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,-Map=${CMAKE_PROJECT_NAME}.map -Wl,--gc-sections")
|
||||||
|
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--start-group -lc -lm -Wl,--end-group")
|
||||||
|
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--print-memory-usage")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--start-group -lstdc++ -lsupc++ -Wl,--end-group")
|
87
cmake/stm32cubemx/CMakeLists.txt
Normal file
87
cmake/stm32cubemx/CMakeLists.txt
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
cmake_minimum_required(VERSION 3.22)
|
||||||
|
|
||||||
|
project(stm32cubemx)
|
||||||
|
add_library(stm32cubemx INTERFACE)
|
||||||
|
|
||||||
|
# Enable CMake support for ASM and C languages
|
||||||
|
enable_language(C ASM)
|
||||||
|
|
||||||
|
target_compile_definitions(stm32cubemx INTERFACE
|
||||||
|
USE_HAL_DRIVER
|
||||||
|
STM32G473xx
|
||||||
|
$<$<CONFIG:Debug>:DEBUG>
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(stm32cubemx INTERFACE
|
||||||
|
../../Core/Inc
|
||||||
|
../../USB_Device/App
|
||||||
|
../../USB_Device/Target
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Inc
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Inc/Legacy
|
||||||
|
../../Middlewares/ST/STM32_USB_Device_Library/Core/Inc
|
||||||
|
../../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc
|
||||||
|
../../Drivers/CMSIS/Device/ST/STM32G4xx/Include
|
||||||
|
../../Drivers/CMSIS/Include
|
||||||
|
)
|
||||||
|
|
||||||
|
target_sources(stm32cubemx INTERFACE
|
||||||
|
../../Core/Src/main.c
|
||||||
|
../../Core/Src/gpio.c
|
||||||
|
../../Core/Src/adc.c
|
||||||
|
../../Core/Src/dma.c
|
||||||
|
../../Core/Src/i2c.c
|
||||||
|
../../Core/Src/tim.c
|
||||||
|
../../Core/Src/usart.c
|
||||||
|
../../Core/Src/stm32g4xx_it.c
|
||||||
|
../../Core/Src/stm32g4xx_hal_msp.c
|
||||||
|
../../USB_Device/Target/usbd_conf.c
|
||||||
|
../../USB_Device/App/usb_device.c
|
||||||
|
../../USB_Device/App/usbd_desc.c
|
||||||
|
../../USB_Device/App/usbd_cdc_if.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_pcd.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_pcd_ex.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_ll_usb.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_rcc.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_rcc_ex.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_flash.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_flash_ex.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_flash_ramfunc.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_gpio.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_exti.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_dma.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_dma_ex.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_pwr.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_pwr_ex.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_cortex.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_adc.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_adc_ex.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_ll_adc.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_i2c.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_i2c_ex.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_tim.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_tim_ex.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_uart.c
|
||||||
|
../../Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_uart_ex.c
|
||||||
|
../../Core/Src/system_stm32g4xx.c
|
||||||
|
../../Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c
|
||||||
|
../../Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c
|
||||||
|
../../Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c
|
||||||
|
../../Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c
|
||||||
|
../../Core/Src/sysmem.c
|
||||||
|
../../Core/Src/syscalls.c
|
||||||
|
../../startup_stm32g473xx.s
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_directories(stm32cubemx INTERFACE
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(stm32cubemx INTERFACE
|
||||||
|
)
|
||||||
|
|
||||||
|
# Validate that STM32CubeMX code is compatible with C standard
|
||||||
|
if(CMAKE_C_STANDARD LESS 11)
|
||||||
|
message(ERROR "Generated code requires C11 or higher")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
568
startup_stm32g473xx.s
Normal file
568
startup_stm32g473xx.s
Normal file
|
@ -0,0 +1,568 @@
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file startup_stm32g473xx.s
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief STM32G473xx devices vector table GCC toolchain.
|
||||||
|
* This module performs:
|
||||||
|
* - Set the initial SP
|
||||||
|
* - Set the initial PC == Reset_Handler,
|
||||||
|
* - Set the vector table entries with the exceptions ISR address,
|
||||||
|
* - Configure the clock system
|
||||||
|
* - Branches to main in the C library (which eventually
|
||||||
|
* calls main()).
|
||||||
|
* After Reset the Cortex-M4 processor is in Thread mode,
|
||||||
|
* priority is Privileged, and the Stack is set to Main.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
.cpu cortex-m4
|
||||||
|
.fpu softvfp
|
||||||
|
.thumb
|
||||||
|
|
||||||
|
.global g_pfnVectors
|
||||||
|
.global Default_Handler
|
||||||
|
|
||||||
|
/* start address for the initialization values of the .data section.
|
||||||
|
defined in linker script */
|
||||||
|
.word _sidata
|
||||||
|
/* start address for the .data section. defined in linker script */
|
||||||
|
.word _sdata
|
||||||
|
/* end address for the .data section. defined in linker script */
|
||||||
|
.word _edata
|
||||||
|
/* start address for the .bss section. defined in linker script */
|
||||||
|
.word _sbss
|
||||||
|
/* end address for the .bss section. defined in linker script */
|
||||||
|
.word _ebss
|
||||||
|
|
||||||
|
.equ BootRAM, 0xF1E0F85F
|
||||||
|
/**
|
||||||
|
* @brief This is the code that gets called when the processor first
|
||||||
|
* starts execution following a reset event. Only the absolutely
|
||||||
|
* necessary set is performed, after which the application
|
||||||
|
* supplied main() routine is called.
|
||||||
|
* @param None
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
|
||||||
|
.section .text.Reset_Handler
|
||||||
|
.weak Reset_Handler
|
||||||
|
.type Reset_Handler, %function
|
||||||
|
Reset_Handler:
|
||||||
|
ldr r0, =_estack
|
||||||
|
mov sp, r0 /* set stack pointer */
|
||||||
|
|
||||||
|
/* Call the clock system initialization function.*/
|
||||||
|
bl SystemInit
|
||||||
|
|
||||||
|
/* Copy the data segment initializers from flash to SRAM */
|
||||||
|
ldr r0, =_sdata
|
||||||
|
ldr r1, =_edata
|
||||||
|
ldr r2, =_sidata
|
||||||
|
movs r3, #0
|
||||||
|
b LoopCopyDataInit
|
||||||
|
|
||||||
|
CopyDataInit:
|
||||||
|
ldr r4, [r2, r3]
|
||||||
|
str r4, [r0, r3]
|
||||||
|
adds r3, r3, #4
|
||||||
|
|
||||||
|
LoopCopyDataInit:
|
||||||
|
adds r4, r0, r3
|
||||||
|
cmp r4, r1
|
||||||
|
bcc CopyDataInit
|
||||||
|
|
||||||
|
/* Zero fill the bss segment. */
|
||||||
|
ldr r2, =_sbss
|
||||||
|
ldr r4, =_ebss
|
||||||
|
movs r3, #0
|
||||||
|
b LoopFillZerobss
|
||||||
|
|
||||||
|
FillZerobss:
|
||||||
|
str r3, [r2]
|
||||||
|
adds r2, r2, #4
|
||||||
|
|
||||||
|
LoopFillZerobss:
|
||||||
|
cmp r2, r4
|
||||||
|
bcc FillZerobss
|
||||||
|
|
||||||
|
/* Call static constructors */
|
||||||
|
bl __libc_init_array
|
||||||
|
/* Call the application's entry point.*/
|
||||||
|
bl main
|
||||||
|
|
||||||
|
LoopForever:
|
||||||
|
b LoopForever
|
||||||
|
|
||||||
|
.size Reset_Handler, .-Reset_Handler
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This is the code that gets called when the processor receives an
|
||||||
|
* unexpected interrupt. This simply enters an infinite loop, preserving
|
||||||
|
* the system state for examination by a debugger.
|
||||||
|
*
|
||||||
|
* @param None
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
.section .text.Default_Handler,"ax",%progbits
|
||||||
|
Default_Handler:
|
||||||
|
Infinite_Loop:
|
||||||
|
b Infinite_Loop
|
||||||
|
.size Default_Handler, .-Default_Handler
|
||||||
|
/******************************************************************************
|
||||||
|
*
|
||||||
|
* The minimal vector table for a Cortex-M4. Note that the proper constructs
|
||||||
|
* must be placed on this to ensure that it ends up at physical address
|
||||||
|
* 0x0000.0000.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
.section .isr_vector,"a",%progbits
|
||||||
|
.type g_pfnVectors, %object
|
||||||
|
|
||||||
|
|
||||||
|
g_pfnVectors:
|
||||||
|
.word _estack
|
||||||
|
.word Reset_Handler
|
||||||
|
.word NMI_Handler
|
||||||
|
.word HardFault_Handler
|
||||||
|
.word MemManage_Handler
|
||||||
|
.word BusFault_Handler
|
||||||
|
.word UsageFault_Handler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word SVC_Handler
|
||||||
|
.word DebugMon_Handler
|
||||||
|
.word 0
|
||||||
|
.word PendSV_Handler
|
||||||
|
.word SysTick_Handler
|
||||||
|
.word WWDG_IRQHandler
|
||||||
|
.word PVD_PVM_IRQHandler
|
||||||
|
.word RTC_TAMP_LSECSS_IRQHandler
|
||||||
|
.word RTC_WKUP_IRQHandler
|
||||||
|
.word FLASH_IRQHandler
|
||||||
|
.word RCC_IRQHandler
|
||||||
|
.word EXTI0_IRQHandler
|
||||||
|
.word EXTI1_IRQHandler
|
||||||
|
.word EXTI2_IRQHandler
|
||||||
|
.word EXTI3_IRQHandler
|
||||||
|
.word EXTI4_IRQHandler
|
||||||
|
.word DMA1_Channel1_IRQHandler
|
||||||
|
.word DMA1_Channel2_IRQHandler
|
||||||
|
.word DMA1_Channel3_IRQHandler
|
||||||
|
.word DMA1_Channel4_IRQHandler
|
||||||
|
.word DMA1_Channel5_IRQHandler
|
||||||
|
.word DMA1_Channel6_IRQHandler
|
||||||
|
.word DMA1_Channel7_IRQHandler
|
||||||
|
.word ADC1_2_IRQHandler
|
||||||
|
.word USB_HP_IRQHandler
|
||||||
|
.word USB_LP_IRQHandler
|
||||||
|
.word FDCAN1_IT0_IRQHandler
|
||||||
|
.word FDCAN1_IT1_IRQHandler
|
||||||
|
.word EXTI9_5_IRQHandler
|
||||||
|
.word TIM1_BRK_TIM15_IRQHandler
|
||||||
|
.word TIM1_UP_TIM16_IRQHandler
|
||||||
|
.word TIM1_TRG_COM_TIM17_IRQHandler
|
||||||
|
.word TIM1_CC_IRQHandler
|
||||||
|
.word TIM2_IRQHandler
|
||||||
|
.word TIM3_IRQHandler
|
||||||
|
.word TIM4_IRQHandler
|
||||||
|
.word I2C1_EV_IRQHandler
|
||||||
|
.word I2C1_ER_IRQHandler
|
||||||
|
.word I2C2_EV_IRQHandler
|
||||||
|
.word I2C2_ER_IRQHandler
|
||||||
|
.word SPI1_IRQHandler
|
||||||
|
.word SPI2_IRQHandler
|
||||||
|
.word USART1_IRQHandler
|
||||||
|
.word USART2_IRQHandler
|
||||||
|
.word USART3_IRQHandler
|
||||||
|
.word EXTI15_10_IRQHandler
|
||||||
|
.word RTC_Alarm_IRQHandler
|
||||||
|
.word USBWakeUp_IRQHandler
|
||||||
|
.word TIM8_BRK_IRQHandler
|
||||||
|
.word TIM8_UP_IRQHandler
|
||||||
|
.word TIM8_TRG_COM_IRQHandler
|
||||||
|
.word TIM8_CC_IRQHandler
|
||||||
|
.word ADC3_IRQHandler
|
||||||
|
.word FMC_IRQHandler
|
||||||
|
.word LPTIM1_IRQHandler
|
||||||
|
.word TIM5_IRQHandler
|
||||||
|
.word SPI3_IRQHandler
|
||||||
|
.word UART4_IRQHandler
|
||||||
|
.word UART5_IRQHandler
|
||||||
|
.word TIM6_DAC_IRQHandler
|
||||||
|
.word TIM7_DAC_IRQHandler
|
||||||
|
.word DMA2_Channel1_IRQHandler
|
||||||
|
.word DMA2_Channel2_IRQHandler
|
||||||
|
.word DMA2_Channel3_IRQHandler
|
||||||
|
.word DMA2_Channel4_IRQHandler
|
||||||
|
.word DMA2_Channel5_IRQHandler
|
||||||
|
.word ADC4_IRQHandler
|
||||||
|
.word ADC5_IRQHandler
|
||||||
|
.word UCPD1_IRQHandler
|
||||||
|
.word COMP1_2_3_IRQHandler
|
||||||
|
.word COMP4_5_6_IRQHandler
|
||||||
|
.word COMP7_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word CRS_IRQHandler
|
||||||
|
.word SAI1_IRQHandler
|
||||||
|
.word TIM20_BRK_IRQHandler
|
||||||
|
.word TIM20_UP_IRQHandler
|
||||||
|
.word TIM20_TRG_COM_IRQHandler
|
||||||
|
.word TIM20_CC_IRQHandler
|
||||||
|
.word FPU_IRQHandler
|
||||||
|
.word I2C4_EV_IRQHandler
|
||||||
|
.word I2C4_ER_IRQHandler
|
||||||
|
.word SPI4_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word FDCAN2_IT0_IRQHandler
|
||||||
|
.word FDCAN2_IT1_IRQHandler
|
||||||
|
.word FDCAN3_IT0_IRQHandler
|
||||||
|
.word FDCAN3_IT1_IRQHandler
|
||||||
|
.word RNG_IRQHandler
|
||||||
|
.word LPUART1_IRQHandler
|
||||||
|
.word I2C3_EV_IRQHandler
|
||||||
|
.word I2C3_ER_IRQHandler
|
||||||
|
.word DMAMUX_OVR_IRQHandler
|
||||||
|
.word QUADSPI_IRQHandler
|
||||||
|
.word DMA1_Channel8_IRQHandler
|
||||||
|
.word DMA2_Channel6_IRQHandler
|
||||||
|
.word DMA2_Channel7_IRQHandler
|
||||||
|
.word DMA2_Channel8_IRQHandler
|
||||||
|
.word CORDIC_IRQHandler
|
||||||
|
.word FMAC_IRQHandler
|
||||||
|
|
||||||
|
.size g_pfnVectors, .-g_pfnVectors
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* Provide weak aliases for each Exception handler to the Default_Handler.
|
||||||
|
* As they are weak aliases, any function with the same name will override
|
||||||
|
* this definition.
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
.weak NMI_Handler
|
||||||
|
.thumb_set NMI_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak HardFault_Handler
|
||||||
|
.thumb_set HardFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak MemManage_Handler
|
||||||
|
.thumb_set MemManage_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak BusFault_Handler
|
||||||
|
.thumb_set BusFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak UsageFault_Handler
|
||||||
|
.thumb_set UsageFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak SVC_Handler
|
||||||
|
.thumb_set SVC_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak DebugMon_Handler
|
||||||
|
.thumb_set DebugMon_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak PendSV_Handler
|
||||||
|
.thumb_set PendSV_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak SysTick_Handler
|
||||||
|
.thumb_set SysTick_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak WWDG_IRQHandler
|
||||||
|
.thumb_set WWDG_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak PVD_PVM_IRQHandler
|
||||||
|
.thumb_set PVD_PVM_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RTC_TAMP_LSECSS_IRQHandler
|
||||||
|
.thumb_set RTC_TAMP_LSECSS_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RTC_WKUP_IRQHandler
|
||||||
|
.thumb_set RTC_WKUP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FLASH_IRQHandler
|
||||||
|
.thumb_set FLASH_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RCC_IRQHandler
|
||||||
|
.thumb_set RCC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI0_IRQHandler
|
||||||
|
.thumb_set EXTI0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI1_IRQHandler
|
||||||
|
.thumb_set EXTI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI2_IRQHandler
|
||||||
|
.thumb_set EXTI2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI3_IRQHandler
|
||||||
|
.thumb_set EXTI3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI4_IRQHandler
|
||||||
|
.thumb_set EXTI4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel1_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel2_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel3_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel4_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel5_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel6_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel7_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC1_2_IRQHandler
|
||||||
|
.thumb_set ADC1_2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USB_HP_IRQHandler
|
||||||
|
.thumb_set USB_HP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USB_LP_IRQHandler
|
||||||
|
.thumb_set USB_LP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FDCAN1_IT0_IRQHandler
|
||||||
|
.thumb_set FDCAN1_IT0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FDCAN1_IT1_IRQHandler
|
||||||
|
.thumb_set FDCAN1_IT1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI9_5_IRQHandler
|
||||||
|
.thumb_set EXTI9_5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_BRK_TIM15_IRQHandler
|
||||||
|
.thumb_set TIM1_BRK_TIM15_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_UP_TIM16_IRQHandler
|
||||||
|
.thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_TRG_COM_TIM17_IRQHandler
|
||||||
|
.thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_CC_IRQHandler
|
||||||
|
.thumb_set TIM1_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM2_IRQHandler
|
||||||
|
.thumb_set TIM2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM3_IRQHandler
|
||||||
|
.thumb_set TIM3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM4_IRQHandler
|
||||||
|
.thumb_set TIM4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C1_EV_IRQHandler
|
||||||
|
.thumb_set I2C1_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C1_ER_IRQHandler
|
||||||
|
.thumb_set I2C1_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C2_EV_IRQHandler
|
||||||
|
.thumb_set I2C2_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C2_ER_IRQHandler
|
||||||
|
.thumb_set I2C2_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI1_IRQHandler
|
||||||
|
.thumb_set SPI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI2_IRQHandler
|
||||||
|
.thumb_set SPI2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART1_IRQHandler
|
||||||
|
.thumb_set USART1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART2_IRQHandler
|
||||||
|
.thumb_set USART2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART3_IRQHandler
|
||||||
|
.thumb_set USART3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI15_10_IRQHandler
|
||||||
|
.thumb_set EXTI15_10_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RTC_Alarm_IRQHandler
|
||||||
|
.thumb_set RTC_Alarm_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USBWakeUp_IRQHandler
|
||||||
|
.thumb_set USBWakeUp_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_BRK_IRQHandler
|
||||||
|
.thumb_set TIM8_BRK_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_UP_IRQHandler
|
||||||
|
.thumb_set TIM8_UP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_TRG_COM_IRQHandler
|
||||||
|
.thumb_set TIM8_TRG_COM_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_CC_IRQHandler
|
||||||
|
.thumb_set TIM8_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC3_IRQHandler
|
||||||
|
.thumb_set ADC3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FMC_IRQHandler
|
||||||
|
.thumb_set FMC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak LPTIM1_IRQHandler
|
||||||
|
.thumb_set LPTIM1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM5_IRQHandler
|
||||||
|
.thumb_set TIM5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI3_IRQHandler
|
||||||
|
.thumb_set SPI3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UART4_IRQHandler
|
||||||
|
.thumb_set UART4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UART5_IRQHandler
|
||||||
|
.thumb_set UART5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM6_DAC_IRQHandler
|
||||||
|
.thumb_set TIM6_DAC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM7_DAC_IRQHandler
|
||||||
|
.thumb_set TIM7_DAC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel1_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel2_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel3_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel4_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel5_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC4_IRQHandler
|
||||||
|
.thumb_set ADC4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC5_IRQHandler
|
||||||
|
.thumb_set ADC5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UCPD1_IRQHandler
|
||||||
|
.thumb_set UCPD1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak COMP1_2_3_IRQHandler
|
||||||
|
.thumb_set COMP1_2_3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak COMP4_5_6_IRQHandler
|
||||||
|
.thumb_set COMP4_5_6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak COMP7_IRQHandler
|
||||||
|
.thumb_set COMP7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CRS_IRQHandler
|
||||||
|
.thumb_set CRS_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SAI1_IRQHandler
|
||||||
|
.thumb_set SAI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM20_BRK_IRQHandler
|
||||||
|
.thumb_set TIM20_BRK_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM20_UP_IRQHandler
|
||||||
|
.thumb_set TIM20_UP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM20_TRG_COM_IRQHandler
|
||||||
|
.thumb_set TIM20_TRG_COM_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM20_CC_IRQHandler
|
||||||
|
.thumb_set TIM20_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FPU_IRQHandler
|
||||||
|
.thumb_set FPU_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C4_EV_IRQHandler
|
||||||
|
.thumb_set I2C4_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C4_ER_IRQHandler
|
||||||
|
.thumb_set I2C4_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI4_IRQHandler
|
||||||
|
.thumb_set SPI4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FDCAN2_IT0_IRQHandler
|
||||||
|
.thumb_set FDCAN2_IT0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FDCAN2_IT1_IRQHandler
|
||||||
|
.thumb_set FDCAN2_IT1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FDCAN3_IT0_IRQHandler
|
||||||
|
.thumb_set FDCAN3_IT0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FDCAN3_IT1_IRQHandler
|
||||||
|
.thumb_set FDCAN3_IT1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RNG_IRQHandler
|
||||||
|
.thumb_set RNG_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak LPUART1_IRQHandler
|
||||||
|
.thumb_set LPUART1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C3_EV_IRQHandler
|
||||||
|
.thumb_set I2C3_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C3_ER_IRQHandler
|
||||||
|
.thumb_set I2C3_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMAMUX_OVR_IRQHandler
|
||||||
|
.thumb_set DMAMUX_OVR_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak QUADSPI_IRQHandler
|
||||||
|
.thumb_set QUADSPI_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel8_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel8_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel6_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel7_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel8_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel8_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CORDIC_IRQHandler
|
||||||
|
.thumb_set CORDIC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FMAC_IRQHandler
|
||||||
|
.thumb_set FMAC_IRQHandler,Default_Handler
|
||||||
|
|
Loading…
Reference in New Issue
Block a user