interrupt code
Company  
ST Home | Microcontrollers

Index  »  ARM9 STR9  »  interrupt code
     
   interrupt code
 Moderated by :   »  mirou  -  eris

Author
beginning argument    ( Replies received: 2 )
norbertg   Posted 31-10-2008 at 08:26   



Registered on :
02-22-2009

Messages : 3

 OFF-Line

Hello,

I noticed a strange behavior when compiling interrupt code using Keil compiler
I use ST library v2.0

when i write a complex interrupt function it starts to use r12 register

but in file 91x_vect.s

IRQHandler
SUB lr,lr ,#4
SaveContext r0,r3
LDR r0, = VectorAddress
LDR r0, [r0] ; Read the routine address from VIC0 Vector Address register

BLX r0 ; Branch with link to the IRQ handler.
RestoreContext r0,r3

doesn't save on stack r12 ?

is this a bug or I am missing something

Thanks
Norbert

[ This message was edited by: norbertg on 31-10-2008 08:30 ]



 Profile   Quote  
lakata   Posted 04-11-2008 at 02:48   



Registered on :
12-30-2006

From USA

Messages : 97

 OFF-Line

"---Removed---". Some of the demos have broken the register context saving. You should save all registers r0 to r12, especially r12. The old ST library actually worked a little better.

SaveContext r0,r12 ; Save the workspace plus the current

...

RestoreContext r0,r12 ; Restore the context and return



[ This message was edited by: eris on 25-12-2008 10:48 ]



 Profile   Quote  
eris   Posted 25-12-2008 at 11:01   





Registered on :
07-19-2006

From tunisia

Messages : 49

 OFF-Line

Hello,

Sorry for the late reply, I’ve just seen the message.

Inside the IRQ handler we are not using all registers from r0 to r12
So that’s why we are saving the context only of r0-r3.
Moreover the majority of compilers do the saving of context for all general purpose registers prior to executing the ISR.

Taking into account the above statements and to enhance the response time of interrupts we have decided to limit the saving context in IRQ handler to r0-r3.

The current implementation is much appreciated by many STR9 customers.


Kind regards,
Eris.




 Profile   Quote  
On Top

Search in the forums
 
Jump To