This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF Mesh crash on publishing lightness when using bt_mesh_lightness_cli_light_set.


I'm trying to publish values using a predefined message context.

This works fine when using bt_mesh_onoff_srv_pub or bt_mesh_lvl_srv_pub, but I get a crash as soon as I use bt_mesh_lightness_srv_pub.

So using this mesage context:

This works fine:

But this crashes:

I was able to somewhat track down the crash and the first crash seems to appear in the function ccm_auth in aes_ccm.c.

Sadly as I'm working with the nRF Dongle I don't get any output before the crash unless I'm adding a significant delay (2 seconds) at specific points before the crash. Doing this I was able to dig deeper and deeper into the SDK and find the abovementioned function.

But why would the encryption crash here? And why doesn't it crash for generic level and generic onoff models just the same?

I'm using a valid lightness server that is configured exactly the same as all other server models. Getting and setting works just fine from the app as well as from a client on the same chip. But publishing crashes.

Thanks in advance


I've tried to reduce potential error sources and thereby removed the context entirely. Instead I used the nRF Mesh App to set publication parameters.

These were set as follows:

I also reduced the input value to a constant, which kleaves the call as follows:

The node was reset, only the lightness server and a lightness client got an appkey assigned, publication was only set for lightness server.

The problem still stands, the chip crashes somewhere in bt_mesh_lightness_srv_pub, likely somewhere in the encryption part.

SDK used: nRF Connect SDK 1.9.1


Actually I've just found out, that this seems to be a problem when using both 

bt_mesh_lightness_srv_pub and bt_mesh_lightness_cli_light_set. The latter doesn't even set the value correctly at all even when standing alone.
I have now used the generic level client instead, as this at least setz the values correctly
However it still crashes when I introduce the publishing function for lightness.
Found out that it for some reason seems to be a scoping error. Using pointers instead of values solved the problem on my end. Apparently I don't understand C scoping when it comes to static/non-static functions well enough.