Showing results for 
Search instead for 
Did you mean: 

Configure USB Bulk IN/OUT packet size 256 bytes

Associate III
Posted on November 21, 2017 at 03:52


I'm the STM32F207 user, as title mentioned, I have a trouble when configure the usb packet size from the default 64 bytes to 256 bytes. The problem is that my usb device may not be able to connect with all PC host(there are about 10 PC with different version Windows for test) when I configured it as 256 bytes for bulk in/out endpoints, it's strange that my usb device couldn't connect with two PC host which were not properly installed the usb driver for my usb device, but it just worked fine on all other PC hosts, and If I configured my usb device with 64 bytes packet size, it worked fine on all PC host.

The issue was happened during the USB initialization, as PC host will request the Device Descriptor, Configuration Descriptor etc..., when PC is requesting to Set Configuration Descriptor, my usb device was received that request and set the configurations accordingly and then respond a 'Zero Length Packet' as the ACK packet to the Host, but after this ACK packet was issued, PC host stopped to request the last Configuration Descriptors.

I've no idea to keep debugging with issue, any suggestions are appreciate.


attached are some related images from my debugging:

Ben K
Senior III
Posted on November 21, 2017 at 10:18

Are you using USB_OTG_FS or USB_OTG_HS with internal FS PHY? If either is the case, you cannot increase the packet size over 64 bytes, as it is the maximum allowed for a Full Speed device. This conflict is what the smarter USB drivers may recognize from the configuration descriptor, and reject connection to the device. Even if the device is accepted by the driver, the transfers over these incorrectly configured endpoints will not be operational.

Posted on November 22, 2017 at 08:11

Thanks Ben, as you said, I'm using the USB_OTG_FS with its internal PHY. 

Since I couldn't find the related descriptions in the 'reference manual of STM32F207', do you know where I can find the related explanation?

And about the 256 bytes packet size, is it normal that my usb device which the bulk in/out endpoints were configured as 256 bytes packet size can normally communicate with some PC hosts, as I have tried a to transact between Host and Device with about 1K data bytes and the result looks fine?

Posted on November 22, 2017 at 13:45

The FS USB endpoint packet size limit is fixed by the USB specification, therefore it isn't repeated in the RM.

The fact that this packet size works for you probably has something to do with the fact that the USB OTG IP used in STM32 devices is designed for FS and HS operation as well, and might be prepared to handle data size up to HS packet size limit (512 bytes) when in FS mode.

Posted on November 23, 2017 at 02:23

Hi Ben, 

I found out the descriptions in the USB specification about this, very appreciate your guidance.