Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web USB reset of micro:bit upsets data logging programs #4681

Closed
jaustin opened this issue May 23, 2022 · 13 comments
Closed

web USB reset of micro:bit upsets data logging programs #4681

jaustin opened this issue May 23, 2022 · 13 comments
Assignees

Comments

@jaustin
Copy link
Collaborator

jaustin commented May 23, 2022

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 #4676 (comment)

@martinwork
Copy link
Contributor

martinwork commented May 23, 2022

Related: #3418, #3357

@pelikhan
Copy link
Member

This is a daplink issue, it resets when setting the baudrate.

@jaustin
Copy link
Collaborator Author

jaustin commented May 26, 2022

Do you have to set the buadrate? If MakeCode is always 115200 and the micro:bit defaults to that, is it actually necessary?

@pelikhan
Copy link
Member

We don't know if the user flashed a program using another environment or changed the baudrate

@jaustin
Copy link
Collaborator Author

jaustin commented May 26, 2022

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).

@pelikhan
Copy link
Member

pelikhan commented Jun 1, 2022

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.

@pelikhan pelikhan assigned abchatra and unassigned pelikhan Jun 1, 2022
@pelikhan
Copy link
Member

pelikhan commented Jun 1, 2022

Added flags to skip those resets: 347f1e1

@abchatra
Copy link
Contributor

abchatra commented Jun 1, 2022

Fixed

@abchatra abchatra closed this as completed Jun 1, 2022
@abchatra abchatra reopened this Jun 1, 2022
@abchatra
Copy link
Contributor

abchatra commented Jun 1, 2022

@jaustin what is the plan of action here?

@abchatra abchatra assigned jaustin and unassigned abchatra Jun 2, 2022
@abchatra
Copy link
Contributor

We reset while setting the baud rate for logging.

@abchatra abchatra removed this from the Micro:bit yearly release June 2022 milestone Jun 10, 2022
@abchatra
Copy link
Contributor

For the next release get rid of the second reset.

@pelikhan
Copy link
Member

Requires a hardware test rig with all versions of DAPLink to validate behavior.

@abchatra
Copy link
Contributor

No actionable thing for makecode here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants