Closed Peter-Moody closed 1 month ago
Updated Issue based on new information discovered recently.
I think neither the title nor the description of the issue are fully accurate to our understanding anymore. @Peter-Moody let's close this please, or adjust it so that it is true if there is anything still useful/informative in the description.
I agree. This description and title are not accurate.
Describe the bug The HCOM/Meadow code required to initiate the VS debugging session uses the follow steps
Remote debugging startup sequence:
HCOM_MDOW_REQUEST_MONO_START_DBG_SESSION
to HCOM to initiate the debugging session.HCOM_BBREG_MONO_DEBUGGING_START_BIT
in a battery backed register (BBR).Background:
For every request CLI sends to Meadow, HCOM responses with aConcluded
message once the request has been fully processed. This was done to add a simple handshake, without actually modifying protocol. For those requests that result in a Meadow restart, the Concluded message is sent immediately after HCOM has restarted.Problem:
Because HCOM sends theConcluded
message, as soon as HCOM code begins execution, CLI can immediately begin sending binary debugging data, even though Mono may not have started. The remote debuggingConcluded
message should not be sent to CLI until remote debugging is fully operational. This, of course, assumes that that CLIv2, waits forConcluded
messages before resuming/completing the requests it has initiated.Additional information:
Almost 2 years ago Mark added a delay, which postpones the transmission of the first message to CLI. Alexis increased this delay from 2 seconds to 4 seconds a few months ago. This delay has no effect on when CLI begins sending binary debug data to Meadow. It delays the sending of the first debugging message received from Mono. But, this is after CLI has sent binary debug data to HCOM and on to Mono, telling Mono what to do (e.g. run, change a variable, set a break point...).To Reproduce Attempt to debug a
MeadowApp
, notice that it usually takes several attempts to be successful starting the process.Expected behavior Debugging a
MeadowApp
should just work every time without multiple attempts.Developer tools (please complete the following information as best as you can):
Meadow (please complete the following information as best as you can): Most of these values can be found by running
meadow device info
using the Meadow CLI.main
branch