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

Skip to content

RP2: Pico W hangs shortly after start of main.py when connected to USB host #8904

Closed
@lowfatcode

Description

@lowfatcode

We had reports on our repo that users were having issues with their Pico W locking up: pimoroni/pimoroni-pico#392

I can recreate this issue (using an M1 Macbook Air) with a very simple script:

import time
from machine import Pin

onboard = Pin("LED", Pin.OUT, value=0)

for i in range(0, 40000):
  onboard.on()
  time.sleep(0.025)
  onboard.off()
  time.sleep(0.025)

If that is saved as main.py then when the Pico starts up it will run for perhaps 20-30 iterations of the loop and then lock up hard every single time. Weirdly if I remotely execute the script using the mpremote tool then it runs flawlessly every time.

  • occurs both with the official MicroPython build (currently rp2-pico-w-20220712-unstable-v1.19.1-127-g74794d42b.uf2) and also our build (pimoroni-picow-v1.19.2-micropython.uf2)
  • definitely happens with MacOS (M1 specifically perhaps? not sure) but we think it may affect other platforms with less consistency
  • does not occur on a Pico (sans wireless)
  • does not occur if the device is plugged into a microB AC adaptor

I'm pretty sure something is causing the USB stack to fall over on the Pico W which is then causing it to hang completely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions