2 Replies Latest reply on Jun 8, 2020 3:54 PM by NoTa_4591161

    About compile option setting of KBA229177

    NoTa_4591161

      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

        • 1. Re: About compile option setting of KBA229177
          DheerajK_81

          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

          1 of 1 people found this helpful
          • 2. Re: About compile option setting of KBA229177
            NoTa_4591161

            Hi Dheeraj,

             

            Yes, I did.

            Thank you for your reply.

             

            Regards,

            Kenshow