1 of 1 people found this helpful
When you want to specify custom compiler optimization flags, please make sure you set the CONFIG option to "Custom" instead of "Debug". This line should have been mentioned in the KBA, I will fix that. Thanks for pointing it out
Once you do that the toolchain optimizations won't override the options you have specified. They only apply for Debug and Release build options as seen in this line of code in GCC_ARM.mk file:
ifeq ($(CONFIG),Debug) CY_TOOLCHAIN_DEBUG_FLAG=-DDEBUG CY_TOOLCHAIN_OPTIMIZATION=-Og else ifeq ($(CONFIG),Release) CY_TOOLCHAIN_DEBUG_FLAG=-DNDEBUG CY_TOOLCHAIN_OPTIMIZATION=-Os else CY_TOOLCHAIN_DEBUG_FLAG= CY_TOOLCHAIN_OPTIMIZATION= endif
Yes, I did.
Thank you for your reply.