├── .gitignore ├── APP BTLD AND APP 0x753906E9.hex ├── APP ├── .cproject ├── .gitignore ├── .mxproject ├── .project ├── .settings │ ├── com.atollic.truestudio.debug.hardware_device.prefs │ ├── org.eclipse.cdt.codan.core.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── APP 0x753906E9.hex ├── APP.ioc ├── APP.launch ├── BOOT+APP.launch ├── Drivers │ ├── CMSIS │ │ ├── Device │ │ │ └── ST │ │ │ │ └── STM32F3xx │ │ │ │ └── Include │ │ │ │ ├── stm32f373xc.h │ │ │ │ ├── stm32f3xx.h │ │ │ │ └── system_stm32f3xx.h │ │ └── Include │ │ │ ├── arm_common_tables.h │ │ │ ├── arm_const_structs.h │ │ │ ├── arm_math.h │ │ │ ├── cmsis_armcc.h │ │ │ ├── cmsis_armcc_V6.h │ │ │ ├── cmsis_gcc.h │ │ │ ├── core_cm0.h │ │ │ ├── core_cm0plus.h │ │ │ ├── core_cm3.h │ │ │ ├── core_cm4.h │ │ │ ├── core_cm7.h │ │ │ ├── core_cmFunc.h │ │ │ ├── core_cmInstr.h │ │ │ ├── core_cmSimd.h │ │ │ ├── core_sc000.h │ │ │ └── core_sc300.h │ └── STM32F3xx_HAL_Driver │ │ ├── Inc │ │ ├── Legacy │ │ │ └── stm32_hal_legacy.h │ │ ├── stm32f3xx_hal.h │ │ ├── stm32f3xx_hal_can.h │ │ ├── stm32f3xx_hal_cortex.h │ │ ├── stm32f3xx_hal_def.h │ │ ├── stm32f3xx_hal_dma.h │ │ ├── stm32f3xx_hal_dma_ex.h │ │ ├── stm32f3xx_hal_flash.h │ │ ├── stm32f3xx_hal_flash_ex.h │ │ ├── stm32f3xx_hal_gpio.h │ │ ├── stm32f3xx_hal_gpio_ex.h │ │ ├── stm32f3xx_hal_i2c.h │ │ ├── stm32f3xx_hal_i2c_ex.h │ │ ├── stm32f3xx_hal_pwr.h │ │ ├── stm32f3xx_hal_pwr_ex.h │ │ ├── stm32f3xx_hal_rcc.h │ │ ├── stm32f3xx_hal_rcc_ex.h │ │ ├── stm32f3xx_hal_tim.h │ │ └── stm32f3xx_hal_tim_ex.h │ │ └── Src │ │ ├── stm32f3xx_hal.c │ │ ├── stm32f3xx_hal_can.c │ │ ├── stm32f3xx_hal_cortex.c │ │ ├── stm32f3xx_hal_dma.c │ │ ├── stm32f3xx_hal_flash.c │ │ ├── stm32f3xx_hal_flash_ex.c │ │ ├── stm32f3xx_hal_gpio.c │ │ ├── stm32f3xx_hal_i2c.c │ │ ├── stm32f3xx_hal_i2c_ex.c │ │ ├── stm32f3xx_hal_pwr.c │ │ ├── stm32f3xx_hal_pwr_ex.c │ │ ├── stm32f3xx_hal_rcc.c │ │ ├── stm32f3xx_hal_rcc_ex.c │ │ ├── stm32f3xx_hal_tim.c │ │ └── stm32f3xx_hal_tim_ex.c ├── Inc │ ├── CANTX_FIFO.h │ ├── IO_MGMT.h │ ├── globaldefines.h │ ├── globalvars.h │ ├── main.h │ ├── stm32f3xx_hal_conf.h │ └── stm32f3xx_it.h ├── STM32F373VC_FLASH.ld ├── Src │ ├── CANTX_FIFO.c │ ├── IO_MGMT.c │ ├── globalvars.c │ ├── main.c │ ├── stm32f3xx_hal_msp.c │ ├── stm32f3xx_it.c │ ├── syscalls.c │ └── system_stm32f3xx.c ├── debug.log ├── startup │ └── startup_stm32f373xc.s └── syscalls.c ├── BOOT ├── .code_review_properties ├── .cproject ├── .gitignore ├── .mxproject ├── .project ├── .settings │ ├── com.atollic.truestudio.debug.hardware_device.prefs │ └── org.eclipse.cdt.managedbuilder.core.prefs ├── BOOT 0x2AA5AE59.hex ├── BOOT.ioc ├── BOOT.launch ├── Drivers │ ├── CMSIS │ │ ├── Device │ │ │ └── ST │ │ │ │ └── STM32F3xx │ │ │ │ └── Include │ │ │ │ ├── stm32f373xc.h │ │ │ │ ├── stm32f3xx.h │ │ │ │ └── system_stm32f3xx.h │ │ └── Include │ │ │ ├── arm_common_tables.h │ │ │ ├── arm_const_structs.h │ │ │ ├── arm_math.h │ │ │ ├── cmsis_armcc.h │ │ │ ├── cmsis_armcc_V6.h │ │ │ ├── cmsis_gcc.h │ │ │ ├── core_cm0.h │ │ │ ├── core_cm0plus.h │ │ │ ├── core_cm3.h │ │ │ ├── core_cm4.h │ │ │ ├── core_cm7.h │ │ │ ├── core_cmFunc.h │ │ │ ├── core_cmInstr.h │ │ │ ├── core_cmSimd.h │ │ │ ├── core_sc000.h │ │ │ └── core_sc300.h │ └── STM32F3xx_HAL_Driver │ │ ├── Inc │ │ ├── Legacy │ │ │ └── stm32_hal_legacy.h │ │ ├── stm32f3xx_hal.h │ │ ├── stm32f3xx_hal_can.h │ │ ├── stm32f3xx_hal_cortex.h │ │ ├── stm32f3xx_hal_crc.h │ │ ├── stm32f3xx_hal_crc_ex.h │ │ ├── stm32f3xx_hal_def.h │ │ ├── stm32f3xx_hal_dma.h │ │ ├── stm32f3xx_hal_dma_ex.h │ │ ├── stm32f3xx_hal_flash.h │ │ ├── stm32f3xx_hal_flash_ex.h │ │ ├── stm32f3xx_hal_gpio.h │ │ ├── stm32f3xx_hal_gpio_ex.h │ │ ├── stm32f3xx_hal_i2c.h │ │ ├── stm32f3xx_hal_i2c_ex.h │ │ ├── stm32f3xx_hal_pwr.h │ │ ├── stm32f3xx_hal_pwr_ex.h │ │ ├── stm32f3xx_hal_rcc.h │ │ ├── stm32f3xx_hal_rcc_ex.h │ │ ├── stm32f3xx_hal_tim.h │ │ └── stm32f3xx_hal_tim_ex.h │ │ └── Src │ │ ├── stm32f3xx_hal.c │ │ ├── stm32f3xx_hal_can.c │ │ ├── stm32f3xx_hal_cortex.c │ │ ├── stm32f3xx_hal_crc.c │ │ ├── stm32f3xx_hal_crc_ex.c │ │ ├── stm32f3xx_hal_dma.c │ │ ├── stm32f3xx_hal_flash.c │ │ ├── stm32f3xx_hal_flash_ex.c │ │ ├── stm32f3xx_hal_gpio.c │ │ ├── stm32f3xx_hal_i2c.c │ │ ├── stm32f3xx_hal_i2c_ex.c │ │ ├── stm32f3xx_hal_pwr.c │ │ ├── stm32f3xx_hal_pwr_ex.c │ │ ├── stm32f3xx_hal_rcc.c │ │ ├── stm32f3xx_hal_rcc_ex.c │ │ ├── stm32f3xx_hal_tim.c │ │ └── stm32f3xx_hal_tim_ex.c ├── Inc │ ├── btld.h │ ├── main.h │ ├── stm32f3xx_hal_conf.h │ └── stm32f3xx_it.h ├── STM32F373VC_FLASH.ld ├── Src │ ├── btld.c │ ├── main.c │ ├── stm32f3xx_hal_msp.c │ ├── stm32f3xx_it.c │ ├── syscalls.c │ └── system_stm32f3xx.c ├── startup │ └── startup_stm32f373xc.s └── syscalls.c ├── LICENSE ├── LOADER └── PY-CAN-LOADER.py ├── README.md └── SCRIPTS ├── GetBin.py └── MakeNewHex.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/effenco/stm32-can-bootloader/106bf5828c6193284f40027c85a628ba04a17207/.gitignore -------------------------------------------------------------------------------- /APP/.gitignore: -------------------------------------------------------------------------------- 1 | Debug/ 2 | .settings/language.settings.xml 3 | -------------------------------------------------------------------------------- /APP/.mxproject: -------------------------------------------------------------------------------- 1 | [PreviousGenFiles] 2 | HeaderPath=C:/github/stm32-can-bootloader/APP/Inc 3 | HeaderFiles=stm32f3xx_it.h;stm32f3xx_hal_conf.h;main.h; 4 | SourcePath=C:/github/stm32-can-bootloader/APP/Src 5 | SourceFiles=stm32f3xx_it.c;stm32f3xx_hal_msp.c;main.c; 6 | 7 | [PreviousLibFiles] 8 | LibFiles=Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_can.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_cortex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_can.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_can.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_cortex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f373xc.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f3xx.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/system_stm32f3xx.h;Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/system_stm32f3xx.c;Drivers/CMSIS/Include/arm_common_tables.h;Drivers/CMSIS/Include/arm_const_structs.h;Drivers/CMSIS/Include/arm_math.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armcc_V6.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_cmFunc.h;Drivers/CMSIS/Include/core_cmInstr.h;Drivers/CMSIS/Include/core_cmSimd.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h; 9 | 10 | [PreviousUsedTStudioFiles] 11 | SourceFiles=..\Src\main.c;..\Src\stm32f3xx_it.c;..\Src\stm32f3xx_hal_msp.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_can.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;../\Src/system_stm32f3xx.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_can.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;../\Src/system_stm32f3xx.c;../Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/system_stm32f3xx.c;null; 12 | HeaderPath=..\Drivers\STM32F3xx_HAL_Driver\Inc;..\Drivers\STM32F3xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F3xx\Include;..\Drivers\CMSIS\Include;..\Inc; 13 | CDefines=__weak:__attribute__((weak));__packed:__attribute__((__packed__)); 14 | 15 | -------------------------------------------------------------------------------- /APP/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | APP 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | ?children? 14 | ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| 15 | 16 | 17 | ?name? 18 | 19 | 20 | 21 | org.eclipse.cdt.make.core.append_environment 22 | true 23 | 24 | 25 | org.eclipse.cdt.make.core.buildArguments 26 | 27 | 28 | 29 | org.eclipse.cdt.make.core.buildCommand 30 | make 31 | 32 | 33 | org.eclipse.cdt.make.core.buildLocation 34 | ${workspace_loc:/STM32100B-EVAL/Debug} 35 | 36 | 37 | org.eclipse.cdt.make.core.contents 38 | org.eclipse.cdt.make.core.activeConfigSettings 39 | 40 | 41 | org.eclipse.cdt.make.core.enableAutoBuild 42 | false 43 | 44 | 45 | org.eclipse.cdt.make.core.enableCleanBuild 46 | true 47 | 48 | 49 | org.eclipse.cdt.make.core.enableFullBuild 50 | true 51 | 52 | 53 | org.eclipse.cdt.make.core.stopOnError 54 | true 55 | 56 | 57 | org.eclipse.cdt.make.core.useDefaultBuildCmd 58 | true 59 | 60 | 61 | 62 | 63 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 64 | 65 | 66 | 67 | 68 | 69 | org.eclipse.cdt.core.cnature 70 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 71 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /APP/.settings/com.atollic.truestudio.debug.hardware_device.prefs: -------------------------------------------------------------------------------- 1 | BOARD=None 2 | CODE_LOCATION=FLASH 3 | ENDIAN=Little-endian 4 | MCU=STM32F373VC 5 | MCU_VENDOR=STMicroelectronics 6 | MODEL=Lite 7 | PROBE=ST-LINK 8 | PROJECT_FORMAT_VERSION=2 9 | TARGET=ARM\u00AE 10 | VERSION=4.1.0 11 | eclipse.preferences.version=1 12 | -------------------------------------------------------------------------------- /APP/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.1518366166/CPATH/delimiter=; 3 | environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.1518366166/CPATH/operation=remove 4 | environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.1518366166/C_INCLUDE_PATH/delimiter=; 5 | environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.1518366166/C_INCLUDE_PATH/operation=remove 6 | environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.1518366166/append=true 7 | environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.1518366166/appendContributed=true 8 | environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.1518366166/LIBRARY_PATH/delimiter=; 9 | environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.1518366166/LIBRARY_PATH/operation=remove 10 | environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.1518366166/append=true 11 | environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.1518366166/appendContributed=true 12 | -------------------------------------------------------------------------------- /APP/APP.ioc: -------------------------------------------------------------------------------- 1 | #MicroXplorer Configuration settings - do not modify 2 | CAN.ABOM=ENABLE 3 | CAN.BS1=CAN_BS1_9TQ 4 | CAN.BS2=CAN_BS2_6TQ 5 | CAN.CalculateTimeQuantum=125.0 6 | CAN.IPParameters=CalculateTimeQuantum,BS1,Prescaler,BS2,ABOM 7 | CAN.Prescaler=4 8 | File.Version=6 9 | KeepUserPlacement=false 10 | Mcu.Family=STM32F3 11 | Mcu.IP0=CAN 12 | Mcu.IP1=NVIC 13 | Mcu.IP2=RCC 14 | Mcu.IP3=SYS 15 | Mcu.IP4=TIM17 16 | Mcu.IPNb=5 17 | Mcu.Name=STM32F373V(8-B-C)Tx 18 | Mcu.Package=LQFP100 19 | Mcu.Pin0=PA13 20 | Mcu.Pin1=PA14 21 | Mcu.Pin2=PA15 22 | Mcu.Pin3=PC10 23 | Mcu.Pin4=PC11 24 | Mcu.Pin5=PD0 25 | Mcu.Pin6=PD1 26 | Mcu.Pin7=PB3 27 | Mcu.Pin8=VP_SYS_VS_Systick 28 | Mcu.Pin9=VP_TIM17_VS_ClockSourceINT 29 | Mcu.PinsNb=10 30 | Mcu.ThirdPartyNb=0 31 | Mcu.UserConstants= 32 | Mcu.UserName=STM32F373VCTx 33 | MxCube.Version=5.1.0 34 | MxDb.Version=DB.5.0.10 35 | NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false 36 | NVIC.CAN_RX0_IRQn=true\:0\:0\:false\:false\:true\:true\:true 37 | NVIC.CAN_TX_IRQn=true\:0\:0\:false\:false\:true\:true\:true 38 | NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false 39 | NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false 40 | NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false 41 | NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false 42 | NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false 43 | NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 44 | NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false 45 | NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true 46 | NVIC.TIM17_IRQn=true\:0\:0\:false\:false\:true\:true\:true 47 | NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false 48 | PA13.Mode=Trace_Asynchronous_SW 49 | PA13.Signal=SYS_JTMS-SWDIO 50 | PA14.Mode=Trace_Asynchronous_SW 51 | PA14.Signal=SYS_JTCK-SWCLK 52 | PA15.GPIOParameters=GPIO_Label 53 | PA15.GPIO_Label=GPIO_LED1_R 54 | PA15.Locked=true 55 | PA15.Signal=GPIO_Output 56 | PB3.Mode=Trace_Asynchronous_SW 57 | PB3.Signal=SYS_JTDO-TRACESWO 58 | PC10.GPIOParameters=GPIO_Label 59 | PC10.GPIO_Label=GPIO_LED1_G 60 | PC10.Locked=true 61 | PC10.Signal=GPIO_Output 62 | PC11.GPIOParameters=GPIO_Label 63 | PC11.GPIO_Label=GPIO_LED1_B 64 | PC11.Locked=true 65 | PC11.Signal=GPIO_Output 66 | PCC.Checker=false 67 | PCC.Line=STM32F373 68 | PCC.MCU=STM32F373V(8-B-C)Tx 69 | PCC.PartNumber=STM32F373VCTx 70 | PCC.Seq0=0 71 | PCC.Series=STM32F3 72 | PCC.Temperature=25 73 | PCC.Vdd=3.6 74 | PD0.Locked=true 75 | PD0.Mode=Master 76 | PD0.Signal=CAN_RX 77 | PD1.Mode=Master 78 | PD1.Signal=CAN_TX 79 | PinOutPanel.RotationAngle=0 80 | ProjectManager.AskForMigrate=true 81 | ProjectManager.BackupPrevious=false 82 | ProjectManager.CompilerOptimize=6 83 | ProjectManager.ComputerToolchain=false 84 | ProjectManager.CoupleFile=false 85 | ProjectManager.CustomerFirmwarePackage= 86 | ProjectManager.DefaultFWLocation=true 87 | ProjectManager.DeletePrevious=true 88 | ProjectManager.DeviceId=STM32F373VCTx 89 | ProjectManager.FirmwarePackage=STM32Cube FW_F3 V1.10.0 90 | ProjectManager.FreePins=false 91 | ProjectManager.HalAssertFull=false 92 | ProjectManager.HeapSize=0x200 93 | ProjectManager.KeepUserCode=true 94 | ProjectManager.LastFirmware=true 95 | ProjectManager.LibraryCopy=1 96 | ProjectManager.MainLocation=Src 97 | ProjectManager.NoMain=false 98 | ProjectManager.PreviousToolchain=TrueSTUDIO 99 | ProjectManager.ProjectBuild=false 100 | ProjectManager.ProjectFileName=APP.ioc 101 | ProjectManager.ProjectName=APP 102 | ProjectManager.StackSize=0x400 103 | ProjectManager.TargetToolchain=TrueSTUDIO 104 | ProjectManager.ToolChainLocation= 105 | ProjectManager.UnderRoot=true 106 | ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_CAN_Init-CAN-false-HAL-true,3-MX_TIM17_Init-TIM17-false-HAL-true,4-SystemClock_Config-RCC-false-HAL-false 107 | RCC.ADCoutputFreq_Value=32000000 108 | RCC.AHBFreq_Value=64000000 109 | RCC.APB1CLKDivider=RCC_HCLK_DIV2 110 | RCC.APB1Freq_Value=32000000 111 | RCC.APB1TimFreq_Value=64000000 112 | RCC.APB2Freq_Value=64000000 113 | RCC.APB2TimFreq_Value=64000000 114 | RCC.CECFreq_Value=32786.88524590164 115 | RCC.CortexFreq_Value=64000000 116 | RCC.FCLKCortexFreq_Value=64000000 117 | RCC.FamilyName=M 118 | RCC.HCLKFreq_Value=64000000 119 | RCC.HSEPLLFreq_Value=8000000 120 | RCC.HSE_VALUE=8000000 121 | RCC.HSICECFreq_Value=32786.88524590164 122 | RCC.HSIPLLFreq_Value=4000000 123 | RCC.HSI_VALUE=8000000 124 | RCC.I2C1Freq_Value=8000000 125 | RCC.I2CFreq_Value=8000000 126 | RCC.IPParameters=ADCoutputFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CECFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSEPLLFreq_Value,HSE_VALUE,HSICECFreq_Value,HSIPLLFreq_Value,HSI_VALUE,I2C1Freq_Value,I2CFreq_Value,LSE_VALUE,LSI_VALUE,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PWRFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SDADCPresc,SDADCoutputFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,TIM2Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOOutput2Freq_Value 127 | RCC.LSE_VALUE=32768 128 | RCC.LSI_VALUE=40000 129 | RCC.MCOFreq_Value=64000000 130 | RCC.PLLCLKFreq_Value=64000000 131 | RCC.PLLMCOFreq_Value=32000000 132 | RCC.PLLMUL=RCC_PLL_MUL16 133 | RCC.PWRFreq_Value=64000000 134 | RCC.RTCFreq_Value=40000 135 | RCC.RTCHSEDivFreq_Value=250000 136 | RCC.SDADCPresc=RCC_SDADCSYSCLK_DIV48 137 | RCC.SDADCoutputFreq_Value=1333333.3333333333 138 | RCC.SYSCLKFreq_VALUE=64000000 139 | RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK 140 | RCC.TIM2Freq_Value=64000000 141 | RCC.USART1Freq_Value=64000000 142 | RCC.USART2Freq_Value=32000000 143 | RCC.USART3Freq_Value=32000000 144 | RCC.USBFreq_Value=64000000 145 | RCC.VCOOutput2Freq_Value=4000000 146 | TIM17.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE 147 | TIM17.ClockDivision=TIM_CLOCKDIVISION_DIV2 148 | TIM17.IPParameters=Prescaler,Period,ClockDivision,AutoReloadPreload 149 | TIM17.Period=32000 150 | TIM17.Prescaler=1 151 | VP_SYS_VS_Systick.Mode=SysTick 152 | VP_SYS_VS_Systick.Signal=SYS_VS_Systick 153 | VP_TIM17_VS_ClockSourceINT.Mode=Enable_Timer 154 | VP_TIM17_VS_ClockSourceINT.Signal=TIM17_VS_ClockSourceINT 155 | board=custom 156 | -------------------------------------------------------------------------------- /APP/APP.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /APP/BOOT+APP.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /APP/Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f373xc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/effenco/stm32-can-bootloader/106bf5828c6193284f40027c85a628ba04a17207/APP/Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f373xc.h -------------------------------------------------------------------------------- /APP/Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f3xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/effenco/stm32-can-bootloader/106bf5828c6193284f40027c85a628ba04a17207/APP/Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f3xx.h -------------------------------------------------------------------------------- /APP/Drivers/CMSIS/Device/ST/STM32F3xx/Include/system_stm32f3xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f3xx.h 4 | * @author MCD Application Team 5 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F3xx devices. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© COPYRIGHT(c) 2016 STMicroelectronics

