Forum: System Workbench for STM32

-Os gcc compilation breaks build in strcpy and FreeRTOS (in MacOS)

Hi,

I am trying to generate an optimised build, but I am facing issues with gcc optimisation.

-O0 all works fine, -Os, -O1, -O2, -O3 the build generates a hard fault.

I have traced it to strcpy first. Then disabled selectively the optimisation where those functions are called.

But then I have seen some parts of FreeRTOS also break, which seems weird to me.

am I missing something regarding the build options? anybody has found the same issue?

thanks,
E.-

It would be nice to know which instruction generates the hard fault. Is it a load/store instruction? Is it an unaligned access maybe?