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

nRF52805 can't enter into sleep mode

Excuse me, I use BSP_EVENT_KEY_0 to get into the sleep mode, however, it will go to the NRF_BREAKPOINT_COND and then reset the device;.
case BSP_EVENT_KEY_0:
SEGGER_RTT_printf(0,"long push\n");
nrf_gpio_pin_set(18);
sleep_mode_enter();
I defined the DEBUG in app_error_weak to find out the bug , the information it output is ERROR 8198 [Unknown error code] at :000> PC at: 0x00000000End of error report
I try to close the softdevice, twi and uart/uartE, however, it still doesn't work.
I have uploaded my code to the github, the example I use is in nRF52805_sleep/examples/ble_peripheral/ble_app_hids_mouse/pca10040e_nRF52805/s112/arm5_no_packs/
The address of my code in github is https://github.com/1436294280/nRF52805_sleep
Hope you can help me:)
Parents
  • I have the nRF52805 device now and I see what you see in the debugger.

    This code will fail in the debugger, since sd_power_system_off will return with error in debug mode. In debugger mode, the systemoff is emulated and I think instead of APP_ERROR_CHECK, you should have a while(1); here. The error is expected and a correct behavior, but i can see that it causes some confusion.

    I recommend you to replace the last APP_ERROR_CHECK(err_code); with while(1);

  •   Thanks for your help, I replace the last APP_ERROR_CHECK(err_code); with while(1);
    and add the sleep_mode_enter(); to the main().
    However it still doesn't work, the device automatically reset after enter into sleep mode.

  • The reset happens when your chip wakes up from the system off sleep. Seems like you are configuring the wrong GPIO pin number as the wakeup button source. Which board file are you using in your project from the nRF52805_sleep_main\components\boards directory. I think the button connected on your board is connected to a different GPIO than the board you included causing a wrong wakeup source for your chip. which in turn is waking your chip immediately after going to sleep which causes a system reset.

Reply
  • The reset happens when your chip wakes up from the system off sleep. Seems like you are configuring the wrong GPIO pin number as the wakeup button source. Which board file are you using in your project from the nRF52805_sleep_main\components\boards directory. I think the button connected on your board is connected to a different GPIO than the board you included causing a wrong wakeup source for your chip. which in turn is waking your chip immediately after going to sleep which causes a system reset.

Children
No Data
Related