This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

What's the use of NRF_MESH_ASSERT_DEBUG(*p_flags & MESH_CONFIG_ENTRY_FLAG_BUSY);?

Hello, we are using nordic SDK 16.0 and mesh SDK 4.2.0.

In our project, sometimes at the start of the program, we are running into line 280 of mesh_config.c, a debug assert that looks for *p_flags & MESH_CONFIG_ENTRY_FLAG_BUSY.

Why is this assert checked only in debug mode? What is this even doing? Can we safely comment this out and continue running the project in debug mode while we develop it or is it a sign of something that is wrong with our project? What happens if the MESH_CONFIG_ENTRY_FLAG_BUSY flag is up and we proceed anyway without asserting?

Thank you

Parents Reply
  • Sorry, I think I was not notified of this answer. This only happened sometimes but always in debug mode. I think it is a feature of the function not being triggered in release mode. Check here, line 80 of nrf_mesh_assert.h:

    /**
    * Run-time assertion for debug use.
    * Debug assertions are only run if the stack is compiled in debug mode.
    */
    #ifdef NDEBUG /* The NDEBUG define is added automatically when compiling in release mode. */
    #define NRF_MESH_ASSERT_DEBUG(cond) (void) (cond)
    #else
    #define NRF_MESH_ASSERT_DEBUG(cond) NRF_MESH_ASSERT(cond)
    #endif

Children
Related