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

Understanding booting; SD not handling SVC

Hi,

Why is it that when NRFFW[0] = 0xFFFFFFFF SVC calls are passed on to the softdevice but when NRFFW[0] = 0x19000 they are passed on to the SVC handler of the application?

I am using softdevice 6.1.0 and SDK version 15.2.0.

When stepping through the code of the MBR I noticed that it depends on the value located at the first word of RAM. When NRFFW[0] = 0xFFFFFFFF the value at 0x2000_0000 is 0x1000. When NRFFW[0] = 0x19000 the value at 0x2000_0000 is 0x19000.

Why is that?

Kind regards,

Bert

  • Hi Bert, 

    The NRFFW[0] register is used to signal the MBR that a bootloader is present, and at what address it starts at. And when a bootloader is present, the MBR will not invoke the Softdevice but forward execution and interrupts directly to the bootloader (or application in this case) effectively bypassing the Softdevice. That is why the SVC interrupts are not being processed but forwarded to the application with this register configuration.

    You can invoke the Softdevice from your bootloader by issuing the following MBR command:

    sd_mbr_command_t com = {SD_MBR_COMMAND_INIT_SD, };
    
    /**< Init forwarding interrupts to SD, and run reset function in SD*/
    
    err_code = sd_mbr_command(&com);
    APP_ERROR_CHECK(err_code);
    
    /* Change Softedvice interrupt forwarding address if it is different from the default starting address (0x19000 for this Softdevice) */
    
    err_code = sd_softdevice_vector_table_base_set(<vector table address>);
    APP_ERROR_CHECK(err_code);

    You can also read more about the MBR and the startup sequence in the SDS here: Master boot record and bootloader. I hope this helps. If anything is unclear, let me know.

    Kind regards,

    Vidar

Related