cancel
Showing results for 
Search instead for 
Did you mean: 

USBD_LL_Transmit doesnt work on STM32F401CCU6 (Black Pill)

vaibhav3012
Associate

Hi , This is the first time I am using USB on STM32F401CCU6 blackpill.

I am thinking of developing stereo microphone.

To start with I am USING STM32CUBEIDE for development .

Selected the STM32F401CCU6 in MCU and have configured the clock to 84Mhz.

In Communications , USB_OTG_FS --> selected DEVICE ONLY.

In Middleware , AUDIO Class is selected.

The descriptors are modified correctly and the device is detected as microphone.

Have not used the AUDIO UNIT FEATURE descriptor.

For now to keep it simple, I have not selected any ADC for input.

To debug I have configured the GPIO PC13 as output and will toggle as per my debug purpose.

The endpoint EP1 0x81 is used for the microphone data transfer to PC.

The DATAOUT call back is commented since , it will not be used, have made a dummy transfer in the DATAIN callback in the file usb_audio,.c found in middleware folder.

 

Have implemented a non blocking GPIO pin toggle every 1000ms in the datain callback.

Even after the device is detected correctly , I am unable to transmit the packages, also the DATAIN callback is never called.

After analysing the code , it is found that the "transfer complete interrupt" is never set and hence the DATAIN callback is never called.

The data packets are monitored on the Wireshark , below is the screenshot

vaibhav3012_0-1717999074736.png

It seems that the PC is requesting the data , but the device never responds with the packet because the DATAIN is not called.

I am using STM32CubeIDE version 1.51.1

vaibhav3012_1-1717999205667.png

The firmware version for STM32F401CCU6 firmware version is V1.28.0

vaibhav3012_2-1717999293491.png

Attached are the USB_audio.c and USB_audio.h.

Am I missing something ?Am I doing something wrong ? 

I am very new to this , experts help will be appreciated.

Thanks,

 

1 REPLY 1
FBL
ST Employee

Hi @vaibhav3012 

 

Unfortunately, not certain that the F401 in question is an ST product, and as such, we may not give further support.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.