10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | * 33 | ****************************************************************************** 34 | */ 35 | 36 | /** @addtogroup CMSIS 37 | * @{ 38 | */ 39 | 40 | /** @addtogroup stm32f3xx_system 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @brief Define to prevent recursive inclusion 46 | */ 47 | #ifndef __SYSTEM_STM32F3XX_H 48 | #define __SYSTEM_STM32F3XX_H 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | 54 | /** @addtogroup STM32F3xx_System_Includes 55 | * @{ 56 | */ 57 | 58 | /** 59 | * @} 60 | */ 61 | 62 | 63 | /** @addtogroup STM32F3xx_System_Exported_types 64 | * @{ 65 | */ 66 | /* This variable is updated in three ways: 67 | 1) by calling CMSIS function SystemCoreClockUpdate() 68 | 3) by calling HAL API function HAL_RCC_GetHCLKFreq() 69 | 3) by calling HAL API function HAL_RCC_ClockConfig() 70 | Note: If you use this function to configure the system clock; then there 71 | is no need to call the 2 first functions listed above, since SystemCoreClock 72 | variable is updated automatically. 73 | */ 74 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 75 | extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */ 76 | extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */ 77 | 78 | 79 | /** 80 | * @} 81 | */ 82 | 83 | /** @addtogroup STM32F3xx_System_Exported_Constants 84 | * @{ 85 | */ 86 | 87 | /** 88 | * @} 89 | */ 90 | 91 | /** @addtogroup STM32F3xx_System_Exported_Macros 92 | * @{ 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | 99 | /** @addtogroup STM32F3xx_System_Exported_Functions 100 | * @{ 101 | */ 102 | 103 | extern void SystemInit(void); 104 | extern void SystemCoreClockUpdate(void); 105 | /** 106 | * @} 107 | */ 108 | 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | 113 | #endif /*__SYSTEM_STM32F3XX_H */ 114 | 115 | /** 116 | * @} 117 | */ 118 | 119 | /** 120 | * @} 121 | */ 122 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 123 | -------------------------------------------------------------------------------- /APP/Drivers/CMSIS/Include/arm_common_tables.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. October 2015 5 | * $Revision: V.1.4.5 a 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_common_tables.h 9 | * 10 | * Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #ifndef _ARM_COMMON_TABLES_H 42 | #define _ARM_COMMON_TABLES_H 43 | 44 | #include "arm_math.h" 45 | 46 | extern const uint16_t armBitRevTable[1024]; 47 | extern const q15_t armRecipTableQ15[64]; 48 | extern const q31_t armRecipTableQ31[64]; 49 | /* extern const q31_t realCoefAQ31[1024]; */ 50 | /* extern const q31_t realCoefBQ31[1024]; */ 51 | extern const float32_t twiddleCoef_16[32]; 52 | extern const float32_t twiddleCoef_32[64]; 53 | extern const float32_t twiddleCoef_64[128]; 54 | extern const float32_t twiddleCoef_128[256]; 55 | extern const float32_t twiddleCoef_256[512]; 56 | extern const float32_t twiddleCoef_512[1024]; 57 | extern const float32_t twiddleCoef_1024[2048]; 58 | extern const float32_t twiddleCoef_2048[4096]; 59 | extern const float32_t twiddleCoef_4096[8192]; 60 | #define twiddleCoef twiddleCoef_4096 61 | extern const q31_t twiddleCoef_16_q31[24]; 62 | extern const q31_t twiddleCoef_32_q31[48]; 63 | extern const q31_t twiddleCoef_64_q31[96]; 64 | extern const q31_t twiddleCoef_128_q31[192]; 65 | extern const q31_t twiddleCoef_256_q31[384]; 66 | extern const q31_t twiddleCoef_512_q31[768]; 67 | extern const q31_t twiddleCoef_1024_q31[1536]; 68 | extern const q31_t twiddleCoef_2048_q31[3072]; 69 | extern const q31_t twiddleCoef_4096_q31[6144]; 70 | extern const q15_t twiddleCoef_16_q15[24]; 71 | extern const q15_t twiddleCoef_32_q15[48]; 72 | extern const q15_t twiddleCoef_64_q15[96]; 73 | extern const q15_t twiddleCoef_128_q15[192]; 74 | extern const q15_t twiddleCoef_256_q15[384]; 75 | extern const q15_t twiddleCoef_512_q15[768]; 76 | extern const q15_t twiddleCoef_1024_q15[1536]; 77 | extern const q15_t twiddleCoef_2048_q15[3072]; 78 | extern const q15_t twiddleCoef_4096_q15[6144]; 79 | extern const float32_t twiddleCoef_rfft_32[32]; 80 | extern const float32_t twiddleCoef_rfft_64[64]; 81 | extern const float32_t twiddleCoef_rfft_128[128]; 82 | extern const float32_t twiddleCoef_rfft_256[256]; 83 | extern const float32_t twiddleCoef_rfft_512[512]; 84 | extern const float32_t twiddleCoef_rfft_1024[1024]; 85 | extern const float32_t twiddleCoef_rfft_2048[2048]; 86 | extern const float32_t twiddleCoef_rfft_4096[4096]; 87 | 88 | 89 | /* floating-point bit reversal tables */ 90 | #define ARMBITREVINDEXTABLE__16_TABLE_LENGTH ((uint16_t)20 ) 91 | #define ARMBITREVINDEXTABLE__32_TABLE_LENGTH ((uint16_t)48 ) 92 | #define ARMBITREVINDEXTABLE__64_TABLE_LENGTH ((uint16_t)56 ) 93 | #define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208 ) 94 | #define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440 ) 95 | #define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448 ) 96 | #define ARMBITREVINDEXTABLE1024_TABLE_LENGTH ((uint16_t)1800) 97 | #define ARMBITREVINDEXTABLE2048_TABLE_LENGTH ((uint16_t)3808) 98 | #define ARMBITREVINDEXTABLE4096_TABLE_LENGTH ((uint16_t)4032) 99 | 100 | extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH]; 101 | extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE__32_TABLE_LENGTH]; 102 | extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE__64_TABLE_LENGTH]; 103 | extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]; 104 | extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]; 105 | extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]; 106 | extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE1024_TABLE_LENGTH]; 107 | extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE2048_TABLE_LENGTH]; 108 | extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE4096_TABLE_LENGTH]; 109 | 110 | /* fixed-point bit reversal tables */ 111 | #define ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH ((uint16_t)12 ) 112 | #define ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH ((uint16_t)24 ) 113 | #define ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH ((uint16_t)56 ) 114 | #define ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH ((uint16_t)112 ) 115 | #define ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH ((uint16_t)240 ) 116 | #define ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH ((uint16_t)480 ) 117 | #define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992 ) 118 | #define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984) 119 | #define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032) 120 | 121 | extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH]; 122 | extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH]; 123 | extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH]; 124 | extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH]; 125 | extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH]; 126 | extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH]; 127 | extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH]; 128 | extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH]; 129 | extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH]; 130 | 131 | /* Tables for Fast Math Sine and Cosine */ 132 | extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1]; 133 | extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1]; 134 | extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; 135 | 136 | #endif /* ARM_COMMON_TABLES_H */ 137 | -------------------------------------------------------------------------------- /APP/Drivers/CMSIS/Include/arm_const_structs.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_const_structs.h 9 | * 10 | * Description: This file has constant structs that are initialized for 11 | * user convenience. For example, some can be given as 12 | * arguments to the arm_cfft_f32() function. 13 | * 14 | * Target Processor: Cortex-M4/Cortex-M3 15 | * 16 | * Redistribution and use in source and binary forms, with or without 17 | * modification, are permitted provided that the following conditions 18 | * are met: 19 | * - Redistributions of source code must retain the above copyright 20 | * notice, this list of conditions and the following disclaimer. 21 | * - Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * - Neither the name of ARM LIMITED nor the names of its contributors 26 | * may be used to endorse or promote products derived from this 27 | * software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 32 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 33 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 35 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 36 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 37 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 39 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 | * POSSIBILITY OF SUCH DAMAGE. 41 | * -------------------------------------------------------------------- */ 42 | 43 | #ifndef _ARM_CONST_STRUCTS_H 44 | #define _ARM_CONST_STRUCTS_H 45 | 46 | #include "arm_math.h" 47 | #include "arm_common_tables.h" 48 | 49 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; 50 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; 51 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; 52 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; 53 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; 54 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; 55 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; 56 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; 57 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; 58 | 59 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; 60 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; 61 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; 62 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; 63 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; 64 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; 65 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; 66 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; 67 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; 68 | 69 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; 70 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; 71 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; 72 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; 73 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; 74 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; 75 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; 76 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; 77 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /APP/Drivers/CMSIS/Include/core_cmFunc.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmFunc.h 3 | * @brief CMSIS Cortex-M Core Function Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMFUNC_H 42 | #define __CORE_CMFUNC_H 43 | 44 | 45 | /* ########################### Core Function Access ########################### */ 46 | /** \ingroup CMSIS_Core_FunctionInterface 47 | \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@} end of CMSIS_Core_RegAccFunctions */ 86 | 87 | #endif /* __CORE_CMFUNC_H */ 88 | -------------------------------------------------------------------------------- /APP/Drivers/CMSIS/Include/core_cmInstr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmInstr.h 3 | * @brief CMSIS Cortex-M Core Instruction Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMINSTR_H 42 | #define __CORE_CMINSTR_H 43 | 44 | 45 | /* ########################## Core Instruction Access ######################### */ 46 | /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface 47 | Access to dedicated instructions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@}*/ /* end of group CMSIS_Core_InstructionInterface */ 86 | 87 | #endif /* __CORE_CMINSTR_H */ 88 | -------------------------------------------------------------------------------- /APP/Drivers/CMSIS/Include/core_cmSimd.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmSimd.h 3 | * @brief CMSIS Cortex-M SIMD Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMSIMD_H 42 | #define __CORE_CMSIMD_H 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | 49 | /* ################### Compiler specific Intrinsics ########################### */ 50 | /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics 51 | Access to dedicated SIMD instructions 52 | @{ 53 | */ 54 | 55 | /*------------------ RealView Compiler -----------------*/ 56 | #if defined ( __CC_ARM ) 57 | #include "cmsis_armcc.h" 58 | 59 | /*------------------ ARM Compiler V6 -------------------*/ 60 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 61 | #include "cmsis_armcc_V6.h" 62 | 63 | /*------------------ GNU Compiler ----------------------*/ 64 | #elif defined ( __GNUC__ ) 65 | #include "cmsis_gcc.h" 66 | 67 | /*------------------ ICC Compiler ----------------------*/ 68 | #elif defined ( __ICCARM__ ) 69 | #include 70 | 71 | /*------------------ TI CCS Compiler -------------------*/ 72 | #elif defined ( __TMS470__ ) 73 | #include 74 | 75 | /*------------------ TASKING Compiler ------------------*/ 76 | #elif defined ( __TASKING__ ) 77 | /* 78 | * The CMSIS functions have been implemented as intrinsics in the compiler. 79 | * Please use "carm -?i" to get an up to date list of all intrinsics, 80 | * Including the CMSIS ones. 81 | */ 82 | 83 | /*------------------ COSMIC Compiler -------------------*/ 84 | #elif defined ( __CSMC__ ) 85 | #include 86 | 87 | #endif 88 | 89 | /*@} end of group CMSIS_SIMD_intrinsics */ 90 | 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* __CORE_CMSIMD_H */ 97 | -------------------------------------------------------------------------------- /APP/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f3xx_hal_def.h 4 | * @author MCD Application Team 5 | * @brief This file contains HAL common defines, enumeration, macros and 6 | * structures definitions. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | *

© COPYRIGHT(c) 2016 STMicroelectronics

11 | * 12 | * Redistribution and use in source and binary forms, with or without modification, 13 | * are permitted provided that the following conditions are met: 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 20 | * may be used to endorse or promote products derived from this software 21 | * without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 31 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | * 34 | ****************************************************************************** 35 | */ 36 | 37 | /* Define to prevent recursive inclusion -------------------------------------*/ 38 | #ifndef __STM32F3xx_HAL_DEF 39 | #define __STM32F3xx_HAL_DEF 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /* Includes ------------------------------------------------------------------*/ 46 | #include "stm32f3xx.h" 47 | #if defined USE_LEGACY 48 | #include "Legacy/stm32_hal_legacy.h" 49 | #endif 50 | #include 51 | 52 | /* Exported types ------------------------------------------------------------*/ 53 | 54 | /** 55 | * @brief HAL Status structures definition 56 | */ 57 | typedef enum 58 | { 59 | HAL_OK = 0x00U, 60 | HAL_ERROR = 0x01U, 61 | HAL_BUSY = 0x02U, 62 | HAL_TIMEOUT = 0x03 63 | } HAL_StatusTypeDef; 64 | 65 | /** 66 | * @brief HAL Lock structures definition 67 | */ 68 | typedef enum 69 | { 70 | HAL_UNLOCKED = 0x00U, 71 | HAL_LOCKED = 0x01 72 | } HAL_LockTypeDef; 73 | 74 | /* Exported macro ------------------------------------------------------------*/ 75 | 76 | #define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */ 77 | 78 | #define HAL_MAX_DELAY 0xFFFFFFFFU 79 | 80 | #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) == BIT) 81 | #define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U) 82 | 83 | #define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD_, __DMA_HANDLE_) \ 84 | do{ \ 85 | (__HANDLE__)->__PPP_DMA_FIELD_ = &(__DMA_HANDLE_); \ 86 | (__DMA_HANDLE_).Parent = (__HANDLE__); \ 87 | } while(0U) 88 | 89 | /** @brief Reset the Handle's State field. 90 | * @param __HANDLE__ specifies the Peripheral Handle. 91 | * @note This macro can be used for the following purpose: 92 | * - When the Handle is declared as local variable; before passing it as parameter 93 | * to HAL_PPP_Init() for the first time, it is mandatory to use this macro 94 | * to set to 0 the Handle's "State" field. 95 | * Otherwise, "State" field may have any random value and the first time the function 96 | * HAL_PPP_Init() is called, the low level hardware initialization will be missed 97 | * (i.e. HAL_PPP_MspInit() will not be executed). 98 | * - When there is a need to reconfigure the low level hardware: instead of calling 99 | * HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init(). 100 | * In this later function, when the Handle's "State" field is set to 0, it will execute the function 101 | * HAL_PPP_MspInit() which will reconfigure the low level hardware. 102 | * @retval None 103 | */ 104 | #define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U) 105 | 106 | #if (USE_RTOS == 1U) 107 | #error " USE_RTOS should be 0 in the current HAL release " 108 | #else 109 | #define __HAL_LOCK(__HANDLE__) \ 110 | do{ \ 111 | if((__HANDLE__)->Lock == HAL_LOCKED) \ 112 | { \ 113 | return HAL_BUSY; \ 114 | } \ 115 | else \ 116 | { \ 117 | (__HANDLE__)->Lock = HAL_LOCKED; \ 118 | } \ 119 | }while (0U) 120 | 121 | #define __HAL_UNLOCK(__HANDLE__) \ 122 | do{ \ 123 | (__HANDLE__)->Lock = HAL_UNLOCKED; \ 124 | }while (0U) 125 | #endif /* USE_RTOS */ 126 | 127 | #if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */ 128 | #ifndef __weak 129 | #define __weak __attribute__((weak)) 130 | #endif /* __weak */ 131 | #ifndef __packed 132 | #define __packed __attribute__((__packed__)) 133 | #endif /* __packed */ 134 | #endif /* __GNUC__ */ 135 | 136 | 137 | /* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */ 138 | #if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */ 139 | #ifndef __ALIGN_END 140 | #define __ALIGN_END __attribute__ ((aligned (4))) 141 | #endif /* __ALIGN_END */ 142 | #ifndef __ALIGN_BEGIN 143 | #define __ALIGN_BEGIN 144 | #endif /* __ALIGN_BEGIN */ 145 | #else 146 | #ifndef __ALIGN_END 147 | #define __ALIGN_END 148 | #endif /* __ALIGN_END */ 149 | #ifndef __ALIGN_BEGIN 150 | #if defined (__CC_ARM) /* ARM Compiler */ 151 | #define __ALIGN_BEGIN __align(4) 152 | #elif defined (__ICCARM__) /* IAR Compiler */ 153 | #define __ALIGN_BEGIN 154 | #endif /* __CC_ARM */ 155 | #endif /* __ALIGN_BEGIN */ 156 | #endif /* __GNUC__ */ 157 | 158 | /** 159 | * @brief __NOINLINE definition 160 | */ 161 | #if defined ( __CC_ARM ) || defined ( __GNUC__ ) 162 | /* ARM & GNUCompiler 163 | ---------------- 164 | */ 165 | #define __NOINLINE __attribute__ ( (noinline) ) 166 | 167 | #elif defined ( __ICCARM__ ) 168 | /* ICCARM Compiler 169 | --------------- 170 | */ 171 | #define __NOINLINE _Pragma("optimize = no_inline") 172 | 173 | #endif 174 | 175 | #ifdef __cplusplus 176 | } 177 | #endif 178 | 179 | #endif /* ___STM32F3xx_HAL_DEF */ 180 | 181 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 182 | -------------------------------------------------------------------------------- /APP/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f3xx_hal_i2c_ex.h 4 | * @author MCD Application Team 5 | * @brief Header file of I2C HAL Extended module. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© COPYRIGHT(c) 2016 STMicroelectronics

