我在使用 Cortex-R过程中,在进行FLASH操作时发生data abort,状态码指示Synchronous External Abort。想请问这个是的错误源通常是什么?
Data abort相关的Synchronous External Abort,
Cortex-R5手册上Table 4-28 Fault Status Register encodings,Synchronous External Abort的FSR [10,3:0] = 0b01000,或许你可以查看c5, Data Fault Status Register来判断是否存取数据的时候AXI总线出错了。
Table 4-29 DFSR bit assignments
[12] SD Distinguishes between an AXI Decode or Slave error on an external abort. This bit is only valid for external
aborts. For all other aborts types of abort, this bit is set to zero:
0 = AXI Decode error (DECERR), or AHB error, caused the abort
1 = AXI Slave error (SLVERR), or unsupported exclusive access, for example exclusive access using the AHB
peripheral port, caused the abort.
[10] S Part of the Status field.
[3:0] Status Indicates the type of fault generated. To determine the data fault, you must use bit [12] and bit [10] in
conjunction with bits [3:0].
我观察到的Data Fault Status Register=0x00000008,就是说SD = 0,AXI decode error啦?我该怎么解决呢?我没有头绪
Data Fault Adrress Register 指示的地址是MEMORY中的一块reserved区域
Memory中的reserved区域不能被访问吧,你把地址改成Memory中有效的地址,无效地址访问肯定出错啊。
我的代码中没有对该区域地址进行的操作
我看手册说AXI decode error是AXI system产生的,我怎么消除这个呢,或者检查代码的哪些方面呢?
确定是data abort哈,代码没有对flash的数据,指令操作么。检查下mpu和堆栈的设置。应该是 cpu 对axi的访问引起的。
你好,我又测试了一下,发现我只进行了初始化以后,就已经产生了BTCM ECC error。其中,设置情况为MPU为禁止,BTCM RAM ECC使能,ATCM FLASH ECC禁止。尝试过增大STACKS,但是没有效果。
synchronous external abort是在初始化后操作FLASH才产生的。
初始化程序运行过程中可能伴有中断产生。这会导致此问题吗?synchronous external abort会不会与BTCM ECC error有关呢?
谢谢
查下你的芯片手册和处理器手册吧,看有没有建议的操作。感觉软件问题比较多啊,估计得用单步操作之类的一步一步调试了。先查查TCM ECC error的问题吧,查一下是那个类型的error。可参考Handling TCM ECC errors,
When a fatal error, that is, a 2-bit ECC error, is detected on a TCM read, an error is generated. Instruction and data reads generate the appropriate type of precise abort, and the AXI-slave interface returns a SLVERR response to the AXI system.
When a correctable error, that is, a 1-bit ECC error, is detected on a TCM read made by the AXI-slave interface, the processor corrects the data inline before returning to the system.
如果你软件的BTCM ECC error和sync external abort有关系的话,为何等到初始化后操作FLASH的时候才产生这个abort,如果有关应该同时产生吧。另外,你操作FLASH的时候,MPU还是禁止的么?
刚才注意到这个寄存器,你结合DFAR查下软件的2次出错error/abort的具体状态吧,
Table 4-30 ADFSR and AIFSR bit functions
Bits Field Function
[31:28] Reserved SBZ.
[27:24] CacheWaya The value returned in this field indicates the cache way or ways in which the error occurred.
[23:22] Side The value returned in this field indicates the source of the error. Possible values are:
b00 = Cache or AXI-master interface
b01 = ATCM
b10 = BTCM
b11 = Reserved.
[21] Recoverable error
The value returned in this field indicates if the error is recoverable.
0 = Unrecoverable error.
1 = Recoverable error. This includes all correctable parity/ECC errors and recoverable TCM external errors.
[20:14] Reserved SBZ.
[13:5] Indexb
This field returns the index value for the access giving the error.
[4:0] Reserved SBZ.