Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4777

General • Re: Issue with one of two picos when booting, but solved by unplugging/plugging

$
0
0
I use the Pico C SDK exclusively so I can't offer anything that is based on direct experience, but usually I would run simple test programs to determine what works and what does not, and debug the features I need step-by-step.

That looks like CircuitPython, and the Picos would operate as composite USB HID devices. So there appear to be 2 serial consoles and 2 virtual/Pico keyboards. I have no idea how your host-side is set up, but we just need to determine all 4 USB devices work in an operate-from-boot scenario.

I found something interesting here:

https://learn.adafruit.com/circuitpytho ... -and-mouse

See the initialization code, excerpted below:

Code:

# The keyboard object!time.sleep(1)  # Sleep for a bit to avoid a race condition on some systemskeyboard = Keyboard(usb_hid.devices)keyboard_layout = KeyboardLayoutUS(keyboard)  # We're in the US :)
You can try adding delays and spacing out the critical init calls like the above. But if serializing init does not work, then determine which of the serial and keyboard devices are not playing nicely and then maybe someone who's more familiar with CircuitPython can help.
I tried by adding time.sleep but it didn't work. I'll have to look further. Something to note is if I reboot the device, not shutdown, both picos work. But a shutdown and followed boot results in only one pico working. Maybe someone else with CircuitPython experience will chime in!

Statistics: Posted by elpollopollopollo — Mon May 13, 2024 9:49 pm



Viewing all articles
Browse latest Browse all 4777

Trending Articles