Adapt the base project to STM32L0xx microcontrollers - Willeby/GNU_ARM_Eclipse GitHub Wiki
The previously generated ARM Cortex-M0+ project needs to be adapted to the STM32L0xx processor familiy standards. ST provides the vendor specific files which can be used to adapt the project.
-
Download the mentioned files from ST's website: STM32CubeL0
-
Replace the generated Application with the code from a blinky example
- Delete all files in
/srcand/include - Drag
main.candstm32l0xx_it.cfromSTM32Cube_FW_L0_V1.7.0\Projects\STM32L053R8-Nucleo\Examples\GPIO\GPIO_IOToggle\Srcinto/srcin eclipse and selectCopy Files - Drag all files from
STM32Cube_FW_L0_V1.7.0\Projects\STM32L053R8-Nucleo\Examples\GPIO\GPIO_IOToggle\Incinto/includein eclipse and selectCopy Files
- Delete all files in
-
Add Board Support Package
- Drag
stm32l0xx_nucleo.cfromSTM32Cube_FW_L0_V1.7.0\Drivers\BSP\STM32L0xx_Nucleointo/srcin eclipse and selectCopy Files - Drag
stm32l0xx_nucleo.hfromSTM32Cube_FW_L0_V1.7.0\Drivers\BSP\STM32L0xx_Nucleointo/includein eclipse and selectCopy Files
- Drag
-
Replace the ARM CMSIS Drivers
- Delete
stm32l0xx.handsystem_stm32l0xx.hfrom/system/include/cmsis - Drag
stm32l0xx.h,stm32l053xx.handsystem_stm32l0xx.hfromSTM32Cube_FW_L0_V1.7.0\Drivers\CMSIS\Device\ST\STM32L0xx\Includeto/system/include/cmsisin eclipse and selectCopy Files - Delete
system_stm32l0xx.candvectors_stm32l0xx.cfrom/system/src/cmsis - Drag
system_stm32l0xx.cfromSTM32Cube_FW_L0_V1.7.0\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templatesto/system/src/cmsisin eclipse and selectCopy Files - Drag
startup_stm32l053xx.sfromSTM32Cube_FW_L0_V1.7.0\Drivers\CMSIS\Device\ST\STM32L0xx\Source\Templates\gccto/system/src/cmsisin eclipse and selectCopy Files- IMPORTANT Rename
startup_stm32l053xx.stostartup_stm32l053xx.Swith a capitalS
- IMPORTANT Rename
- Delete
-
Add HAL Drivers
- Drag all files from
STM32Cube_FW_L0_V1.7.0\Drivers\STM32L0xx_HAL_Driver\Srcto/system/src/stm32l0xxin eclipse and selectCopy Files - Drag all files from
STM32Cube_FW_L0_V1.7.0\Drivers\STM32L0xx_HAL_Driver\Incto/system/include/stm32l0xxin eclipse and selectCopy Files and Folders
- Drag all files from
-
Uncomment the
#define STM32L053xxin the filestm32l0xx.hinsystem/include/cmsison line92.
(This could also be done with a C Compiler Preprocessor Symbol) -
The link-editor file
mem.ldin/ldscriptsmust be changed from
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 64KtoFLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K -
The project can be compiled with
Project/Build All