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

Secure bootloader and Logs

Hello, 

I am developing an application on nrf52840 using SDK 17.
My application has a bootloader and sometimes when my application is restarting due to a command I send (using NVIC_SystemReset() function) it causes a double reset (a second reset while proccing the first reset).


I tried several things : 

  1.  I have removed all the logs in my application and it worked fine without causing a double reset.
  2.  I tried to use my application without the boot loader (I kept the Logs in the application) and again it worked fine without causing a double reset.

Hence I concluded that the problem is using a bootloader with logs.

Is there any reason that the logs can cause a reset in my application with a bootloader?

  • Hi,

    How did you determine if a "double reset" is occurring?

    As you might know, default behavior if an error code is passed into APP_ERROR_CHECK() is to do a reset.

  • Hi, 
    I have a timestamp in every log, the timestamp goes back to 00:00:00 only when a reset has occurred. When I checked the logs after the reset, the timestamp turned to 00:00:00 and a startup process has started. Then another log with the timestamp 00:00:00 is printed and the startup process has started again. 


    Moreover, my device has a screen you can clearly see that during the reset using  NVIC_SystemReset() a second reset is occurring before the first one is finished.
    This doesn't happen every time I use the NVIC_SystemReset(), and it never happens to me when I disable the logs on my application, or when I am running the application without the bootloader.

    I have tried to find a connection between the Logs and the bootloader that could cause this reset.

  • Do you have the same reset reason at each startup?

    Try printing the reset reason when you print the first timestamp.

    uint32_t reset_reason = NRF_POWER->RESETREAS;
     

Related