cancel
Showing results for 
Search instead for 
Did you mean: 

USB Virtual Com Port unusable

Zanon.Luciano
Senior

hello, I'm trying to transfer a block of data from the PC via USB (with HyperTerminal) to my device card, but I haven't found a way to not lose data.

Surely there is the possibility of controlling the flow of data coming from the PC arriving on the reception routine "CDC_Receive_FS" but I have found nothing.

Is there anyone who knows how to suspend the arrival of data from the host to allow it to be processed?

Without data flow control, the entire VCP package is unusable .....

4 REPLIES 4
S.Ma
Principal

HC-06, wireless and USART only needed.

I'm sorry, but what does this have to do with it?

I'm trying to transfer a text file via USB cable from the PC to my development board (stm3210-c)

Zanon.Luciano
Senior

looking on the net I found this old function that seems suitable for my purpose, (put the out endpoint3 in nak state)

void EP3_OUT_Callback(void) {

...

SetEPRxStatus(ENDP3, Do_I_Have_Room_For_More_Data() ? EP_RX_VALID : EP_RX_NAK);

}

unfortunately the SetEPRxStatus function is not present in the code generated with cubemx for the stm3210c card.

can anyone tell me if there is a similar function in the new libraries?

Zanon.Luciano
Senior

I found something....

As described in UM1734 (USB data transfer flow) The PCD layer provides all the APIs required to start and control a transfer flow.

Is there anyone who has experience using the HAL_PCD_EP_SetStall and HAL_PCD_EP_ClrStall APIs and can help me with any suggestions?

Or is there a reference project for these APIs?

Thanks in advance.