cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G031 Interrupts not working after jump from IAP

MKosa.1
Associate

Hi all

I am working with STM32G031F4 on a custom board and using STM32CubeIDE.

I have a small bootloader that jumps to the application after some time (based on HAL_GetTick()), but none of the interrupts seems to be running after the jump- namely UART and SysTick are of interest.

I have tried

int main(void)
{
	SCB->VTOR=0x08001000;
...

as I have same approach on STM32F407 (where it works)

I have also tried mapping the vector table to the beginning of the ram

int main(void)
{
  /* USER CODE BEGIN 1 */
	for(uint32_t i = 0; i < 48; i++)
	{
		VectorTable[i] = *(__IO uint32_t*)(APPLICATION_ADDRESS + (i<<2));
	}
	/* Remap SRAM at 0x00000000 */
	 __HAL_RCC_SYSCFG_CLK_ENABLE();
	LL_SYSCFG_SetRemapMemory(LL_SYSCFG_REMAP_SRAM);
....

which was suggested somewhere on this forum for the Cortex-M0.

When I omit the BL and load the APP from the beginning of the flash it works fine (with commenting the change to VTOR)

I have also tried the simple bootloader/blinky app for the STM32G031 Nucleo-32 board with no success.

And interestingly (at least for me), if I run the app using the debugger, it works just fine (on both boards)

Any ideas what I might be missing?

Thanks in advance

1 REPLY 1
MKosa.1
Associate

So in my case it is a PEBKAC (and the VTOR works)

The bootloader disabled the IRQs before jumping to app and nobody enabled them back again.

The question (at least for me) remains why the interrupts work when the app starts via debugger or at the beginning of flash