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

how to wake up from sleep mode

hi.....

i am using nrf52832 ........

i want to wake up my device from sleep mode ... i have used the command for sleep mode sd_app_evt_wait() ...... i dono  what command to give for waking up device from sleep mode 

thanks in advance

suggest me an answer

Parents
  • Hi,

    The sd_app_evt_wait() calls __WFE() internally (among other things), so the nRF will wake up on any event/interrupt. A typical wake up source is a RTC compare event or GPIO input interrupt, but it could be anything.

  •  i have called sd_app_evt_wait() in main loop 

    but it doesn't go to sleep 

    /**@brief Application main function.
     */
    int main(void)
    
    {
        bool erase_bonds;
    
        // Initialize.
        uart_init();
        log_init();
        timers_init();
        buttons_leds_init(&erase_bonds);
        power_management_init();
        ble_stack_init();
        gap_params_init();
        gatt_init();
        services_init();
        advertising_init();
        conn_params_init();
        
    
    
        // Start execution.
        printf("\r\nUART started.\r\n");
        NRF_LOG_INFO("Debug logging for UART over RTT started.");
        advertising_start();
        
        twi_init();
        LM75B_set_mode();
        
          while (true)
        {
            nrf_delay_ms(5000);
    
            do
            {
                __WFE();
            }while (m_xfer_done == false);
          
         
           
            // read_sensor_data();
           //  power_manage();
             threshold_value();
          sd_app_evt_wait();
            NRF_LOG_FLUSH();
        }
        }

    help me 

Reply
  •  i have called sd_app_evt_wait() in main loop 

    but it doesn't go to sleep 

    /**@brief Application main function.
     */
    int main(void)
    
    {
        bool erase_bonds;
    
        // Initialize.
        uart_init();
        log_init();
        timers_init();
        buttons_leds_init(&erase_bonds);
        power_management_init();
        ble_stack_init();
        gap_params_init();
        gatt_init();
        services_init();
        advertising_init();
        conn_params_init();
        
    
    
        // Start execution.
        printf("\r\nUART started.\r\n");
        NRF_LOG_INFO("Debug logging for UART over RTT started.");
        advertising_start();
        
        twi_init();
        LM75B_set_mode();
        
          while (true)
        {
            nrf_delay_ms(5000);
    
            do
            {
                __WFE();
            }while (m_xfer_done == false);
          
         
           
            // read_sensor_data();
           //  power_manage();
             threshold_value();
          sd_app_evt_wait();
            NRF_LOG_FLUSH();
        }
        }

    help me 

Children
Related