事实证明,ARM11 的 openocd 有一些错误。我最终进行了一些更改以使其按照 arm 规范工作:
在 arm11_debug_entry
打开数据的排放会中止。支票应该是:
if (!(dscr & DSCR_STICKY_ABORT_IMPRECISE))
然后在C1控制寄存器前添加如下代码
/* Enable Debug Cache write back, and disable line fills */
/* mcr p15,7,R0,c15,c0,0 */
retval = arm11_run_instr_data_to_core_via_r0(arm11, 0xeeef0f10, 0x07);
if (retval != ERROR_OK)
return retval;
现在我保存然后恢复 C1 控制寄存器
/* Read Modify write control register 1 to disable MMU/Cache etc. Store to reprogram upon return */
/* MRC p15,0,R0,c1,c0,0 */
arm11_run_instr_data_from_core_via_r0(arm11, 0xee110f10, &cntrlregval);
if (retval != ERROR_OK)
return retval;
arm11->saved_c1cntrl = cntrlregval;
/* Perform Modifications */
/* MCR p15,0,R0,c1,c0,0 */
retval = arm11_run_instr_data_to_core_via_r0(arm11, 0xee010f10, cntrlregval);
if (retval != ERROR_OK)
return retval;
在 arm11_leave_debug_state
/* disable debug cache write thrus, etc */
retval = arm11_run_instr_data_prepare(arm11);
if (retval != ERROR_OK)
return retval;
retval = arm11_run_instr_data_to_core_via_r0(arm11, 0xeeef0f10, 0x00);
if (retval != ERROR_OK)
return retval;
/* re write Coprocessor control */
retval = arm11_run_instr_data_to_core_via_r0(arm11, 0xee010f10, arm11->saved_c1cntrl);
if (retval != ERROR_OK)
return retval;
retval = arm11_run_instr_data_finish(arm11);
if (retval != ERROR_OK)
return retval;
我会尝试进行这些更改,以便其他人不会遇到我的问题。