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

Button Causing CPU freeze/SystemOff

I have this odd issue which creeps up in field testing. Upon a button push the board goes immediately to System Off. 99.99% of the time Button pushes are handled normally, but in these rare cases while connected to a phone, the device will go straight to System Off upon a button push. Using SDK 6.1, S110 7.1

I was worried this could be happening because of one of the following reasons:

  • Stack, app_timer and app_button all use the Scheduler. Perhaps this is a corner case that occurs when the Scheduler Queue is full?
  • Perhaps the 32.768kHz crystal has drifted causing an assert according to DRGN-5153
  • A fault in the GPIOTE within the app_button is hardfaulting?
  • Noticed that in my on_sys_evt(uint32_t sys_evt) there is a system_off_mode_enter(); call on an NRF_EVT_FLASH_OPERATION_SUCCESS or NRF_EVT_FLASH_OPERATION_ERROR. Though it is unlikely to get here as I don't use pstorage anywhere in my application.

These are the only ways I can see this Button Freeze issue is occuring. I just thought I'd post this in case anyone else had seen this issue before. I read a similar post, which found a loop was blocking the Stack. I've verified none of my IRQ or scheduler handlers have any blocking.

Thanks guys,

DC

Parents
  • Hi Aryan, you are correct. I added a while(1) loop with LEDs to catch if it ever reached the Flash Error system_off code. However we again saw the fault and it didn't reach the while(1). So the fault lies somewhere else.

    How our button section works is on a Button push, I start a 1second Repeating timer. At each timeout I use app_sched_event_put() to scheduler events according to how long the button as been held.

    Looking into the differences between app_timer.c in SDK6.1 and later versions I see the use of rtc1_stop() which is not used in later version. I found if execute the following (psuedo) code on a Button Push Handler I can re-create the issue:

    button_handler()
    {
        if(PUSHED)
    {
    rtc1_stop();     //Added to simulate app_timer.c  error condition of SDK 6.1
    rtc1_start();    //to restart RTC1
    
    stop_button_hold_timer();
    start_button_hold_timer();
    }
    }
    
Reply
  • Hi Aryan, you are correct. I added a while(1) loop with LEDs to catch if it ever reached the Flash Error system_off code. However we again saw the fault and it didn't reach the while(1). So the fault lies somewhere else.

    How our button section works is on a Button push, I start a 1second Repeating timer. At each timeout I use app_sched_event_put() to scheduler events according to how long the button as been held.

    Looking into the differences between app_timer.c in SDK6.1 and later versions I see the use of rtc1_stop() which is not used in later version. I found if execute the following (psuedo) code on a Button Push Handler I can re-create the issue:

    button_handler()
    {
        if(PUSHED)
    {
    rtc1_stop();     //Added to simulate app_timer.c  error condition of SDK 6.1
    rtc1_start();    //to restart RTC1
    
    stop_button_hold_timer();
    start_button_hold_timer();
    }
    }
    
Children
No Data
Related