ARM Technical Support Knowledge Articles

Use of banked registers after forced user-mode STM

Applies to: ARM Firmware Suite, RealMonitor


This is fixed in AFS 1.4.
RMTarget, as supplied in AFS 1.2 and AFS 1.3, uses a sequence of instructions that accesses banked registers after a forced user-mode STM. To fix this, you must add a NOP as follows:

1) In the Sources/rm_asm.s file, locate the following code in the rm_PollRunningToStoppped function:

         STMIA   lr, {a1,a3,r5-r14}^ ; Save user-mode r3-r14.
ADD a1, lr, #12*4 ; a1 points to r[15]

2) Insert a NOP instruction as follows:

         STMIA   lr, {a1,a3,r5-r14}^ ; Save user-mode r3-r14.
NOP ; need a 1 instruction gap before reading lr
ADD a1, lr, #12*4 ; a1 points to r[15]

(DE 63660)

Article last edited on: 2008-09-09 15:47:32

Rate this article

Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential