Hello everyone
My system is as follows:
- Using sdk v2.4.4, zephyr with nrf5340 (Raytak)
- Using Threads zephyr to create threads to control the system
- Using CONFIG_PM=y, CONFIG_PM_DEVICE=y to manage the power of the system device, in addition to being able to enter Deep sleep state
- Using the device with BLE role peripheral to connect to the phone
- In normal state, I attach the button with the polling mechanism to operate with other functions. But before entering Deep sleep state, I assign that button to wake up the device after entering Deep sleep state
- After many times entering Deep sleep and then waking up again, the device hangs. While hanging, the device is still connected to the phone via BLE. It seems that the system threads are still working, but the thread with the button function with the polling mechanism, that function is not called again and any value that is LOG_INF is not printed out, it seems that the Chip is suspended. Then I disconnect the phone from the device, the device is not able to reconnect to the phone and the device is suspended without any intervention and can only be hard reset.
I tried to turn on debug to monitor, but when the button check function is not called, I always see the following error line:

So how can I fix the system suspension error, if the above situation occurs