arm - What are the steps to setup an RTOS application on STM32 using Linux and Makefiles instead of using Windows based IDEs? -


i using stm32f4 discovery board develop simple application on-board accelerometer while simultaneously lighting respective leds mounted around accelerometer device. want use rtos unable decide 1 since new using rtos.

if elaborate steps start project using linux , makefiles, appreciated.

here steps start project using linux , makefiles:

step 1: toolchain

on ubuntu:

apt-get install gcc-arm-none-eabi 

or on launchpad:

wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q1-update/+download/gcc-arm-none-eabi-4_9-2015q1-20150306-linux.tar.bz2 tar xjf gcc-arm-none-eabi-4_9-2015q1-20150306-linux.tar.bz2 

step 2: needed sources

step 2.1: standard library

you can choose stm32f4 dsp , standard peripherals library

or, can use library libopencm3.

step 2.2: rtos

the common use freertos.

step 3: create makefile

just that:

cross_compile=arm-none-eabi-  src := myapp.c src += <the needed library files> src += <the needed freertos files>  myapp.elf: myapp.bin         $(cross_compile)objcopy -obinary $@ $<  myapp.bin: $(src:%.c=%.o)         $(cross_compile)gcc -mthumb -nostartfiles -wl,--gc-sections $^ -o $@  %.o: %.c         $(cross_compile)gcc -mthumb -ffunction-sections -fdata-sections -fno-common -os -c $< -o $@ 

you should add -i or -l fix 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 example project in demo/cortex_m4f_stm32f407zg-sk can you.

step 4: build

add toolchain directory in path , run makefile:

export path="$path:/path/to/toochain/bin" make 

step 5: flash

you have use dfu mode of stm32f4.

install tool on ubuntu apt-get install dfu-util can flash elf file using:

sudo dfu-util -a 0 -s 0x08000000 -d myapp.elf 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -