I am using STM32F4 Discovery board to develop a simple application to on-board accelerometer while simultaneously lighting respective LEDs mounted around the accelerometer device. I want to use any RTOS but I am unable to decide which one since I am new to using RTOS.
If anyone could elaborate the steps to start this project by using Linux and some Makefiles, that would be appreciated.
Here are the steps to start your project using Linux and Makefiles:
Step 1: Get a toolchain
On Ubuntu:
Or on launchpad:
Step 2: Get the needed sources
Step 2.1: The standard library
You can choose the STM32F4 DSP and standard peripherals library
Or, you can also use another library like libopencm3.
Step 2.2: The RTOS
The most common is to use FreeRTOS.
Step 3: Create the Makefile
Just do something like that:
You should add some
-I
or-L
to fix the include issue.The needed FreeRTOS files are:
list.c, queue.c, tasks.c, portable/MemMang/heap_4.c, portable/GCC/ARM_CM4F/port.c
There is a example project in the
Demo/CORTEX_M4F_STM32F407ZG-SK
which can help you.Step 4: Build
Add your toolchain directory in the path and run your Makefile:
Step 5: Flash
You have to use the DFU mode of the STM32F4.
Install the tool on Ubuntu with
apt-get install dfu-util
then you can flash yourelf
file by using: