AnsweredAssumed Answered

Hard Fault only with Optimize More (-O2)

Question asked by bakin.andrew on Feb 23, 2016
Latest reply on Feb 29, 2016 by Clive One
This is strange: I have an application that works perfectly on every optimize level except Optimize More (-O2). A hard fault occurs when a particular thread is running. I have read about various causes for hard faults with FreeRTOS but I can't find any information relating to optimization levels.

As my application works with -O0, -O1, -O3 and -Os I won't lose any sleep over this but would like to know why.

Does anyone have any ideas why? My understanding is that the optimize levels beyond -O2 include -O2 optimizations, so how can -O3 work?

Here's my set up:

STM32F407VGT6
CooCox version 1.7.8
Toolchain : GNU ARM 4.9 2015q3



Outcomes