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

Sleep and Wake up by GPIO

Hello,

My board is connected to Gyro, Magneto sensor.

And board is sleep and wake-up by GPIO.

It usually works well. But time to time after wake-up from sleep mode, sensor data read wired.

In below picture, from -800 to -400, same value is read although sensor is shaken.

After power reset at -400, sensor data is read well again.

I checked sensor configuration with sensor company. They confirmed that it looks fine and suggest me to check difference between wake-up from sleep and power reset.

In 18.8 Reset behavior, It specified that GPIO and SWJ-DP, WDT, Retained register, RESETREAS isn't reset.

"sleep_mode_enter" function is called when sleep interrupt is triggered from Gyro sensor.

void sleep_mode_enter(void)
{
   uint32_t err_code;

   NRF_LOG_INFO("Entering sleep mode \r\n");
   nrf_delay_ms(15);

   // Enable wake on low power accelerometer.
   nrf_gpio_cfg_sense_input(PIN_LSM_INT2, NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH);

   //Enter System-off
   nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_STAY_IN_SYSOFF);
   nrf_delay_ms(15);

   NRF_LOG_INFO("sd_power_system_off() returned. -Probably due to debugger being used. Instructions will still run. \r\n");

}

Could I configure wake-up work like power reset?

Related