Thanks to visit codestin.com
Credit goes to github.com

Skip to content

stm32: if plugging in USB during pyb.delay or pyb.udelay, USB breaks #4210

@ryannathans

Description

@ryannathans

main.py:

while True:
	print('hello')
	pyb.delay(500)  # pyb.udelay(500000) has the same behavior

Running the above snippet on a v1.9.4 PYBLITE V1.0, if USB is unplugged and plugged back in, the USB breaks.

Steps to reproduce:

  1. plug into USB (device powers up)
  2. apply external power supply
  3. connect to REPL, observe 'hello' being printed
  4. unplug USB
  5. plug USB back in
  6. connect to REPL, observe nothing being printed anymore (but connection in PuTTY stays open and filesystem is still accessible)

Oddly, if the pyb.delay is removed, the device works exactly as expected - no bugs.

Perhaps if USB is connected during a pyb.delay it isn't processed properly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-infoThis issue needs more information to be resolvableport-stm32

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions