Provisioning error in Light Switch server (NRF52832)

Hello! I am trying to run the "Light switch" example on a custom board.


My environment:
- nRF5 SDK v17.0.2
- nRF5 SDK for Mesh v5.0.0
- SoftDevice S132 v7.2.0
- NRF52832_xxAA (on custom board)
- Keil uVision 5.33.0 (Compiler v5)
- J-link debugger
- nRF Mesh App v3.1.6 for Android


I'm using Keil's built-in MDK. When trying to add a device to the network, nRF Mesh reports an error:

The example code remained unchanged, except for the fact that I commented out all calls related to the board (controlling the LEDs). After the error occurs, my log looks like this:


While debugging, I was able to figure out that the "m_device_provisioned" flag is set to "true" at this location:



However, after that, the GATT connection is closed, as evidenced by the call to the "a_link_close_notify" function, which informs subscribers about the NRF_MESH_PROV_LINK_CLOSE_REASON_ERROR error:



Call stack up to this function:



When compiling the project, I see that some of the declared sections do not have observers registered, but the project starts successfully:



I hope for your help!

  • Hi Hung,
    I can build the project in SES, but the application needs to be created using Keil, it is more convenient for our company to use this product, since it is our main IDE. In your example Mesh, there are .sct files intended for use in Keil, from which it can be concluded that the mesh can be worked with using Keil (For example: \examples\light_switch\server\linker\). I would like to understand what is the reason for not working correctly in Keil.Thanks!

  • Hi Dmitro, 

    The .sct file was there from the beginning when we planned to support both Keil and SES. Unfortunately there were no progress in adding KEIL support since 2017 when it was Mesh SDK v0.10. The last activity from what I can find internally was this blog.


    It might be possible to figure out why flash manager doesn't work when compiled with KEIL, but since it's a not tested compiler I would strongly suggest to use gcc or SES to compile the project. 

Related