2019-05-03 08:19 AM
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 .....
2019-05-03 10:35 AM
HC-06, wireless and USART only needed.
2019-05-04 01:05 AM
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)
2019-05-05 02:45 AM
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?
2019-05-05 09:54 AM
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.