10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | * 33 | ****************************************************************************** 34 | */ 35 | 36 | /* Define to prevent recursive inclusion -------------------------------------*/ 37 | #ifndef __STM32F3xx_HAL_I2C_EX_H 38 | #define __STM32F3xx_HAL_I2C_EX_H 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* Includes ------------------------------------------------------------------*/ 45 | #include "stm32f3xx_hal_def.h" 46 | 47 | /** @addtogroup STM32F3xx_HAL_Driver 48 | * @{ 49 | */ 50 | 51 | /** @addtogroup I2CEx 52 | * @{ 53 | */ 54 | 55 | /* Exported types ------------------------------------------------------------*/ 56 | /* Exported constants --------------------------------------------------------*/ 57 | 58 | /** @defgroup I2CEx_Exported_Constants I2C Extended Exported Constants 59 | * @{ 60 | */ 61 | 62 | /** @defgroup I2CEx_Analog_Filter I2C Extended Analog Filter 63 | * @{ 64 | */ 65 | #define I2C_ANALOGFILTER_ENABLE 0x00000000U 66 | #define I2C_ANALOGFILTER_DISABLE I2C_CR1_ANFOFF 67 | /** 68 | * @} 69 | */ 70 | 71 | /** @defgroup I2CEx_FastModePlus I2C Extended Fast Mode Plus 72 | * @{ 73 | */ 74 | #define I2C_FMP_NOT_SUPPORTED 0xAAAA0000U /*!< Fast Mode Plus not supported */ 75 | #define I2C_FASTMODEPLUS_PB6 SYSCFG_CFGR1_I2C_PB6_FMP /*!< Enable Fast Mode Plus on PB6 */ 76 | #define I2C_FASTMODEPLUS_PB7 SYSCFG_CFGR1_I2C_PB7_FMP /*!< Enable Fast Mode Plus on PB7 */ 77 | #define I2C_FASTMODEPLUS_PB8 SYSCFG_CFGR1_I2C_PB8_FMP /*!< Enable Fast Mode Plus on PB8 */ 78 | #define I2C_FASTMODEPLUS_PB9 SYSCFG_CFGR1_I2C_PB9_FMP /*!< Enable Fast Mode Plus on PB9 */ 79 | #define I2C_FASTMODEPLUS_I2C1 SYSCFG_CFGR1_I2C1_FMP /*!< Enable Fast Mode Plus on I2C1 pins */ 80 | #if defined(SYSCFG_CFGR1_I2C2_FMP) 81 | #define I2C_FASTMODEPLUS_I2C2 SYSCFG_CFGR1_I2C2_FMP /*!< Enable Fast Mode Plus on I2C2 pins */ 82 | #else 83 | #define I2C_FASTMODEPLUS_I2C2 (uint32_t)(0x00000200U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C2 not supported */ 84 | #endif 85 | #if defined(SYSCFG_CFGR1_I2C3_FMP) 86 | #define I2C_FASTMODEPLUS_I2C3 SYSCFG_CFGR1_I2C3_FMP /*!< Enable Fast Mode Plus on I2C3 pins */ 87 | #else 88 | #define I2C_FASTMODEPLUS_I2C3 (uint32_t)(0x00000400U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C3 not supported */ 89 | #endif 90 | /** 91 | * @} 92 | */ 93 | 94 | /** 95 | * @} 96 | */ 97 | 98 | /* Exported macro ------------------------------------------------------------*/ 99 | /* Exported functions --------------------------------------------------------*/ 100 | 101 | /** @addtogroup I2CEx_Exported_Functions I2C Extended Exported Functions 102 | * @{ 103 | */ 104 | 105 | /** @addtogroup I2CEx_Exported_Functions_Group1 Extended features functions 106 | * @brief Extended features functions 107 | * @{ 108 | */ 109 | 110 | /* Peripheral Control functions ************************************************/ 111 | HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter); 112 | HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter); 113 | HAL_StatusTypeDef HAL_I2CEx_EnableWakeUp(I2C_HandleTypeDef *hi2c); 114 | HAL_StatusTypeDef HAL_I2CEx_DisableWakeUp(I2C_HandleTypeDef *hi2c); 115 | void HAL_I2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus); 116 | void HAL_I2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus); 117 | 118 | /* Private constants ---------------------------------------------------------*/ 119 | /** @defgroup I2CEx_Private_Constants I2C Extended Private Constants 120 | * @{ 121 | */ 122 | 123 | /** 124 | * @} 125 | */ 126 | 127 | /* Private macros ------------------------------------------------------------*/ 128 | /** @defgroup I2CEx_Private_Macro I2C Extended Private Macros 129 | * @{ 130 | */ 131 | #define IS_I2C_ANALOG_FILTER(FILTER) (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \ 132 | ((FILTER) == I2C_ANALOGFILTER_DISABLE)) 133 | 134 | #define IS_I2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000FU) 135 | 136 | #define IS_I2C_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & I2C_FMP_NOT_SUPPORTED) != I2C_FMP_NOT_SUPPORTED) && \ 137 | ((((__CONFIG__) & (I2C_FASTMODEPLUS_PB6)) == I2C_FASTMODEPLUS_PB6) || \ 138 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB7)) == I2C_FASTMODEPLUS_PB7) || \ 139 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB8)) == I2C_FASTMODEPLUS_PB8) || \ 140 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB9)) == I2C_FASTMODEPLUS_PB9) || \ 141 | (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C1)) == I2C_FASTMODEPLUS_I2C1) || \ 142 | (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C2)) == I2C_FASTMODEPLUS_I2C2) || \ 143 | (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C3)) == I2C_FASTMODEPLUS_I2C3))) 144 | /** 145 | * @} 146 | */ 147 | 148 | /* Private Functions ---------------------------------------------------------*/ 149 | /** @defgroup I2CEx_Private_Functions I2C Extended Private Functions 150 | * @{ 151 | */ 152 | /* Private functions are defined in stm32f3xx_hal_i2c_ex.c file */ 153 | /** 154 | * @} 155 | */ 156 | 157 | /** 158 | * @} 159 | */ 160 | 161 | /** 162 | * @} 163 | */ 164 | 165 | /** 166 | * @} 167 | */ 168 | 169 | /** 170 | * @} 171 | */ 172 | 173 | #ifdef __cplusplus 174 | } 175 | #endif 176 | 177 | #endif /* __STM32F3xx_HAL_I2C_EX_H */ 178 | 179 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 180 | -------------------------------------------------------------------------------- /APP/Inc/CANTX_FIFO.h: -------------------------------------------------------------------------------- 1 | /* CANTX_FIFO.h --------------------------------------------------------------*/ 2 | /* 3 | * CANTX_FIFO.h 4 | * 5 | * Created on: Feb 20, 2017 6 | * Author: frainville 7 | */ 8 | 9 | #ifndef CANTX_FIFO_H_ 10 | #define CANTX_FIFO_H_ 11 | 12 | 13 | /* Includes ------------------------------------------------------------------*/ 14 | #include 15 | #include "stm32f3xx_hal.h" 16 | 17 | /*------------------------------------------------------------------ Includes */ 18 | 19 | /* Public defines ------------------------------------------------------------*/ 20 | #define CANTX_FIFO_SIZE 50 21 | /*------------------------------------------------------------ Public defines */ 22 | 23 | 24 | /* Public typedef ------------------------------------------------------------*/ 25 | typedef struct{ 26 | CAN_TxHeaderTypeDef header; 27 | uint8_t Data[8]; 28 | }CanTxMsgTypeDef; 29 | 30 | typedef struct{ 31 | CanTxMsgTypeDef array[CANTX_FIFO_SIZE]; 32 | 33 | uint8_t current_index; 34 | uint8_t current_qty_in_queue; 35 | uint8_t current_next_to_go_out; 36 | 37 | CanTxMsgTypeDef SendMsgBuff; 38 | uint8_t TxInProgress; 39 | 40 | }CANTX_FIFO; 41 | /*------------------------------------------------------------ Public typedef */ 42 | 43 | /* function prototypes -------------------------------------------------------*/ 44 | void CANTX_FIFO_init(CANTX_FIFO* o, CAN_HandleTypeDef* hcan); 45 | 46 | void CANTX_FIFO_clear(CANTX_FIFO* o); 47 | 48 | uint8_t CANTX_FIFO_isin(CANTX_FIFO* o,CanTxMsgTypeDef* pmsg); 49 | 50 | uint8_t CANTX_FIFO_push(CANTX_FIFO* o,CanTxMsgTypeDef* pmsg); 51 | 52 | uint8_t CANTX_FIFO_intellipush(CANTX_FIFO* o,CanTxMsgTypeDef* pmsg); 53 | 54 | CanTxMsgTypeDef CANTX_FIFO_pull(CANTX_FIFO* o); 55 | 56 | void CANTX_FIFO_INITIATE_TRANSMIT(CANTX_FIFO* o,CAN_HandleTypeDef* hcan); 57 | 58 | /*------------------------------------------------------- function prototypes */ 59 | 60 | 61 | #endif 62 | /*-------------------------------------------------------------- CANTX_FIFO.h */ 63 | -------------------------------------------------------------------------------- /APP/Inc/IO_MGMT.h: -------------------------------------------------------------------------------- 1 | /* IO_MGMT.h -----------------------------------------------------------------*/ 2 | /* 3 | * IO_MGMT.h 4 | * 5 | * Created on: 3 nov. 2017 6 | * Author: frainville 7 | */ 8 | 9 | #ifndef IO_MGMT_H_ 10 | #define IO_MGMT_H_ 11 | 12 | /* Includes ------------------------------------------------------------------*/ 13 | #include 14 | #include "stm32f3xx_hal.h" 15 | 16 | #include "globalvars.h" 17 | #include "globaldefines.h" 18 | 19 | /*------------------------------------------------------------------ Includes */ 20 | 21 | /* Public defines ------------------------------------------------------------*/ 22 | 23 | /*------------------------------------------------------------ Public defines */ 24 | 25 | /* Public typedef ------------------------------------------------------------*/ 26 | 27 | 28 | /*------------------------------------------------------------ Public typedef */ 29 | 30 | /* function prototypes -------------------------------------------------------*/ 31 | void CAN_SEND_1000ms(); 32 | void CAN_SEND_100ms(); 33 | void CAN_SEND_20ms(); 34 | /*------------------------------------------------------- function prototypes */ 35 | 36 | 37 | #endif /* IO_MGMT_H_ */ 38 | 39 | /*----------------------------------------------------------------- IO_MGMT.h */ 40 | -------------------------------------------------------------------------------- /APP/Inc/globaldefines.h: -------------------------------------------------------------------------------- 1 | /*globaldefines.h-------------------------------------------------------------*/ 2 | /* 3 | * globaldefines.h 4 | * 5 | * Created on: Jan 18, 2017 6 | * Author: frainville 7 | */ 8 | #ifndef INC_GLOBALDEFINES_H_ 9 | #define INC_GLOBALDEFINES_H_ 10 | 11 | /* Includes ------------------------------------------------------------------*/ 12 | 13 | /*------------------------------------------------------------------ Includes */ 14 | 15 | /* Public defines ------------------------------------------------------------*/ 16 | #define TRUE 1 17 | #define FALSE 0 18 | #define G_MAX_MS_COUNTER 4294967296 19 | 20 | #define CAN_SA 0x10 21 | /*------------------------------------------------------------ Public defines */ 22 | 23 | /* Public typedef ------------------------------------------------------------*/ 24 | 25 | /*------------------------------------------------------------ Public typedef */ 26 | 27 | #endif /* INC_GLOBALDEFINES_H_ */ 28 | /*---------------------------------------------------------------globaldefines.h*/ 29 | -------------------------------------------------------------------------------- /APP/Inc/globalvars.h: -------------------------------------------------------------------------------- 1 | /*globalvars.h---------------------------------------------------------------*/ 2 | /* 3 | * globalvars.h 4 | * 5 | * Created on: Nov 3, 2017 6 | * Author: frainville 7 | */ 8 | 9 | #ifndef INC_GLOBALVARS_H_ 10 | #define INC_GLOBALVARS_H_ 11 | 12 | /* Includes ------------------------------------------------------------------*/ 13 | /* Include all headers containing the needed typedefs here */ 14 | #include "globaldefines.h" 15 | #include "CANTX_FIFO.h" 16 | 17 | /*------------------------------------------------------------------ Includes */ 18 | 19 | /* Public variables ----------------------------------------------------------*/ 20 | /* Define all extern global variables here 21 | * Do not initialize value here */ 22 | 23 | /* Global management -------------------*/ 24 | extern uint32_t G_mSCounter; 25 | /*------------------- Global management */ 26 | 27 | 28 | /* CAN management ----------------------*/ 29 | extern CANTX_FIFO CanTxList; 30 | /*---------------------- CAN management */ 31 | 32 | /*---------------------------------------------------------- Public variables */ 33 | 34 | 35 | #endif /* INC_GLOBALVARS_H_ */ 36 | /*---------------------------------------------------------------globalvars.h*/ 37 | -------------------------------------------------------------------------------- /APP/Inc/main.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file : main.h 5 | * @brief : Header for main.c file. 6 | * This file contains the common defines of the application. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | *

© Copyright (c) 2019 STMicroelectronics. 11 | * All rights reserved.

