ARM Technical Support Knowledge Articles

How do I get my ARM1176 processor to do unaligned accesses without aborting?

Applies to: ARM1176

Answer

The U bit (bit[22]) in the cp15 c1 Control Register determines whether the ARM1176 can handle unaligned accesses properly, or not.

The default value is zero (or the value of the UBITINIT input) which is ARMv5 Legacy Mode. With the U bit defaulting to zero it allows the ARM1176JZF-S to run code originally intended to run on an Architecture v5 core, such as the ARM926EJ-S, with little or no modification. In v5 cores, unaligned accesses are not allowed. You might expect a data abort to occur when an unaligned access is attempted in Legacy Mode; this only happens if strict alignment checking is turned on by setting the A bit (bit[1]) in the same cp15 c1 register. The default for the A bit is zero; hence unaligned accesses causing incorrect data to be stored/reported but not signalled by an abort.

To get unaligned accesses to work, all you should need to do is set the U bit in the cp15 c1 register. This you will have to do with some assembler code
since there is no way to access cp15 from C.


Rate this article

[Bad]
|
|
[Good]
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