-
Notifications
You must be signed in to change notification settings - Fork 2
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
Battery powered V2.2 WebUSB errors after unplugging & replugging USB #17
Comments
Could not repeat this with V2.00 + 0258-beta1_kl27z_microbit_if_crc_1c60ddb_gcc.hex. Unplugging causes one of
and once there was |
I cannot replicate this in the Python Editor V2, but it does replicate quite easily in Python Editor V3 and MakeCode, so that points at being related to WebUSB serial being pulled. Commenting out these lines from the Python Editor V3 "resolves" the issue, so I that confirms it's related to that: |
With V2.00 and 0258beta2, I saw none of the problems switching between power bank and PC USB with a battery connected given in https://github.com/microbit-foundation/DAPLink-microbit/issues/146. After testing that 10-20 times, my first attempt to disconnect and connect WebUSB in MakeCode failed
When I power cycled micro:bit, it connected, and I flashed a program. Repeatedly reconnecting the USB cable and flashing a program, the same error appears in the console every few (maybe 5-10) connections, the micro:bit logo next to Download keeps pulsing, but flashing always works and appears to fix the connection, though the console says: Found an ARM Cortex-M4 With a battery powered V2.0, reconnecting USB still seems to cause a glitch in MakeCode. In previous tests I said "WebUSB may be broken until micro:bit is power cycled", but with 0258beta2, all I see is that the MakeCode Download button continues pulsing. Ignoring the pulsing, and downloading anyway always seems to work, as does power cycling or simply reconnecting. Python seems to repeat the pairing process whenever the USB is disconnected, instead of trying to reconnect, so doesn't see a problem. The only way I could trigger a problem in Python was to add a switch between MakeCode and Python. |
A quick note to add that response for command 131 is the This is likely because the USB cable was disconnected between the editors sending a 131 command, to read serial data (as the Python Editor and MakeCode constantly do in the background) and DAPLink being able to send the respond back. |
Adding a bit of extra logging to the Python Editor we can see the following set of events;
Ideally we could find a way to reset the DAPLink state/buffers with existing DAP commands, but we haven't looked into this yet. One possible workaround we could try to implement in the editors (to avoid having to ask users to update the micro:bit firmware with an updated DAPLink) could be the following:
|
Thanks Carlos. Reading through this thread I can't quite determine whether 0258-beta3 fixes this, or whether we still think this is outstanding in DAPLink? |
This is still outstanding in DAPLink. |
With a micro:bit V2.2 running 0256 or 0257:
This is not replicable with V2.0 running DAPLink 0255.
Current reports:
The text was updated successfully, but these errors were encountered: