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

How to put the nrf52832 into deep sleep mode

Hello,

I am currently using nRF52832 with SDK v11.0.0 and S132 v2.0.0. I am also using the soft device as my application requires. I have been trying to put the CPU into SYSTEM OFF mode using the following:

// Configure the "main" button:

nrf_gpio_cfg_sense_input( BUTTON_MAIN_PIN, NRF_GPIO_PIN_PULLUPNRF_GPIO_PIN_SENSE_LOW );

// Enter SYSTEM OFF mode

sd_power_system_off();

There is one major problem -- the system is still pulling a lot of current ~3.5mA. I don't understand what is going on. I read this in the manual, in section 18.2: "

Before entering System OFF mode, the user must make sure that all on-going EasyDMA transactions have been completed. This is usually accomplished by making sure that the EasyDMA enabled peripheral is not active when entering System OFF. "

Questions: -Am I using the correct function call for my version of the SDK to put the system in System OFF mode?

                  - Is the EasyDMA consuming that much current?! If so, how do I disable EasyDMA and ensure all transactions are complete?

                   - What other calls am I missing?

Parents
  • You can also use sd_nvic_SystemReset() at the start of your main() function. This should work in SDK 11.0.0 as well.

    The problem could be the EasyDMA, but I want to eliminate this possibility before going down that road. You want to get out of Debug mode, not into it.

    Best regards,

    Simon

  • Hi Simonr,

    Thank you for your reply. I put sd_nvic_SystemReset() at the very start of my main() function (to take the system out of debug mode) and now my app doesn't run at all (completely unresponsive). Looks like there's another piece of information that I may be missing here...

    For EasyDMA, I'm uninitializing + disabling all TWI and SPI resources before calling sd_power_system_off(). 

    Thanks,

    Sami

  • Of course putting the reset call in does not help you: it is in an endless boot loop now. Indeed, make sure your debugger is detached. You can do this with the IDE. If don't now how, for now, close it completely and reset your target manually.

  • Thank you for your reply. I made sure to flash my app into the target, then immediately remove the debugger, etc. I even detached the battery and reattached it, but still, same current consumption. 

    // Configure the "main" button:
        nrf_gpio_cfg_sense_input( BUTTON_MAIN_PIN,
                                  NRF_GPIO_PIN_PULLUP,
                                  NRF_GPIO_PIN_SENSE_LOW );
    
        // SWCLK
        // SWDIO
        nrf_gpio_cfg_input( CONSOLE_TX_PIN, NRF_GPIO_PIN_PULLDOWN );
        nrf_gpio_cfg_input( CONSOLE_RX_PIN, NRF_GPIO_PIN_PULLDOWN );
    
        // Turn off the NVM:
        bool stat = extNvm_enterDeepPowerDown( true );
    
        if ( stat == false )
        {
            APP_PRINTF( "extNvm_enterDeepPowerDown() failed\n" );
            // Log the error.
            logDevNoDesc( LIB_ORIG_BLE, stat, REG_ERR );
        }
    
        // Turn off the AMOLED:
        displayQDisplayOff( NULL, NULL );
    
        // Before entering System OFF mode, the user must make sure that all
        // on-going EasyDMA transactions have been completed. This is usually
        // accomplished by making sure that the EasyDMA enabled peripheral is not
        // active when entering System OFF and this is achieved by disabling TWIM
        // and SPI busses.
    
        i2c_master_uninit();
        spi_uninit();
    
        //sd_softdevice_disable();
        DebugConsole_Disable();
    
    
        uint32_t errCode = sd_power_system_off();
    
        if ( errCode != NRF_SUCCESS )
        {
            APP_PRINTF( "sd_power_system_off() failed\n" );
            // Log the error.
            logDevNoDesc( LIB_ORIG_BLE, errCode, FATAL_ERR );
        }

    There must be something else missing...going through the manual and devzone is all I have at this point.

Reply
  • Thank you for your reply. I made sure to flash my app into the target, then immediately remove the debugger, etc. I even detached the battery and reattached it, but still, same current consumption. 

    // Configure the "main" button:
        nrf_gpio_cfg_sense_input( BUTTON_MAIN_PIN,
                                  NRF_GPIO_PIN_PULLUP,
                                  NRF_GPIO_PIN_SENSE_LOW );
    
        // SWCLK
        // SWDIO
        nrf_gpio_cfg_input( CONSOLE_TX_PIN, NRF_GPIO_PIN_PULLDOWN );
        nrf_gpio_cfg_input( CONSOLE_RX_PIN, NRF_GPIO_PIN_PULLDOWN );
    
        // Turn off the NVM:
        bool stat = extNvm_enterDeepPowerDown( true );
    
        if ( stat == false )
        {
            APP_PRINTF( "extNvm_enterDeepPowerDown() failed\n" );
            // Log the error.
            logDevNoDesc( LIB_ORIG_BLE, stat, REG_ERR );
        }
    
        // Turn off the AMOLED:
        displayQDisplayOff( NULL, NULL );
    
        // Before entering System OFF mode, the user must make sure that all
        // on-going EasyDMA transactions have been completed. This is usually
        // accomplished by making sure that the EasyDMA enabled peripheral is not
        // active when entering System OFF and this is achieved by disabling TWIM
        // and SPI busses.
    
        i2c_master_uninit();
        spi_uninit();
    
        //sd_softdevice_disable();
        DebugConsole_Disable();
    
    
        uint32_t errCode = sd_power_system_off();
    
        if ( errCode != NRF_SUCCESS )
        {
            APP_PRINTF( "sd_power_system_off() failed\n" );
            // Log the error.
            logDevNoDesc( LIB_ORIG_BLE, errCode, FATAL_ERR );
        }

    There must be something else missing...going through the manual and devzone is all I have at this point.

Children
No Data
Related