Template project for STM32F4xx with Debugging in RAM and FLASH support. The project is set up for EM::BLOCKS (V1.43) with external GNU-ARM Compiler. However it will also work with the integrated ARM-Compiler.
This sample / template project will toggle GPIOG, GPIO_Pin_13, using Systick_Handler
To use the external Compiler select Menu Settings->Tools->Global Compiler Settings Select ARM GCC (generic) at the drop down menu Select tab Toolchain executables and set the path to the compiler executable. For example: C:\Program Files (x86)\GNU Tools ARM Embedded\4.8 2013q4\bin
Select tab Search directoroes and check the settings:
- $(TARGET_COMPILER_DIR)..\arm-none-eabi\include
- $(TARGET_COMPILER_DIR)..\arm-none-eabi
If they're missing, add them.
Setting DEBUG -> Debug in RAM
Setting RELEASE -> Debug or run in FLASH
To adapt the template project to your needs, edit
- the HSE_VALUE with the oscillator frequency in file "stm32f4xx.h" example: 8000000 => 8MHz
- system_stm32f4xx.c: typically only set PLL_M to the oscillator frequency in MHz (8 => 8MHz) eventually check and set PLL_N, PLL_P and PLL_Q and check SystemCoreClock
- stm32f4xx_conf.h uncomment the peripheral files if additional peripheral drivers are needed
- set STACK_SIZE in startup_stm32f4xx.c