can Bootloader call API in SoftDevice?

my nRF52840 has MBR, SoftDevice, Application and Bootloader.

Can Bootloader call API in SD? 

Will it be an issue? If I need to upgrade SD (could be a newer version), Application and Bootloader.

Any suggestion on implementing Bootloader? 

Parents Reply Children
  • Thanks for your answers and information!!

    SVC 0x18 interrupt handler is implemented in MBR. right ?

    48 uint32_t nrf_dfu_mbr_copy_bl(uint32_t * p_src, uint32_t len)
    49 {
    \ nrf_dfu_mbr_copy_bl: (+1)
    \ 0x0 0xB538 PUSH {R3-R5,LR}
    \ 0x2 0xB084 SUB SP,SP,#+16
    \ 0x4 0x0004 MOVS R4,R0
    \ 0x6 0x000D MOVS R5,R1
    50 uint32_t ret_val;
    51 uint32_t const len_words = len / sizeof(uint32_t);
    \ 0x8 0x08AD LSRS R5,R5,#+2
    52
    53 sd_mbr_command_t command =
    54 {
    55 .command = SD_MBR_COMMAND_COPY_BL,
    56 .params.copy_bl.bl_src = p_src,
    57 .params.copy_bl.bl_len = len_words
    58 };
    \ 0xA 0x4668 MOV R0,SP
    \ 0xC 0x2110 MOVS R1,#+16
    \ 0xE 0x.... 0x.... BL __aeabi_memclr4
    \ 0x12 0x9401 STR R4,[SP, #+4]
    \ 0x14 0x9502 STR R5,[SP, #+8]
    59
    60 ret_val = sd_mbr_command(&command);
    \ 0x16 0x4668 MOV R0,SP
    \ 0x18 0xDF18 SVC 0x18
    61
    62 return ret_val;
    \ 0x1A 0xB005 ADD SP,SP,#+20
    \ 0x1C 0xBD30 POP {R4,R5,PC}
    63 }

  • Yes, that is implemented in the MBR

    I was not specific in my previous reply, but I woudl advice that you use the example BLE bootloader as a basis for your bootloader. In most applications it can be used with little or no change (other than adapting the configuration in sdk_config.h and using your own public key).

Related