What’s better for New Year’s Eve than debugging some USB hardware issues?
In my previous article, I explained how the design of Waveshare’s RP2350-USB-A can make the USB-A host connector incapable of detecting certain USB devices, and of any hot-plugging. The solution was to desolder R13, a pull-up resistor on D+:

With this fix, my RP2350-USB-A was able to detect when I connected a keyboard to the USB-A port, and to receive keypresses.
However, I noticed another issue: when disconnecting the keyboard, the board would not detect that it happened. When connecting the keyboard again, it would often not work at all, unless I reset the board.
The reason is that the USB-A circuitry is still not compliant with the requirements of a USB host. Specifically, the host side should have weak pull-down resistors on D+ and D-:

Without this, the voltage level of D+ and D- remains “floating”. That is, the value is not well defined. In practice, it was close enough to GND at boot, that the board could see the device pulling D+ (or D-) up. However, when disconnecting the keyboard, the charge in D+ (or D-) would have nowhere to go, and the voltage would likely not return to GND.
To test this, I made a small gadget out of some male and female USB connector breakout boards:

The magic lies on the back:

I just plug the gadget between the RP2350-USB-A and the keyboard (on the right):

When I disconnect the keyboard from the gadget (not the gadget from the RP2350-USB-A, as the gadget complements the host), the RP2350-USB-A has no problem detecting it!

This will do for experimenting but, for a cleaner solution, I would go with soldering an SMD resistor between the D+ and GND pins, and maybe a through-hole resistor between the D- and GND pins, directly on the pads of the USB-A connector of the board.
