I can't really offer any useful suggestions, but I'm doing similar things and have a few comments.
I find the USB device-mode (as you are apparently using) pretty reliable. The host mode seems a bit more flaky, but mainly in the area of attach/detach (where I have seen panics) rather than raw data transfer.
The USB/stdio doesn't provide flow control (ie. data lost if you send faster than the host is reading it). You can drive the CDC directly yourself and have more control - I often set up with two CDCs in my device descriptor, which lets the SDK use the first one for stdio (use for human-readable debugging) and the second one for automated data transfer.
Arguably it's better to use a vendor protocol (ie. devise your own) rather than CDC for this kind of transaction-based control. Vendor protocols get to see the boundaries between logical transfers, which fits well with transactions or other packet-oriented applications. I now have this working well in one of my applications, but it was a huge effort to get there, partly because a Windows PC as host was a requirement. The combination of TinyUSB's lack of documentation or even comments to clarify what is an interface vs an internal function, libusb on the host and various bizarre bits of behaviour on the part of Windows led to a great deal of head-scratching. The source of the Picoprobe was helpful here, as it also implements a vendor protocol (the ARM CMSIS-DAP).
I find the USB device-mode (as you are apparently using) pretty reliable. The host mode seems a bit more flaky, but mainly in the area of attach/detach (where I have seen panics) rather than raw data transfer.
The USB/stdio doesn't provide flow control (ie. data lost if you send faster than the host is reading it). You can drive the CDC directly yourself and have more control - I often set up with two CDCs in my device descriptor, which lets the SDK use the first one for stdio (use for human-readable debugging) and the second one for automated data transfer.
Arguably it's better to use a vendor protocol (ie. devise your own) rather than CDC for this kind of transaction-based control. Vendor protocols get to see the boundaries between logical transfers, which fits well with transactions or other packet-oriented applications. I now have this working well in one of my applications, but it was a huge effort to get there, partly because a Windows PC as host was a requirement. The combination of TinyUSB's lack of documentation or even comments to clarify what is an interface vs an internal function, libusb on the host and various bizarre bits of behaviour on the part of Windows led to a great deal of head-scratching. The source of the Picoprobe was helpful here, as it also implements a vendor protocol (the ARM CMSIS-DAP).
Statistics: Posted by arg001 — Mon Jul 22, 2024 8:53 am