likes: food, programming, traveling, physics

  • 47 Posts
  • 182 Comments
Joined 1 year ago
cake
Cake day: June 17th, 2023

help-circle

























  • Learned how drivers worked and fixed a driver for an USB to I2C chip. It’s still buggy but at least it sorta works now.

    Some more details: I was using a CH347 (USB to UART/SPI/I2C) and there was an open source driver that used a previous chip version. The original dev had hardcoded the bulk IO endpoints indices. The only change I had to do was just iterate over the endpoints and search for the correct ones. But at first, I didn’t understand anything about how the USB subsystem worked and how drivers were loaded. All I could tell was the USB device was correctly detected but the I2C driver wasn’t being loaded, despite proper udev rules, correct vendor/product IDs, etc.