No0ne / hid2cdc

USB keyboard to USB CDC converter using a Raspberry Pi Pico
MIT License
6 stars 2 forks source link

after CPU RESTART picomite VGA no longer connected to HID2CDC #5

Open robert-rozee opened 9 months ago

robert-rozee commented 9 months ago

there are circumstance where, after an attached picomite VGA has reset itself, it appears to no longer be connected to the pico running HID2CDC. this is a minor bug, as once you realize what has happened recovering is easy.

setup is: picomite VGA version 5.08.00. HID2CDC 1.0.

to reproduce behaviour: type CPU RESTART at the picomite command prompt and wait. when the intro message comes back up on the VGA screen (after 5 seconds or so), keyboard input is ignored by the picomite. provided that GPIO3 is connected to RUN on the picomite, pressing ctrl-alt-delete causes a full and successful reboot of everything.

the same (ignoring keyboard input) behaviour can also be created by toggling the RUN pin on the picomite low. again, pressing ctrl-alt-delete fixes things.

if GPIO3 is not connected the picomite may or may not work, or the picomite may start working again after a minute or two.

i'd suggest an easy fix would be to have HID2CDC perform the ctrl-alt-delete sequence (including toggling GPIO3) whenever it sees the picomite disappear from the USB bus. a more complex solution would be to try probing for the picomite on the USB bus, but from past experience with picomites attached to a Linux box, this may be futile. under certain 'misbehaving' conditions i've seen a picomite quite successfully crash Linux's USB subsystem.

IMPORTANT NOTE: the picomite requires that DTR be asserted for the console to operate correctly. this may or may not be related to this issue. since HID2CDC has always operated ok under normal conditions, i assumed that DTR was always being kept asserted.

cheers, rob :-)