← index #16713Issue #15471
Related · medium · value 1.394
QUERY · ISSUE

Serial com and external power supply

openby eleroyopened 2025-02-06updated 2025-02-23
bug

Port, board and/or hardware

rp2, raspberry pico

MicroPython version

MicroPython v1.24.1 on 2024-11-29; Raspberry Pi Pico with RP2040

Reproduction

  1. Start a code with serial printing such as:
import time

while True:
    print(time.time())
    time.sleep(0.1)    
  1. Connect external power supply (+5V or 3V3)
  2. Disconnect usb
  3. Wait ~4 s
  4. Reconnect usb

Expected behaviour

When you reconnect USB, the board should be normally detected as CDC Serial device and printing.

Observed behaviour

When you reconnect USB the board is not detected anymore and it seems the program has been interrupted.

Additional Information

I suspect something like a buffer overflow on the serial output hardware is happening.

If the usb is reconnected quickly (in 1 second or so), the board is well detected.

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

rp2: Board does not enable USB after hard reset if an error is raised in boot.py.

closedby robert-hhopened 2024-07-16updated 2024-07-19
bugport-samdport-mimxrtport-rp2

Port, board and/or hardware

rp2, mimxrt, SAMD, but maybe other's as well

MicroPython version

MicroPython v1.24.0-preview.23.g8809ae716.dirty on 2024-07-16; Raspberry Pi Pico with RP2040

Reproduction

Just create a boot.py file, which raises an exception and push reset or do a power cycle. On Soft reset this problem does not occur. I used the following test script with the option to bypass the test:

from machine import Pin
p=Pin(2, Pin.IN, Pin.PULL_UP)
if p():
    1/0

Expected behaviour

Just boot with an exception message and bypass main.py.

Observed behaviour

Board does not register USB and seems bricked. Uploading an older firmware including v1.23.0 helps.
Just a few interim commits:
Fails with commit 8809ae716 shared/tinyusb: Buffer startup CDC data to send to host on connection.
Runs with the previous commit d144f0699 lib/tinyusb: Update to the most recent master.

Additional Information

No, I've provided everything above.
@pi-anl

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied