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

Custom I2C Bootloader to Flash Softdevice

I am working on a custom I2C bootloader for nrf52832 using SDK 14.2.0. Currently, the bootloader can flash the application code very well. But I have no idea how to flash the softdevice through my bootloader. In my bootloader code, I do not use anything from the softdevice. but when I start to erase the softdevice pages in the bootloader, it dead. I want to check can I flash the softdevice like that? 

so my bootloader is located at 0x0007800 and softdevice start from 0x00000000. the UICR 0x10001014 has been set to bootloader starting address.

  • Hi,

    The master boot record occupies the first page in flash (0x0 - 0x1000) and must not be erased during DFU as it is in charge of forwarding interrupts/execution to the bootloader or the softdevice (memory layout). It should work if you only erase the pages between address 0x1000 and application start. 

    Some additional notes:

    - SDK 15.2.0 secure UART bootloader uses a standalone version of the MBR which removes the need for having a softdevice present. This allows you to free up some space as long as your application/bootloader is not dependent on a softdevice being present. 

    - All softdevice images are distributed with the MBR included, but this section is automatically removed by nrfutil when it generates the DFU distribution image. If you are converting the hex files to binary yourself, make sure to omit the MBR section. 

    - Another alternative to creating a custom bootloader is to implement a custom i2c transport to our existing bootloader example.  

Related