Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8035

SDK • Re: TinyUSB Only mounts one device

$
0
0
The big issue I found with multiple devices was that you mustn't put any additional USB code in the mount callback (e.g. tuh_hid_receive_report). If you do TinyUSB appears to block on it and miss subsequent connections. I set a timer after the mount callback for each device (different value) and only start executing the normal transactions after the timeout for that device has expired. This gives time for all the devices connected to a hub to go through the mount protocol before any other USB exchanges happen.
Okay I've tried two things with this I've removed the tuh_hid_receive_report call and then I've tried speeding up the calls to tuh_task I'm still only seeing one device connect to address one. Devices with more than one instance do show up as instance 0 and 1 but I don't ever see more than two. the tuh_mount_cb function fires to say address 1 is mounted but I only use that for logging right now.

Any other ideas?

Code:

void tuh_hid_mount_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* desc_report, uint16_t desc_len){    //uint8_t const itf_protocol = tuh_hid_interface_protocol(dev_addr, instance);    USB_PRINTF("HID device address = %d, instance = %d is mounted\r\n", dev_addr, instance);}
USB_PRINTF is defined as printf right now and that prints directly to VGA.

Statistics: Posted by DarkElvenAngel — Sat Nov 16, 2024 2:08 pm



Viewing all articles
Browse latest Browse all 8035

Trending Articles