-
|
Hello, I'm trying to implement a tinyusb interface with 3 CDC devices and 1 MSC. [snips of relevant configs] I've been using these interface numbers in the first argument to the n function calls and I've been getting crashes, and reviewing the initializer for CDC here https://github.com/raspberrypi/tinyusb/blob/master/src/class/cdc/cdc_device.c#L259 and the usage within _n_read and _n_write here https://github.com/raspberrypi/tinyusb/blob/master/src/class/cdc/cdc_device.c#L169 (backtrace detail) and finally the dual port example here: https://github.com/raspberrypi/tinyusb/blob/pico/examples/device/cdc_dual_ports/src/main.c#L84 I want to ask if my understanding that the USBD_ITF numbers are NOT what should be passed to the n() functions ITF parameter, and where do I get/generate/determine those interface numbers from? For the time being I'm just going to guess they're sequential from the ordering of CDC devices within the descriptor configuration returned by tud_descriptor_configuration_cb? Then my next question would be, if the CDC devices are not in strict order, how are they numbered (IE, if the descriptor config has CDC, MSC, MIDI, CDC, MSC, CDC). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
all class driver API take instance ID instead of interface number. Which is zero-index and depends on the order of appearance of the interfaces within configuration. I should rename the ITF to INSTANCE to make it clearer. Originally posted by @hathach in #1202 (reply in thread) |
Beta Was this translation helpful? Give feedback.
all class driver API take instance ID instead of interface number. Which is zero-index and depends on the order of appearance of the interfaces within configuration. I should rename the ITF to INSTANCE to make it clearer.
Originally posted by @hathach in #1202 (reply in thread)