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

What does NVIC_SystemReset() actually do?

When I call this function on any of the Development Kits, my application restarts just like when I power up the DK for the first time (after being programmed of course) or when I download an updated version of the application.

However, when I install the same code on the nRF52840 dongle as I do on the nRF52840 DK, the application does not restart. No LEDs turn on. Its as if power has been removed. ON application start an LED turns on of a certain color that indicates the dongle is advertising. When I plug in the dongle, that works. After the call to NVIC_SystemReset() the dongle goes silent and I have to pull out the dongle and re-insert it to restart the application. On the DK I do not have do do this. What am I missing?

Parents
  • Hi,

    The support staff is reduced during the summer holidays, and you may experience delayed answers. 

    I thought about the bootloader on the nRF52840 which enters DFU mode on pin reset, but it does not do so on soft reset.

    Do you read the resetreason register in your app and use that for something?

    NVIC_SystemReset() triggers a soft reset by writing to the AIRCR (Application Interrupt and Reset Control Register) register in the Cortex M4 core. I do not see how it could fail, so if you call it, the device is reset. You can see the implementation in components\toolchain\cmsis\include\core_cm4.h

    I think you either do not call it for some reason, or you do something differently after a soft reset than a power-on reset. 

    Regards,

    Amanda 

  • All I do after a call to NVIC_SystemReset() is exit the for loop [for(::)] in main() which, of course, just exits main().

Reply Children
No Data
Related