Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Mesh assert error at Light CTL Client example in MESH SDK V5.0

Iam facing mesh assert error if i call any function in super loop.

given code:

static void rtt_input_handler(int key)
{
uint32_t button_number = UINT32_MAX;

if (key >= '1' && key <= '9')
{
button_number = key - '1';
button_event_handler(button_number);
}
else if (key >= 'a' && key <= 'l')
{
button_number = key - 'a' + 0xa;
button_event_handler(button_number);
}

In main

for (;;)
{

if(key_flag)
{
button_event_handler(0x01);
key_flag =0x00;
}

(void)sd_app_evt_wait();
}

These statements running without errors. 

But when I change the code as below:

static void rtt_input_handler(int key)
{
uint32_t button_number = UINT32_MAX;

if (key >= '1' && key <= '9')
{
button_number = key - '1';
key_flag = 0x01;
}
else if (key >= 'a' && key <= 'l')
{
button_number = key - 'a' + 0xa;
button_event_handler(button_number);
}


else
{
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, m_usage_string);
}
}

In main:

for (;;)
{

if(key_flag)
{
button_event_handler(0x01);
key_flag =0x00;
}

(void)sd_app_evt_wait();
}

This results in errors after provisioning of devices, when i have given any of the commands.

My Observations: Whenever any mesh sdk apis are called other than call back functions then they result to these kind of issues.

Kindly reply with exact answer. as many tickets related to these type of issues are not resolved at customer end.

Related