NDEBUG and the assert macro

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JoBl_4817131
Level 1
Level 1

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!

0 Likes
1 Solution
Charles_Lai
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 sign-ins

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

View solution in original post

1 Reply
Charles_Lai
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 sign-ins

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