We have seen data aborts happening.
The always seems to happen when the CPU is reading a pointer from memory.
LD Rn, [PC, #imm]
LD Rn, [Rn]
...
imm: DC32 address
When the first instruction executes, the data abort happens when accessing the "imm" variable
In one case, this is in a subroutine.
This code is called multiple times.
In two places, it generates a data abort, but only when running at full speed.
If I single step through the code, the data abort does not happen.
In other places, I have not seen the bug.
We are using the Parameter Overlay Module, and remap the first 64 kB to SRAM to allow flash programming (It is a bootloader)
The first subroutine that exhibits this problem, runs maybe 20 instructions after POM has been enabled.
The second subroutine runs maybe 20 seconds after the POM has been disabled.
===
I have seen the problem in another place.
This is right after a call to the F021 library has returned.
I am then checking the status through a pointer and it the code has the same pattern.
In this case, both full speed execution and single stepping will cause a data abort.
The POM is enabled in this case, and the CPU should be executing in the first 64 kB, but the POM remaps this to internal SRAM.
I found a workaround, which is to create a __ramfunc subroutine which I jumo to. Then I do not get an abort.
===
The third place where we have seen the problem does not use the POM at all.
When the bootloader starts the application, it passes a parameter to the application
indicating a POWER ON RESET. The application then asserts a S/W reset which
will return the CPU to the bootloader which will not do a full initialization.
Only the stacks and the general purpose registers are initialized before calling the application
again, now passing S/W RESET as a parameter, and the application starts real execution.
The applicatino never touches the POM.
The data abort now happens in an SVC. This SVC is setting the CPU in System Mode. PSR.M[4:;0} = 0x1F.
This is bound to be executed many many times, but after 1 hour a data abort occurs.
We would appreciate ideas on this one!