Application Switch Works in NCS 3.1 but Hangs in NCS 2.6.4

Hello,

I have developed a bootloader with OTA update functionality on an nRF device. The partition switching code (bootloader jumping to the application after OTA) works perfectly in nRF NCS 3.1. However, when I move the same code to NCS 2.6.4, it stops working.

Here’s what I’ve tried so far:

  1. Flashing the bootloader and application into separate flash sections using code (not manually).

  2. Reading specific memory addresses in the application’s flash section. When I try this in 2.6.4, the system hangs.

I suspect the problem may be related to:

  • Differences in vector table relocation or startup code between NCS versions.

  • Flash alignment or partition size issues.

  • Bootloader → application handoff sequence not being compatible with NCS 2.6.4.

void boot_manager_jump_to_application(void)
{
    LOG_INF("Jumping to application at 0x%08X", APPLICATION_IMAGE_START);

    uint32_t app_addr = APPLICATION_IMAGE_START;

    /* Read application's vector table */
    uint32_t app_stack_ptr = *((uint32_t *)app_addr);
    uint32_t app_reset_entry = *((uint32_t *)(app_addr + 4));

    /* Disable all interrupts before jumping */
    __disable_irq();
    NVIC->ICER[0] = 0xFFFFFFFF;
    NVIC->ICPR[0] = 0xFFFFFFFF;

    /* Set vector table base address to application region */
    SCB->VTOR = app_addr;

    /* Set Main Stack Pointer (MSP) to app's stack start */
    __set_MSP(app_stack_ptr);

    /* Jump to application reset handler */
    void (*app_start)(void) = (void (*)(void))app_reset_entry;
    app_start();
}

Questions:

  1. Are there known differences in NCS 2.6.4 that could cause this handoff to fail?

  2. Do I need to explicitly set the vector table (VTOR) when jumping to the application?

  3. Could memory alignment or flash partition differences cause the system to hang when reading flash?

  4. Any recommended approach to debug or verify the bootloader → application switching in NCS 2.6.4?

Thanks in advance for any guidance!

Parents Reply Children
No Data
Related