STM32F4 + GCC compilation problems

blackswords wrote on Saturday, December 08, 2012:

Hi,

I just got the STM32F4 discovery board and I wanted to try it out. I started with some led blinking and everything was working fine so I tried to compile a FreeRTOS project and I have some errors about not allowed instructions…

I’m using Yagarto with Eclipse on OS X. These are the errors I get :

instruction not allowed in IT block -- `msr psp,r0'
instruction not allowed in IT block -- `stmdb r0!,{r4-r11,r14}'
selected processor does not support Thumb mode `vldmiaeq r0!,{s16-s31}'
selected processor does not support Thumb mode `vstmdbeq r0!,{s16-s31}'

my compiler flags : -c -mthumb -mcpu=cortex-m4
my linker flags : -T “…/stm32_flash.ld” -mthumb -mcpu=cortex-m4 -Wl,-Map=linker.map -Wl,-cref -Wl,-gc-sections
my assembler flags : -mthumb -mcpu=cortex-m4 -g -Wa,-warn -x assembler-with-cpp

Does anyone have an idea to get rid of these errors?

davedoors wrote on Saturday, December 08, 2012:

These would be a typical set of options (assuming FPU is present and being used) for a new ARM GCC build. I don’t know which version Yagarto uses

-c -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -std=gnu90 -O0 -ffunction-sections -fdata-sections -g -Wall

blackswords wrote on Sunday, December 09, 2012:

Thanks, that’s working great with these flags!