As far as I understand, ARM Cortex-M processors are always in a Thumb state, which means:
The speaker status indicated by the software counter is odd (LSB = 1). branching to an even address will throw an exception because switching to ARM Status is not allowed.
However, although I use CortexM0 and M4 CPUs, PCs are always even . Every time I enter branches, LR writes PC + 1 and every time I return, PC gives LR-1.
For example, if lr = 0x0000_01D5,
Run
Bx lr
Then the PC should be 0x0000_01D5, while it gives 0x0000_01D4.
Is it impossible?
Any comments would be appreciated.
source share