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

nrf52832 crashes during soft device update

Hi,

I am writing a boot loader which does not need to use the soft device as the image is being transferred over an SPI interface.

I have merged the softdevice and my application code together to make a single payload to update.

I am also storing the image into an external flash connected via another SPI interface.

When trying to copy the binary from the external flash to the internal I am erasing from address 0x0 to 0x6FFFF which I have dedicated from the soft device and the application.

The boot loader is placed at the address 0x70000.

Now as I am erasing the SD+App blocks the boot loader crashes.

When restarted the boot loader never get executed. At this point if I deploy the SD+App using JTag the boot loader works.

I am not calling any SD function in the bootloader apart from the nrf_bootloader_app_start. Which I am calling after installing everything.

I have also noticed that if I skip the SD it the boot loader works perfectly.

Do you know why the boot loader is crashing and why it SD is required to run the boot loader?

Is there anything I can do to run the boot loader regardless of the SD?

Parents
  • When trying to copy the binary from the external flash to the internal I am erasing from address 0x0 to 0x6FFFF which I have dedicated from the soft device and the application.

    Why? This will erase the MBR and the interrupt vector table (at address 0x00). Until you can finish the writing - without interrupts or with a changed VTOR - the device will end up bricked in a power loss event.

    The MBR has its own syscalls to safely replace the SD. You should never erase the first flash sector in the field, as MBR should be identical across SD versions.

Reply
  • When trying to copy the binary from the external flash to the internal I am erasing from address 0x0 to 0x6FFFF which I have dedicated from the soft device and the application.

    Why? This will erase the MBR and the interrupt vector table (at address 0x00). Until you can finish the writing - without interrupts or with a changed VTOR - the device will end up bricked in a power loss event.

    The MBR has its own syscalls to safely replace the SD. You should never erase the first flash sector in the field, as MBR should be identical across SD versions.

Children
Related