cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupts not working with Bootloader

Marco Burgener
Associate

Dear Community,

I'm working on a bootloader project using an STM32L071. I was able to start the main application using the code below:

 

void HalSys_BootMainApplication()
{
    /* Set address to jump to*/
    volatile uint32_t jumpAddress = *(uint32_t*)(0x08008000 + 4);
    pFunction jump = (pFunction)jumpAddress;

    /* Set stack pointer to new initial value, located at the start of the new application */
    __set_MSP(*(uint32_t*)0x08008000);

    /* Jump to application */
    jump();
}

 

The main application start successfully (I get a lot of logs over UART) but apparently the interrupts are not working. After having searched for a solution in the forum, I came across the SCB->VTOR which apparently must be set correctly in the main application such that it can find the correct interrupt addresses. So in the main application's system_init, I'm setting it to 0x08008000, but then the application doesn't even start at all. Any idea?

Many thanks in advance and best,

Marco

1 REPLY 1
Dor_RH
ST Employee

Hello @Marco Burgener , 

There are a few things to consider that might be causing the issue you're experiencing:

  • Ensure that the clock configuration in the main application is set up correctly. An incorrect clock configuration can cause the system to behave unexpectedly.
  • Make sure that the memory mapping is correct and that the address 0x08008000 is indeed where your main application's vector table is located. 
  • Try to enable or re-enable global Interrupts in the Main Application:  __enable_irq();

I hope my answer has helped you. When your question is answered, please select this topic as solution that answered you, it will help others find that answer faster.

Thanks for your contribution.

Dor_RH