Cannot read using serialHost with RPI Pico,tinyUSB and PIOUSB.h

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jginaz
 
Posts: 2
Joined: Wed Feb 15, 2023 10:50 pm

Cannot read using serialHost with RPI Pico,tinyUSB and PIOUSB.h

Post by jginaz »

I am trying to read from a u-blox GPS receiver through a USB connection to a RP2040 RPI pico. I am using the Arduino IDE and have configured tinyusb in the IDE and the code uses the bit-banging piousb method. When I load the device_info.ino from the examples I am able to see the device descriptor in the serial monitor and it has a product type of 2. When I use the serial_host_bridge.ino example, I see that it connects with a SerialHost.connect() returning a 1 but the SerialHost.available() always returns a 0 and the incoming buffer is not read. I can see with a scope that the signal on pin 20 is toggling every 1 ms but the data is never shown as available. The scope data shows a solid preamble of alternating 1s and 0s and then likely a start of frame character then random 2, I'm guessing, characters. The stream of this pattern is continuous every 1ms

User avatar
jginaz
 
Posts: 2
Joined: Wed Feb 15, 2023 10:50 pm

Re: Cannot read using serialHost with RPI Pico,tinyUSB and PIOUSB.h

Post by jginaz »

I finally did get this to work. I needed to add CFG_TUD_CDC 2 to tusb_config.h. Also added the latest updates from the hathach tinyusb on github. It actually works quite well with the GPS. Unfortunately, my ultimate goal was to get it to work with a (tr)usdx radio but it reports as a vendor specific USB device instead of CDC.

JG

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”