2017-11-08 01:32 AM
Hi,
i m using STM32f746G-DISC board for USB HOST in CDC mode, i m trying to receive data of 256-bytes (which is transmitted from another board) but i am able to receive only 64-bytes (stored in CDC_RX_Buffer[ ])...
How to get Total data (of 256 bytes).
#stm32f7-usb-receive #stm #stm32f7-discovery #stm32f7-receive-interrupt #stm32f7-usb-host-cdc2017-11-08 03:03 AM
Hi,
You will need to store 64 bytes away each time before leaving the receive function CDC_Receive_FS, as that is the most that will arrive in one interrupt if you are using a 64 byte endpoint.
Each time in the receive function, copy your data to a buffer and increment the buffer pointer by the amount received ready for next time. As you say, there is a user buffer already provided (alter APP_RX_DATA_SIZE to 256 and have a moving pointer), or you could just have your own.
Maybe have a structure, which has your 256 byte buffer, a pointer which you will alter, and a flag to say that a full data packet has been received... but it depends on your application.
Ant