2023-02-26 10:57 PM
Enabling any interrupt at the initialization triggers the WWDG_IRQHandler when watchdog timer doesn't even configured in the code whereas excluding bootloader fw doesn't seem to cause any issues, code runs fine. In the bootloader fw, I haven't configured any interrupts except the cubemx generated system interrupts such as NMI, Hardfault, svc, Pendsv, systick and RCC_CRS.
I've ensured to define handler for all interrupt request in the app fw. code is developed for stm32g0b1ret6 mcu
Here is my jump to app code look alike:
SYS_ERR_t SYS_JumpToApplication()
{
// This is the offset to the application execution region
// Ideally this puts the flow of control of the application to right
// After the Vector table
const uint32_t NUMBER_OF_INTERRUPTS = 30;
uint32_t *executeAddress ;
executeAddress = (uint32_t*) 0x08020000;
// Creates a pointer pointing to start of Application address space
void (*ApplicationFunction)(void);
/// Points function pointer to its reset handler
ApplicationFunction = (void(*)(void)) (*(uint32_t*)(executeAddress + 1));
for (int ii = -2;ii<NUMBER_OF_INTERRUPTS;ii++)
{
HAL_NVIC_DisableIRQ(ii);
NVIC_ClearPendingIRQ(ii);
}
HAL_SuspendTick();
__disable_irq();
//Set Stack pointers to what is stored there
__set_PSP(*(uint32_t*)executeAddress);
__set_MSP(*(uint32_t*)executeAddress);
//Perform Instruction Synschronization Barrier
__set_CONTROL(0);
__ISB();
SCB->VTOR = executeAddress;
__DSB();
__enable_irq();
// Jump to application code
ApplicationFunction();
// In the event the main application returns perform a full system reset
NVIC_SystemReset();
return SYS_NO_ERR;
}
Any pointer how to debug this issue ?
Solved! Go to Solution.
2023-02-27 12:57 AM
It's a catch-all Handler, dozens of the vectors point here.
Determine which is firing, perhaps USART or SysTick. Narrow down to what loader uses. Ensure VTOR is aligned
2023-02-26 11:28 PM
Looks like it's debugged already - see the called procedures' hierarchy in the left pane - watchdog interrupt is firing.
2023-02-26 11:39 PM
watchdog hasn't been configured in the code. It is the default handler who is triggering the watchdog handler. Not sure why?
2023-02-27 12:56 AM
Issue has been sorted. It was because of improper address in the VTOR register in app fw.
2023-02-27 12:57 AM
It's a catch-all Handler, dozens of the vectors point here.
Determine which is firing, perhaps USART or SysTick. Narrow down to what loader uses. Ensure VTOR is aligned