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

mesh sdk api "nrf_mesh_node_config_clear()" not work

Hi All:

        i met a trouble. 

        i want to implement a function that  i can restore mesh device by uart cmd.

       so , i add uart to light switch service demo,  when i recive a cmd "AT+RESTORE", i will run nrf_mesh_node_config_clear() to clear flash data.

       but i failed. when i send AT+RESTORE to device.  the device  enter ASSERT(),   

      

      i don't know this is API problem or my problem.

     you function (nrf_mesh_node_config_clear()) can work properly?

  • Hi Jijang,

     

    We have seen similar kind of error in non mesh solutions when trying to access flash in multi context. I have asked the Mesh expert to look into this issue, to see if this is the case. Will come back to you soon when he responds

    Before, that can you please let me know which Mesh SDK version are you using?

  • Hi Jijang,

    you should call that function from main

    Currently, it is not possible to work in the different interrupt levels within stack algorithms. That causes impossibility nested handlers excluding high priority radio stuff. The issue has been reproduced in the current version because of the public API is invoked from the main loop in the example(with thread mcu priority). There is the limitation for calling the public API (see documentation subclause 'Interrupt priority levels').

    'Limitations

    Except for calling initialization related functions before entering the main loop, no mesh API functions must be called from an IRQ priority other than the one specified in the configuration. Breaking this rule may cause unpredictable behavior.'

  • Hi Aryan:

            Thank you for your answer. 

            My Mesh SDK is 1.0.1 ,  

            your means i call nrf_mesh_node_config_clear() in low interrupt (in main), then, high level interrupt triggerd and that operation flash. so happen this ?

            i  found that i commit sd_app_evt_wait();  will this affect normal work?

           i find this is can implement my need, when i commit net_state_reset();

        

          i do not understand, how do i call the mesh API , is the correct usage?

  • commenting out sd_app_evt_wait is ok, if you do not care much about the low power modes.

    commenting out net_state_reset is not ok since it will not reset the sequence number, flashed state and IV indexes

Related