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

mesh_stack_init and Low Power

Hello,

I'm working with the nRF5 SDK for Mesh v4.2.0.

During the init phase, I call the function mesh_stack_init()

After doing so, the consumption is on average 2.8 mA, even when doing :

    for (;;)
    {
        nrf_pwr_mgmt_run();
    }

And the MCU is never in idle state.

How to desactivate all the functions initialized by mesh_stack_init() in order to put the MCU in low power state ?

Thank you.

Parents Reply Children
  • Thank you for your answer.

    I tried this, and also to disable everything that I could, but it doesn't work.

    PS : I made a lot of research and tests before posting my question, and I wouldn't have posted it if there was a publicly available and functionnal answer.

  • Ok if you have done that and the current consumption still high, I suspect the high current was from something else. 

    Have you made sure you power reset the chip before you do the measurement ? After flashing the chip will remain in debug mode hence the CPU will stay awake regardless what you do. A power reset needed. 



  • The chip is not in debug mode. If I don't call the function mesh_stack_init(), the average power consumption is 2.3 µA.

    I did what you suggested :

    uint32_t retval = proxy_stop();
    if (retval == NRF_SUCCESS)
    {
    retval = nrf_mesh_disable();
    }

    And I still have an average power consumption of 2.8 mA.

    The INTENSET registers give me :

    <t:      14010>, main.c,  410, Peripherals enabled:
    <t:      14013>, main.c,  436,   RTC1:   	0x10002
    <t:      14016>, main.c,  460,   RNG:    	0x1
    <t:      14019>, main.c,  475,   MWU:    	0x1000001

    So, it seems that the stack is not disabled.

    I didn't find any example that disables the mesh stack. If you have one, I'm interested.

  • Hi,

    I added this:

     case 2:
            {
              uint32_t retval = proxy_stop();
    
              if (retval == NRF_SUCCESS)
    
              {
    
                  retval = nrf_mesh_disable();
                  if (retval != NRF_SUCCESS) 
                  {
                      __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "error = %d \n",retval);
                  }
    
    
              }
            break;
            }
            case 3:
            {
              retval = proxy_enable();
              if (retval == NRF_SUCCESS)
              {
                  retval = proxy_start();
              }
              if (retval == NRF_SUCCESS)
              {
                  retval = nrf_mesh_enable();
              }
               if (retval != NRF_SUCCESS)
               {
                __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "error = %d \n",retval);
                }
              break;
    
            }
    

    Into button_event_handler() in light_switch server in SDK v4.2 and I can see when I press button 2 on nRF52832 DK the current dropped down to a few uA. And pressing button 3 will wake it up again (up to 12mA). 
    (There is an issue when enabling it when it not provisioned that I'm looking into, but I guess it's not relevant to this thread)

    Please make sure you don't use RTT log when you measure the current, it would keep the CPU awake. 
    I attached the hex file here in case you need for testing. 

    5001.light_switch_server_nrf52832_xxAA_s132_7.0.1.hex

  • I did what you said, once more, and it still doesn't work.

    I also added in the callback of the NRF_MESH_EVT_DISABLED event  :

    mesh_adv_stop();
    scanner_disable();

    Some timer is still running and wakes up the MCU.

    Try to do something like this in your own code, and tell me if the LED blinks :

    for (;;)
    {
        nrf_pwr_mgmt_run();
        nrf_gpio_pin_toggle(LED_1);
        nrf_delay_ms(100);
    }

    How to be sure that the RTT log is not working ?

Related