Skip to main content
Zanon.Luciano
Associate III
May 3, 2019
Question

USB Virtual Com Port unusable

  • May 3, 2019
  • 4 replies
  • 640 views

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 .....

This topic has been closed for replies.

4 replies

S.Ma
Principal
May 3, 2019

HC-06, wireless and USART only needed.

Zanon.Luciano
Associate III
May 4, 2019

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
Associate III
May 5, 2019

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
Associate III
May 5, 2019

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.