This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EK-TM4C1294XL: STR.w leads to unaligned memory access

Part Number: EK-TM4C1294XL


Hi,

in my program for a TM4C1294XL there is an instruction

0xF8420021: str.w r0, [r2, r1, lsl #2]
with
r0 = 0x00000001
r1 = 0x00000000
r2 = 0x20012AD1

This instruction is assembled from the C line

grantedQoSs[(*count)++] = readChar(&curdata);

and probably forms the store process of the array element. However executing this instruction immediately causes a Hardfault The fault type is unaligned memory access, which I can see because UFSR = 0x0100.

Now my question is what exactly does the instruction do? Does it calculate r2+r1 and shift the result left by 2 bits? Then in my opinion an unaligned memory access would not occure.

Best regards