STM32F412 USB Mono speaker. Corrupted USB driver after a few changes between alternate settings. #2311
Replies: 3 comments 9 replies
-
Alright, after a bit of on and off debugging. Increasing the size of the RX fifo by at least 4x the size of the largest endpoint fixed the issue. Unsure as to why the Rx FIFO has to be so big. I looked through the update_grxfsiz function and calls within, and it seems as though it should work. Any help is appreciated. |
Beta Was this translation helpful? Give feedback.
-
You mean CDC or UAC FIFO ? If there is no usage error then there could be some unknown issues in dwc2 driver.
|
Beta Was this translation helpful? Give feedback.
-
@keshav-raj-trekker It may (or not) help. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I have an issue, which I am certain is likely a configuration issue on my end.
I have a board with an STM32F412 with I2S to a audio amplifier. I am using TinyUSB in device mode full speed using the synopsis dwc2 driver for the USB OTG FS peripheral on the STM32. I am also using AzureRTOS. (Not using USBX as audio class isn't fully supported by their framework builder).
I have configured the descriptors for a CDC ACM class and audio class mono speaker. The plan is to utilize the feedback endpoint at some point. But right now I am trying to get the basic audio streaming working.
The device enumerates correctly and I see both the interfaces. My board also shows up as an audio device (after setting up the callbacks) and I am able to receive streaming data from my PC when I adjust the volume slider on the windows 10 taskbar. However when I deselect the slider and the device switches to 0 bandwidth streaming. Occasionally the slider freezes, and on the device side after debugging. The processor stops at a TUD breakpoint in
dcd_dwc2.c
within functionhandle_rxflvl_irq
. It seems that the ctl_word contains garbage data. For example, the endpoint number is 10, when I only have 6 total endpoints, and pktsts is none of the valid status enums and ranges from 11-15.At this point the USB driver is unrecoverable without a full processor reset. Replugging the device usb does nothing, the PC no longer detects the device.
The status of the dwc2 driver interrupt status(GINTSTS): 0x44a08428
The value control word from the driver FIFO (GRXSTSP): 0xf3df78fe
Debug printout:
The printout cuts out once the breakpoint stops.
The following is my descriptors:
I have modified the TUD_AUDIO_SPEAKER_MONO_FB_DESCRIPTOR macro template and removed the feedback endpoint.
I am calling the tud_int_handler in the USB OTG FS handler and returning to ensure the original HAL IRQ handler isn't called.
I am calling tud_task() in a high priority ThreadX thread which is run every time a timer elapses. Which makes the task run every 50us.
Finally the following details my TUSB configuration:
Any help is appreciated.
Cheers!
EDIT: Thought I might add the debug prinouts at program initialization and enumeration of device:
Beta Was this translation helpful? Give feedback.
All reactions