Furthermore, if I choose FreeRtos instead of ThreadX the problem completely goes away.
1 of 1 people found this helpful
Yes it is true that the "-debug" option on "Make Target" disables the optimization so that the code could be debugged. The "-debug" disables the optimization in the build string.
For detailed optimization setting could be found in ../tools/makefiles/wiced_toolchain_ARM_GNU.mk.
The COMPILER_SPECIFIC_UNOPTIMIZED_CFLAGS and COMPILER_SPECIFIC_OPTIMIZED_CFLAGS sets the optimization off and optimization on respectively.