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

Updating start address to nrf52840 dk via code

Hello to everyone, I have a nrf52840 dk device running Zephyr RTOS. I have flash an app to the start address 0x00 and a second app to 0x2000 address. While I am pressing a button from the first app I can jump to second app which runs ok. My question is how to update the start address to the address of the second firmware (0x2000)? Thus the second app will start on the reset. At this time the on reset the first app is booting.

Parents Reply
  • I have to correct myself. The code execution will not always start at adress 0, but the VTOR register will always be 0x00 at reset. Thus your vector table should be placed at address 0x00. After setting the MSP based on address 0x00 it will set the PC based on the value stored in the reset vector at address 0x04. However, this value can be set to e.g. 0x2000, but this is not a safe solution and your device can easily get bricked.

    I would recommend you to go for the solution I suggested (your workaround), using a custom bootlader.

    Best regards,

    Simon

Children
Related