2023-08-04 01:53 AM
Solved! Go to Solution.
2023-08-04 09:29 AM
Really aren't that many registers in the NVIC, dump them, and review.
Are you calling from inside an Interrupt Handler or Call-back? Do you set the SCB->VTOR properly? Is it at the right address alignment, with the correct content?
Are you calling from an RTOS
Deinit all you peripheral interrupts at the *source*. Watch that you don't end up stuck in the Error_Handler() or HardFault_Handler(), instrument those so you know.
2023-08-04 05:53 AM
The code you shared doesn't mess with interrupts at all. Are you disabling them prior to the jump? When they are not happening, debug the chip, look at the appropriate systick-related registers to determine their state.
2023-08-04 07:58 AM
Hi,
thankyou for your reply.
About the interrupt disable before jump I make this:
NVIC_DisableIRQ(USART2_IRQn);
NVIC_ClearPendingIRQ(USART2_IRQn);
Is it enough?
About the regsters STK:
STK_CVR change his value going step by step in debug.
STK_CSR->COUNT_FLAG from 0 goes to 1 but going on with the debug remain always high.
It is proven by the breakpoint I put inside the interrupt routine. I never reach the breakpoint.
I attach a screenshot of the registers. The tick interrupt exeption is enabled.
Thank you.
Regards.
2023-08-04 09:25 AM
I also verifyed that the PRIMASK register bit PM is correctly at 0.
Maybe the problem is on NVIC?
Any suggestion about what can I check on NVIC?
2023-08-04 09:29 AM
Really aren't that many registers in the NVIC, dump them, and review.
Are you calling from inside an Interrupt Handler or Call-back? Do you set the SCB->VTOR properly? Is it at the right address alignment, with the correct content?
Are you calling from an RTOS
Deinit all you peripheral interrupts at the *source*. Watch that you don't end up stuck in the Error_Handler() or HardFault_Handler(), instrument those so you know.
2023-08-06 02:10 AM
Thank you for your reply.
The problem was SCB->VTOR. The vector table was not aligned. In the apllication the vector table start address is at 0x08008000. In bootloader execution on 0x08000000. On the Bootloader I have to make explicit the offset that is 0 by SCB->VTOR. Otherwise if I come from Application the vector table address is still 0x08008000 after the jump.
thank you.
2023-08-06 04:05 PM
Just drop that fragile and complex design and implement a better and simpler one: