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

nrf_mesh_disable() function changed since SDK for Mesh V3.1.0?

Hi,

I was wanting to know if this function has been changed since mesh SDK v2.2.1? It appears to not behave quite the same. When I call it, I think the mesh does not entirely get disabled as there is still something like ~8mA of current draw, when before it used to put the system in a state where it drew something like 600uA.

I had a poke into the nrf_mesh_disable() function and saw that scanner_disable() was no longer called. Is this the reason? I tried adding this call back into nrf_mesh_disable() and it caused an assert.

Any help would be greatly appreciated.

Parents
  • Hi Gordie, 

    As far as I can tell, the scanner will be automatically disabled after the timeslot has been ended (that what the nrf_mesh_disable() does) . So when testing here I can see that after I call nrf_mesh_disable() the device stayed in high current draw for a little while (about 10s before dropping the current down to the range of uA. This matches with the timeslot being stopped. 

  • Is there anyway to end the timeslot earlier than 10s? Its just that in mesh sdk 2.2.0, the nrf_mesh_disable() function caused the device to enter the lower power state much faster (less than one second)?

  • i added the code into the bootloader, at the start of bootloader_util_app_start().

    this appears to fix the issue, as the device goes to ~15uA as expected.

    DFU was still functional.

    we have a sensor on our board that draws a bit of current, so that is why the current might be higher than you expect.

    thanks!

  • Thanks for verifying. UART needs to be turned off by the bootloader before switching to application.

    I guess we didn't really pay much attention on power consumption when making the bootloader as it's a mesh application and usually main powered. I have reported this issue internally. 

  • Hi Hung, so just to confirm, after applying the suggested patch to bearer_handler.c, the correct way of enabling and disabling the mesh is now:

    // The proper sequence to disable mesh (immediately) is: 
    
    uint32_t retval = proxy_stop();
    
    if (retval == NRF_SUCCESS)
    {
    	//scanner_disable(); // not needed
    	retval = nrf_mesh_disable();
    }
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Disabling mesh: status: %d\n", retval);
    
    
    
    // And to enable: 
    
    //scanner_enable(); // not needed
    
    uint32_t retval = proxy_enable();
    
    if (retval == NRF_SUCCESS)
    {
    	retval = proxy_start();
    }
    
    if (retval == NRF_SUCCESS)
    {
    	retval = nrf_mesh_enable();
    }
    
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Enabling  mesh: status: %d\n", retval);

  • Hello,

    I work with SDK for mesh 4.0.0. I use the example code "light switch server". I just want to disable the Mesh stack and enable it when I want. When the mesh is disable I want sleep current so approx 4uA.
    I measure the current with the PPK on a DK.
    As you can see in the attached code. I made as recommended to disable the mesh. but I still get average +- 110 uA due to some peaks (see image attached, first image)).
    If I add  NRF_CLOCK->TASKS_HFCLKSTOP=1; NRF_UART0->TASKS_STOPRX= 1;
    I get no peaks but the average current increase to +- 400uA ... (see attached, second image).

    Can someone help me please !? I don't know what to do and this is very critical for my low power application !!

    int main(void)
    {
        initialize();
        start();
        //nrf_delay_ms(3000);
        uint32_t retval;
        retval = proxy_stop();
        //SEGGER_RTT_printf(0, "retval_stopproxy %d\n",retval);
        if (retval == NRF_SUCCESS)
        {
            retval = nrf_mesh_disable();
            //NRF_CLOCK->TASKS_HFCLKSTOP=1;
            //NRF_UART0->TASKS_STOPRX= 1;
        }
        //SEGGER_RTT_printf(0, "mesh_disable %d\n",retval);
        //scanner_radio_stop();
    
        for (;;)
        {
            (void)sd_app_evt_wait();
            //__WFE();
        }
    }

Reply
  • Hello,

    I work with SDK for mesh 4.0.0. I use the example code "light switch server". I just want to disable the Mesh stack and enable it when I want. When the mesh is disable I want sleep current so approx 4uA.
    I measure the current with the PPK on a DK.
    As you can see in the attached code. I made as recommended to disable the mesh. but I still get average +- 110 uA due to some peaks (see image attached, first image)).
    If I add  NRF_CLOCK->TASKS_HFCLKSTOP=1; NRF_UART0->TASKS_STOPRX= 1;
    I get no peaks but the average current increase to +- 400uA ... (see attached, second image).

    Can someone help me please !? I don't know what to do and this is very critical for my low power application !!

    int main(void)
    {
        initialize();
        start();
        //nrf_delay_ms(3000);
        uint32_t retval;
        retval = proxy_stop();
        //SEGGER_RTT_printf(0, "retval_stopproxy %d\n",retval);
        if (retval == NRF_SUCCESS)
        {
            retval = nrf_mesh_disable();
            //NRF_CLOCK->TASKS_HFCLKSTOP=1;
            //NRF_UART0->TASKS_STOPRX= 1;
        }
        //SEGGER_RTT_printf(0, "mesh_disable %d\n",retval);
        //scanner_radio_stop();
    
        for (;;)
        {
            (void)sd_app_evt_wait();
            //__WFE();
        }
    }

Children
Related