From a2cb89385e3a920a27975f1ca4c338c00fe81c76 Mon Sep 17 00:00:00 2001 From: Nav Date: Sun, 5 Jun 2022 18:00:42 +0100 Subject: [PATCH] Updated TC docs --- src/TargetController/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/TargetController/README.md b/src/TargetController/README.md index 29d3b071..b4becf6c 100644 --- a/src/TargetController/README.md +++ b/src/TargetController/README.md @@ -109,6 +109,23 @@ See the corresponding [GitHub issue](https://github.com/navnavnav/Bloom/issues/3 For more on TargetController suspension, see `TargetControllerComponent::suspend()` and `TargetControllerComponent::resume()`. +### Programming mode + +When a component needs to write to the target's program memory, it must enable programming mode on the target. This can +be done by issuing the `EnableProgrammingMode` command to the TargetController (see +`TargetControllerConsole::enableProgrammingMode()`). Once programming mode has been enabled, the TargetController will +reject any subsequent commands that involve debug operations (such as `ResumeTargetExecution`, `RaedTargetRegisters`, +etc), until programming mode has been disabled. + +The TargetController will emit `ProgrammingModeEnabled` and `ProgrammingModeDisabled` events when it enables/disables +programming mode. Components should listen for these events to ensure that they disable any means for the user to trigger +debugging operations whilst programming mode is enabled. For example, the Insight component will disable much of its +GUI components when programming mode is enabled. + +It shouldn't be too much of a problem if a component attempts to perform a debug operation on the target whilst +programming mode is enabled, as the TargetController will just respond with an error. But still, it would be best to +avoid doing this where possible. + --- TODO: Cover debug tool & target drivers.