How to know if USB data buffer is completely transmitted ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to know if USB data buffer is completely transmitted ?

1,025件の閲覧回数
_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 件の賞賛
返信
1 返信

736件の閲覧回数
gaurav_sharma
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 件の賞賛
返信