cancel
Showing results for 
Search instead for 
Did you mean: 

Process gets stuck in the initialization phase before enter main(), because of timer interrupt?

CLi.21
Associate II

I am developing on STM32-f030CCT6 MCU, and IDE is IAR.

There are two program in the flash, one is loader, one is application.

Loader is responsible to upload application, and jump to application location to execution.

Loader uses timer 6 as time base source.

After jumping from loader to application, application gets stuck in the initialization phase before enter main().

However, if I turn off timer 6 before jumping to application, it works fine.

If loader uses system tick as time base source, it works fine as well.

My questions is, Do timer interrupts cause application to get stuck?

If it is the reason, why system tick works fine? System tick causes interrupts as well.

Thanks for your time to read this question!

Hope could get help for this, thanks a lot.

5 REPLIES 5

You probably have two different vector tables, one for the loader, other for the application.

Is a proper interrupt handler defined for TIM6 in both?

JW

AvaTar
Lead

Yes, bootloader and application supposedly work on a different set of interrupt vectors.

It would be wise to disable all interrupts before jumping to the application, and do a full initialization there.

Yes, I do have two vector tables. Those two both define interrupt handler for TIM6.

In the beginning of application's main function, application's vector table is copied to SRAM and used.

Before copying application's vector table to SRAM, the vector table of loader is used. Even its in system initialization of application.

I see, thanks.

However, I still wandering how TIM6 interrupt affect system initialization of application.

I don't know your BL and application.

But if you don't disable the timer interrupt, it may hit after you had jumped to to the app, while initializing.