cancel
Showing results for 
Search instead for 
Did you mean: 

Zero Length Packet necessary? (USB STM32F407 VCP bare metal)

waldi
Associate II

I thought if I transfer e.g. 64 bytes I can load pktcnt with a value of 2.

One for 64 bytes, second for ZLP?

Or do I have to send it manually after IN transfer complete interrupt?

3 REPLIES 3

The Synopsys OTG IP in 'F4xx is a very fragile machine, you cannot work on it through assumptions even if logical. Follow closely whatever documentation is available, and the existing example code.

Here, in particular, the procedure is documented. From RM0090:

To transmit a few maximum-packet-size packets and a zero-length data packet at

the end of the transfer, the application must split the transfer into two parts. The

first sends maximum-packet-size data packets and the second sends the zero-

length data packet alone.

JW

waldi
Associate II

Interestingly if I disable subsequent ZLP and use for 384 bytes pctcnt of 6 (not 7! with 7 it didn't work), a continuous stream also works.

waldi
Associate II

Is it possible to load pktcnt with a number higher than 7? There was something in the datasheet, but I can't find it. It is odd to have a 10 bit register which can be filled only to a value of 7...