← index #17792Issue #15471
Off-topic · high · value 0.194
QUERY · ISSUE

OSError 16 from time.sleep_ms()

openby victorallumeopened 2025-07-31updated 2025-08-05
bugport-stm32

Port, board and/or hardware

stm32

MicroPython version

MicroPython v1.25.0

Reproduction

This is on a custom board. Code during the boot process calls time.sleep_ms(1100)

  1. Hard reset the board
  2. boot/main code starts running fine
  3. Break out to a repl
  4. (at this point, I can run time.sleep_ms() without problem)
  5. soft reset the board
  6. during the boot process, call to sleep_ms() fails

I cannot replicate the issue on v1.24.0 (i.e. something has changed going to v1.25.0)

Expected behaviour

No response

Observed behaviour

Call to time.sleep_ms() raises OSError 16 in the above conditions

Additional Information

This is running on a custom board with an STM32H743 MCU.

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