Associate
January 26, 2021
Solved
Why do some misaligned operands require more memory cycles than expected to read from the memory of a Cortex-M4?
- January 26, 2021
- 5 replies
- 1596 views
I wrote some software that reliably measures the number of memory cycles required to retrieve 16 and 32-bit operands from the Cortex-M4 memory. When a 16-bit operand fits within a 32-bit physical word, I would have expected that only a single memory cycle would be necessary to read or write the data, but that's apparently not the case if it's in the MIDDLE of a 32-bit physical word. And when a 32-bit operand is stored at an address off by 1 or 3 from being word-aligned, it takes THREE cycles (instead of the expected two). Take a look at the attached summary of results. Can anyone explain why the results are not as expected (as shown in red)?
Thanks!
Dan