Please share more details on the buffers that you created. How many buffers are you using. I can understand that the buffer size as 16KB.
Actually, we have reference code that sends a full packet followed by a short packet and also for sending a full packet followed by a ZLP. You can find this code as attachment to the following application note:
The code attached to the above application note will be a good starting point for your project development.
Also please let me know the reason behind sending a ZLP after 1KB data.
1.I used 4 buffers for each address line,and the buffer size is 16KB, pc bluk buffer size is 64KB 2.I want to send 1KB data to pc,but data could not be received on the pc side when i sent 1kB , the PKTEND# signal asserted with the last word of which, so i sent 1KB +ZLP to see whether it can work.
Does the size of buffer must be set as the size of full packet?
If you want to just send 1KB of data then assert both PKTEND# and SLWR# simultaneously. Then it should commit just 1KB of data (short packet) to USB.
Please try this and let me know the result.
You can also do this by changing the buffer size to 1KB. But it will reduce the data rate if you are doing bulk data transfers.
After i did it , Pc received nothing when buffer size is 16kB, but received 1kB when buffer size is 1KB.
The same is when i want to send nkB (smaller than 16KB), buffer size must be set as 1KB.
I want to know when to use ZLP.
If the buffer size is 16KB, what ' s the size of data to send when ZLP must be asserted?