Closed jaustin closed 1 year ago
This is a daplink issue, it resets when setting the baudrate.
Do you have to set the buadrate? If MakeCode is always 115200 and the micro:bit defaults to that, is it actually necessary?
We don't know if the user flashed a program using another environment or changed the baudrate
But if they have serial at a different baudrate, MakeCode doesn't support that anyway (eg #3537) , and if they changed the baudrate somewhere else, that's a pretty uncommon use-case to drive resetting everyone's board (and therefore resetting all timestamps on data logging programs).
Any change in this space would require testing accross (1) V1 vs V2 (2) data logger vs not data logger (3) all versions of DapLink in circulation.
Added flags to skip those resets: https://github.com/microsoft/pxt-microbit/commit/347f1e11e66fb3001f644435b83592c76e133d6f
Fixed
@jaustin what is the plan of action here?
We reset while setting the baud rate for logging.
For the next release get rid of the second reset.
Requires a hardware test rig with all versions of DAPLink to validate behavior.
No actionable thing for makecode here.
When data logging, the micro:bit has a timestamp which is 'time since boot' - this is nice for quickly previewing data.
If you plug in a battery and then do things over a long period of time the time stamps are reliable, except if you are using MakeCode and web USB - in which case the micro:bit gets arbitrarily reset in a set of cases - certainly when you plug the micro:bit back in while web USB is connected.
The result is that your data doesn't have continuous time stamps.
Is it possible to avoid resetting the micro:bit so often with web USB?
CC @martinwork who noticed that beta does this more than live in https://github.com/microsoft/pxt-microbit/issues/4676#issuecomment-1133945430