correct way to use Pico-PIO-USB with pico-sdk v2.2.0 (host + device + stdio) #194
Replies: 1 comment
-
|
I think I managed to answer my own question. The problem was with the USB device descriptors I was using; once I used the one from the I've also noticed that trying to enable debugging by adding does not work as expected; the build complains about But if I set these in my What is odd is that setting Something else I have noticed is that connecting/disconnecting a device from the PIO USB pins is not detected -- detection of the connected device only occurs at powerup. If I enable hub support I can connect and disconnect devices from the hub all day long and it works, but connecting/disconnecting the hub from the PIO USB pins is also not detected. Is there a configuration option or some code I need to add to poll for host port connections/disconnections? I'm now working on actually reading data from the CDC device; I have |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am relatively new to the rpi pico (RP2040 specifically) and am trying to figure out the correct way to write an application which uses the dedicated USB peripheral as a USB device (CDC to start) and the PIO USB as a USB host which will talk to CDC devices like the FT232, CP2104, CH341, etc.. I have cloned the Pico-PIO-USB repo into the same parent directory that I have the pico-sdk as well as my own application, and my CMakeLists.txt contains
to make it aware of the Pico-PIO-USB library.
My
target_link_libraries()looks like this:target_link_libraries(${PROJECT_NAME} PUBLIC pico_stdlib pico_pio_usb tinyusb_device tinyusb_host tinyusb_board)running
cmake ..from thebuilddirectory works, and the firmware builds with the tinyusb warning that stdio has been disabled because both host and device modes are enabled but I have worked around that by providing my own implementation (and it works with Pico-PIO-USB linked in (but not used) when I do not try to use host mode. (e.g.target_link_libraries()does not havetinyusb_hostlisted).I make no code changes, just add
tinyusb_hosttotarget_link_libraries(), blow away the build directory, cmake .. and make again, the board fails to be seen by the host. (I have not enabled host yet, just brought in the library).At this point I'm not sure what I'm doing wrong; Pico-PIO-USB is building and linking fine, but even without
CFG_TUH_ENABLEDandCFG_TUH_RPI_PIO_USBdefined intusb_config.hnor with any calls to set up the host port it fails to bring up the device side.Can anyone help me figure out why the moment I link in
tinyusb_host(without actually enabling host mode) the device-side breaks?Beta Was this translation helpful? Give feedback.
All reactions