12 | * 13 | * This software component is licensed by ST under BSD 3-Clause license, 14 | * the "License"; You may not use this file except in compliance with the 15 | * License. You may obtain a copy of the License at: 16 | * opensource.org/licenses/BSD-3-Clause 17 | * 18 | ****************************************************************************** 19 | */ 20 | /* USER CODE END Header */ 21 | 22 | /* Define to prevent recursive inclusion -------------------------------------*/ 23 | #ifndef __MAIN_H 24 | #define __MAIN_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* Includes ------------------------------------------------------------------*/ 31 | #include "stm32f3xx_hal.h" 32 | 33 | /* Private includes ----------------------------------------------------------*/ 34 | /* USER CODE BEGIN Includes */ 35 | 36 | /* USER CODE END Includes */ 37 | 38 | /* Exported types ------------------------------------------------------------*/ 39 | /* USER CODE BEGIN ET */ 40 | 41 | /* USER CODE END ET */ 42 | 43 | /* Exported constants --------------------------------------------------------*/ 44 | /* USER CODE BEGIN EC */ 45 | 46 | /* USER CODE END EC */ 47 | 48 | /* Exported macro ------------------------------------------------------------*/ 49 | /* USER CODE BEGIN EM */ 50 | 51 | /* USER CODE END EM */ 52 | 53 | /* Exported functions prototypes ---------------------------------------------*/ 54 | void Error_Handler(void); 55 | 56 | /* USER CODE BEGIN EFP */ 57 | 58 | /* USER CODE END EFP */ 59 | 60 | /* Private defines -----------------------------------------------------------*/ 61 | #define GPIO_LED1_R_Pin GPIO_PIN_15 62 | #define GPIO_LED1_R_GPIO_Port GPIOA 63 | #define GPIO_LED1_G_Pin GPIO_PIN_10 64 | #define GPIO_LED1_G_GPIO_Port GPIOC 65 | #define GPIO_LED1_B_Pin GPIO_PIN_11 66 | #define GPIO_LED1_B_GPIO_Port GPIOC 67 | /* USER CODE BEGIN Private defines */ 68 | 69 | /* USER CODE END Private defines */ 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif /* __MAIN_H */ 76 | 77 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 78 | -------------------------------------------------------------------------------- /APP/Inc/stm32f3xx_it.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f3xx_it.h 5 | * @brief This file contains the headers of the interrupt handlers. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2019 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __STM32F3xx_IT_H 23 | #define __STM32F3xx_IT_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* Private includes ----------------------------------------------------------*/ 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | /* Exported types ------------------------------------------------------------*/ 35 | /* USER CODE BEGIN ET */ 36 | 37 | /* USER CODE END ET */ 38 | 39 | /* Exported constants --------------------------------------------------------*/ 40 | /* USER CODE BEGIN EC */ 41 | 42 | /* USER CODE END EC */ 43 | 44 | /* Exported macro ------------------------------------------------------------*/ 45 | /* USER CODE BEGIN EM */ 46 | 47 | /* USER CODE END EM */ 48 | 49 | /* Exported functions prototypes ---------------------------------------------*/ 50 | void NMI_Handler(void); 51 | void HardFault_Handler(void); 52 | void MemManage_Handler(void); 53 | void BusFault_Handler(void); 54 | void UsageFault_Handler(void); 55 | void SVC_Handler(void); 56 | void DebugMon_Handler(void); 57 | void PendSV_Handler(void); 58 | void SysTick_Handler(void); 59 | void CAN_TX_IRQHandler(void); 60 | void CAN_RX0_IRQHandler(void); 61 | void TIM17_IRQHandler(void); 62 | /* USER CODE BEGIN EFP */ 63 | 64 | /* USER CODE END EFP */ 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* __STM32F3xx_IT_H */ 71 | 72 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 73 | -------------------------------------------------------------------------------- /APP/STM32F373VC_FLASH.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ***************************************************************************** 3 | ** 4 | 5 | ** File : stm32_flash.ld 6 | ** 7 | ** Abstract : Linker script for STM32F373VC Device with 8 | ** 256KByte FLASH, 32KByte RAM 9 | ** 10 | ** Set heap size, stack size and stack location according 11 | ** to application requirements. 12 | ** 13 | ** Set memory bank area and size if external memory is used. 14 | ** 15 | ** Target : STMicroelectronics STM32 16 | ** 17 | ** Environment : Atollic TrueSTUDIO(R) 18 | ** 19 | ** Distribution: The file is distributed as is, without any warranty 20 | ** of any kind. 21 | ** 22 | ** (c)Copyright Atollic AB. 23 | ** You may use this file as-is or modify it according to the needs of your 24 | ** project. This file may only be built (assembled or compiled and linked) 25 | ** using the Atollic TrueSTUDIO(R) product. The use of this file together 26 | ** with other tools than Atollic TrueSTUDIO(R) is not permitted. 27 | ** 28 | ***************************************************************************** 29 | */ 30 | 31 | /* Entry Point */ 32 | ENTRY(Reset_Handler) 33 | 34 | /* Highest address of the user mode stack */ 35 | _estack = 0x20008000; /* end of RAM */ 36 | /* Generate a link error if heap and stack don't fit into RAM */ 37 | _Min_Heap_Size = 0x200; /* required amount of heap */ 38 | _Min_Stack_Size = 0x400; /* required amount of stack */ 39 | 40 | /* Specify the memory areas */ 41 | MEMORY 42 | { 43 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K 44 | FLASH (rx) : ORIGIN = 0x8008000, LENGTH = 220K 45 | } 46 | 47 | /* Define output sections */ 48 | SECTIONS 49 | { 50 | /* The startup code goes first into FLASH */ 51 | .isr_vector : 52 | { 53 | . = ALIGN(4); 54 | KEEP(*(.isr_vector)) /* Startup code */ 55 | . = ALIGN(4); 56 | } >FLASH 57 | 58 | /* BOARD NAME GOES INTO FLASH */ 59 | .board_info : {KEEP(*(.board_info))} > FLASH 60 | 61 | /* The program code and other data goes into FLASH */ 62 | .text : 63 | { 64 | . = ALIGN(4); 65 | *(.text) /* .text sections (code) */ 66 | *(.text*) /* .text* sections (code) */ 67 | *(.glue_7) /* glue arm to thumb code */ 68 | *(.glue_7t) /* glue thumb to arm code */ 69 | *(.eh_frame) 70 | 71 | KEEP (*(.init)) 72 | KEEP (*(.fini)) 73 | 74 | . = ALIGN(4); 75 | _etext = .; /* define a global symbols at end of code */ 76 | } >FLASH 77 | 78 | /* Constant data goes into FLASH */ 79 | .rodata : 80 | { 81 | . = ALIGN(4); 82 | *(.rodata) /* .rodata sections (constants, strings, etc.) */ 83 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ 84 | . = ALIGN(4); 85 | } >FLASH 86 | 87 | .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH 88 | .ARM : { 89 | __exidx_start = .; 90 | *(.ARM.exidx*) 91 | __exidx_end = .; 92 | } >FLASH 93 | 94 | .preinit_array : 95 | { 96 | PROVIDE_HIDDEN (__preinit_array_start = .); 97 | KEEP (*(.preinit_array*)) 98 | PROVIDE_HIDDEN (__preinit_array_end = .); 99 | } >FLASH 100 | .init_array : 101 | { 102 | PROVIDE_HIDDEN (__init_array_start = .); 103 | KEEP (*(SORT(.init_array.*))) 104 | KEEP (*(.init_array*)) 105 | PROVIDE_HIDDEN (__init_array_end = .); 106 | } >FLASH 107 | .fini_array : 108 | { 109 | PROVIDE_HIDDEN (__fini_array_start = .); 110 | KEEP (*(SORT(.fini_array.*))) 111 | KEEP (*(.fini_array*)) 112 | PROVIDE_HIDDEN (__fini_array_end = .); 113 | } >FLASH 114 | 115 | /* used by the startup to initialize data */ 116 | _sidata = LOADADDR(.data); 117 | 118 | /* Initialized data sections goes into RAM, load LMA copy after code */ 119 | .data : 120 | { 121 | . = ALIGN(4); 122 | _sdata = .; /* create a global symbol at data start */ 123 | *(.data) /* .data sections */ 124 | *(.data*) /* .data* sections */ 125 | 126 | . = ALIGN(4); 127 | _edata = .; /* define a global symbol at data end */ 128 | } >RAM AT> FLASH 129 | 130 | 131 | /* Uninitialized data section */ 132 | . = ALIGN(4); 133 | .bss : 134 | { 135 | /* This is used by the startup in order to initialize the .bss secion */ 136 | _sbss = .; /* define a global symbol at bss start */ 137 | __bss_start__ = _sbss; 138 | *(.bss) 139 | *(.bss*) 140 | *(COMMON) 141 | 142 | . = ALIGN(4); 143 | _ebss = .; /* define a global symbol at bss end */ 144 | __bss_end__ = _ebss; 145 | } >RAM 146 | 147 | /* User_heap_stack section, used to check that there is enough RAM left */ 148 | ._user_heap_stack : 149 | { 150 | . = ALIGN(4); 151 | PROVIDE ( end = . ); 152 | PROVIDE ( _end = . ); 153 | . = . + _Min_Heap_Size; 154 | . = . + _Min_Stack_Size; 155 | . = ALIGN(4); 156 | } >RAM 157 | 158 | 159 | 160 | /* Remove information from the standard libraries */ 161 | /DISCARD/ : 162 | { 163 | libc.a ( * ) 164 | libm.a ( * ) 165 | libgcc.a ( * ) 166 | } 167 | 168 | .ARM.attributes 0 : { *(.ARM.attributes) } 169 | } 170 | 171 | 172 | -------------------------------------------------------------------------------- /APP/Src/CANTX_FIFO.c: -------------------------------------------------------------------------------- 1 | /* CANTX_FIFO.c --------------------------------------------------------------*/ 2 | /* 3 | * CANTX_FIFO.c 4 | * 5 | * Created on: Feb 20, 2016 6 | * Author: frainville 7 | */ 8 | 9 | /* Includes ------------------------------------------------------------------*/ 10 | #include "CANTX_FIFO.h" 11 | #include "stm32f3xx_hal.h" 12 | //#include "FreeRTOS.h" 13 | /*------------------------------------------------------------------ Includes */ 14 | 15 | /* Private defines -----------------------------------------------------------*/ 16 | 17 | /*----------------------------------------------------------- Private defines */ 18 | 19 | /* Private macros ------------------------------------------------------------*/ 20 | 21 | /*------------------------------------------------------------ Private macros */ 22 | 23 | /* Private variables ---------------------------------------------------------*/ 24 | 25 | /*--------------------------------------------------------- Private variables */ 26 | 27 | /* Private function prototypes -----------------------------------------------*/ 28 | uint8_t CanTxMsgCompare(const CanTxMsgTypeDef* msg1, 29 | const CanTxMsgTypeDef* msg2); 30 | //uint8_t CanTxMsgCpy(CanTxMsgTypeDef* dst, const CanTxMsgTypeDef* msrc); 31 | 32 | /*----------------------------------------------- Private function prototypes */ 33 | 34 | /* Private function definitions ----------------------------------------------*/ 35 | uint8_t CanTxMsgCompare(const CanTxMsgTypeDef* msg1, 36 | const CanTxMsgTypeDef* msg2) { 37 | if (msg1->header.ExtId == msg2->header.ExtId) { 38 | return 1; 39 | } 40 | 41 | return 0; 42 | } 43 | 44 | /*---------------------------------------------- Private function definitions */ 45 | 46 | /* Public function definitions -----------------------------------------------*/ 47 | 48 | void CANTX_FIFO_init(CANTX_FIFO* o, CAN_HandleTypeDef* hcan) { 49 | 50 | int i; 51 | 52 | //hcan->pTxMsg = &(o->SendMsgBuff); 53 | 54 | CanTxMsgTypeDef tempzeromsg = { 0 }; 55 | 56 | for (i = 0; i < CANTX_FIFO_SIZE; i++) { 57 | o->array[i] = tempzeromsg; 58 | } 59 | 60 | o->current_index = 0; 61 | o->current_qty_in_queue = 0; 62 | o->current_next_to_go_out = 0; 63 | o->TxInProgress = 0; 64 | } 65 | 66 | void CANTX_FIFO_clear(CANTX_FIFO* o) { 67 | while (o->current_qty_in_queue > 0) { 68 | CANTX_FIFO_pull(o); 69 | } 70 | } 71 | 72 | uint8_t CANTX_FIFO_isin(CANTX_FIFO* o, CanTxMsgTypeDef* pmsg) { 73 | uint8_t tmp = 0; 74 | uint8_t vindex = 0; 75 | uint8_t counter = 0; 76 | 77 | tmp = 0; 78 | counter = 0; 79 | 80 | if (o->current_qty_in_queue >= 0) { 81 | vindex = o->current_next_to_go_out; 82 | 83 | while (counter < o->current_qty_in_queue && !tmp) { 84 | 85 | if (CanTxMsgCompare(&(o->array[vindex]), pmsg)) { 86 | tmp = 1; 87 | } 88 | 89 | vindex += 1; 90 | 91 | if (vindex > (CANTX_FIFO_SIZE - 1)) { 92 | vindex = 0; 93 | } 94 | 95 | counter += 1; 96 | 97 | } 98 | 99 | } 100 | return tmp; 101 | } 102 | 103 | uint8_t CANTX_FIFO_push(CANTX_FIFO* o, CanTxMsgTypeDef* pmsg) { 104 | if (o->current_qty_in_queue >= CANTX_FIFO_SIZE) { 105 | return 0; 106 | } else { 107 | 108 | o->array[o->current_index] = *pmsg; 109 | //o->array[o->current_index] = val; 110 | 111 | if (o->current_qty_in_queue == 0) { 112 | o->current_next_to_go_out = o->current_index; 113 | } 114 | 115 | o->current_index += 1; 116 | if (o->current_index > (CANTX_FIFO_SIZE - 1)) { 117 | o->current_index = 0; 118 | } 119 | 120 | o->current_qty_in_queue += 1; 121 | 122 | //Initiate transmission with Interrupt here 123 | 124 | return 1; 125 | } 126 | } 127 | 128 | uint8_t CANTX_FIFO_intellipush(CANTX_FIFO* o, CanTxMsgTypeDef* pmsg) { 129 | uint8_t tmp = 0; 130 | 131 | if (!CANTX_FIFO_isin(o, pmsg)) { 132 | tmp = CANTX_FIFO_push(o, pmsg); 133 | } 134 | return tmp; 135 | } 136 | 137 | CanTxMsgTypeDef CANTX_FIFO_pull(CANTX_FIFO* o) { 138 | CanTxMsgTypeDef tempzeromsg = { 0 }; 139 | CanTxMsgTypeDef dummy = { 0 }; 140 | 141 | if (o->current_qty_in_queue > 0) { 142 | 143 | dummy = o->array[o->current_next_to_go_out]; 144 | 145 | o->array[o->current_next_to_go_out] = tempzeromsg; 146 | 147 | o->current_next_to_go_out += 1; 148 | 149 | if (o->current_next_to_go_out > (CANTX_FIFO_SIZE - 1)) { 150 | o->current_next_to_go_out = 0; 151 | } 152 | 153 | o->current_qty_in_queue -= 1; 154 | 155 | } 156 | return dummy; 157 | } 158 | 159 | void CANTX_FIFO_INITIATE_TRANSMIT(CANTX_FIFO* o, CAN_HandleTypeDef* hcan) { 160 | uint32_t transmitmailbox; 161 | if (!o->TxInProgress && o->current_qty_in_queue) { 162 | o->SendMsgBuff = CANTX_FIFO_pull(o); 163 | 164 | o->TxInProgress=1; 165 | 166 | HAL_CAN_ActivateNotification(hcan,CAN_IT_TX_MAILBOX_EMPTY); 167 | HAL_CAN_AddTxMessage(hcan,&(o->SendMsgBuff.header),o->SendMsgBuff.Data,&transmitmailbox); 168 | 169 | } 170 | 171 | } 172 | 173 | /*----------------------------------------------- Public function definitions */ 174 | 175 | /*-------------------------------------------------------------- CANTX_FIFO.c */ 176 | -------------------------------------------------------------------------------- /APP/Src/IO_MGMT.c: -------------------------------------------------------------------------------- 1 | /* IO_MGMT.c -----------------------------------------------------------------*/ 2 | /* 3 | * IO_MGMT.c 4 | * 5 | * Created on: 3 nov. 2017 6 | * Author: frainville 7 | */ 8 | 9 | 10 | /* Includes ------------------------------------------------------------------*/ 11 | 12 | #include "IO_MGMT.h" 13 | #include "main.h" 14 | 15 | #include "stm32f3xx_hal.h" 16 | 17 | #include "globalvars.h" 18 | #include "globaldefines.h" 19 | 20 | #include "CANTX_FIFO.h" 21 | /*------------------------------------------------------------------ Includes */ 22 | 23 | /* Private defines -----------------------------------------------------------*/ 24 | 25 | /*----------------------------------------------------------- Private defines */ 26 | 27 | /* Private macros ------------------------------------------------------------*/ 28 | 29 | /*------------------------------------------------------------ Private macros */ 30 | 31 | /* Private variables ---------------------------------------------------------*/ 32 | 33 | /*--------------------------------------------------------- Private variables */ 34 | 35 | /* Private function prototypes -----------------------------------------------*/ 36 | 37 | /*----------------------------------------------- Private function prototypes */ 38 | 39 | /* Private function definitions ----------------------------------------------*/ 40 | 41 | /*---------------------------------------------- Private function definitions */ 42 | 43 | /* Public function definitions -----------------------------------------------*/ 44 | 45 | void CAN_SEND_1000ms(){ 46 | 47 | #if 0 48 | CanTxMsgTypeDef CAN_SEND_MSG; 49 | uint32_t tempbitstream; 50 | #endif 51 | 52 | } 53 | 54 | void CAN_SEND_100ms(){ 55 | 56 | #if 0 57 | CanTxMsgTypeDef CAN_SEND_MSG; 58 | uint32_t tempbitstream; 59 | #endif 60 | 61 | } 62 | 63 | void CAN_SEND_20ms(){ 64 | CanTxMsgTypeDef CAN_SEND_MSG; 65 | 66 | static uint8_t heartbeat=0; 67 | 68 | // Increment Heartbeat 69 | heartbeat++; 70 | if (heartbeat >= 255)heartbeat = 0; 71 | 72 | //========================================================================================= 73 | // This message is designed to keep compatibility with ECU that was programmed to work with the PIC32 version 74 | CAN_SEND_MSG.header.IDE = CAN_ID_EXT; 75 | CAN_SEND_MSG.header.ExtId = 0x18FFFF00 + CAN_SA; 76 | CAN_SEND_MSG.header.RTR = CAN_RTR_DATA; 77 | CAN_SEND_MSG.header.DLC = 8; 78 | 79 | CAN_SEND_MSG.Data[0]=0x00; 80 | CAN_SEND_MSG.Data[1]=0x00; 81 | CAN_SEND_MSG.Data[2]=0x00; 82 | CAN_SEND_MSG.Data[3]=0x00; 83 | CAN_SEND_MSG.Data[4]=0x00; 84 | CAN_SEND_MSG.Data[5]=0x00; 85 | CAN_SEND_MSG.Data[6]=0x00; 86 | CAN_SEND_MSG.Data[7]=heartbeat; 87 | 88 | CANTX_FIFO_intellipush(&CanTxList, &CAN_SEND_MSG); 89 | 90 | } 91 | /*----------------------------------------------- Public function definitions */ 92 | 93 | /*----------------------------------------------------------------- IO_MGMT.c */ 94 | -------------------------------------------------------------------------------- /APP/Src/globalvars.c: -------------------------------------------------------------------------------- 1 | /*globalvars.c---------------------------------------------------------------*/ 2 | /* 3 | * globalvars.c 4 | * 5 | * Created on: Nov 3, 2017 6 | * Author: frainville 7 | */ 8 | 9 | /* Includes ------------------------------------------------------------------*/ 10 | /* Include all headers containing the needed typedefs here */ 11 | #include "globaldefines.h" 12 | #include "CANTX_FIFO.h" 13 | 14 | /*------------------------------------------------------------------ Includes */ 15 | 16 | __attribute__((__section__(".board_info"))) const unsigned char BOARD_NAME[10] = "APP"; 17 | 18 | /* Public variables ----------------------------------------------------------*/ 19 | /* Declare all global variables here */ 20 | 21 | /* Global management -------------------*/ 22 | uint32_t G_mSCounter=0; 23 | /*------------------- Global management */ 24 | 25 | 26 | 27 | /* CAN management ----------------------*/ 28 | CANTX_FIFO CanTxList; 29 | /*---------------------- CAN management */ 30 | 31 | /*---------------------------------------------------------- Public variables */ 32 | 33 | /*---------------------------------------------------------------globalvars.c*/ 34 | -------------------------------------------------------------------------------- /APP/Src/stm32f3xx_hal_msp.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * File Name : stm32f3xx_hal_msp.c 5 | * Description : This file provides code for the MSP Initialization 6 | * and de-Initialization codes. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | *

© Copyright (c) 2019 STMicroelectronics. 11 | * All rights reserved.

12 | * 13 | * This software component is licensed by ST under BSD 3-Clause license, 14 | * the "License"; You may not use this file except in compliance with the 15 | * License. You may obtain a copy of the License at: 16 | * opensource.org/licenses/BSD-3-Clause 17 | * 18 | ****************************************************************************** 19 | */ 20 | /* USER CODE END Header */ 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "main.h" 24 | /* USER CODE BEGIN Includes */ 25 | 26 | /* USER CODE END Includes */ 27 | 28 | /* Private typedef -----------------------------------------------------------*/ 29 | /* USER CODE BEGIN TD */ 30 | 31 | /* USER CODE END TD */ 32 | 33 | /* Private define ------------------------------------------------------------*/ 34 | /* USER CODE BEGIN Define */ 35 | 36 | /* USER CODE END Define */ 37 | 38 | /* Private macro -------------------------------------------------------------*/ 39 | /* USER CODE BEGIN Macro */ 40 | 41 | /* USER CODE END Macro */ 42 | 43 | /* Private variables ---------------------------------------------------------*/ 44 | /* USER CODE BEGIN PV */ 45 | 46 | /* USER CODE END PV */ 47 | 48 | /* Private function prototypes -----------------------------------------------*/ 49 | /* USER CODE BEGIN PFP */ 50 | 51 | /* USER CODE END PFP */ 52 | 53 | /* External functions --------------------------------------------------------*/ 54 | /* USER CODE BEGIN ExternalFunctions */ 55 | 56 | /* USER CODE END ExternalFunctions */ 57 | 58 | /* USER CODE BEGIN 0 */ 59 | 60 | /* USER CODE END 0 */ 61 | /** 62 | * Initializes the Global MSP. 63 | */ 64 | void HAL_MspInit(void) 65 | { 66 | /* USER CODE BEGIN MspInit 0 */ 67 | 68 | /* USER CODE END MspInit 0 */ 69 | 70 | __HAL_RCC_SYSCFG_CLK_ENABLE(); 71 | __HAL_RCC_PWR_CLK_ENABLE(); 72 | 73 | /* System interrupt init*/ 74 | 75 | /* USER CODE BEGIN MspInit 1 */ 76 | 77 | /* USER CODE END MspInit 1 */ 78 | } 79 | 80 | /** 81 | * @brief CAN MSP Initialization 82 | * This function configures the hardware resources used in this example 83 | * @param hcan: CAN handle pointer 84 | * @retval None 85 | */ 86 | void HAL_CAN_MspInit(CAN_HandleTypeDef* hcan) 87 | { 88 | GPIO_InitTypeDef GPIO_InitStruct = {0}; 89 | if(hcan->Instance==CAN) 90 | { 91 | /* USER CODE BEGIN CAN_MspInit 0 */ 92 | 93 | /* USER CODE END CAN_MspInit 0 */ 94 | /* Peripheral clock enable */ 95 | __HAL_RCC_CAN1_CLK_ENABLE(); 96 | 97 | __HAL_RCC_GPIOD_CLK_ENABLE(); 98 | /**CAN GPIO Configuration 99 | PD0 ------> CAN_RX 100 | PD1 ------> CAN_TX 101 | */ 102 | GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1; 103 | GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; 104 | GPIO_InitStruct.Pull = GPIO_NOPULL; 105 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; 106 | GPIO_InitStruct.Alternate = GPIO_AF7_CAN; 107 | HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); 108 | 109 | /* CAN interrupt Init */ 110 | HAL_NVIC_SetPriority(CAN_TX_IRQn, 0, 0); 111 | HAL_NVIC_EnableIRQ(CAN_TX_IRQn); 112 | HAL_NVIC_SetPriority(CAN_RX0_IRQn, 0, 0); 113 | HAL_NVIC_EnableIRQ(CAN_RX0_IRQn); 114 | /* USER CODE BEGIN CAN_MspInit 1 */ 115 | 116 | /* USER CODE END CAN_MspInit 1 */ 117 | } 118 | 119 | } 120 | 121 | /** 122 | * @brief CAN MSP De-Initialization 123 | * This function freeze the hardware resources used in this example 124 | * @param hcan: CAN handle pointer 125 | * @retval None 126 | */ 127 | void HAL_CAN_MspDeInit(CAN_HandleTypeDef* hcan) 128 | { 129 | if(hcan->Instance==CAN) 130 | { 131 | /* USER CODE BEGIN CAN_MspDeInit 0 */ 132 | 133 | /* USER CODE END CAN_MspDeInit 0 */ 134 | /* Peripheral clock disable */ 135 | __HAL_RCC_CAN1_CLK_DISABLE(); 136 | 137 | /**CAN GPIO Configuration 138 | PD0 ------> CAN_RX 139 | PD1 ------> CAN_TX 140 | */ 141 | HAL_GPIO_DeInit(GPIOD, GPIO_PIN_0|GPIO_PIN_1); 142 | 143 | /* CAN interrupt DeInit */ 144 | HAL_NVIC_DisableIRQ(CAN_TX_IRQn); 145 | HAL_NVIC_DisableIRQ(CAN_RX0_IRQn); 146 | /* USER CODE BEGIN CAN_MspDeInit 1 */ 147 | 148 | /* USER CODE END CAN_MspDeInit 1 */ 149 | } 150 | 151 | } 152 | 153 | /** 154 | * @brief TIM_Base MSP Initialization 155 | * This function configures the hardware resources used in this example 156 | * @param htim_base: TIM_Base handle pointer 157 | * @retval None 158 | */ 159 | void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base) 160 | { 161 | if(htim_base->Instance==TIM17) 162 | { 163 | /* USER CODE BEGIN TIM17_MspInit 0 */ 164 | 165 | /* USER CODE END TIM17_MspInit 0 */ 166 | /* Peripheral clock enable */ 167 | __HAL_RCC_TIM17_CLK_ENABLE(); 168 | /* TIM17 interrupt Init */ 169 | HAL_NVIC_SetPriority(TIM17_IRQn, 0, 0); 170 | HAL_NVIC_EnableIRQ(TIM17_IRQn); 171 | /* USER CODE BEGIN TIM17_MspInit 1 */ 172 | 173 | /* USER CODE END TIM17_MspInit 1 */ 174 | } 175 | 176 | } 177 | 178 | /** 179 | * @brief TIM_Base MSP De-Initialization 180 | * This function freeze the hardware resources used in this example 181 | * @param htim_base: TIM_Base handle pointer 182 | * @retval None 183 | */ 184 | void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base) 185 | { 186 | if(htim_base->Instance==TIM17) 187 | { 188 | /* USER CODE BEGIN TIM17_MspDeInit 0 */ 189 | 190 | /* USER CODE END TIM17_MspDeInit 0 */ 191 | /* Peripheral clock disable */ 192 | __HAL_RCC_TIM17_CLK_DISABLE(); 193 | 194 | /* TIM17 interrupt DeInit */ 195 | HAL_NVIC_DisableIRQ(TIM17_IRQn); 196 | /* USER CODE BEGIN TIM17_MspDeInit 1 */ 197 | 198 | /* USER CODE END TIM17_MspDeInit 1 */ 199 | } 200 | 201 | } 202 | 203 | /* USER CODE BEGIN 1 */ 204 | 205 | /* USER CODE END 1 */ 206 | 207 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 208 | -------------------------------------------------------------------------------- /APP/Src/stm32f3xx_it.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f3xx_it.c 5 | * @brief Interrupt Service Routines. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2019 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Includes ------------------------------------------------------------------*/ 22 | #include "main.h" 23 | #include "stm32f3xx_it.h" 24 | /* Private includes ----------------------------------------------------------*/ 25 | /* USER CODE BEGIN Includes */ 26 | /* USER CODE END Includes */ 27 | 28 | /* Private typedef -----------------------------------------------------------*/ 29 | /* USER CODE BEGIN TD */ 30 | 31 | /* USER CODE END TD */ 32 | 33 | /* Private define ------------------------------------------------------------*/ 34 | /* USER CODE BEGIN PD */ 35 | 36 | /* USER CODE END PD */ 37 | 38 | /* Private macro -------------------------------------------------------------*/ 39 | /* USER CODE BEGIN PM */ 40 | 41 | /* USER CODE END PM */ 42 | 43 | /* Private variables ---------------------------------------------------------*/ 44 | /* USER CODE BEGIN PV */ 45 | 46 | /* USER CODE END PV */ 47 | 48 | /* Private function prototypes -----------------------------------------------*/ 49 | /* USER CODE BEGIN PFP */ 50 | 51 | /* USER CODE END PFP */ 52 | 53 | /* Private user code ---------------------------------------------------------*/ 54 | /* USER CODE BEGIN 0 */ 55 | 56 | /* USER CODE END 0 */ 57 | 58 | /* External variables --------------------------------------------------------*/ 59 | extern CAN_HandleTypeDef hcan; 60 | extern TIM_HandleTypeDef htim17; 61 | /* USER CODE BEGIN EV */ 62 | 63 | /* USER CODE END EV */ 64 | 65 | /******************************************************************************/ 66 | /* Cortex-M4 Processor Interruption and Exception Handlers */ 67 | /******************************************************************************/ 68 | /** 69 | * @brief This function handles Non maskable interrupt. 70 | */ 71 | void NMI_Handler(void) 72 | { 73 | /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ 74 | 75 | /* USER CODE END NonMaskableInt_IRQn 0 */ 76 | /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ 77 | 78 | /* USER CODE END NonMaskableInt_IRQn 1 */ 79 | } 80 | 81 | /** 82 | * @brief This function handles Hard fault interrupt. 83 | */ 84 | void HardFault_Handler(void) 85 | { 86 | /* USER CODE BEGIN HardFault_IRQn 0 */ 87 | 88 | /* USER CODE END HardFault_IRQn 0 */ 89 | while (1) 90 | { 91 | /* USER CODE BEGIN W1_HardFault_IRQn 0 */ 92 | /* USER CODE END W1_HardFault_IRQn 0 */ 93 | } 94 | } 95 | 96 | /** 97 | * @brief This function handles Memory management fault. 98 | */ 99 | void MemManage_Handler(void) 100 | { 101 | /* USER CODE BEGIN MemoryManagement_IRQn 0 */ 102 | 103 | /* USER CODE END MemoryManagement_IRQn 0 */ 104 | while (1) 105 | { 106 | /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ 107 | /* USER CODE END W1_MemoryManagement_IRQn 0 */ 108 | } 109 | } 110 | 111 | /** 112 | * @brief This function handles Prefetch fault, memory access fault. 113 | */ 114 | void BusFault_Handler(void) 115 | { 116 | /* USER CODE BEGIN BusFault_IRQn 0 */ 117 | 118 | /* USER CODE END BusFault_IRQn 0 */ 119 | while (1) 120 | { 121 | /* USER CODE BEGIN W1_BusFault_IRQn 0 */ 122 | /* USER CODE END W1_BusFault_IRQn 0 */ 123 | } 124 | } 125 | 126 | /** 127 | * @brief This function handles Undefined instruction or illegal state. 128 | */ 129 | void UsageFault_Handler(void) 130 | { 131 | /* USER CODE BEGIN UsageFault_IRQn 0 */ 132 | 133 | /* USER CODE END UsageFault_IRQn 0 */ 134 | while (1) 135 | { 136 | /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ 137 | /* USER CODE END W1_UsageFault_IRQn 0 */ 138 | } 139 | } 140 | 141 | /** 142 | * @brief This function handles System service call via SWI instruction. 143 | */ 144 | void SVC_Handler(void) 145 | { 146 | /* USER CODE BEGIN SVCall_IRQn 0 */ 147 | 148 | /* USER CODE END SVCall_IRQn 0 */ 149 | /* USER CODE BEGIN SVCall_IRQn 1 */ 150 | 151 | /* USER CODE END SVCall_IRQn 1 */ 152 | } 153 | 154 | /** 155 | * @brief This function handles Debug monitor. 156 | */ 157 | void DebugMon_Handler(void) 158 | { 159 | /* USER CODE BEGIN DebugMonitor_IRQn 0 */ 160 | 161 | /* USER CODE END DebugMonitor_IRQn 0 */ 162 | /* USER CODE BEGIN DebugMonitor_IRQn 1 */ 163 | 164 | /* USER CODE END DebugMonitor_IRQn 1 */ 165 | } 166 | 167 | /** 168 | * @brief This function handles Pendable request for system service. 169 | */ 170 | void PendSV_Handler(void) 171 | { 172 | /* USER CODE BEGIN PendSV_IRQn 0 */ 173 | 174 | /* USER CODE END PendSV_IRQn 0 */ 175 | /* USER CODE BEGIN PendSV_IRQn 1 */ 176 | 177 | /* USER CODE END PendSV_IRQn 1 */ 178 | } 179 | 180 | /** 181 | * @brief This function handles System tick timer. 182 | */ 183 | void SysTick_Handler(void) 184 | { 185 | /* USER CODE BEGIN SysTick_IRQn 0 */ 186 | 187 | /* USER CODE END SysTick_IRQn 0 */ 188 | HAL_IncTick(); 189 | /* USER CODE BEGIN SysTick_IRQn 1 */ 190 | 191 | /* USER CODE END SysTick_IRQn 1 */ 192 | } 193 | 194 | /******************************************************************************/ 195 | /* STM32F3xx Peripheral Interrupt Handlers */ 196 | /* Add here the Interrupt Handlers for the used peripherals. */ 197 | /* For the available peripheral interrupt handler names, */ 198 | /* please refer to the startup file (startup_stm32f3xx.s). */ 199 | /******************************************************************************/ 200 | 201 | /** 202 | * @brief This function handles CAN TX interrupt. 203 | */ 204 | void CAN_TX_IRQHandler(void) 205 | { 206 | /* USER CODE BEGIN CAN_TX_IRQn 0 */ 207 | 208 | /* USER CODE END CAN_TX_IRQn 0 */ 209 | HAL_CAN_IRQHandler(&hcan); 210 | /* USER CODE BEGIN CAN_TX_IRQn 1 */ 211 | 212 | /* USER CODE END CAN_TX_IRQn 1 */ 213 | } 214 | 215 | /** 216 | * @brief This function handles CAN RX0 interrupt. 217 | */ 218 | void CAN_RX0_IRQHandler(void) 219 | { 220 | /* USER CODE BEGIN CAN_RX0_IRQn 0 */ 221 | 222 | /* USER CODE END CAN_RX0_IRQn 0 */ 223 | HAL_CAN_IRQHandler(&hcan); 224 | /* USER CODE BEGIN CAN_RX0_IRQn 1 */ 225 | 226 | /* USER CODE END CAN_RX0_IRQn 1 */ 227 | } 228 | 229 | /** 230 | * @brief This function handles TIM17 global interrupt. 231 | */ 232 | void TIM17_IRQHandler(void) 233 | { 234 | /* USER CODE BEGIN TIM17_IRQn 0 */ 235 | 236 | /* USER CODE END TIM17_IRQn 0 */ 237 | HAL_TIM_IRQHandler(&htim17); 238 | /* USER CODE BEGIN TIM17_IRQn 1 */ 239 | 240 | /* USER CODE END TIM17_IRQn 1 */ 241 | } 242 | 243 | /* USER CODE BEGIN 1 */ 244 | 245 | /* USER CODE END 1 */ 246 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 247 | -------------------------------------------------------------------------------- /APP/Src/syscalls.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/effenco/stm32-can-bootloader/106bf5828c6193284f40027c85a628ba04a17207/APP/Src/syscalls.c -------------------------------------------------------------------------------- /APP/debug.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/effenco/stm32-can-bootloader/106bf5828c6193284f40027c85a628ba04a17207/APP/debug.log -------------------------------------------------------------------------------- /APP/syscalls.c: -------------------------------------------------------------------------------- 1 | /** 2 | ***************************************************************************** 3 | ** 4 | ** File : syscalls.c 5 | ** 6 | ** Abstract : System Workbench Minimal System calls file 7 | ** 8 | ** For more information about which c-functions 9 | ** need which of these lowlevel functions 10 | ** please consult the Newlib libc-manual 11 | ** 12 | ** Environment : System Workbench for MCU 13 | ** 14 | ** Distribution: The file is distributed as is without any warranty 15 | ** of any kind. 16 | ** 17 | ***************************************************************************** 18 | ** 19 | **

