--- Quote Start ---
originally posted by tns1@Nov 9 2005, 10:42 AM
if the code looks ok, what about the state of the registers?
to learn more, try explicitly disabling interrupts around the dsr "abe++".
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10880)
--- quote end ---
--- Quote End ---
The problem has been located.
Stepping through the assembler code I noticed that the index into the hal_interrupt_data is calculated and stored in r15.
Then a call to the isr takes place and upon return r15 is used again for finding the DSR and calling the interrupt_end function.
If the ISR uses r15 without restoring it this scenario will obviously crash in many flavours
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif
In the broken code r15 is used by the compiler and not restored which is perfectly legal according to the register usage table 7-2 in
nios ii processor reference handbook.
Depending on the kind of C code you write in the ISR you can have r15 corrupted or not.
I've just modified the vector.s code to use r16 instead of r15 pushing it onto the stack etc and that did the trick.
in my humble opinion this seems to be a major bug in the nios port of ecos. Looking forward to having your opinions.