This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

A RET instruction does not return correctly (problem only with flash) !!!

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?