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

Forwarding Interrupts to application without SD use

Hello,

I have an application that uses the Soft-Device. That application want to start a SPI-Bootloader. That SPI-Bootloader isn't the only bootloader on the device, so I just want the application to forward all interrupts to the SPI-Bootloader. The SPI-bootloader doesn't make use of the softdevice.

this is the code, that tries to start the bootloader:

void start_bootloader_without_sd( std::uint32_t start_address )
{
    sd_softdevice_disable();

    // set vector table of master bootrecord direct to the bootloaders start address
    sd_mbr_command_t command = { SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET };
    command.params.base_set.address = start_address;

    const auto rc = sd_mbr_command( &command );
    static_cast< void >( rc );
    assert( rc != NRF_SUCCESS );

    NVIC_SystemReset();
}

After the final reset, the MBR does not forward the reset handler to the SPI bootloader. When I try to debug the startup, it looks like the MBR tries to start an application at 0xffffffff. In addion, I observed, that the RAM is inaccessable from the debugger.

According to the documentation, I would say, the code above should work, but it doesn't. Any idea, why it is not working as expected?

Softdevice is S310, version is 2.0.

kind regards,

Torsten

Parents
  • Hi Torsten, You are right. When you call SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET, the MBR will store the address to Flash ( MBR param page, on nRF15 it's inside the MBR ). It then does a reset, when it start again, it will forward the vector table to the address in the param and then branch to the reset handler at that vector table. I guess you are talking about S130 v2.0 not S310 v2.0 ? I just did a test here with this code in a bootloader:

    sd_mbr_command_t command = { SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET };
            command.params.base_set.address = 0x1B000;
    		sd_mbr_command( &command );
     		while(1);		
    

    It worked fine, MBR forwarded to the application at 0x1B000 and won't start the bootloader on a hard reset(s) after that. Go straight to application.

Reply
  • Hi Torsten, You are right. When you call SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET, the MBR will store the address to Flash ( MBR param page, on nRF15 it's inside the MBR ). It then does a reset, when it start again, it will forward the vector table to the address in the param and then branch to the reset handler at that vector table. I guess you are talking about S130 v2.0 not S310 v2.0 ? I just did a test here with this code in a bootloader:

    sd_mbr_command_t command = { SD_MBR_COMMAND_VECTOR_TABLE_BASE_SET };
            command.params.base_set.address = 0x1B000;
    		sd_mbr_command( &command );
     		while(1);		
    

    It worked fine, MBR forwarded to the application at 0x1B000 and won't start the bootloader on a hard reset(s) after that. Go straight to application.

Children
No Data
Related