How to know if USB data buffer is completely transmitted ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to know if USB data buffer is completely transmitted ?

608 Views
_Ferrari_
Contributor IV


I am developing an application based on the LCP5526 microcontroller. From USB,configured as VCOM, I need to receive and transmit a large amount of data (size>20kbyte). The size of the USB buffer is 64 bytes, so I would like to know:

- what happens if I receive a data amount greater than 64 bytes
- to transmit data, I need to fragment my buffer (called BUFFER A) into multiple parts (called BUFFER B[0], B[1], B[2], ..., B[n]) and transmit them separately. How do I know that a buffer (B[i]) has been completely transmitted before moving on to the next (B[i+1])?

Has anyone of you had a similar problem? In that case, how was it solved? Thank you very much for your help and collaboration Best regards

0 Kudos
1 Reply

319 Views
gauravsharma7
NXP Employee
NXP Employee

You can configure USB interrupt that routes to NVIC on LPC552x. Whenever you receive data in USB buffers, the handler gets called. You might find this helpful - https://github.com/nxp-mcuxpresso/mcux-sdk-middleware-usb/blob/main/docs/MCUXpresso%20SDK%20USB%20St...

There are callbacks that can be configured which are called when you transmit or receive data on USB buffers.

0 Kudos