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

Fatal error on sleep 0x4001

I am running the SDK12.2.0 ble_app_template peripheral example with RTT Logging enabled. The example seems to be running OK, but it logs: APP_ERROR:ERROR:Fatal with the ID of 0x4001 whenever advertising times out and the sleep_mode_enter() function is called. What's going on here?

Parents
  • Yo can't disable debug mode, debug mode is automatically enabled when the debug (SWD) interface is used. When the chip is in debug mode, emulated system off mode will be used instead of system off mode. Just ignore the error code returned from call to sd_power_system_off() instead of passing it to APP_ERROR_CHECK() macro in sleep_mode_enter() function. You should add an empty while loop after calling this function, to avoid executing other code untill wakeup source is triggered. Wakeup will trigger reset in both system off and emulated system off mode.

Reply
  • Yo can't disable debug mode, debug mode is automatically enabled when the debug (SWD) interface is used. When the chip is in debug mode, emulated system off mode will be used instead of system off mode. Just ignore the error code returned from call to sd_power_system_off() instead of passing it to APP_ERROR_CHECK() macro in sleep_mode_enter() function. You should add an empty while loop after calling this function, to avoid executing other code untill wakeup source is triggered. Wakeup will trigger reset in both system off and emulated system off mode.

Children
No Data
Related