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

Brick after sd_nvic_SystemReset() with enabled readback protection.

Hello,

My device is nRF51822 SD110 8.0.0.

The problem occured after firmware update in bootloader (own, not SDK) with readback protection enabled. So bootloader connects to host, receive the data and write it to firmware area of the flash. After all data transferred, central disconnect device. In bootloader disconnection handled in next way:

...
else if (evt_id == BLE_GAP_EVT_DISCONNECTED){ 
   sd_nvic_SystemReset();
}...

And device restarts, it jumps to botloader first and bootloader switches to firmware. Everithing works fine. But in case when readback protection enabled on chip, the last become brick after sd_nvic_SystemReset(); command. Power reset didn't help. What should I do to fix this?

Parents
  • I am not sure "writting 0x05fa0004 to 0xe000ed0c" is a correct way of triggering reset. Here is the code for NVIC_SystemReset:

    __STATIC_INLINE void NVIC_SystemReset(void)
    {
      __DSB();                                                          /* Ensure all outstanding memory accesses included
                                                                           buffered write are completed before reset */
      SCB->AIRCR  = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
                     SCB_AIRCR_SYSRESETREQ_Msk);
      __DSB();                                                          /* Ensure completion of memory access */
    
      for(;;)                                                           /* wait until reset */
      {
        __NOP();
      }
    }
    

    It's in core_cm0.h

Reply
  • I am not sure "writting 0x05fa0004 to 0xe000ed0c" is a correct way of triggering reset. Here is the code for NVIC_SystemReset:

    __STATIC_INLINE void NVIC_SystemReset(void)
    {
      __DSB();                                                          /* Ensure all outstanding memory accesses included
                                                                           buffered write are completed before reset */
      SCB->AIRCR  = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
                     SCB_AIRCR_SYSRESETREQ_Msk);
      __DSB();                                                          /* Ensure completion of memory access */
    
      for(;;)                                                           /* wait until reset */
      {
        __NOP();
      }
    }
    

    It's in core_cm0.h

Children
No Data
Related