- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am using Modus toolbox2.1 with PSoC6 BLE Pioneer kit.
If the compiler optimization options are changed, the following methods described in KBA229177 may not be effective?
CFLAGS=-Wall -O2
Described in "13. How do I pass compiler flags?"
Because gcc gives priority to the last option if multiple options that affect each other are used.
SOLUTION:
We need to set the optimization option in "CY_TOOLCHAIN OPTIMIZATION=" or place it as a new compile configuration in the GCC_ARM.mk file.
Thanks,
Kenshow
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Kenshow,
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
Regards,
Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Kenshow,
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
Regards,
Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dheeraj,
Yes, I did.
Thank you for your reply.
Regards,
Kenshow