Warning about file 91x_vect.s
Company  
ST Home | Microcontrollers

Index  »  ST9  »  Warning about file 91x_vect.s
     
   Warning about file 91x_vect.s
 Moderated by :   »  Loiccho  -  chaps

Author
beginning argument    ( Replies received: 1 )
lhoy   Posted 19-02-2008 at 18:44   



Registered on :
02-09-2009

Messages : 2

 OFF-Line

I have been trying to build a STR912 application based on the USB examples from the ST7/9 USB kit "um0290". After many hours of chasing flakey behaviour, I noted that the low level interrupt code in the file "91x_vect.s" only saved/restored the R0-R3 register data during an IRQ interrupt. It should have been saving R0-R12. A quick check of newer examples showed that later versions of the 91x_vect.s code had been corrected to save/restore R0-R12. The file in question is the one that is included in all the examples in the USB kit. It is time stamped 9/29/2006. The examples had been a bit flakey from the start but the real problems started when I added more interrupt activity and tried to up the optimization level in the compiler. The unexplained program jumps and corrupted memory arrays went away after modifing 91x_vect.s to save/restore the full set of registers. I have only been working with the examples from the USB kit. I do not know if this problem also exists in other older example files.



 Profile   Quote  
lakata   Posted 23-08-2008 at 03:12   



Registered on :
12-30-2006

From USA

Messages : 97

 OFF-Line

I will have to concur with this warning. I wish I had found it at the beginning of the day rather waste all day trying to figure out why R12 was getting corrupted. I also noticed that the ST example code is all over the place. The old code saves/restores r0-r12, the newer code saves/restores r0-r3 or r0-r4, depending on which example you look at.

I believe the proper thing to do is (for EWARM 5.11) change 91x_vect.s to use the following where needed.

STMFD sp!,{r0-r3,r12,lr} ;
...
LDMFD sp!,{r0-r3,r12,pc}^;





 Profile   Quote  
On Top

Search in the forums
 
Jump To