Have to unplug after hibernating PC connected to micro:bit v2

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
Posts: 1
Joined: Wed May 05, 2021 4:05 pm

Have to unplug after hibernating PC connected to micro:bit v2

Post by andys » Wed May 05, 2021 4:17 pm

# Note

I have added more detail below - and this now looks like it may be a firmware issue, so I will try and sort this through the microbit forum.

Any tips or suggestions gratefully received...

BTW - Just checked and I can get the same 'no microbit' drive with v2 on a laptop

Here is the 'simpler' behaviour to replicate this:

1. Hibernate Windows.
2. If the micro:bit is still powered, then unplug it and plug it back in (or wait for power to be lost).
3. Power up the PC
4. Check the drives - the microbit drive is now missing. The only way access it is to unplug it and plug it back in resetting doesn't work).

v1 works after I did lots of reflashing (see below). There is a notification about 'device is ready...'

Hello Everyone

When I hibernate my PC, which the micro:bit is plugged into, and also switch off the power completely (so the USB port becomes unpowered), when I bring the PC back up, I cannot reconnect to the micro:bit, without unplugging the usb lead. The micro:bit is also not in the device list and the port is not connected.

The micro:bit is not visible to Windows, Mu Editor (the little red x is shown in the window) and also my application I'm running on the PC.

I have tried the following:

1. Pressing reset on the micro:bit. This restarts the microPython program, but not the USB connection.
2. Triggering a microbit.reset()
3. Triggering a machine.reset()
4. Re initialising the uart using uart.init(115200)

None of these work - I have tried them together as well.

It also makes no difference if I restart Mu or my application.

The only thing that works is to unplug the USB and plug it back in again.

Any ideas/help please?

Note: I have seen this issue with both v1 and v2 micro:bit.

# Success with v1

I tried reflashing a v1 firmware (to a v1) and it made no difference - note that it still ran the micropython program.

I used makecode to create a simple 'show a heart' hex file, downloaded that - and the microbit (v1) then shows as E: after coming out of hibernate (and the Mu Editor finds it as well).

**So this now worked for v1**

I then reflashed the firmware and hibernated - again the microbit is visible.

I then wrote a simple microPython program and flashed it - this also worked fine?!

I then reflashed my original failing microPython program - it now works fine.

# Trying with v2

Tried all above, then used https://python.microbit.org/v/2 to flash a hello world program, then reflashed - nothing seems to get it to work.

Post Reply