cancel
Showing results for 
Search instead for 
Did you mean: 

cubemx stm32 usb cdc: feature request after transmitting data then call transmitt_complete callback

taraben
Senior
Posted on February 07, 2016 at 19:25

Hello,

I use the USB device CDC class. I do transmit data.

But while I give the the data to the CDC_Transmit_FS function.

The application must not overwrite data on those buffer until the transmit is finished.

Potentially there are several USB packets to be sent until all data transmitted.

What I miss is a trigger for the application to reuse the buffer used in the CDC_Transmit_FS function.

I assume in the file usbd_cdc.c in function USBD_CDC_DataIn there you could put a function call to callback function: CDC_TransmitCplt_FS

the callback function could be added to USBD_CDC_ItfTypeDef.

This way it could callback to usbd_cdc_if.c module.

Right now after automated code generation I have to patch usbd_cdc.c and usbd_cdc_if.c

in order get signals data_received and data_transmit_completed into the application.

Regards,

Adib.

--

#stm32-usb-cdc-cubemx
3 REPLIES 3
taraben
Senior
Posted on February 10, 2016 at 00:13

Hello Hannibal,

thanks for your response. But the thread you mentioned is  different topic.

Yes I have to know to not to sent data while Tx is in progress.

To not let the application wait and do NOP cycles the application need to be informed by the means of callback.

This is what I need. This is implemented in other modules. But not in USB CDC.

Regards, Adib.

--