© COPYRIGHT(c) 2014 Ac6

20 | ** 21 | ** Redistribution and use in source and binary forms, with or without modification, 22 | ** are permitted provided that the following conditions are met: 23 | ** 1. Redistributions of source code must retain the above copyright notice, 24 | ** this list of conditions and the following disclaimer. 25 | ** 2. Redistributions in binary form must reproduce the above copyright notice, 26 | ** this list of conditions and the following disclaimer in the documentation 27 | ** and/or other materials provided with the distribution. 28 | ** 3. Neither the name of Ac6 nor the names of its contributors 29 | ** may be used to endorse or promote products derived from this software 30 | ** without specific prior written permission. 31 | ** 32 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 33 | ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 34 | ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 35 | ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 36 | ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 37 | ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 38 | ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 39 | ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 40 | ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 41 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 42 | ** 43 | ***************************************************************************** 44 | */ 45 | 46 | /* Includes */ 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | 56 | 57 | /* Variables */ 58 | //#undef errno 59 | extern int errno; 60 | extern int __io_putchar(int ch) __attribute__((weak)); 61 | extern int __io_getchar(void) __attribute__((weak)); 62 | 63 | register char * stack_ptr asm("sp"); 64 | 65 | char *__env[1] = { 0 }; 66 | char **environ = __env; 67 | 68 | 69 | /* Functions */ 70 | void initialise_monitor_handles() 71 | { 72 | } 73 | 74 | int _getpid(void) 75 | { 76 | return 1; 77 | } 78 | 79 | int _kill(int pid, int sig) 80 | { 81 | errno = EINVAL; 82 | return -1; 83 | } 84 | 85 | void _exit (int status) 86 | { 87 | _kill(status, -1); 88 | while (1) {} /* Make sure we hang here */ 89 | } 90 | 91 | int _read (int file, char *ptr, int len) 92 | { 93 | int DataIdx; 94 | 95 | for (DataIdx = 0; DataIdx < len; DataIdx++) 96 | { 97 | *ptr++ = __io_getchar(); 98 | } 99 | 100 | return len; 101 | } 102 | 103 | int _write(int file, char *ptr, int len) 104 | { 105 | int DataIdx; 106 | 107 | for (DataIdx = 0; DataIdx < len; DataIdx++) 108 | { 109 | __io_putchar(*ptr++); 110 | } 111 | return len; 112 | } 113 | 114 | caddr_t _sbrk(int incr) 115 | { 116 | extern char end asm("end"); 117 | static char *heap_end; 118 | char *prev_heap_end; 119 | 120 | if (heap_end == 0) 121 | heap_end = &end; 122 | 123 | prev_heap_end = heap_end; 124 | if (heap_end + incr > stack_ptr) 125 | { 126 | // write(1, "Heap and stack collision\n", 25); 127 | // abort(); 128 | errno = ENOMEM; 129 | return (caddr_t) -1; 130 | } 131 | 132 | heap_end += incr; 133 | 134 | return (caddr_t) prev_heap_end; 135 | } 136 | 137 | int _close(int file) 138 | { 139 | return -1; 140 | } 141 | 142 | 143 | int _fstat(int file, struct stat *st) 144 | { 145 | st->st_mode = S_IFCHR; 146 | return 0; 147 | } 148 | 149 | int _isatty(int file) 150 | { 151 | return 1; 152 | } 153 | 154 | int _lseek(int file, int ptr, int dir) 155 | { 156 | return 0; 157 | } 158 | 159 | int _open(char *path, int flags, ...) 160 | { 161 | /* Pretend like we always fail */ 162 | return -1; 163 | } 164 | 165 | int _wait(int *status) 166 | { 167 | errno = ECHILD; 168 | return -1; 169 | } 170 | 171 | int _unlink(char *name) 172 | { 173 | errno = ENOENT; 174 | return -1; 175 | } 176 | 177 | int _times(struct tms *buf) 178 | { 179 | return -1; 180 | } 181 | 182 | int _stat(char *file, struct stat *st) 183 | { 184 | st->st_mode = S_IFCHR; 185 | return 0; 186 | } 187 | 188 | int _link(char *old, char *new) 189 | { 190 | errno = EMLINK; 191 | return -1; 192 | } 193 | 194 | int _fork(void) 195 | { 196 | errno = EAGAIN; 197 | return -1; 198 | } 199 | 200 | int _execve(char *name, char **argv, char **env) 201 | { 202 | errno = ENOMEM; 203 | return -1; 204 | } 205 | -------------------------------------------------------------------------------- /BOOT/.code_review_properties: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | property.default.description 5 | 6 | 1970-01-01 :: 00:00:00:000 GMT-10:00 7 | review 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /BOOT/.gitignore: -------------------------------------------------------------------------------- 1 | Debug/ 2 | .settings/language.settings.xml 3 | -------------------------------------------------------------------------------- /BOOT/.mxproject: -------------------------------------------------------------------------------- 1 | [PreviousGenFiles] 2 | HeaderPath=C:/github/stm32-can-bootloader/BOOT/Inc 3 | HeaderFiles=stm32f3xx_it.h;stm32f3xx_hal_conf.h;main.h; 4 | SourcePath=C:/github/stm32-can-bootloader/BOOT/Src 5 | SourceFiles=stm32f3xx_it.c;stm32f3xx_hal_msp.c;main.c; 6 | 7 | [PreviousLibFiles] 8 | LibFiles=Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_can.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_crc.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_crc_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_cortex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_can.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_crc.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_crc_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_can.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_crc.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_crc_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_cortex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f373xc.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f3xx.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/system_stm32f3xx.h;Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/system_stm32f3xx.c;Drivers/CMSIS/Include/arm_common_tables.h;Drivers/CMSIS/Include/arm_const_structs.h;Drivers/CMSIS/Include/arm_math.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armcc_V6.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_cmFunc.h;Drivers/CMSIS/Include/core_cmInstr.h;Drivers/CMSIS/Include/core_cmSimd.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h; 9 | 10 | [PreviousUsedTStudioFiles] 11 | SourceFiles=..\Src\main.c;..\Src\stm32f3xx_it.c;..\Src\stm32f3xx_hal_msp.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_can.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_crc.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_crc_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;../\Src/system_stm32f3xx.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_can.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_crc.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_crc_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;../Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;../\Src/system_stm32f3xx.c;../Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/system_stm32f3xx.c;null; 12 | HeaderPath=..\Drivers\STM32F3xx_HAL_Driver\Inc;..\Drivers\STM32F3xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F3xx\Include;..\Drivers\CMSIS\Include;..\Inc; 13 | CDefines=__weak:__attribute__((weak));__packed:__attribute__((__packed__)); 14 | 15 | -------------------------------------------------------------------------------- /BOOT/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | BOOT 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | ?children? 14 | ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\|| 15 | 16 | 17 | ?name? 18 | 19 | 20 | 21 | org.eclipse.cdt.make.core.append_environment 22 | true 23 | 24 | 25 | org.eclipse.cdt.make.core.buildArguments 26 | 27 | 28 | 29 | org.eclipse.cdt.make.core.buildCommand 30 | make 31 | 32 | 33 | org.eclipse.cdt.make.core.buildLocation 34 | ${workspace_loc:/STM32100B-EVAL/Debug} 35 | 36 | 37 | org.eclipse.cdt.make.core.contents 38 | org.eclipse.cdt.make.core.activeConfigSettings 39 | 40 | 41 | org.eclipse.cdt.make.core.enableAutoBuild 42 | false 43 | 44 | 45 | org.eclipse.cdt.make.core.enableCleanBuild 46 | true 47 | 48 | 49 | org.eclipse.cdt.make.core.enableFullBuild 50 | true 51 | 52 | 53 | org.eclipse.cdt.make.core.stopOnError 54 | true 55 | 56 | 57 | org.eclipse.cdt.make.core.useDefaultBuildCmd 58 | true 59 | 60 | 61 | 62 | 63 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 64 | 65 | 66 | 67 | 68 | 69 | org.eclipse.cdt.core.cnature 70 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 71 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /BOOT/.settings/com.atollic.truestudio.debug.hardware_device.prefs: -------------------------------------------------------------------------------- 1 | BOARD=None 2 | CODE_LOCATION=FLASH 3 | ENDIAN=Little-endian 4 | MCU=STM32F373VC 5 | MCU_VENDOR=STMicroelectronics 6 | MODEL=Lite 7 | PROBE=ST-LINK 8 | PROJECT_FORMAT_VERSION=2 9 | TARGET=ARM\u00AE 10 | VERSION=4.1.0 11 | eclipse.preferences.version=1 12 | -------------------------------------------------------------------------------- /BOOT/.settings/org.eclipse.cdt.managedbuilder.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.1518366166/CPATH/delimiter=; 3 | environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.1518366166/CPATH/operation=remove 4 | environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.1518366166/C_INCLUDE_PATH/delimiter=; 5 | environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.1518366166/C_INCLUDE_PATH/operation=remove 6 | environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.1518366166/append=true 7 | environment/buildEnvironmentInclude/com.atollic.truestudio.exe.debug.1518366166/appendContributed=true 8 | environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.1518366166/LIBRARY_PATH/delimiter=; 9 | environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.1518366166/LIBRARY_PATH/operation=remove 10 | environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.1518366166/append=true 11 | environment/buildEnvironmentLibrary/com.atollic.truestudio.exe.debug.1518366166/appendContributed=true 12 | -------------------------------------------------------------------------------- /BOOT/BOOT.ioc: -------------------------------------------------------------------------------- 1 | #MicroXplorer Configuration settings - do not modify 2 | CAN.ABOM=ENABLE 3 | CAN.BS1=CAN_BS1_9TQ 4 | CAN.BS2=CAN_BS2_6TQ 5 | CAN.CalculateTimeBit=2000 6 | CAN.CalculateTimeQuantum=125.0 7 | CAN.IPParameters=CalculateTimeQuantum,CalculateTimeBit,ABOM,Prescaler,BS1,BS2 8 | CAN.Prescaler=4 9 | File.Version=6 10 | KeepUserPlacement=false 11 | Mcu.Family=STM32F3 12 | Mcu.IP0=CAN 13 | Mcu.IP1=CRC 14 | Mcu.IP2=NVIC 15 | Mcu.IP3=RCC 16 | Mcu.IP4=SYS 17 | Mcu.IP5=TIM17 18 | Mcu.IPNb=6 19 | Mcu.Name=STM32F373V(8-B-C)Tx 20 | Mcu.Package=LQFP100 21 | Mcu.Pin0=PA13 22 | Mcu.Pin1=PA14 23 | Mcu.Pin10=VP_TIM17_VS_ClockSourceINT 24 | Mcu.Pin2=PA15 25 | Mcu.Pin3=PC10 26 | Mcu.Pin4=PC11 27 | Mcu.Pin5=PD0 28 | Mcu.Pin6=PD1 29 | Mcu.Pin7=PB3 30 | Mcu.Pin8=VP_CRC_VS_CRC 31 | Mcu.Pin9=VP_SYS_VS_Systick 32 | Mcu.PinsNb=11 33 | Mcu.ThirdPartyNb=0 34 | Mcu.UserConstants= 35 | Mcu.UserName=STM32F373VCTx 36 | MxCube.Version=5.1.0 37 | MxDb.Version=DB.5.0.10 38 | NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false 39 | NVIC.CAN_RX0_IRQn=true\:0\:0\:false\:false\:true\:true\:true 40 | NVIC.CAN_TX_IRQn=true\:0\:0\:false\:false\:true\:true\:true 41 | NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false 42 | NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false 43 | NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false 44 | NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false 45 | NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false 46 | NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 47 | NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false 48 | NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true 49 | NVIC.TIM17_IRQn=true\:0\:0\:false\:false\:true\:true\:true 50 | NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false 51 | PA13.Mode=Trace_Asynchronous_SW 52 | PA13.Signal=SYS_JTMS-SWDIO 53 | PA14.Mode=Trace_Asynchronous_SW 54 | PA14.Signal=SYS_JTCK-SWCLK 55 | PA15.GPIOParameters=GPIO_Speed,PinState,GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP 56 | PA15.GPIO_Label=GPIO_LED1_R 57 | PA15.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP 58 | PA15.GPIO_PuPd=GPIO_NOPULL 59 | PA15.GPIO_Speed=GPIO_SPEED_FREQ_LOW 60 | PA15.Locked=true 61 | PA15.PinState=GPIO_PIN_RESET 62 | PA15.Signal=GPIO_Output 63 | PB3.Mode=Trace_Asynchronous_SW 64 | PB3.Signal=SYS_JTDO-TRACESWO 65 | PC10.GPIOParameters=GPIO_Speed,PinState,GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP 66 | PC10.GPIO_Label=GPIO_LED1_G 67 | PC10.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP 68 | PC10.GPIO_PuPd=GPIO_NOPULL 69 | PC10.GPIO_Speed=GPIO_SPEED_FREQ_LOW 70 | PC10.Locked=true 71 | PC10.PinState=GPIO_PIN_RESET 72 | PC10.Signal=GPIO_Output 73 | PC11.GPIOParameters=GPIO_Speed,PinState,GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP 74 | PC11.GPIO_Label=GPIO_LED1_B 75 | PC11.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP 76 | PC11.GPIO_PuPd=GPIO_NOPULL 77 | PC11.GPIO_Speed=GPIO_SPEED_FREQ_LOW 78 | PC11.Locked=true 79 | PC11.PinState=GPIO_PIN_RESET 80 | PC11.Signal=GPIO_Output 81 | PCC.Checker=false 82 | PCC.Line=STM32F373 83 | PCC.MCU=STM32F373V(8-B-C)Tx 84 | PCC.PartNumber=STM32F373VCTx 85 | PCC.Seq0=0 86 | PCC.Series=STM32F3 87 | PCC.Temperature=25 88 | PCC.Vdd=3.6 89 | PD0.Locked=true 90 | PD0.Mode=Master 91 | PD0.Signal=CAN_RX 92 | PD1.Locked=true 93 | PD1.Mode=Master 94 | PD1.Signal=CAN_TX 95 | PinOutPanel.RotationAngle=0 96 | ProjectManager.AskForMigrate=true 97 | ProjectManager.BackupPrevious=false 98 | ProjectManager.CompilerOptimize=3 99 | ProjectManager.ComputerToolchain=false 100 | ProjectManager.CoupleFile=false 101 | ProjectManager.CustomerFirmwarePackage= 102 | ProjectManager.DefaultFWLocation=true 103 | ProjectManager.DeletePrevious=true 104 | ProjectManager.DeviceId=STM32F373VCTx 105 | ProjectManager.FirmwarePackage=STM32Cube FW_F3 V1.10.0 106 | ProjectManager.FreePins=false 107 | ProjectManager.HalAssertFull=false 108 | ProjectManager.HeapSize=0x200 109 | ProjectManager.KeepUserCode=true 110 | ProjectManager.LastFirmware=true 111 | ProjectManager.LibraryCopy=1 112 | ProjectManager.MainLocation=Src 113 | ProjectManager.NoMain=false 114 | ProjectManager.PreviousToolchain=TrueSTUDIO 115 | ProjectManager.ProjectBuild=false 116 | ProjectManager.ProjectFileName=BOOT.ioc 117 | ProjectManager.ProjectName=BOOT 118 | ProjectManager.StackSize=0x400 119 | ProjectManager.TargetToolchain=TrueSTUDIO 120 | ProjectManager.ToolChainLocation= 121 | ProjectManager.UnderRoot=true 122 | ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-true,3-MX_TIM17_Init-TIM17-false-HAL-true,4-MX_CAN_Init-CAN-false-HAL-true,5-MX_CRC_Init-CRC-false-HAL-true 123 | RCC.ADCoutputFreq_Value=32000000 124 | RCC.AHBFreq_Value=64000000 125 | RCC.APB1CLKDivider=RCC_HCLK_DIV2 126 | RCC.APB1Freq_Value=32000000 127 | RCC.APB1TimFreq_Value=64000000 128 | RCC.APB2Freq_Value=64000000 129 | RCC.APB2TimFreq_Value=64000000 130 | RCC.CECFreq_Value=32786.88524590164 131 | RCC.CortexFreq_Value=64000000 132 | RCC.FCLKCortexFreq_Value=64000000 133 | RCC.FamilyName=M 134 | RCC.HCLKFreq_Value=64000000 135 | RCC.HSEPLLFreq_Value=8000000 136 | RCC.HSE_VALUE=8000000 137 | RCC.HSICECFreq_Value=32786.88524590164 138 | RCC.HSIPLLFreq_Value=4000000 139 | RCC.HSI_VALUE=8000000 140 | RCC.I2C1Freq_Value=8000000 141 | RCC.I2CFreq_Value=8000000 142 | RCC.IPParameters=ADCoutputFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CECFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSEPLLFreq_Value,HSE_VALUE,HSICECFreq_Value,HSIPLLFreq_Value,HSI_VALUE,I2C1Freq_Value,I2CFreq_Value,LSE_VALUE,LSI_VALUE,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PWRFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SDADCPresc,SDADCoutputFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,TIM2Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOOutput2Freq_Value 143 | RCC.LSE_VALUE=32768 144 | RCC.LSI_VALUE=40000 145 | RCC.MCOFreq_Value=64000000 146 | RCC.PLLCLKFreq_Value=64000000 147 | RCC.PLLMCOFreq_Value=32000000 148 | RCC.PLLMUL=RCC_PLL_MUL16 149 | RCC.PWRFreq_Value=64000000 150 | RCC.RTCFreq_Value=40000 151 | RCC.RTCHSEDivFreq_Value=250000 152 | RCC.SDADCPresc=RCC_SDADCSYSCLK_DIV48 153 | RCC.SDADCoutputFreq_Value=1333333.3333333333 154 | RCC.SYSCLKFreq_VALUE=64000000 155 | RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK 156 | RCC.TIM2Freq_Value=64000000 157 | RCC.USART1Freq_Value=64000000 158 | RCC.USART2Freq_Value=32000000 159 | RCC.USART3Freq_Value=32000000 160 | RCC.USBFreq_Value=64000000 161 | RCC.VCOOutput2Freq_Value=4000000 162 | TIM17.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE 163 | TIM17.ClockDivision=TIM_CLOCKDIVISION_DIV2 164 | TIM17.IPParameters=Prescaler,Period,ClockDivision,AutoReloadPreload 165 | TIM17.Period=32000 166 | TIM17.Prescaler=1 167 | VP_CRC_VS_CRC.Mode=CRC_Activate 168 | VP_CRC_VS_CRC.Signal=CRC_VS_CRC 169 | VP_SYS_VS_Systick.Mode=SysTick 170 | VP_SYS_VS_Systick.Signal=SYS_VS_Systick 171 | VP_TIM17_VS_ClockSourceINT.Mode=Enable_Timer 172 | VP_TIM17_VS_ClockSourceINT.Signal=TIM17_VS_ClockSourceINT 173 | board=BOOT 174 | -------------------------------------------------------------------------------- /BOOT/BOOT.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /BOOT/Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f373xc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/effenco/stm32-can-bootloader/106bf5828c6193284f40027c85a628ba04a17207/BOOT/Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f373xc.h -------------------------------------------------------------------------------- /BOOT/Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f3xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/effenco/stm32-can-bootloader/106bf5828c6193284f40027c85a628ba04a17207/BOOT/Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f3xx.h -------------------------------------------------------------------------------- /BOOT/Drivers/CMSIS/Device/ST/STM32F3xx/Include/system_stm32f3xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f3xx.h 4 | * @author MCD Application Team 5 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F3xx devices. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© COPYRIGHT(c) 2016 STMicroelectronics

