Hi,
I am trying to port some Keyword spotting code that I found from: https://github.com/ARM-software/ML-KWS-for-MCU to Arm DS and have it run on an Arm M33 FVP. Although the code builds successfully without any errors, at some point I am getting the following error within a for loop :
Failed to read 4 bytes from address 0xEFFFFE6E
Failed to read 2 bytes from address 0xEFFFFFFE
I don't understand why the compiled code is trying to access memory at these addresses. I am using the default scatter file and the RAM address range is from 0x20000000 to 0x20020000.
What could I be missing?
Hi FanisMy name is Stephen and I work at Arm.I suspect that some kind of exception is occurring at run-time, that is resulting in a fault condition, but the fault is then not being trapped, and so your code crashes. Possible exceptions might include an unaligned data access (load/store instruction), stack or heap overflow (or underflow), an attempt to execute a floating point instruction but floating point is not enabled, etc.I suggest you single-step through the code to identify the culprit instruction. You can also use the "trace" support provided in the Cortex-M33 FVP, to capture the history of instruction execution, to help reveal unexpected run-time issues. To capture trace from the FVP, seeSee developer.arm.com/.../Capture-trace-output-from-a-Fixed-Virtual-PlatformHope this helps,Stephen
Dear Stephen,
Thank you for your prompt reply. I went through the code step by step as you suggested and indeed the crash happens at a store instruction. It seems that the code attempts to store a register value to address 0x3F5E6BFF although this exceeds the limits of memory with RW rights. How could I check if this issue is caused by unaligned data access?
Hi again FanisAn example of an unaligned data access is trying to load/store a word (4 bytes) e.g. LDR/STR to an address that is not a modulo of 4, or to load/store a half-word (2 bytes) e.g. LDRB/STRB to an address that is not a modulo of 2. You don't say exactly what the instruction is in your case, but if it is an STR or STRH to 0x3F5E6BFF, then that would be an unaligned access.
However, the address 0x3F5E6BFF itself looks very wrong in your M-class system, as it is outside the RAM address range of 0x20000000 to 0x20020000. I suggest you debug the code to find out where that address is coming from.Stephen