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

SD calls fail in bootloader.

Hi!

We are currently writing a simple bootloader which reads the new application image from a external SPI based flash memory. We are using the S110 SoftDevice, which works excellent with our main application.

The bootloader is placed @0x38000, and e have successfully written to the UICR.BOOTLOADERADDR register to jump from the SoftDevice to the bootloader, no problems there. :)

Our problem is this:

When trying to use sd-based calls, or use SOFTDEVICE_HANDLER_INIT to initiate the SoftDevice in our bootloader, it stops/hangs in the SVC_Handler. This is when the bootloader is @0x38000, and the UICR.BOOTLOADERADDR = 0x38000.

However, if we place the bootloader @0x18000 and leave the UICR.BOOTLOADERADDR to its default value (0xFFFFFFFF), the bootloader both initiates the SoftDevice and completes the sd calls without any issues. We have also tried placing the bootloader @0x18000, and then write the UICR-register to 0x18000, but this fails as well.

Is there a difference when the SoftDevice jumps to 0x18000 (end of the SoftDevice) by default (UICR.BOOTLOADERADDR = 0xff), or when we use the UICR-register to tell the SoftDevice to jump to the bootloader (0x38000 or 0x18000)?

We want to initiate the SoftDevice to be able to use the default spi_master.c drivers.

Related