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

Toggle nReset without using an external button before exiting DFU?

NRF52840 = GCC/GNU ARM - SDK 15.0 - SD 6.0.0 - Builds tested under windows & linux on two separate machines. Chip is Fanstel BT840E-V2 module on a custom board.

We've been using the DFU via bootloader with USB with success for almost 6 months on various 840 hardware starting with kits and custom boards, but it has always required a hard reset to start the new app - this is clear since the UICR requires a hard reset to update/read new values - but in an ideal world the new app would start without touching the reset button. Soft reset does not work for the reason just mentioned with UICR. 

Inside main, we activate SD and an app_timer which blinks an led until the bootloader times out - I have tried shutting down timer per this link, although starting an app after not performing the DFU has never been an issue, so I don't buy that the timer settings carrying over could be an issue :
https://devzone.nordicsemi.com/f/nordic-q-a/29141/bad-application-behavior-after-bootloader-dfu

What it seems like we need is to do is trigger a hard reset of the device after DFU COMPLETE -  I think I read at some point that it was possible to  use software to hard trigger the nReset (NOT using the NVIC Reset which is "soft") since it has a permanent pull-up or down on the pin - this feature is specifically for instances that don't have a button, but we want to exploit it. What is the proper way to hard reset without the signal being externally toggled?


Parents
  • Hi,

    We've been using the DFU via bootloader with USB with success for almost 6 months on various 840 hardware starting with kits and custom boards, but it has always required a hard reset to start the new app - this is clear since the UICR requires a hard reset to update/read new values

    UICR is loaded on "soft" reset so I think there has to be a different reason for this. Possibly errata 187. Workaround for this errata was implemented in SDK 15.0.0, but unfortunately not applied when run on IC rev. 1 due to an error in the nrf_drv_usbd_errata.h->nrf_drv_usbd_errata_187() check. Below is a patched version of the nrf_drv_usbd_errata.h (I copied the nrf_drv_usbd_errata_187 implementation from SDK 15.2.0). Please try to re-compile your application and bootloader against this header and see if you get the same result. 

     nrf_drv_usbd_errata.h

    Inside main, we activate SD and an app_timer which blinks an led until the bootloader times out - I have tried shutting down timer per this link, although starting an app after not performing the DFU has never been an issue, so I don't buy that the timer settings carrying over could be an issue :

     Agree. The clean up is performed differently in SDK 15 so should not be an issue. 

Reply
  • Hi,

    We've been using the DFU via bootloader with USB with success for almost 6 months on various 840 hardware starting with kits and custom boards, but it has always required a hard reset to start the new app - this is clear since the UICR requires a hard reset to update/read new values

    UICR is loaded on "soft" reset so I think there has to be a different reason for this. Possibly errata 187. Workaround for this errata was implemented in SDK 15.0.0, but unfortunately not applied when run on IC rev. 1 due to an error in the nrf_drv_usbd_errata.h->nrf_drv_usbd_errata_187() check. Below is a patched version of the nrf_drv_usbd_errata.h (I copied the nrf_drv_usbd_errata_187 implementation from SDK 15.2.0). Please try to re-compile your application and bootloader against this header and see if you get the same result. 

     nrf_drv_usbd_errata.h

    Inside main, we activate SD and an app_timer which blinks an led until the bootloader times out - I have tried shutting down timer per this link, although starting an app after not performing the DFU has never been an issue, so I don't buy that the timer settings carrying over could be an issue :

     Agree. The clean up is performed differently in SDK 15 so should not be an issue. 

Children
No Data
Related