Skip to content

Commit 5bcedf7

Browse files
committed
xtensa: allow hiding DSR errors
In some situations we know that DSR errors will occur. Add a flag to not print them to the console, so that user doesn't treat them as an issue.
1 parent 734289c commit 5bcedf7

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/target/xtensa.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -617,19 +617,24 @@ int xtensa_core_status_check(struct target *target)
617617
dsr = xtensa_dm_core_status_get(&xtensa->dbg_mod);
618618
LOG_DEBUG("%s: DSR (%08X)", target_name(target), dsr);
619619
if (dsr & OCDDSR_EXECBUSY) {
620-
LOG_ERROR("%s: DSR (%08X) indicates target still busy!", target_name(target), dsr);
620+
if (!xtensa->suppress_dsr_errors)
621+
LOG_ERROR("%s: DSR (%08X) indicates target still busy!", target_name(
622+
target), dsr);
621623
needclear = 1;
622624
}
623625
if (dsr & OCDDSR_EXECEXCEPTION) {
624-
LOG_ERROR("%s: DSR (%08X) indicates DIR instruction generated an exception!",
625-
target_name(target),
626-
dsr);
626+
if (!xtensa->suppress_dsr_errors)
627+
LOG_ERROR(
628+
"%s: DSR (%08X) indicates DIR instruction generated an exception!",
629+
target_name(target),
630+
dsr);
627631
needclear = 1;
628632
}
629633
if (dsr & OCDDSR_EXECOVERRUN) {
630-
LOG_ERROR("%s: DSR (%08X) indicates DIR instruction generated an overrun!",
631-
target_name(target),
632-
dsr);
634+
if (!xtensa->suppress_dsr_errors)
635+
LOG_ERROR("%s: DSR (%08X) indicates DIR instruction generated an overrun!",
636+
target_name(target),
637+
dsr);
633638
needclear = 1;
634639
}
635640
if (needclear) {

src/target/xtensa.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ struct xtensa {
289289
struct xtensa_sw_breakpoint *sw_brps;
290290
bool trace_active;
291291
bool permissive_mode;
292+
bool suppress_dsr_errors;
292293
};
293294

294295
static inline struct xtensa *target_to_xtensa(struct target *target)

0 commit comments

Comments
 (0)