microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
698 stars 580 forks source link

Workaround WebUSB DAPLink firmware issue #5530

Open microbit-carlos opened 3 months ago

microbit-carlos commented 3 months ago

There is at least one known issue with WebUSB failing that we can apply a workaround in MakeCode. If the micro:bit has a battery pack connected, when the USB cable is unplugged (in the middle of a WebUSB transaction) it can leave DAPLink in a bad state and WebUSB might stop working when the micro:bit is reconnected:

This will need a DAPLink firmware update, but a workaround can be applied to MakeCode as described in the DAPLink issue, which is desirable, as many user will never really update their firmware.

microbit-carlos commented 3 months ago

@abchatra The general idea of the workaround (from https://github.com/microbit-foundation/DAPLink/issues/17#issuecomment-1555034429):

abchatra commented 3 months ago

Thanks @microbit-carlos

microbit-carlos commented 2 months ago

We talked about it with @abchatra and we think we should first do the following:

https://github.com/microsoft/pxt-microbit/assets/29712657/d9c210c3-aede-4e93-9854-05f6a76da0f1