[NCS1.9.1]System off mode abnormal problem

Dear Support Team,
I test system off mode under the following conditions:
NCS1.9.1; nRF52840-DK and nRF52-DK; added dk_button_init initialization code in the system off example.
After nRF52840-DK and or nRF52-DK burn compiled firmware, you can see the following log output:

*** Booting Zephyr OS build v2.7.99-ncs1-1  ***

nrf52840dk_nrf52840 system off demo
Retained data not supported
Sleep 2 s
Entering system off; press BUTTON1 to restart

Test method: Press button1 on the DK continuously and quickly within 2 seconds.
Result: the device gets bricked and the program freezes.
The following is my program, please help analyze the reason and give a solution, thank you for your support!

system_off.7z
Remarks: Only need to compile and burn to nRF52840-DK or nRF52-DK, press button1 continuously and quickly to reproduce.

Parents
  • Hi,

    Sorry for the delayed response. I have attached a modified zip file. Please try this and let me know if you still face the issue.

    Regards,

    Priyanka

    0726.system_off.zip

  • Hi Priyanka

    Download the zip file you attached, the problem still exists, the log is as follows:

    *** Booting Zephyr OS build v2.7.99-ncs1-1  ***
    
    nrf52dk_nrf52832 system off demo
    Retained data not supported
    Busy-wait 2 s
    Busy-wait 2 s with UART off
    Sleep 2 s
    Sleep 2 s with UART off
    Sleep 2 s
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    Entering system off; press BUTTON1 to restart
    *** Booting Zephyr OS build v2.7.99-ncs1-1  ***
    
    nrf52dk_nrf52832 system off demo
    Retained data not supported
    Busy-wait 2 s
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    Busy-wait 2 s with UART off
    Sleep 2 s
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    Sleep 2 s with UART off
    Sleep 2 s
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    dk_buttons_init -> button 1 pressed
    
    Entering system off; press BUTTON1 to restart

    After the device is powered on, press button1 on the DK continuously and quickly, and the device cannot be woken up after seeing that the log does not output. This problem must arise.

    Regards,

    Zero

  • Hi,

    Apologies for the delay. I have not forgotten it. I was actually trying out the code and looking for a solution. I am having some doubts. I will discuss with experts and update you today with a response.

    -Priyanka

  • Hi Priyanka,

    Thank you for your support and look forward to your reply.

    BR,

    Zero

  • Hi,

    So we finally got to the culprit. Smiley

    The problem is that  dk_buttons_and_leds.c does this little thing that when a button is pressed, it disables the interrupts, and manually scans the GPIOs to see when they are released. So if you are continuously pressing it, or even holding it down, there does not seem to be a release and interrupt is disabled.

    So you can have a small workaround by introducing a check to prevent the system from going into sleep. I will attach the modified code here. THe check is named keep_alive.

    6165.system_off.zip

    Hope this helps. Slight smile

Reply
  • Hi,

    So we finally got to the culprit. Smiley

    The problem is that  dk_buttons_and_leds.c does this little thing that when a button is pressed, it disables the interrupts, and manually scans the GPIOs to see when they are released. So if you are continuously pressing it, or even holding it down, there does not seem to be a release and interrupt is disabled.

    So you can have a small workaround by introducing a check to prevent the system from going into sleep. I will attach the modified code here. THe check is named keep_alive.

    6165.system_off.zip

    Hope this helps. Slight smile

Children
Related