10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | * 33 | ****************************************************************************** 34 | */ 35 | 36 | /** @addtogroup CMSIS 37 | * @{ 38 | */ 39 | 40 | /** @addtogroup stm32f3xx_system 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @brief Define to prevent recursive inclusion 46 | */ 47 | #ifndef __SYSTEM_STM32F3XX_H 48 | #define __SYSTEM_STM32F3XX_H 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | 54 | /** @addtogroup STM32F3xx_System_Includes 55 | * @{ 56 | */ 57 | 58 | /** 59 | * @} 60 | */ 61 | 62 | 63 | /** @addtogroup STM32F3xx_System_Exported_types 64 | * @{ 65 | */ 66 | /* This variable is updated in three ways: 67 | 1) by calling CMSIS function SystemCoreClockUpdate() 68 | 3) by calling HAL API function HAL_RCC_GetHCLKFreq() 69 | 3) by calling HAL API function HAL_RCC_ClockConfig() 70 | Note: If you use this function to configure the system clock; then there 71 | is no need to call the 2 first functions listed above, since SystemCoreClock 72 | variable is updated automatically. 73 | */ 74 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 75 | extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */ 76 | extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */ 77 | 78 | 79 | /** 80 | * @} 81 | */ 82 | 83 | /** @addtogroup STM32F3xx_System_Exported_Constants 84 | * @{ 85 | */ 86 | 87 | /** 88 | * @} 89 | */ 90 | 91 | /** @addtogroup STM32F3xx_System_Exported_Macros 92 | * @{ 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | 99 | /** @addtogroup STM32F3xx_System_Exported_Functions 100 | * @{ 101 | */ 102 | 103 | extern void SystemInit(void); 104 | extern void SystemCoreClockUpdate(void); 105 | /** 106 | * @} 107 | */ 108 | 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | 113 | #endif /*__SYSTEM_STM32F3XX_H */ 114 | 115 | /** 116 | * @} 117 | */ 118 | 119 | /** 120 | * @} 121 | */ 122 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 123 | -------------------------------------------------------------------------------- /BOOT/Drivers/CMSIS/Include/arm_common_tables.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. October 2015 5 | * $Revision: V.1.4.5 a 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_common_tables.h 9 | * 10 | * Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #ifndef _ARM_COMMON_TABLES_H 42 | #define _ARM_COMMON_TABLES_H 43 | 44 | #include "arm_math.h" 45 | 46 | extern const uint16_t armBitRevTable[1024]; 47 | extern const q15_t armRecipTableQ15[64]; 48 | extern const q31_t armRecipTableQ31[64]; 49 | /* extern const q31_t realCoefAQ31[1024]; */ 50 | /* extern const q31_t realCoefBQ31[1024]; */ 51 | extern const float32_t twiddleCoef_16[32]; 52 | extern const float32_t twiddleCoef_32[64]; 53 | extern const float32_t twiddleCoef_64[128]; 54 | extern const float32_t twiddleCoef_128[256]; 55 | extern const float32_t twiddleCoef_256[512]; 56 | extern const float32_t twiddleCoef_512[1024]; 57 | extern const float32_t twiddleCoef_1024[2048]; 58 | extern const float32_t twiddleCoef_2048[4096]; 59 | extern const float32_t twiddleCoef_4096[8192]; 60 | #define twiddleCoef twiddleCoef_4096 61 | extern const q31_t twiddleCoef_16_q31[24]; 62 | extern const q31_t twiddleCoef_32_q31[48]; 63 | extern const q31_t twiddleCoef_64_q31[96]; 64 | extern const q31_t twiddleCoef_128_q31[192]; 65 | extern const q31_t twiddleCoef_256_q31[384]; 66 | extern const q31_t twiddleCoef_512_q31[768]; 67 | extern const q31_t twiddleCoef_1024_q31[1536]; 68 | extern const q31_t twiddleCoef_2048_q31[3072]; 69 | extern const q31_t twiddleCoef_4096_q31[6144]; 70 | extern const q15_t twiddleCoef_16_q15[24]; 71 | extern const q15_t twiddleCoef_32_q15[48]; 72 | extern const q15_t twiddleCoef_64_q15[96]; 73 | extern const q15_t twiddleCoef_128_q15[192]; 74 | extern const q15_t twiddleCoef_256_q15[384]; 75 | extern const q15_t twiddleCoef_512_q15[768]; 76 | extern const q15_t twiddleCoef_1024_q15[1536]; 77 | extern const q15_t twiddleCoef_2048_q15[3072]; 78 | extern const q15_t twiddleCoef_4096_q15[6144]; 79 | extern const float32_t twiddleCoef_rfft_32[32]; 80 | extern const float32_t twiddleCoef_rfft_64[64]; 81 | extern const float32_t twiddleCoef_rfft_128[128]; 82 | extern const float32_t twiddleCoef_rfft_256[256]; 83 | extern const float32_t twiddleCoef_rfft_512[512]; 84 | extern const float32_t twiddleCoef_rfft_1024[1024]; 85 | extern const float32_t twiddleCoef_rfft_2048[2048]; 86 | extern const float32_t twiddleCoef_rfft_4096[4096]; 87 | 88 | 89 | /* floating-point bit reversal tables */ 90 | #define ARMBITREVINDEXTABLE__16_TABLE_LENGTH ((uint16_t)20 ) 91 | #define ARMBITREVINDEXTABLE__32_TABLE_LENGTH ((uint16_t)48 ) 92 | #define ARMBITREVINDEXTABLE__64_TABLE_LENGTH ((uint16_t)56 ) 93 | #define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208 ) 94 | #define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440 ) 95 | #define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448 ) 96 | #define ARMBITREVINDEXTABLE1024_TABLE_LENGTH ((uint16_t)1800) 97 | #define ARMBITREVINDEXTABLE2048_TABLE_LENGTH ((uint16_t)3808) 98 | #define ARMBITREVINDEXTABLE4096_TABLE_LENGTH ((uint16_t)4032) 99 | 100 | extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH]; 101 | extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE__32_TABLE_LENGTH]; 102 | extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE__64_TABLE_LENGTH]; 103 | extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]; 104 | extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]; 105 | extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]; 106 | extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE1024_TABLE_LENGTH]; 107 | extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE2048_TABLE_LENGTH]; 108 | extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE4096_TABLE_LENGTH]; 109 | 110 | /* fixed-point bit reversal tables */ 111 | #define ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH ((uint16_t)12 ) 112 | #define ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH ((uint16_t)24 ) 113 | #define ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH ((uint16_t)56 ) 114 | #define ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH ((uint16_t)112 ) 115 | #define ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH ((uint16_t)240 ) 116 | #define ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH ((uint16_t)480 ) 117 | #define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992 ) 118 | #define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984) 119 | #define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032) 120 | 121 | extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH]; 122 | extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH]; 123 | extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH]; 124 | extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH]; 125 | extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH]; 126 | extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH]; 127 | extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH]; 128 | extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH]; 129 | extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH]; 130 | 131 | /* Tables for Fast Math Sine and Cosine */ 132 | extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1]; 133 | extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1]; 134 | extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; 135 | 136 | #endif /* ARM_COMMON_TABLES_H */ 137 | -------------------------------------------------------------------------------- /BOOT/Drivers/CMSIS/Include/arm_const_structs.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_const_structs.h 9 | * 10 | * Description: This file has constant structs that are initialized for 11 | * user convenience. For example, some can be given as 12 | * arguments to the arm_cfft_f32() function. 13 | * 14 | * Target Processor: Cortex-M4/Cortex-M3 15 | * 16 | * Redistribution and use in source and binary forms, with or without 17 | * modification, are permitted provided that the following conditions 18 | * are met: 19 | * - Redistributions of source code must retain the above copyright 20 | * notice, this list of conditions and the following disclaimer. 21 | * - Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * - Neither the name of ARM LIMITED nor the names of its contributors 26 | * may be used to endorse or promote products derived from this 27 | * software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 32 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 33 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 35 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 36 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 37 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 39 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 | * POSSIBILITY OF SUCH DAMAGE. 41 | * -------------------------------------------------------------------- */ 42 | 43 | #ifndef _ARM_CONST_STRUCTS_H 44 | #define _ARM_CONST_STRUCTS_H 45 | 46 | #include "arm_math.h" 47 | #include "arm_common_tables.h" 48 | 49 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; 50 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; 51 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; 52 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; 53 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; 54 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; 55 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; 56 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; 57 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; 58 | 59 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; 60 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; 61 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; 62 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; 63 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; 64 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; 65 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; 66 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; 67 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; 68 | 69 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; 70 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; 71 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; 72 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; 73 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; 74 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; 75 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; 76 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; 77 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /BOOT/Drivers/CMSIS/Include/core_cmFunc.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmFunc.h 3 | * @brief CMSIS Cortex-M Core Function Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMFUNC_H 42 | #define __CORE_CMFUNC_H 43 | 44 | 45 | /* ########################### Core Function Access ########################### */ 46 | /** \ingroup CMSIS_Core_FunctionInterface 47 | \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@} end of CMSIS_Core_RegAccFunctions */ 86 | 87 | #endif /* __CORE_CMFUNC_H */ 88 | -------------------------------------------------------------------------------- /BOOT/Drivers/CMSIS/Include/core_cmInstr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmInstr.h 3 | * @brief CMSIS Cortex-M Core Instruction Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMINSTR_H 42 | #define __CORE_CMINSTR_H 43 | 44 | 45 | /* ########################## Core Instruction Access ######################### */ 46 | /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface 47 | Access to dedicated instructions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@}*/ /* end of group CMSIS_Core_InstructionInterface */ 86 | 87 | #endif /* __CORE_CMINSTR_H */ 88 | -------------------------------------------------------------------------------- /BOOT/Drivers/CMSIS/Include/core_cmSimd.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmSimd.h 3 | * @brief CMSIS Cortex-M SIMD Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMSIMD_H 42 | #define __CORE_CMSIMD_H 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | 49 | /* ################### Compiler specific Intrinsics ########################### */ 50 | /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics 51 | Access to dedicated SIMD instructions 52 | @{ 53 | */ 54 | 55 | /*------------------ RealView Compiler -----------------*/ 56 | #if defined ( __CC_ARM ) 57 | #include "cmsis_armcc.h" 58 | 59 | /*------------------ ARM Compiler V6 -------------------*/ 60 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 61 | #include "cmsis_armcc_V6.h" 62 | 63 | /*------------------ GNU Compiler ----------------------*/ 64 | #elif defined ( __GNUC__ ) 65 | #include "cmsis_gcc.h" 66 | 67 | /*------------------ ICC Compiler ----------------------*/ 68 | #elif defined ( __ICCARM__ ) 69 | #include 70 | 71 | /*------------------ TI CCS Compiler -------------------*/ 72 | #elif defined ( __TMS470__ ) 73 | #include 74 | 75 | /*------------------ TASKING Compiler ------------------*/ 76 | #elif defined ( __TASKING__ ) 77 | /* 78 | * The CMSIS functions have been implemented as intrinsics in the compiler. 79 | * Please use "carm -?i" to get an up to date list of all intrinsics, 80 | * Including the CMSIS ones. 81 | */ 82 | 83 | /*------------------ COSMIC Compiler -------------------*/ 84 | #elif defined ( __CSMC__ ) 85 | #include 86 | 87 | #endif 88 | 89 | /*@} end of group CMSIS_SIMD_intrinsics */ 90 | 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* __CORE_CMSIMD_H */ 97 | -------------------------------------------------------------------------------- /BOOT/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_crc_ex.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f3xx_hal_crc_ex.h 4 | * @author MCD Application Team 5 | * @brief Header file of CRC HAL extension module. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© COPYRIGHT(c) 2016 STMicroelectronics

10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | * 33 | ****************************************************************************** 34 | */ 35 | 36 | /* Define to prevent recursive inclusion -------------------------------------*/ 37 | #ifndef __STM32F3xx_HAL_CRC_EX_H 38 | #define __STM32F3xx_HAL_CRC_EX_H 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* Includes ------------------------------------------------------------------*/ 45 | #include "stm32f3xx_hal_def.h" 46 | 47 | /** @addtogroup STM32F3xx_HAL_Driver 48 | * @{ 49 | */ 50 | 51 | /** @addtogroup CRCEx CRCEx 52 | * @{ 53 | */ 54 | 55 | /* Exported types ------------------------------------------------------------*/ 56 | /* Exported constants --------------------------------------------------------*/ 57 | /** @defgroup CRCEx_Exported_Constants CRC Extended Exported Constants 58 | * @{ 59 | */ 60 | 61 | /** @defgroup CRCEx_Input_Data_Inversion CRC Extended Input Data Inversion Modes 62 | * @{ 63 | */ 64 | #define CRC_INPUTDATA_INVERSION_NONE (0x00000000U) /*!< No input data inversion */ 65 | #define CRC_INPUTDATA_INVERSION_BYTE ((uint32_t)CRC_CR_REV_IN_0) /*!< Byte-wise input data inversion */ 66 | #define CRC_INPUTDATA_INVERSION_HALFWORD ((uint32_t)CRC_CR_REV_IN_1) /*!< HalfWord-wise input data inversion */ 67 | #define CRC_INPUTDATA_INVERSION_WORD ((uint32_t)CRC_CR_REV_IN) /*!< Word-wise input data inversion */ 68 | /** 69 | * @} 70 | */ 71 | 72 | /** @defgroup CRCEx_Output_Data_Inversion CRC Extended Output Data Inversion Modes 73 | * @{ 74 | */ 75 | #define CRC_OUTPUTDATA_INVERSION_DISABLE (0x00000000U) /*!< No output data inversion */ 76 | #define CRC_OUTPUTDATA_INVERSION_ENABLE ((uint32_t)CRC_CR_REV_OUT) /*!< Bit-wise output data inversion */ 77 | /** 78 | * @} 79 | */ 80 | 81 | /** 82 | * @} 83 | */ 84 | 85 | /* Exported macro ------------------------------------------------------------*/ 86 | 87 | /** @defgroup CRCEx_Exported_Macros CRC Extended Exported Macros 88 | * @{ 89 | */ 90 | 91 | /** 92 | * @brief Set CRC output reversal 93 | * @param __HANDLE__ CRC handle 94 | * @retval None. 95 | */ 96 | #define __HAL_CRC_OUTPUTREVERSAL_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRC_CR_REV_OUT) 97 | 98 | /** 99 | * @brief Unset CRC output reversal 100 | * @param __HANDLE__ CRC handle 101 | * @retval None. 102 | */ 103 | #define __HAL_CRC_OUTPUTREVERSAL_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(CRC_CR_REV_OUT)) 104 | 105 | /** 106 | * @brief Set CRC non-default polynomial 107 | * @param __HANDLE__ CRC handle 108 | * @param __POLYNOMIAL__ 7, 8, 16 or 32-bit polynomial 109 | * @retval None. 110 | */ 111 | #define __HAL_CRC_POLYNOMIAL_CONFIG(__HANDLE__, __POLYNOMIAL__) ((__HANDLE__)->Instance->POL = (__POLYNOMIAL__)) 112 | 113 | /** 114 | * @} 115 | */ 116 | 117 | /* Private macros --------------------------------------------------------*/ 118 | /** @addtogroup CRCEx_Private_Macros CRCEx Private Macros 119 | * @{ 120 | */ 121 | 122 | #define IS_CRC_INPUTDATA_INVERSION_MODE(MODE) (((MODE) == CRC_INPUTDATA_INVERSION_NONE) || \ 123 | ((MODE) == CRC_INPUTDATA_INVERSION_BYTE) || \ 124 | ((MODE) == CRC_INPUTDATA_INVERSION_HALFWORD) || \ 125 | ((MODE) == CRC_INPUTDATA_INVERSION_WORD)) 126 | 127 | 128 | #define IS_CRC_OUTPUTDATA_INVERSION_MODE(MODE) (((MODE) == CRC_OUTPUTDATA_INVERSION_DISABLE) || \ 129 | ((MODE) == CRC_OUTPUTDATA_INVERSION_ENABLE)) 130 | 131 | /** 132 | * @} 133 | */ 134 | 135 | /* Exported functions --------------------------------------------------------*/ 136 | /** @addtogroup CRCEx_Exported_Functions CRC Extended Exported Functions 137 | * @{ 138 | */ 139 | 140 | /** @addtogroup CRCEx_Exported_Functions_Group1 CRC Extended Initialization and de-initialization functions 141 | * @brief Extended Initialization and Configuration functions. 142 | * @{ 143 | */ 144 | /* Initialization and de-initialization functions ****************************/ 145 | HAL_StatusTypeDef HAL_CRCEx_Polynomial_Set(CRC_HandleTypeDef *hcrc, uint32_t Pol, uint32_t PolyLength); 146 | HAL_StatusTypeDef HAL_CRCEx_Input_Data_Reverse(CRC_HandleTypeDef *hcrc, uint32_t InputReverseMode); 147 | HAL_StatusTypeDef HAL_CRCEx_Output_Data_Reverse(CRC_HandleTypeDef *hcrc, uint32_t OutputReverseMode); 148 | /** 149 | * @} 150 | */ 151 | 152 | /* Peripheral Control functions ***********************************************/ 153 | /* Peripheral State and Error functions ***************************************/ 154 | 155 | /** 156 | * @} 157 | */ 158 | 159 | /** 160 | * @} 161 | */ 162 | 163 | /** 164 | * @} 165 | */ 166 | 167 | #ifdef __cplusplus 168 | } 169 | #endif 170 | 171 | #endif /* __STM32F3xx_HAL_CRC_EX_H */ 172 | 173 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 174 | -------------------------------------------------------------------------------- /BOOT/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f3xx_hal_def.h 4 | * @author MCD Application Team 5 | * @brief This file contains HAL common defines, enumeration, macros and 6 | * structures definitions. 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | *

