cancel
Showing results for 
Search instead for 
Did you mean: 

VCP userBufferRX limitation on STM32Cube

PATRICK COMBETTE
Associate II

Hello everyone,

I have one more question about a project I generated with STM32CubeMX for an STM32WB55 microcontroller. The code generation included all necessaries libraries and source code to communicate with an external master device (such as a laptop), and all seems to work perfectly on this side (I mean, communication between my laptop and the STM32WB is OK).

When I try to receive a frame sent by the laptop or a terminal, (in the "userBufferRX" ) it seems to be limited tu 64 bytes only. In the RX buffer, I see only 64 bytes and the end of my frame seems to loopback at the beginning of the buffer. I need to receive frames up to 200 bytes.

So, here is my question : Is there any configuration to extend this size or is it herd-limited ? How can I set this ?

Thank you for your help, and have a nice weekend to all.

Patrick

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

USB FS data frames are limited to 64 bytes. If messages are longer, they are split into several frames, and you'll only receive 64 on the first frame.

It could be you're jumping the gun and need to wait longer for the remaining data to come in. You'll need to store them in a buffer until all 200 bytes are present.

The 64 bit frame size is a limitation of USB FS.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

USB FS data frames are limited to 64 bytes. If messages are longer, they are split into several frames, and you'll only receive 64 on the first frame.

It could be you're jumping the gun and need to wait longer for the remaining data to come in. You'll need to store them in a buffer until all 200 bytes are present.

The 64 bit frame size is a limitation of USB FS.

If you feel a post has answered your question, please click "Accept as Solution".
PATRICK COMBETTE
Associate II

Hello TDK,

Thank'a lot for your quick reply.

Those explanation are clear and it's what I guessed.

I just implemented splitting my data in less than 64 bytes frames, and this is Ok now.

Thank you again and have a nice day.

Patrick