Softdevice seems raising assertion failed after flashing app via bootloader

Hi,

i am playing around with configuration of Softdevice (S112 ) + bootloader + application.

Bootloader is custom, really simple. Flashing block of data received via uart. Application is a passthrough from uart to Bt and viceversa and without booloader seems all ok.

When i flash app via bootloader and turn on BT via uart command it goes up and advertise, connect with nrf toolbox via NUS. But then after sending command from uart to the app I have a crash which is not appearing without booloader.

I am flashing bootloader address using linker file like this:

MEMORY
{
    /* NOTE 1 K = 1 KiBi = 1024 bytes */
  /* These values correspond to the NRF52805 with SoftDevices S112 7.2.0 */
  FLASH (rx) : ORIGIN = 0x28000, LENGTH = 24K
  RAM : ORIGIN = 0x20000008, LENGTH = 24K - 8
  mbr_params_page (r) : ORIGIN = 0x0002E000, LENGTH = 4K
  bootloader_settings_page (r) : ORIGIN = 0x0002F000, LENGTH = 4K
  uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
}

SECTIONS {
     .uicr_bootloader_start_address :  {
       KEEP(*(.uicr_bootloader_start_address))
       . = ALIGN(4);
     } > uicr_bootloader_start_address
};

And anyway flashing simple app without SD seems working correctly, I jump to the app basically using sd_mbr_command_irq_forward_address_set_t and pushing address 0x1000 which is the MBR. My application is placed at the end of SD (0x19000) in my case so it starts but then I have bad behavioud when I turn bt on.

Maybe I have to disable completely uart from bootloader ( or interrupts ) before jumping?

also it's not clear to me if I have to use in someway also the command sd_mbr_command_vector_table_base_set_t in some way...

Thanks for any advice guys!

Related