Hi,
first of all I am sorry if this post is incomplete. I can not imagine what the fellow readers here might need to answer my question but I am sure they will tell me. So here it is:
I run a function to read a timer which is called every few microseconds and most of the time works just fine. However, sometimes I get a prefetch abort exception with either
IFSR=0x00000005, IFAR=0x00000004 and Link=0x00000008
or
IFSR=0x0000000d, IFAR=0x49000000 and Link=0x49000004
Using ETB I get the following result (shortened)
| Disassembly | Program Address | Code | Read Address | Write Address | Cycle |
Delta Cycles |
| LDR R1, 0x800381A4 | 0x8003808C | 0x4945 | 2015 | 1 | ||
| 0x800381A4 | 2016 | 5 | ||||
| LDR R0, [SP] | 0x8003808E | 0x9800 | 2021 | 1 | ||
| 0x80E030B8 | 2022 | 5 | ||||
| STR R0, [R1] | 0x80038090 | 0x6008 | 2027 | 1 | ||
| 0x803C1D00 | 2028 | 5 | ||||
| LDR R1, 0x800381A8 | 0x80038092 | 0x4945 | 2033 | 1 | ||
| 0x800381A8 | 2034 | 5 | ||||
| LDR R0, [SP, #0x8] | 0x80038094 | 0x9802 | 2039 | 1 | ||
| 0x80E030C0 | 2040 | 5 | ||||
| LDR R2, [R1] | 0x80038096 | 0x680A | 2045 | 1 | ||
| 0x40810204 | 2046 | 7 | ||||
| ADD R0, R0, R2 | 0x80038098 | 0x1880 | 2053 | 1 | ||
| STR R0, [R1] | 0x8003809A | 0x6008 | 2054 | 1 | ||
| LDR R0, 0x800381A8 | 0x8003809C | 0x4842 | 2055 | 1 | ||
| LDR R0, [R0] | 0x8003809E | 0x6800 | 2056 | 1 | ||
| POP {R1, R2, R3, PC} | 0x800380A0 | 0xBD0E | 2057 | 1 |
Note that "Delta Cycles" says 7 while the same sequence usually looks like this (Delta Cycles = 5):
| LDR R1, 0x800381A8 | 0x80038092 | 0x4945 | 1812 | 1 | ||
| 0x800381A8 | 1813 | 5 | ||||
| LDR R0, [SP, #0x8] | 0x80038094 | 0x9802 | 1818 | 1 | ||
| 0x80E030C0 | 1819 | 5 | ||||
| LDR R2, [R1] | 0x80038096 | 0x680A | 1824 | 1 | ||
| 0x803C1D04 | 1825 | 5 | ||||
| ADD R0, R0, R2 | 0x80038098 | 0x1880 | 1830 | 0 | ||
| STR R0, [R1] | 0x8003809A | 0x6008 | 1830 | 1 | ||
|
0x803C1D04 |
1831 | 2 | ||||
| LDR R0, 0x800381A8 | 0x8003809C | 0x4842 | 1833 | 1 | ||
| 0x800381A8 | 1834 | 5 | ||||
| LDR R0, [R0] | 0x8003809E | 0x6800 | 1839 | 1 | ||
| 0x803C1D04 | 1840 | 5 | ||||
| POP {R1, R2, R3, PC} | 0x800380A0 | 0xBD0E | 1845 | 1 | ||
| 0x80E030B8 | 1846 | 5 | ||||
| 0x80E030BC | 1851 | 1 | ||||
| 0x80E030C0 | 1852 | 1 | ||||
| 0x80E030C4 | 1853 |
4 |
This is not reproducible; sometimes I have to wait 15 to 20 minutes to see the exception, sometimes the program runs for several days without issues.
I would be very thankful for an explanation of what I do see here, a solution, or an idea on how to dig deeper into this.
Regards and a relaxing weekend
Ingo