© COPYRIGHT(c) 2016 STMicroelectronics

11 | * 12 | * Redistribution and use in source and binary forms, with or without modification, 13 | * are permitted provided that the following conditions are met: 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 20 | * may be used to endorse or promote products derived from this software 21 | * without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 31 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | * 34 | ****************************************************************************** 35 | */ 36 | 37 | /* Define to prevent recursive inclusion -------------------------------------*/ 38 | #ifndef __STM32F3xx_HAL_DEF 39 | #define __STM32F3xx_HAL_DEF 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /* Includes ------------------------------------------------------------------*/ 46 | #include "stm32f3xx.h" 47 | #if defined USE_LEGACY 48 | #include "Legacy/stm32_hal_legacy.h" 49 | #endif 50 | #include 51 | 52 | /* Exported types ------------------------------------------------------------*/ 53 | 54 | /** 55 | * @brief HAL Status structures definition 56 | */ 57 | typedef enum 58 | { 59 | HAL_OK = 0x00U, 60 | HAL_ERROR = 0x01U, 61 | HAL_BUSY = 0x02U, 62 | HAL_TIMEOUT = 0x03 63 | } HAL_StatusTypeDef; 64 | 65 | /** 66 | * @brief HAL Lock structures definition 67 | */ 68 | typedef enum 69 | { 70 | HAL_UNLOCKED = 0x00U, 71 | HAL_LOCKED = 0x01 72 | } HAL_LockTypeDef; 73 | 74 | /* Exported macro ------------------------------------------------------------*/ 75 | 76 | #define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */ 77 | 78 | #define HAL_MAX_DELAY 0xFFFFFFFFU 79 | 80 | #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) == BIT) 81 | #define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U) 82 | 83 | #define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD_, __DMA_HANDLE_) \ 84 | do{ \ 85 | (__HANDLE__)->__PPP_DMA_FIELD_ = &(__DMA_HANDLE_); \ 86 | (__DMA_HANDLE_).Parent = (__HANDLE__); \ 87 | } while(0U) 88 | 89 | /** @brief Reset the Handle's State field. 90 | * @param __HANDLE__ specifies the Peripheral Handle. 91 | * @note This macro can be used for the following purpose: 92 | * - When the Handle is declared as local variable; before passing it as parameter 93 | * to HAL_PPP_Init() for the first time, it is mandatory to use this macro 94 | * to set to 0 the Handle's "State" field. 95 | * Otherwise, "State" field may have any random value and the first time the function 96 | * HAL_PPP_Init() is called, the low level hardware initialization will be missed 97 | * (i.e. HAL_PPP_MspInit() will not be executed). 98 | * - When there is a need to reconfigure the low level hardware: instead of calling 99 | * HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init(). 100 | * In this later function, when the Handle's "State" field is set to 0, it will execute the function 101 | * HAL_PPP_MspInit() which will reconfigure the low level hardware. 102 | * @retval None 103 | */ 104 | #define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U) 105 | 106 | #if (USE_RTOS == 1U) 107 | #error " USE_RTOS should be 0 in the current HAL release " 108 | #else 109 | #define __HAL_LOCK(__HANDLE__) \ 110 | do{ \ 111 | if((__HANDLE__)->Lock == HAL_LOCKED) \ 112 | { \ 113 | return HAL_BUSY; \ 114 | } \ 115 | else \ 116 | { \ 117 | (__HANDLE__)->Lock = HAL_LOCKED; \ 118 | } \ 119 | }while (0U) 120 | 121 | #define __HAL_UNLOCK(__HANDLE__) \ 122 | do{ \ 123 | (__HANDLE__)->Lock = HAL_UNLOCKED; \ 124 | }while (0U) 125 | #endif /* USE_RTOS */ 126 | 127 | #if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */ 128 | #ifndef __weak 129 | #define __weak __attribute__((weak)) 130 | #endif /* __weak */ 131 | #ifndef __packed 132 | #define __packed __attribute__((__packed__)) 133 | #endif /* __packed */ 134 | #endif /* __GNUC__ */ 135 | 136 | 137 | /* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */ 138 | #if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */ 139 | #ifndef __ALIGN_END 140 | #define __ALIGN_END __attribute__ ((aligned (4))) 141 | #endif /* __ALIGN_END */ 142 | #ifndef __ALIGN_BEGIN 143 | #define __ALIGN_BEGIN 144 | #endif /* __ALIGN_BEGIN */ 145 | #else 146 | #ifndef __ALIGN_END 147 | #define __ALIGN_END 148 | #endif /* __ALIGN_END */ 149 | #ifndef __ALIGN_BEGIN 150 | #if defined (__CC_ARM) /* ARM Compiler */ 151 | #define __ALIGN_BEGIN __align(4) 152 | #elif defined (__ICCARM__) /* IAR Compiler */ 153 | #define __ALIGN_BEGIN 154 | #endif /* __CC_ARM */ 155 | #endif /* __ALIGN_BEGIN */ 156 | #endif /* __GNUC__ */ 157 | 158 | /** 159 | * @brief __NOINLINE definition 160 | */ 161 | #if defined ( __CC_ARM ) || defined ( __GNUC__ ) 162 | /* ARM & GNUCompiler 163 | ---------------- 164 | */ 165 | #define __NOINLINE __attribute__ ( (noinline) ) 166 | 167 | #elif defined ( __ICCARM__ ) 168 | /* ICCARM Compiler 169 | --------------- 170 | */ 171 | #define __NOINLINE _Pragma("optimize = no_inline") 172 | 173 | #endif 174 | 175 | #ifdef __cplusplus 176 | } 177 | #endif 178 | 179 | #endif /* ___STM32F3xx_HAL_DEF */ 180 | 181 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 182 | -------------------------------------------------------------------------------- /BOOT/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f3xx_hal_i2c_ex.h 4 | * @author MCD Application Team 5 | * @brief Header file of I2C HAL Extended module. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© COPYRIGHT(c) 2016 STMicroelectronics

10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | * 33 | ****************************************************************************** 34 | */ 35 | 36 | /* Define to prevent recursive inclusion -------------------------------------*/ 37 | #ifndef __STM32F3xx_HAL_I2C_EX_H 38 | #define __STM32F3xx_HAL_I2C_EX_H 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* Includes ------------------------------------------------------------------*/ 45 | #include "stm32f3xx_hal_def.h" 46 | 47 | /** @addtogroup STM32F3xx_HAL_Driver 48 | * @{ 49 | */ 50 | 51 | /** @addtogroup I2CEx 52 | * @{ 53 | */ 54 | 55 | /* Exported types ------------------------------------------------------------*/ 56 | /* Exported constants --------------------------------------------------------*/ 57 | 58 | /** @defgroup I2CEx_Exported_Constants I2C Extended Exported Constants 59 | * @{ 60 | */ 61 | 62 | /** @defgroup I2CEx_Analog_Filter I2C Extended Analog Filter 63 | * @{ 64 | */ 65 | #define I2C_ANALOGFILTER_ENABLE 0x00000000U 66 | #define I2C_ANALOGFILTER_DISABLE I2C_CR1_ANFOFF 67 | /** 68 | * @} 69 | */ 70 | 71 | /** @defgroup I2CEx_FastModePlus I2C Extended Fast Mode Plus 72 | * @{ 73 | */ 74 | #define I2C_FMP_NOT_SUPPORTED 0xAAAA0000U /*!< Fast Mode Plus not supported */ 75 | #define I2C_FASTMODEPLUS_PB6 SYSCFG_CFGR1_I2C_PB6_FMP /*!< Enable Fast Mode Plus on PB6 */ 76 | #define I2C_FASTMODEPLUS_PB7 SYSCFG_CFGR1_I2C_PB7_FMP /*!< Enable Fast Mode Plus on PB7 */ 77 | #define I2C_FASTMODEPLUS_PB8 SYSCFG_CFGR1_I2C_PB8_FMP /*!< Enable Fast Mode Plus on PB8 */ 78 | #define I2C_FASTMODEPLUS_PB9 SYSCFG_CFGR1_I2C_PB9_FMP /*!< Enable Fast Mode Plus on PB9 */ 79 | #define I2C_FASTMODEPLUS_I2C1 SYSCFG_CFGR1_I2C1_FMP /*!< Enable Fast Mode Plus on I2C1 pins */ 80 | #if defined(SYSCFG_CFGR1_I2C2_FMP) 81 | #define I2C_FASTMODEPLUS_I2C2 SYSCFG_CFGR1_I2C2_FMP /*!< Enable Fast Mode Plus on I2C2 pins */ 82 | #else 83 | #define I2C_FASTMODEPLUS_I2C2 (uint32_t)(0x00000200U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C2 not supported */ 84 | #endif 85 | #if defined(SYSCFG_CFGR1_I2C3_FMP) 86 | #define I2C_FASTMODEPLUS_I2C3 SYSCFG_CFGR1_I2C3_FMP /*!< Enable Fast Mode Plus on I2C3 pins */ 87 | #else 88 | #define I2C_FASTMODEPLUS_I2C3 (uint32_t)(0x00000400U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C3 not supported */ 89 | #endif 90 | /** 91 | * @} 92 | */ 93 | 94 | /** 95 | * @} 96 | */ 97 | 98 | /* Exported macro ------------------------------------------------------------*/ 99 | /* Exported functions --------------------------------------------------------*/ 100 | 101 | /** @addtogroup I2CEx_Exported_Functions I2C Extended Exported Functions 102 | * @{ 103 | */ 104 | 105 | /** @addtogroup I2CEx_Exported_Functions_Group1 Extended features functions 106 | * @brief Extended features functions 107 | * @{ 108 | */ 109 | 110 | /* Peripheral Control functions ************************************************/ 111 | HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter); 112 | HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter); 113 | HAL_StatusTypeDef HAL_I2CEx_EnableWakeUp(I2C_HandleTypeDef *hi2c); 114 | HAL_StatusTypeDef HAL_I2CEx_DisableWakeUp(I2C_HandleTypeDef *hi2c); 115 | void HAL_I2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus); 116 | void HAL_I2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus); 117 | 118 | /* Private constants ---------------------------------------------------------*/ 119 | /** @defgroup I2CEx_Private_Constants I2C Extended Private Constants 120 | * @{ 121 | */ 122 | 123 | /** 124 | * @} 125 | */ 126 | 127 | /* Private macros ------------------------------------------------------------*/ 128 | /** @defgroup I2CEx_Private_Macro I2C Extended Private Macros 129 | * @{ 130 | */ 131 | #define IS_I2C_ANALOG_FILTER(FILTER) (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \ 132 | ((FILTER) == I2C_ANALOGFILTER_DISABLE)) 133 | 134 | #define IS_I2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000FU) 135 | 136 | #define IS_I2C_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & I2C_FMP_NOT_SUPPORTED) != I2C_FMP_NOT_SUPPORTED) && \ 137 | ((((__CONFIG__) & (I2C_FASTMODEPLUS_PB6)) == I2C_FASTMODEPLUS_PB6) || \ 138 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB7)) == I2C_FASTMODEPLUS_PB7) || \ 139 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB8)) == I2C_FASTMODEPLUS_PB8) || \ 140 | (((__CONFIG__) & (I2C_FASTMODEPLUS_PB9)) == I2C_FASTMODEPLUS_PB9) || \ 141 | (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C1)) == I2C_FASTMODEPLUS_I2C1) || \ 142 | (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C2)) == I2C_FASTMODEPLUS_I2C2) || \ 143 | (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C3)) == I2C_FASTMODEPLUS_I2C3))) 144 | /** 145 | * @} 146 | */ 147 | 148 | /* Private Functions ---------------------------------------------------------*/ 149 | /** @defgroup I2CEx_Private_Functions I2C Extended Private Functions 150 | * @{ 151 | */ 152 | /* Private functions are defined in stm32f3xx_hal_i2c_ex.c file */ 153 | /** 154 | * @} 155 | */ 156 | 157 | /** 158 | * @} 159 | */ 160 | 161 | /** 162 | * @} 163 | */ 164 | 165 | /** 166 | * @} 167 | */ 168 | 169 | /** 170 | * @} 171 | */ 172 | 173 | #ifdef __cplusplus 174 | } 175 | #endif 176 | 177 | #endif /* __STM32F3xx_HAL_I2C_EX_H */ 178 | 179 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 180 | -------------------------------------------------------------------------------- /BOOT/Inc/btld.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/effenco/stm32-can-bootloader/106bf5828c6193284f40027c85a628ba04a17207/BOOT/Inc/btld.h -------------------------------------------------------------------------------- /BOOT/Inc/main.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file : main.h 5 | * @brief : Header for main.c file. 6 | * This file contains the common defines of the application. 7 | ****************************************************************************** 8 | ** This notice applies to any and all portions of this file 9 | * that are not between comment pairs USER CODE BEGIN and 10 | * USER CODE END. Other portions of this file, whether 11 | * inserted by the user or by software development tools 12 | * are owned by their respective copyright owners. 13 | * 14 | * COPYRIGHT(c) 2019 STMicroelectronics 15 | * 16 | * Redistribution and use in source and binary forms, with or without modification, 17 | * are permitted provided that the following conditions are met: 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright notice, 21 | * this list of conditions and the following disclaimer in the documentation 22 | * and/or other materials provided with the distribution. 23 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 24 | * may be used to endorse or promote products derived from this software 25 | * without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 28 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 29 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 31 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 33 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 34 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 35 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | ****************************************************************************** 39 | */ 40 | /* USER CODE END Header */ 41 | 42 | /* Define to prevent recursive inclusion -------------------------------------*/ 43 | #ifndef __MAIN_H 44 | #define __MAIN_H 45 | 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | /* Includes ------------------------------------------------------------------*/ 51 | #include "stm32f3xx_hal.h" 52 | 53 | /* Private includes ----------------------------------------------------------*/ 54 | /* USER CODE BEGIN Includes */ 55 | 56 | /* USER CODE END Includes */ 57 | 58 | /* Exported types ------------------------------------------------------------*/ 59 | /* USER CODE BEGIN ET */ 60 | 61 | /* USER CODE END ET */ 62 | 63 | /* Exported constants --------------------------------------------------------*/ 64 | /* USER CODE BEGIN EC */ 65 | 66 | /* USER CODE END EC */ 67 | 68 | /* Exported macro ------------------------------------------------------------*/ 69 | /* USER CODE BEGIN EM */ 70 | 71 | /* USER CODE END EM */ 72 | 73 | /* Exported functions prototypes ---------------------------------------------*/ 74 | void Error_Handler(void); 75 | 76 | /* USER CODE BEGIN EFP */ 77 | 78 | /* USER CODE END EFP */ 79 | 80 | /* Private defines -----------------------------------------------------------*/ 81 | #define GPIO_LED1_R_Pin GPIO_PIN_15 82 | #define GPIO_LED1_R_GPIO_Port GPIOA 83 | #define GPIO_LED1_G_Pin GPIO_PIN_10 84 | #define GPIO_LED1_G_GPIO_Port GPIOC 85 | #define GPIO_LED1_B_Pin GPIO_PIN_11 86 | #define GPIO_LED1_B_GPIO_Port GPIOC 87 | /* USER CODE BEGIN Private defines */ 88 | 89 | /* USER CODE END Private defines */ 90 | 91 | #ifdef __cplusplus 92 | } 93 | #endif 94 | 95 | #endif /* __MAIN_H */ 96 | 97 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 98 | -------------------------------------------------------------------------------- /BOOT/Inc/stm32f3xx_it.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32f3xx_it.h 5 | * @brief This file contains the headers of the interrupt handlers. 6 | ****************************************************************************** 7 | * 8 | * COPYRIGHT(c) 2019 STMicroelectronics 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright notice, 15 | * this list of conditions and the following disclaimer in the documentation 16 | * and/or other materials provided with the distribution. 17 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 28 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * 32 | ****************************************************************************** 33 | */ 34 | /* USER CODE END Header */ 35 | 36 | /* Define to prevent recursive inclusion -------------------------------------*/ 37 | #ifndef __STM32F3xx_IT_H 38 | #define __STM32F3xx_IT_H 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* Private includes ----------------------------------------------------------*/ 45 | /* USER CODE BEGIN Includes */ 46 | 47 | /* USER CODE END Includes */ 48 | 49 | /* Exported types ------------------------------------------------------------*/ 50 | /* USER CODE BEGIN ET */ 51 | 52 | /* USER CODE END ET */ 53 | 54 | /* Exported constants --------------------------------------------------------*/ 55 | /* USER CODE BEGIN EC */ 56 | 57 | /* USER CODE END EC */ 58 | 59 | /* Exported macro ------------------------------------------------------------*/ 60 | /* USER CODE BEGIN EM */ 61 | 62 | /* USER CODE END EM */ 63 | 64 | /* Exported functions prototypes ---------------------------------------------*/ 65 | void NMI_Handler(void); 66 | void HardFault_Handler(void); 67 | void MemManage_Handler(void); 68 | void BusFault_Handler(void); 69 | void UsageFault_Handler(void); 70 | void SVC_Handler(void); 71 | void DebugMon_Handler(void); 72 | void PendSV_Handler(void); 73 | void SysTick_Handler(void); 74 | void CAN_TX_IRQHandler(void); 75 | void CAN_RX0_IRQHandler(void); 76 | void TIM17_IRQHandler(void); 77 | /* USER CODE BEGIN EFP */ 78 | 79 | /* USER CODE END EFP */ 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* __STM32F3xx_IT_H */ 86 | 87 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 88 | -------------------------------------------------------------------------------- /BOOT/STM32F373VC_FLASH.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ***************************************************************************** 3 | ** 4 | 5 | ** File : stm32_flash.ld 6 | ** 7 | ** Abstract : Linker script for STM32F373VC Device with 8 | ** 256KByte FLASH, 32KByte RAM 9 | ** 10 | ** Set heap size, stack size and stack location according 11 | ** to application requirements. 12 | ** 13 | ** Set memory bank area and size if external memory is used. 14 | ** 15 | ** Target : STMicroelectronics STM32 16 | ** 17 | ** Environment : Atollic TrueSTUDIO(R) 18 | ** 19 | ** Distribution: The file is distributed as is, without any warranty 20 | ** of any kind. 21 | ** 22 | ** (c)Copyright Atollic AB. 23 | ** You may use this file as-is or modify it according to the needs of your 24 | ** project. This file may only be built (assembled or compiled and linked) 25 | ** using the Atollic TrueSTUDIO(R) product. The use of this file together 26 | ** with other tools than Atollic TrueSTUDIO(R) is not permitted. 27 | ** 28 | ***************************************************************************** 29 | */ 30 | 31 | /* Entry Point */ 32 | ENTRY(Reset_Handler_BTLD) 33 | 34 | /* Highest address of the user mode stack */ 35 | _estack = 0x20008000; /* end of RAM */ 36 | /* Generate a link error if heap and stack don't fit into RAM */ 37 | _Min_Heap_Size = 0x200; /* required amount of heap */ 38 | _Min_Stack_Size = 0x400; /* required amount of stack */ 39 | 40 | /* Specify the memory areas */ 41 | MEMORY 42 | { 43 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K 44 | FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 32K 45 | } 46 | 47 | /* Define output sections */ 48 | SECTIONS 49 | { 50 | /* The startup code goes first into FLASH */ 51 | .isr_vector : 52 | { 53 | . = ALIGN(4); 54 | KEEP(*(.isr_vector)) /* Startup code */ 55 | . = ALIGN(4); 56 | } >FLASH 57 | 58 | /* The program code and other data goes into FLASH */ 59 | .text : 60 | { 61 | . = ALIGN(4); 62 | *(.text) /* .text sections (code) */ 63 | *(.text*) /* .text* sections (code) */ 64 | *(.glue_7) /* glue arm to thumb code */ 65 | *(.glue_7t) /* glue thumb to arm code */ 66 | *(.eh_frame) 67 | 68 | KEEP (*(.init)) 69 | KEEP (*(.fini)) 70 | 71 | . = ALIGN(4); 72 | _etext = .; /* define a global symbols at end of code */ 73 | } >FLASH 74 | 75 | /* Constant data goes into FLASH */ 76 | .rodata : 77 | { 78 | . = ALIGN(4); 79 | *(.rodata) /* .rodata sections (constants, strings, etc.) */ 80 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ 81 | . = ALIGN(4); 82 | } >FLASH 83 | 84 | .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH 85 | .ARM : { 86 | __exidx_start = .; 87 | *(.ARM.exidx*) 88 | __exidx_end = .; 89 | } >FLASH 90 | 91 | .preinit_array : 92 | { 93 | PROVIDE_HIDDEN (__preinit_array_start = .); 94 | KEEP (*(.preinit_array*)) 95 | PROVIDE_HIDDEN (__preinit_array_end = .); 96 | } >FLASH 97 | .init_array : 98 | { 99 | PROVIDE_HIDDEN (__init_array_start = .); 100 | KEEP (*(SORT(.init_array.*))) 101 | KEEP (*(.init_array*)) 102 | PROVIDE_HIDDEN (__init_array_end = .); 103 | } >FLASH 104 | .fini_array : 105 | { 106 | PROVIDE_HIDDEN (__fini_array_start = .); 107 | KEEP (*(SORT(.fini_array.*))) 108 | KEEP (*(.fini_array*)) 109 | PROVIDE_HIDDEN (__fini_array_end = .); 110 | } >FLASH 111 | 112 | /* used by the startup to initialize data */ 113 | _sidata = LOADADDR(.data); 114 | 115 | /* Initialized data sections goes into RAM, load LMA copy after code */ 116 | .data : 117 | { 118 | . = ALIGN(4); 119 | _sdata = .; /* create a global symbol at data start */ 120 | *(.data) /* .data sections */ 121 | *(.data*) /* .data* sections */ 122 | 123 | . = ALIGN(4); 124 | _edata = .; /* define a global symbol at data end */ 125 | } >RAM AT> FLASH 126 | 127 | 128 | /* Uninitialized data section */ 129 | . = ALIGN(4); 130 | .bss : 131 | { 132 | /* This is used by the startup in order to initialize the .bss secion */ 133 | _sbss = .; /* define a global symbol at bss start */ 134 | __bss_start__ = _sbss; 135 | *(.bss) 136 | *(.bss*) 137 | *(COMMON) 138 | 139 | . = ALIGN(4); 140 | _ebss = .; /* define a global symbol at bss end */ 141 | __bss_end__ = _ebss; 142 | } >RAM 143 | 144 | /* User_heap_stack section, used to check that there is enough RAM left */ 145 | ._user_heap_stack : 146 | { 147 | . = ALIGN(4); 148 | PROVIDE ( end = . ); 149 | PROVIDE ( _end = . ); 150 | . = . + _Min_Heap_Size; 151 | . = . + _Min_Stack_Size; 152 | . = ALIGN(4); 153 | } >RAM 154 | 155 | 156 | 157 | /* Remove information from the standard libraries */ 158 | /DISCARD/ : 159 | { 160 | libc.a ( * ) 161 | libm.a ( * ) 162 | libgcc.a ( * ) 163 | } 164 | 165 | .ARM.attributes 0 : { *(.ARM.attributes) } 166 | } 167 | 168 | 169 | -------------------------------------------------------------------------------- /BOOT/Src/btld.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/effenco/stm32-can-bootloader/106bf5828c6193284f40027c85a628ba04a17207/BOOT/Src/btld.c -------------------------------------------------------------------------------- /BOOT/Src/syscalls.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/effenco/stm32-can-bootloader/106bf5828c6193284f40027c85a628ba04a17207/BOOT/Src/syscalls.c -------------------------------------------------------------------------------- /BOOT/syscalls.c: -------------------------------------------------------------------------------- 1 | /** 2 | ***************************************************************************** 3 | ** 4 | ** File : syscalls.c 5 | ** 6 | ** Abstract : System Workbench Minimal System calls file 7 | ** 8 | ** For more information about which c-functions 9 | ** need which of these lowlevel functions 10 | ** please consult the Newlib libc-manual 11 | ** 12 | ** Environment : System Workbench for MCU 13 | ** 14 | ** Distribution: The file is distributed as is without any warranty 15 | ** of any kind. 16 | ** 17 | ***************************************************************************** 18 | ** 19 | **

