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

S310 V2 bootloader hangs when calling softdevice

Hello,

I try to use the S310 V2 but got stuck into problems.

in order to start the application from bootloader in the S310 V1 I did succesfully :

void (*application)(void);
sd_softdevice_disable();
sd_softdevice_forward_to_application();
/* Jump to user application */
uint32_t application_pc = *(__IO uint32_t*)(application_start_address + 4);
application = (void (*)(void))application_pc;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) application_start_address);
application();

now in S310 V2 I replace the forward_to_application by the new command:

sd_softdevice_vector_table_base_set(application_start_address);

now even in the sd_softdevice_disable(); (as well as sd_softdevice_vector_table_base_set) the processor stucks in the SVC call. Initially I did not enable the sd. Do I have to do that? I am not using any service?

I checked also the reference here: devzone.nordicsemi.com/.../ but this was no help for me.

I programmed the softdevice using:

nrfjprog --programs softdevice.hex --dfu as well as
nrfjprog --programs softdevice.hex

but with no luck.

Thx for any help.

Regards, Adib.

Parents
  • I checked the given sample bootloader code and it turns out that not only the softdevice vector table has to be activated but also some MBR magic.

    Here is the code that works so far:

    start application from inside bootloader

        sd_mbr_command_t com = {SD_MBR_COMMAND_INIT_SD, };
        err_code = sd_mbr_command(&com);
        err_code = sd_softdevice_disable();
        sd_softdevice_vector_table_base_set(0x00020000);
        bootloader_util_app_start(0x00020000);
    

    It should have noted that the mbr initialisation is also needed.

    Adib.

Reply
  • I checked the given sample bootloader code and it turns out that not only the softdevice vector table has to be activated but also some MBR magic.

    Here is the code that works so far:

    start application from inside bootloader

        sd_mbr_command_t com = {SD_MBR_COMMAND_INIT_SD, };
        err_code = sd_mbr_command(&com);
        err_code = sd_softdevice_disable();
        sd_softdevice_vector_table_base_set(0x00020000);
        bootloader_util_app_start(0x00020000);
    

    It should have noted that the mbr initialisation is also needed.

    Adib.

Children
No Data
Related