A RET instruction does not return correctly (problem only with flash) !!!
Mikael Briday
I have a problem in the context switch function of an OS.
the switch function saves the context of the task that is running. Then, it sets the appropriate registers and need to jump to the task_function. The adress of the task_function is set on top of the stack. Then I returns (RET)
But I get a class B interrupt when using the flash.
The value of CSP is not modified ("near" memory model). The value of SP, and the address pointed by SP are correct (I see it on an LCD connected to the developpement kit). I use a C167CS processor (PhyCore). I don't know where the processor jumps, but not to the function it was supposed to :-/
Does someone has an idea? What is the difference between using the simulator and the real hardware?
Read-Only
Author Mike Kleshov
Posted 21-May-2005 18:14 GMT
Toolset C166
RE: A RET instruction does not return correctly (problem only with flash) !!!
RE: A RET instruction does not return correctly (problem only with flash) !!!
Mikael Briday
I found the bug, which was a bad configuration of the stack (Maximum System Stack Size selection (SYSCON.13 .. SYSCON.15) )
SP was changed using MOV instructions (the function change a context) and generate no exception. The problem appear only with the RET instruction, when SP is used.
Thanks Mike Kleshov for your help, I'm sure it will help us!
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.