cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 Discovery. AudioUSB device. 2 Isochronous USB EP (IN EP and OUT EP) do not work simultaneously

chupys
Associate II

Hi. I am currently trying to implement USB headset on my old STM32F407 Discovery board.

In USB descriptor I have simple topology with two input terminals, 2 out terminals and feature unit. Also I describe two streaming interfaces (IN and OUT) and one control interface.

When I am connecting this device to my laptop, host correctly recognize both interfaces. I can play music from host via discovery board and I can record sound from mic, connected to my discovery board.

The problem begin, when I am trying to do that simultaneously - try to record sound from mic, during host`s music is playing. When I am start recording, host`s music suddenly stops, but recording is continuing. When I stop recording, host`s music is still not playing. It seems that my device completely lost ability to play music from hots but preserves ability to record sound from discovery mic.

After debugging I find out, that after that unsuccessful try of simultaneous work of both interfaces, the OUT EP interrupt is stops. Despite the fact that host is still sending samples of music to play (wireshark is able to capture this samples).

From my debug session with logic analyzer I can say, that after both interfaces have to work simultaneously, there is some small amount of time, when both (OUT and IN EP) interrupt is present. But after that OUT EP interrupt is stopped and newer comes again.

All that behavior is repeated, when I reconnect my device to USB.

My code is located on github: https://github.com/ancher-bohdan/stm32_usb_interface/tree/task/usb_headset

 List of my USB descriptor you can find in similar question, that I`ve posted on stack overflow:

 https://stackoverflow.com/questions/71213031/stm32-usb-audio-device-headset-cant-init-second-interface

Any help will be appreciated. Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
chupys
Associate II

Ok. It seems that I`ve fixed it.

There was a problem in my USB TX FIFO stack size configs. I thought, that size of TX FIFO buffer should be in DIEPTXF reg in bytes. But it turns out, that this value should be in 32-bit word.

Silly me

View solution in original post

1 REPLY 1
chupys
Associate II

Ok. It seems that I`ve fixed it.

There was a problem in my USB TX FIFO stack size configs. I thought, that size of TX FIFO buffer should be in DIEPTXF reg in bytes. But it turns out, that this value should be in 32-bit word.

Silly me