Timer ISR is not getting called after jump from bootloader

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Timer ISR is not getting called after jump from bootloader

618 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kounst on Wed Dec 02 01:15:44 MST 2015
Hi,

in my application on the LPC1114 I'm using the 16bit timer 0. The match0 and match1 are set up to generate interrupts.
This is working fine.
I've now added a custom bootloder to my project. At power-on the bootloader is exected and after 5 seconds the bootloader jumps to my application.
With the bootloader the timer ISR of the Application FW is not getting called anymore. I can see that the match interrupt flags are set in the timer interrupt register and  I can see  in the debugger that all timer registers are setup as expected. But the interrupt is not getting called.

It seems that this has something to do with the way the jump from the bootloader to the application is achieved. If the jump from the bootloader to the application is performed within an ISR the behaviour is as described above. But if the jump to the application is done from the main loop (so, not from whtin an ISR) the application works just fine.

My thinking is that the NVIC is somehow getting confused because the ISR of the bootloader is never actually finished (becaus of the jump to the application). I tried to disable and clear the interrupts right before jumping but that didn't change anything.

Does anybody have an idea?
I have a workaround so I don't actually need to figure this out. It's very curious though...

Regards,
Konstantin

Labels (1)
0 Kudos
6 Replies

592 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kounst on Thu Dec 03 00:25:13 MST 2015

Quote: wmues
If you are jumping to your main application from inside an ISR, the ISR is never ended. Other ISRs with higher priority may be called, but all other ISRs are hold off.

You HAVE to jump to your main application from normal execution, not from an ISR.



I thought I could just clear the interrupt inside the ISR and by doing that basically get back to normal excecution context.
I did some reading on the ARM infocenter website and i see now that reseting the interrupt doesn't do what i want.

Resetting the interrupt just resets a pending interrupt but it does not set an interrupt that is active to inactive.
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0497a/Bhchgeei.html
0 Kudos

592 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Wed Dec 02 09:20:46 MST 2015
If you are jumping to your main application from inside an ISR, the ISR is never ended. Other ISRs with higher priority may be called, but all other ISRs are hold off.

You HAVE to jump to your main application from normal execution, not from an ISR.
0 Kudos

592 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kounst on Wed Dec 02 03:04:37 MST 2015

Quote: R2D2

Quote: kounst

If the bootloader calls the application from within the timer16_0 ISR...



:~

You are not jumping inside an ISR, aren't you  :O



Well, yes I am!
That does seem to be the problem. I'm just wondering why this is a problem.
0 Kudos

592 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Dec 02 02:42:59 MST 2015

Quote: kounst

If the bootloader calls the application from within the timer16_0 ISR...



:~

You are not jumping inside an ISR, aren't you  :O
0 Kudos

592 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kounst on Wed Dec 02 02:14:57 MST 2015
thanks R2D2,

i am in fact remapping the vector table to the sram. My interrupts are working both in the bootloader and in the application.
All except for one. The timer16_0 isr in the application is not working

One addition:
If the bootloader calls the application from within the timer16_0 ISR, then the timer16_0 ISR is not working in the application.
Other interrupts are not affected.
0 Kudos

592 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Wed Dec 02 01:28:45 MST 2015

Quote: kounst
Does anybody have an idea?



Read

https://www.lpcware.com/content/forum/secondary-bootloader-on-cortex-m0

:quest:
0 Kudos