Master boot record and SoftDevice initialization procedure

The SoftDevice can be enabled by the bootloader.

The bootloader can enable the SoftDevice by using the following procedure:

  1. Issuing a command for MBR to forward interrupts to the SoftDevice using sd_mbr_command() with SD_MBR_COMMAND_INIT_SD.
  2. Issuing a command for the SoftDevice to forward interrupts to the bootloader using sd_softdevice_vector_table_base_set(uint32_t address) with BOOTLOADERADDR as parameter.
  3. Enabling the SoftDevice using sd_softdevice_enable().

The bootloader can transfer the execution from itself to the application by using the following procedure:

  1. Issuing a command for MBR to forward interrupts to the SoftDevice using sd_mbr_command() with SD_MBR_COMMAND_INIT_SD, if interrupts are not forwarded to the SoftDevice.
  2. Issuing sd_softdevice_disable(), to ensure that the SoftDevice is disabled.
  3. Issuing a command for the SoftDevice to forward interrupts to the application using sd_softdevice_vector_table_base_set(uint32_t address) with APP_CODE_BASE as a parameter.
  4. Branching to the application Reset Handler as specified in the Application Vector Table.