Cortex-R52+ mode switch

Hello

I know that ERET (exception return) and change of CPSR.M can be used for switching mode from high to low. Which way is recommended and why ?

BR, Grace

Parents Reply Children
  • I'd argue it's cleaner.  Typically you want to keep privileged vs non-privileged code separate, and have different permissions applied to each. An exception return instruction performs a change of Mode and a branch.  That allows you to cleanly switch between running privileged code from a higher privileged Exception level to running unprivileged/less-privileged code from a less privileged Exception level.