2023-09-04 04:24 AM
Hi,
I face some issue with the interrupts of STM32L452RET6P. I have two codes running in the controller one is a custom bootloader code and other is an application code which stored in flash memory. when the device get reset it will run the custom bootloader application which is at 0x08000000. It uses TIMER6 and UART2 in interrupts with 1 and 2 priority respectively. As per the flow if there is no uart interrupts triggered with in the defined time the device will jump to the application code which is at a different flash location. This works fine for me, and the application code also starts running,
But the interrupts are not triggering, I use RTC wakeup, UART2, TIMER6 and EXTI interrupts in the application code with priorities 1,2,3 and 4 respectively, my code is stuck in the while(1). Issue is only with interrupts, I checked with and LED Blink code it works fine.
what may be the reason for this issue?
2023-09-04 04:49 AM
Hi,
Before jumping to the application, are you disabling interrupts? If so you need to re-enable them again.
After jumping to the application, are you calling the systeminit function again? It's recommended not to do that and work with Bootloader context if the systeminit content is the same.
Ayoub
2023-09-04 05:35 AM
I haven't disabled the interrupts first, but I tried it now disabling in the bootloader and re-enabled it in the application code but still facing the issue, I also reset all the peripherals before jumping.
I haven't used the systeminit function in both the codes.
2023-09-06 05:35 PM
The VTOR register is not set to a proper vector table address.
2023-09-12 10:57 AM
If the vtor is not set the jump won't work I think.
2023-09-12 12:24 PM
You shouldn't transfer control at some nested level within the NVIC, so within an IRQ Handler or related call-back, or RTOS at some protection level.
So if you're doing things from EXTI or USART IRQ, expect things to break.