2025-01-15 12:05 PM - edited 2025-01-15 12:06 PM
I've setup a custom USB device with multiple interfaces on custom hardware using a ULPI. The USB code is derived from the code generated by CubeMX.
From the PC, I wrote a very simple program that can send and receive a single packet. I can send and receive data on interface 0 (ep1). I can also send data from PC to device to on interface 1 (ep2), but I cannot receive data. Interface 2 has not yet been implemented. Transmit and receive buffers are set as follows in usbd_conf.c:
HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_HS, 0x200);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 0, 0x20);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 1, 0x80);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 2, 0x80);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 3, 0x80);
In my custom device class I open all three pairs of EP's exactly the same way. I'm missing something though. My presumption is that everything will go through the interrupt handler (OTG_HS_IRQHandler). If I toggle a DIO there, it fires off multiple times during enumeration, then every time I read from interface 0. When I read from interface 1, the interrupt doesn't fire. Is there an interrupt configuration that I'm missing a setup on for interface 1? I've been at this for a couple days so any suggestions would be welcome! Thanks!
2025-01-15 01:24 PM
UPDATE:
One further bit of information, when I do a read from the PC while using a USB packet sniffer, I can see an IN packet go out on the wire, but the device is responding with a NAK packet. Something appears to be actively rejecting the request... but not sure where that would be.