Skip to content

Commit

Permalink
Fixed intermittent 'illegal target state' error from EDBG debug tools…
Browse files Browse the repository at this point in the history
…, when issuing commands immediately after target reset.
  • Loading branch information
navnavnav committed Sep 24, 2022
1 parent c7af236 commit 2282967
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
} catch (const Exception& exception) {
throw Exception("Failed to reset AVR8 target - missing stopped event.");
}

/*
* Issuing another command immediately after reset sometimes results in an 'illegal target state' error from
* the EDBG debug tool. Even though we waited for the break event.
*
* All we can really do here is introduce a small delay, to ensure that we're not issuing commands too quickly
* after reset.
*/
std::this_thread::sleep_for(std::chrono::milliseconds(250));
}

void EdbgAvr8Interface::activate() {
Expand Down

0 comments on commit 2282967

Please sign in to comment.