This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-MSPM0G3507: Interrupts stop working after jumping from a custom bootloader to the application

Part Number: LP-MSPM0G3507

I have a simple custom bootloader that simply jumps to the application at startup, however interrupts stop working after application takes over, everything else seems to work fine.  Did anyone have the same issue and have a solution to it?

Thanks,

Mike 

bootloader starts at 0x0000

DL_SYSTICK_disableInterrupt();
DL_SYSTICK_disable();

disable_interrupts();

SCB->VTOR = (volatile uint32_t) 0x4000;

jump_to_app(0x4000);

 

application memory starts at 0x4000

  • Can you make sure:

    1. There is code in applicaiton memory, Maybe erased

    2. Interrupt address bias for app.

  • Thanks Eason for your feedback.   Could you elaborate a little more on interrupt address bias?  I did remap the application's interrupt vector (SCB->VTOR = (volatile uint32_t) 0x4000;) before jumping to the application, if that was you meant.

    Thanks,

  • Hi Mike,

    Yes, that is what I mean.

    Can you double check:

    2. I assume you can't jump to 0x4000 directly. 0x4000, point to the stack end. 0x4004 save the address of reset handler. However, you can't set the PC to 0x4004. It will not automaticly jump to reset handler.

    What you can do is to:

    a. Read the address saved in vector table for reset_handler. Or you can define the enter address for reset_handler, like this:

    b. Jump to the reset_handler

    3. Here is a reference code.

    Boot+APP signle jump.zip

  • Thanks Eason for your clarification and the reference code. I'll check against the reference code and see if there is anything I've left out.

    Really appreciate your input.

    Mike

  • By the way, below is my jump function, and I pass in 0x4000, where the application code is located.  Please let me know if you see any issues with this.

    Thanks.

    static void start_app2(uint32_t app_start)
    {
    // jump

    __asm(" ldr r1, [r0]\n"
    " mov sp, r1\n");

    __asm(" ldr r0, [r0, #4]\n"
    " bx r0\n");
    }

  • For the jump code, I would also suggest you refer to the example code.

  • Problem solved, The root cause of my issue is the I-bit of the CPSR register was set, clearing the I-bit (enable interrupt) fixed the issue.

    Thanks Eason for your help and reference code!