Template project based on Eclipse New STM32F4xx C/C++ project wizard + FreeRTOS 8.2 sources. Tested on OS X Yosemite.
The original application, based on this FreeRTOS tutorial, should blink the green LED (PG13) with a period of 1.5s and toggle the red one (PG14) when the blue button (USER) is pressed. This happens in three separate FreeRTOS tasks: first one for the green LED, second one for detecting button presses and putting them in a queue and the third one for consuming the queued events and toggling the red LED.
-
Eclipse IDE for C/C++ Developers with:
- all plugins from the http://gnuarmeclipse.sourceforge.net/updates update site
- the C/C++ GCC Cross Compiler Support and C/C++ GDB Hardware Debugging plugins from http://download.eclipse.org/tools/cdt/releases/8.5
-
Clone this repository :)
-
Create a project in Eclipse:
-
go to File / New / C Project
-
choose Executable / New STM32F4xx C/C++ project
-
use stm32f4-freertos-starter for the Project name
-
uncheck Use default location and choose the location where you cloned this repository, then click Next
-
in the Chip family dropdown, choose STM32F429xx
-
in the Content dropdown, choose Empty (add your own content)
-
in the Trace output dropdown, choose Semihosting DEBUG channel, then click Next until the Cross GNU ARM toolchain screen
-
choose the GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc) in the Toolchain name dropdown
-
in the Toolchain path, give the path to the
bin
folder of your gcc-arm-none-eabi installation -
configure build settings - go to project properties / C/C++ Build / Settings.
Under Target processor:
- check the Thumb interwork (-mthumb-interwork) checkbox
- in Endianness select Little endian (-mlittle-endian)
- in Float ABI select FP instructions (hard)
- in FPU type select fpv4-sp-d16
Under Cross ARM C Compiler / Includes add the following to the Include paths:
../include/FreeRTOS/Source/include
../include/FreeRTOS/Source/portable/GCC/ARM_CM4F
-
If any of the project files were modified by Eclipse during the import, run
git reset --hard
to restore the original files. -
Go to project properties, then C/C++ General / Paths and Symbols / Source Location, locate and expand the
/stm32f4-freertos-starter/system
folder and clear its attached filter, if not empty (click Edit Filter..., select all withCMD+A
, click Remove) -
Build the project to check if everything works.
-
Create an OpenOCD debug configuration as described in this tutorial.
NOTE: on the OpenOCD Debugger tab, the value of Other options (which is called Config options in Eclipse Luna) should be -f board/stm32f429discovery.cfg
instead of what the tutorial suggests.
Use the created configuration to deploy the application to the board and debug it.
- @grajo
- https://istarc.wordpress.com/2014/07/10/stm32f4-deploy-freertos-in-under-10-seconds/
- http://grafixmafia.net/updated-using-the-stm32f4-discovery-board-with-mac-osx-10-9-mavericks/
- http://gnuarmeclipse.livius.net/blog/openocd-debugging/
- https://github.com/dobromyslov/stm32f0-cmsis-cube-hal-freertos-template