From acd953afd2f52d64e2264c2c7c713dc0ad614406 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Sun, 29 Mar 2020 16:17:53 -0700 Subject: When enabling the debug module, poll til it's really enabled Resolves #435 --- fesvr/dtm.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fesvr') diff --git a/fesvr/dtm.cc b/fesvr/dtm.cc index 6e4952f..993011d 100644 --- a/fesvr/dtm.cc +++ b/fesvr/dtm.cc @@ -560,6 +560,8 @@ void dtm_t::producer_thread() // Enable the debugger. write(DMI_DMCONTROL, DMI_DMCONTROL_DMACTIVE); + // Poll until the debugger agrees it's enabled. + while ((read(DMI_DMCONTROL) & DMI_DMCONTROL_DMACTIVE) == 0) ; // These are checked every time we run an abstract command. uint32_t abstractcs = read(DMI_ABSTRACTCS); -- cgit v1.1