Skip to main content
waldi
Associate II
August 9, 2019
Question

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

  • August 9, 2019
  • 3 replies
  • 877 views

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?

This topic has been closed for replies.

3 replies

waclawek.jan
Super User
August 10, 2019

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
waldiAuthor
Associate II
August 13, 2019

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
waldiAuthor
Associate II
August 14, 2019

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...