1 Reply Latest reply on Nov 10, 2020 1:57 AM by ChunleiL_51

    NDEBUG and the assert macro

    JoBl_4817131

      Using WICED Studio 6.6 and the development kit CYW943907AEVAL1F. I have a couple of issues. First, NDEBUG is being set somewhere and I can't locate where. Second, because of NDEBUG being set the definition of the assert macro becomes: assert(__e)((void)0). When the expression given evaluates to false, execution continues normally and does not pass an error message and abort. Any help is appreciated!

        • 1. Re: NDEBUG and the assert macro
          ChunleiL_51

          Hi,

           

          NDEBUG is enabled in file wiced_toolchain_ARM_GNU.mk or wiced_toolchain_ARM_GNU.mk located at WICED-Studio-6.6\43xxx_Wi-Fi\tools\makefiles\ by default. Seach -DNDEBUG in these files and you will see them. We can see it's enabled only in Release target by default.

          And from the makefile note, you may explicitly activate option -debug to avoid being built in Release target, which gets you in current situation. See below for how to do it:

            Notes

              * Component names are case sensitive

              * 'WICED', 'SDIO', 'SPI' and 'debug' are reserved component names

              * Component names MUST NOT include space or '-' characters

              * Building for release is assumed unless '-debug' is appended to the target

              * Some platforms may only support a single interface bus option

           

            Example Usage

              Build for Release

                $> make snip.scan-BCM943362WCD4

                $> make snip.scan-BCM943362WCD4-ThreadX-NetX_Duo-SDIO

           

              Build for Debug

                $> make snip.scan-BCM943362WCD4-debug

           

          Best regards

          1 of 1 people found this helpful