Skip to content

Commit a3f9fb5

Browse files
arc: Workaround for D$ flushing issue
On EM Starter Kit images with DDR, reading memory ofter flushing D$ returns 0 - some timeout should be added. Reading instruction for the second time is a natural delay that is enough. Signed-off-by: Anton Kolesov <[email protected]>
1 parent d6460c3 commit a3f9fb5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/target/arc_dbg.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ static int arc_dbg_unset_breakpoint(struct target *target,
189189

190190
/* check that user program has not modified breakpoint instruction */
191191
CHECK_RETVAL(arc32_read_instruction_u32(target, breakpoint->address, &current_instr));
192+
/* FIXME: Read to times as a workaround for D$ flushing issues */
193+
CHECK_RETVAL(arc32_read_instruction_u32(target, breakpoint->address, &current_instr));
192194

193195
if (current_instr == ARC32_SDBBP) {
194196
target->running_alg = 1;
@@ -207,9 +209,15 @@ static int arc_dbg_unset_breakpoint(struct target *target,
207209
uint16_t current_instr;
208210

209211
/* check that user program has not modified breakpoint instruction */
212+
#if 0
210213
CHECK_RETVAL(target_read_memory(target, breakpoint->address, 2, 1,
211214
(uint8_t *)&current_instr));
212215
current_instr = target_buffer_get_u16(target, (uint8_t *)&current_instr);
216+
#else
217+
/* FIXME: Read to times as a workaround for D$ flushing issues */
218+
CHECK_RETVAL(target_read_u16(target, breakpoint->address, &current_instr));
219+
CHECK_RETVAL(target_read_u16(target, breakpoint->address, &current_instr));
220+
#endif
213221
if (current_instr == ARC16_SDBBP) {
214222
target->running_alg = 1;
215223
retval = target_write_buffer(target, breakpoint->address,

0 commit comments

Comments
 (0)