© COPYRIGHT(c) 2014 Ac6

20 | ** 21 | ** Redistribution and use in source and binary forms, with or without modification, 22 | ** are permitted provided that the following conditions are met: 23 | ** 1. Redistributions of source code must retain the above copyright notice, 24 | ** this list of conditions and the following disclaimer. 25 | ** 2. Redistributions in binary form must reproduce the above copyright notice, 26 | ** this list of conditions and the following disclaimer in the documentation 27 | ** and/or other materials provided with the distribution. 28 | ** 3. Neither the name of Ac6 nor the names of its contributors 29 | ** may be used to endorse or promote products derived from this software 30 | ** without specific prior written permission. 31 | ** 32 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 33 | ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 34 | ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 35 | ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 36 | ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 37 | ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 38 | ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 39 | ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 40 | ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 41 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 42 | ** 43 | ***************************************************************************** 44 | */ 45 | 46 | /* Includes */ 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | 56 | 57 | /* Variables */ 58 | //#undef errno 59 | extern int errno; 60 | extern int __io_putchar(int ch) __attribute__((weak)); 61 | extern int __io_getchar(void) __attribute__((weak)); 62 | 63 | register char * stack_ptr asm("sp"); 64 | 65 | char *__env[1] = { 0 }; 66 | char **environ = __env; 67 | 68 | 69 | /* Functions */ 70 | void initialise_monitor_handles() 71 | { 72 | } 73 | 74 | int _getpid(void) 75 | { 76 | return 1; 77 | } 78 | 79 | int _kill(int pid, int sig) 80 | { 81 | errno = EINVAL; 82 | return -1; 83 | } 84 | 85 | void _exit (int status) 86 | { 87 | _kill(status, -1); 88 | while (1) {} /* Make sure we hang here */ 89 | } 90 | 91 | int _read (int file, char *ptr, int len) 92 | { 93 | int DataIdx; 94 | 95 | for (DataIdx = 0; DataIdx < len; DataIdx++) 96 | { 97 | *ptr++ = __io_getchar(); 98 | } 99 | 100 | return len; 101 | } 102 | 103 | int _write(int file, char *ptr, int len) 104 | { 105 | int DataIdx; 106 | 107 | for (DataIdx = 0; DataIdx < len; DataIdx++) 108 | { 109 | __io_putchar(*ptr++); 110 | } 111 | return len; 112 | } 113 | 114 | caddr_t _sbrk(int incr) 115 | { 116 | extern char end asm("end"); 117 | static char *heap_end; 118 | char *prev_heap_end; 119 | 120 | if (heap_end == 0) 121 | heap_end = &end; 122 | 123 | prev_heap_end = heap_end; 124 | if (heap_end + incr > stack_ptr) 125 | { 126 | // write(1, "Heap and stack collision\n", 25); 127 | // abort(); 128 | errno = ENOMEM; 129 | return (caddr_t) -1; 130 | } 131 | 132 | heap_end += incr; 133 | 134 | return (caddr_t) prev_heap_end; 135 | } 136 | 137 | int _close(int file) 138 | { 139 | return -1; 140 | } 141 | 142 | 143 | int _fstat(int file, struct stat *st) 144 | { 145 | st->st_mode = S_IFCHR; 146 | return 0; 147 | } 148 | 149 | int _isatty(int file) 150 | { 151 | return 1; 152 | } 153 | 154 | int _lseek(int file, int ptr, int dir) 155 | { 156 | return 0; 157 | } 158 | 159 | int _open(char *path, int flags, ...) 160 | { 161 | /* Pretend like we always fail */ 162 | return -1; 163 | } 164 | 165 | int _wait(int *status) 166 | { 167 | errno = ECHILD; 168 | return -1; 169 | } 170 | 171 | int _unlink(char *name) 172 | { 173 | errno = ENOENT; 174 | return -1; 175 | } 176 | 177 | int _times(struct tms *buf) 178 | { 179 | return -1; 180 | } 181 | 182 | int _stat(char *file, struct stat *st) 183 | { 184 | st->st_mode = S_IFCHR; 185 | return 0; 186 | } 187 | 188 | int _link(char *old, char *new) 189 | { 190 | errno = EMLINK; 191 | return -1; 192 | } 193 | 194 | int _fork(void) 195 | { 196 | errno = EAGAIN; 197 | return -1; 198 | } 199 | 200 | int _execve(char *name, char **argv, char **env) 201 | { 202 | errno = ENOMEM; 203 | return -1; 204 | } 205 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Effenco 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # stm32-can-bootloader 2 | can bootloader for use with stm32 microcontrollers 3 | 4 | everything in this repo will be specific for use with STM32F373VCT6 MCU but you can follow the migration guide to use it with any stm32 except series that uses the M0 core (because of the lack of the SCB->VTOR register) 5 | 6 | ## Getting Started/Prerequisites 7 | 8 | ### Software tools 9 | This project uses the free tools from ST and the STM32 HAL library from ST. This can be easily ported to another compiler/ide. 10 | 11 | Install CubeMx from ST website : https://www.st.com/en/development-tools/stm32cubemx.html 12 | Install Atollic Truestudio from Atollic/stm32 website : https://atollic.com/truestudio/ 13 | 14 | furthermore, to use the loader, you will need a python environement, we suggest Anaconda : https://www.anaconda.com/distribution/ 15 | 16 | you will also need the following python packages (install using pip in the anaconda prompt): 17 | * pip install intelhex 18 | * pip install crcmod 19 | * pip install python-can 20 | 21 | ### Project organisation 22 | 23 | #### BOOT 24 | Contain the bootloader project. 25 | You can build this using atollic. 26 | 27 | #### APP 28 | Contain a demo application to load. 29 | You can build this using atollic. 30 | 31 | #### LOADER 32 | Contain the python script used to load the application using the bootloader. 33 | 34 | ### Hardware 35 | 36 | #### Target 37 | 38 | You will need any Board with a STM32F373VCT (otherwise you can port using the Migration guide). 39 | 40 | ##### default configurations are : 41 | 42 | you can see this graphically using STM32CubeMx in the .ioc file 43 | * SWDIO on pin PA13 (72) 44 | * SWCLK on pin PA14 (76) 45 | * a RGB led on pins PA15 (77) ,PC10 (78) and PC11(79) 46 | * CANrx on pin PD0 (81) 47 | * CANtx on pin PD1(82) 48 | 49 | CAN bitrate is set at 500 kbps but can be adjusted in STM32CubeMx 50 | 51 | #### Debug adapter 52 | 53 | ST-link/V2 usb swd adapter is used to program and debug. see "Debug configurations" section for more informations. 54 | 55 | #### CAN-USB Adapter 56 | 57 | We use the pcan-usb adapter from Peak system, but any adapter supported by the pyhton-can library will work with minor change to the loader script (just one line). 58 | https://www.peak-system.com/PCAN-USB.199.0.html?&L=1 59 | 60 | ## Bootloader information 61 | Flash memory organisation (STM32F373VCT6) 62 | 63 | 0x8040000 -> +-------------+ 64 | | 0x803F000 | \ 65 | | to | \ 66 | | 0x803FFFF | |- Reserved for other informations 67 | | 4 KB | / 68 | | data | / 69 | 0x803F000 -> +-------------+ 70 | | | \ 71 | | | \ 72 | | | | 73 | | | | 74 | | 0x8008000 | | 75 | | to | | 76 | | 0x803EFFF | |- Contain the application software 77 | | 220 KB | | 78 | | application | | 79 | | | | 80 | | | | 81 | | | / 82 | | | / 83 | 0x8008000 -> +-------------+ 84 | | | \ 85 | | 0x8000000 | \ 86 | | to | | 87 | | 0x8007FFF | |- Contain bootloader software 88 | | 32 KB | | 89 | | bootloader | / 90 | | | / 91 | 0x8000000 -> +-------------+ 92 | 93 | ## Debug configurations 94 | 95 | three debug configurations are provided, in atollic, use right-click and "debug as" and "Debug configurations" to choose the one ou wish to use at the moment. 96 | 97 | ### BOOT Debug configuration 98 | 99 | Use this configuration to load and debug the Bootloader only 100 | 101 | ### APP Debug configuration 102 | 103 | Use this configuration to load and debug the demo application only (won't boot after disconnected from st-link/V2 because there will be nothing at address 0x8000000) 104 | 105 | ### BOOT+APP Debug configuration 106 | 107 | Use this to load the complete bootloader and demo application. 108 | 109 | ## Using the bootloader 110 | 111 | * edit the loader script with the path of the hex file to load 112 | * Start the loader script 113 | * Reboot the board in your prefered way 114 | 115 | ## Special guidelines 116 | * No merge to Master branch on fridays 117 | * don't drink and commit 118 | * Commit responsibly 119 | 120 | ## Migration guide 121 | 122 | migration guide will be added soon. 123 | 124 | ## FAQ 125 | 126 | None at the moment 127 | 128 | -------------------------------------------------------------------------------- /SCRIPTS/GetBin.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Created on Wed Mar 13 07:26:47 2019 5 | 6 | @author: frainville 7 | 8 | library requirements 9 | python3 -m pip install intelhex 10 | python3 -m pip install crcmod 11 | 12 | """ 13 | 14 | import re 15 | import os 16 | from intelhex import IntelHex 17 | import crcmod 18 | 19 | SOURCEFOLDER = "C:\\github\\stm32-can-bootloader\\APP\\Debug" 20 | 21 | HEX_file = "" 22 | HEX = "" 23 | outputstr = "" 24 | 25 | # browse BTLD_PROJECT folder for all .hex files 26 | temp_list = os.listdir(SOURCEFOLDER) 27 | 28 | hexfound=0 29 | 30 | hex_list=[] 31 | for file in temp_list: 32 | # Check extension 33 | if os.path.splitext(file)[1]==".hex": 34 | hex_list.append(file) 35 | hexfound=1 36 | 37 | # if no .hex file display error message and exit script 38 | if hexfound==0: 39 | print(f'!!! No hex files found in {BTLD_PROJECT} folder, script will stop !!!') 40 | quit() 41 | 42 | # list all .hex files and input which file to use from user 43 | print(f'list of .hex file found in {SOURCEFOLDER} :') 44 | 45 | for idx,file in enumerate(hex_list): 46 | print(f'\t{idx} {file}') 47 | 48 | HEX_file = hex_list[0] 49 | 50 | print(f'{HEX_file} will be used!\n') 51 | 52 | # read selected .hex file and copy content in BTLD_HEX 53 | # BTLD_HEX_file 54 | path=os.path.join(f'{SOURCEFOLDER}',f'{HEX_file}') 55 | f = open(path,"r") 56 | HEX=f.read() 57 | f.close() 58 | 59 | # Copy HEX to outputstr 60 | outputstr=HEX 61 | 62 | # convert hex to bin 63 | ih=IntelHex() 64 | ih.fromfile(path,format='hex') 65 | bf=ih.tobinarray() 66 | 67 | #pad the array (flash size) for CRC calculation 220kb 68 | while len(bf)<(220*1024): 69 | bf.append(255) 70 | 71 | # calculate checksum for APP_HEX 72 | crc32_func=crcmod.mkCrcFun(int(0x104c11db7),initCrc=int(0xffffffff),rev=False,xorOut=0) 73 | 74 | CHECKSUM=crc32_func(bytearray(bf)) 75 | CHECKSUM=f'0x{CHECKSUM:X}' 76 | 77 | #make filename 78 | output_hex_file=f'{os.path.splitext(HEX_file)[0]} {CHECKSUM}.bin' 79 | 80 | # save Binfile 81 | f = open(output_hex_file,'w+b') 82 | #binary_format =bytearray(bf) 83 | #f.write(binary_format) 84 | f.write(bf) 85 | f.close() 86 | -------------------------------------------------------------------------------- /SCRIPTS/MakeNewHex.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Created on Wed Mar 13 07:26:47 2019 5 | 6 | @author: frainville 7 | 8 | library requirements 9 | python3 -m pip install intelhex 10 | python3 -m pip install crcmod 11 | 12 | """ 13 | 14 | import re 15 | import os 16 | from intelhex import IntelHex 17 | import crcmod 18 | 19 | BTLD_PROJECT = "BOOT" 20 | APP_PROJECT = "APP" 21 | ProjectPath = 'C:\\github\\stm32-can-bootloader' 22 | 23 | def clean_hex_from_folder(folder): 24 | 25 | print(f'Cleaning {folder}') 26 | old_path=os.getcwd() 27 | 28 | # browse BTLD_PROJECT folder for all .hex files 29 | temp_list = os.listdir(folder) 30 | 31 | hexfound=0 32 | 33 | os.chdir(folder) 34 | 35 | hex_list=[] 36 | for file in temp_list: 37 | # Check extension 38 | if os.path.splitext(file)[1]==".hex": 39 | hex_list.append(file) 40 | hexfound=1 41 | 42 | # if no .hex file display error message and exit script 43 | if hexfound==0: 44 | print(f'No hex files found in {BTLD_PROJECT} folder') 45 | else: 46 | for file in hex_list: 47 | os.remove(file) 48 | print(f'Removed {file}') 49 | 50 | os.chdir(old_path) 51 | 52 | def cleanAll(): 53 | clean_hex_from_folder(BTLD_PROJECT) 54 | clean_hex_from_folder(APP_PROJECT) 55 | clean_hex_from_folder(os.getcwd()) 56 | 57 | def CopyHexRelease(project): 58 | old_path=os.getcwd() 59 | os.chdir(project) 60 | 61 | [hexfound, hexlist]=GetHexList('Debug') 62 | 63 | if hexfound==0: 64 | # if no .hex file display error message and exit script 65 | print(f'!!! No hex files found in {project}\Debug folder, script will stop !!!') 66 | os.chdir(old_path) 67 | return 0 68 | else: 69 | # list all .hex files and input which file to use from user 70 | print(f'list of .hex file found in {project}\Debug :') 71 | 72 | for idx,file in enumerate(hexlist): 73 | print(f'\t{idx} {file}') 74 | 75 | HEX_file = hexlist[0] 76 | 77 | print(f'{HEX_file} will be used!\n') 78 | 79 | # read selected .hex file and copy content in BTLD_HEX 80 | # BTLD_HEX_file 81 | path=os.path.join('Debug',f'{HEX_file}') 82 | f = open(path,"r") 83 | HEX=f.read() 84 | f.close() 85 | 86 | # Copy HEX to outputstr 87 | outputstr=HEX 88 | 89 | CHECKSUM=GetHexCrc(path) 90 | 91 | #make filename 92 | output_hex_file=f'{os.path.splitext(HEX_file)[0]} {CHECKSUM}.hex' 93 | 94 | print(f'Output will be {output_hex_file}\n') 95 | 96 | # save outputstr 97 | f = open(output_hex_file,'w+') 98 | f.write(outputstr) 99 | f.close() 100 | 101 | os.chdir(old_path) 102 | return 1 103 | 104 | def GetHexCrc(file): 105 | # convert hex to bin 106 | ih=IntelHex() 107 | ih.fromfile(file,format='hex') 108 | bf=ih.tobinarray() 109 | 110 | #pad the array (flash size) for CRC calculation 220kb 111 | while len(bf)<(220*1024): 112 | bf.append(255) 113 | 114 | # calculate checksum for APP_HEX 115 | crc32_func=crcmod.mkCrcFun(int(0x104c11db7),initCrc=int(0xffffffff),rev=False,xorOut=0) 116 | 117 | checksum_val=crc32_func(bytearray(bf)) 118 | checksum_val=f'0x{checksum_val:X}' 119 | 120 | return checksum_val 121 | 122 | def GetHexList(folder): 123 | # browse BTLD_PROJECT folder for all .hex files 124 | temp_list = os.listdir(folder) 125 | 126 | found=0 127 | 128 | hex_list=[] 129 | for file in temp_list: 130 | # Check extension 131 | if os.path.splitext(file)[1]==".hex": 132 | hex_list.append(file) 133 | found=1 134 | return [found,hex_list] 135 | 136 | def MakeCombinedHex(prj_a,prj_b): 137 | 138 | [a_found,a_list] = GetHexList(prj_a) 139 | 140 | if a_found==0: 141 | print(f'!!! No hex files found in {prj_a} folder, script will stop !!!') 142 | return 0 143 | 144 | print(f'list of .hex file found in {prj_a} :') 145 | 146 | printlist(a_list) 147 | 148 | if len(a_list)==1: 149 | A_HEX_file = a_list[0] 150 | else: 151 | #prompt 152 | user_number = input('which file do you wish to use? :') 153 | if( user_number.isdigit()): 154 | user_number=int(user_number) 155 | if user_number>=0 and user_number=0 and user_number