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

Change the bootloader start address when upgrade the SDK from 11.0 to SDK15.x

Hi Nordic,

I have old NRF52832 product which is developed by SDK11.0. The bootloader start address was set to 0x79000. Now We want to upgrade the it firmware by using the SDK15.x. And we need to change to bootloader start address to 0x76000 to make sure the bootloader has enough space to store some UI resources to display upgrade progress. 

I know we can use NVMC to erase the UICR setting and write new values to UICR. So I developed an intermediate firmware based on SDK11.0. The intermediate firmware  include 2 parts. Actually the 2 parts are seperated applications. The first application is range from 0x1C000. And in the first application it does nothing but just directly jumps to the 2nd application which range from 0x26000 (0x26000 is the SDK15.2 S132 6.1.0 appliaction start address). And in the second application, it completes UICR erasing, new UICR writing, new SOFTDEVICE binary copy, new bootloader binary copy and call NVIC_SystemReset() to reset the MCU to go to new bootloader. All steps are done well when the UICR.APPPROTECT is disabled. 

But if the UICR.APPPROTECT is enabled, all steps complete well except the NVIC_SystemReset(). It seems the MCU is paused and needs to give it an external reset (Power up reset or use Jlink Commander to give it a reset), and after the reset, the MCU will go to the new bootloader normally. I have tried to set the Watch Dog to reset it or set an RTC timer to call the NVIC_SystemReset() in its RTC compare IRQ Handler. Unfortuantely, all have no effect. 

And I have done another test to try to break the APPPROECT: I modified the old application, and in the appilcation beginning I checked the APPPROECT register, if it is enabled, I will try to erase all UICR settings and rewrite  NRFFW[0] (bootloader start address),  NRFFW[1] (mbr settings start address) and  NFCPINS (nrf pin as GPIO settings). After UICR erasing and rewriting, the firmware seems also to be  paused and will recover to run until an external reset performed.

So why APP PROTECT enabled setting leads the above problem. Do I have the possibility to implement the booloader start address changing while upgrade the Softdevice?

Related