paulgoulpie wrote on Wednesday, May 15, 2019:
Hello,
I have a problem regarding the selection of the GCC compiler optimization setting compared to the stack consumption of FreeRTOS tasks.
My architecture is
- a STM32F407 with active hard FPU
- the compiler is GCC (GNU Tools for Arm Embedded Processors 7-2018-q2-update) version 7.3.1
- the version of FreeRTOS is FreeRTOSv10.2.1.
- I use the heap5 to exploit the STM32F407’s CCMRAM zone for hosting the FreeRTOS heap.
During my development phases I use the -Og compilation option (optimized for debug).
During my release phases I use the -Os compilation option (optimized for size).
I notice that by switching from one optimization mode to another, I have big differences in consumption in the FreeRTOS task stack.
In optimization mode -Os, it consumes more stack than in -Og mode. There would be an option to disable an optimization parameter to enter or another trick in order to preserve the consumption in stack.
Thanking you.
Paul Goulpié