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 Dave, Is this behavior reproducable even in debug mode? If you do not use pstorage anywhere, why dont you just delete all its code, escpecially the one calling system_off_enter. DRGN-5153, might not be the cause for this, because you say this happens only when button is pressed. This to me does not look anything softdevice related but seems like your application or button_library could be culprits.

    I did not understand fully your scheduler analysis, if the queue is full, it wont allow to add anything in the queue and hence the call should return with error. I would like to see some code and possible way to reproduce this error to help you further.

Reply
  • Hi Dave, Is this behavior reproducable even in debug mode? If you do not use pstorage anywhere, why dont you just delete all its code, escpecially the one calling system_off_enter. DRGN-5153, might not be the cause for this, because you say this happens only when button is pressed. This to me does not look anything softdevice related but seems like your application or button_library could be culprits.

    I did not understand fully your scheduler analysis, if the queue is full, it wont allow to add anything in the queue and hence the call should return with error. I would like to see some code and possible way to reproduce this error to help you further.

Children
No Data
Related