2016-02-12 02:44 PM
Hi all,
I am trying to develop my own DisplayLink device with STM32F429 Discovery board. I use CDC as a template of it. Whole edited enumeration pass OK. But when I need to receive data from EP 1 (OUT Bulk) than occurs a problem.
I have whole project generated from Cube MX. This way I am trying to read datauint8_t ht[4620];
uint8_t result = USBD_OK;
do
{
result = USBD_CDC_SetRxBuffer(pdev, ht);
}
while(result != USBD_OK);
do
{
result = USBD_CDC_ReceivePacket(pdev);
}
while(result != USBD_OK);
HuffmanTable = ht;
But it doesn´t send success response to USB host.
Thanks for any help.
#stm32f4-usb-cdc-device #discovery #stm32f4
2016-02-15 01:06 AM
1. Change the following define:
#define APP_RX_DATA_SIZE 64 2.USBD_CDC_ReceivePacket
() does not receive anything, it only arms the interface for data reception. The function should be called from CDC_Init_FS(), but it isn't. Add the call before return fromCDC_Init_FS().
3. When the data is received, CDC_Receive_FS() is called by USB framework. You should process the incoming data in this function. After processing, callUSBD_CDC_ReceivePacket
() to re-arm for reception. There are some more quirks and problems in the CubeMX USB CDC stuff.2016-02-18 04:48 AM
Thanks a lot!!!
This exactly solved my problem! As you said, I found a lot of irregularities in that generated code. For example comments above methods sometimes doesn't match the methods. Also a naming of methods are sometimes crazy. I have generated code for my discovery board which works in FS but all methods has HS instad of FS in their names. But works as FS... Thank you! You saved me a lot of time and worry.