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

Can I use EXEC_RETURN on M0 outside of an exeception for contect switches?

I have initialized stacks for various tasks with content as expected on SVC interrupts.  I'm not able to dispatch an initial task via the "normal" dispatch function.  On this first dispatch, the processor is not in an exception handler, but the LR is at 0xfffffff9, msp is in use, and the stack looks like it should.

Is their a hidden state in the processor that requires it to be in an exception handler to recognize the EXEC_RETURN as such?

Thanks,

  • The ARMv6-M Reference Manual states:

    If an EXC_RETURN value is loaded into the PC when in Thread mode, ..., the value is treated as an address, not as a special value. This address range is defined to have XN permissions, and therefore the attempted instruction execution results in a HardFault exception.

    The CPU considers itself to be in Thread mode when the exception number in the IPSR is zero.

    hth

    Simon.