cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 USB Device HS mode interrupt transmission jitter

BOEINGNG
Associate II

I use STM32F407 USB2.0 HS to send data periodically. The USB mode is high-speed mode. I configure the breakpoint IN transmission as the interrupt transmission mode. I use CDC_Transmit to send data. Each time it is judged that the last transmission is completed before sending data, and the time of interrupting the transmission is The interval is 1ms. I built a FIFO for the USB packet. The rate of USB packet generation is 2ms. I measured the time interval for each write and send data to USB and found that the maximum time interval will increase as the measurement time increases. Generally, the maximum interval for half an hour is 100ms, and for one hour it will be around 180ms. Our host computer is written in python, using the libusb library, and runs on the Windows 11 operating system. Can you guys see what the problem is?

1 ACCEPTED SOLUTION

Accepted Solutions
BOEINGNG
Associate II

I changed the USB protocol to virtual serial port and solved the problem. The read interval is now very stable, with a read interval of about 1.3 seconds appearing every few hours.

View solution in original post

4 REPLIES 4
AScha.3
Chief

>The USB mode is high-speed mode.

So you connected a hi-speed PHY ?

+

>and runs on the Windows 11 operating system. Can you guys see what the problem is?

Win 11 ? 🙂

You cannot expect fixed timing , its not a RTOS ! (response might come in a statistical manner , 1...300 ms or so.)

(On USB audio transfer start i got everything between 20ms and 400ms .)

>for one hour it will be around 180ms

More precisely : the response is permanently increasing - or there are just some "slow" and most other responses still at xx ms ?

If you feel a post has answered your question, please click "Accept as Solution".

>More precisely : the response is permanently increasing - or there are just some "slow" and most other responses still at xx ms ?

The maximum USB transmission interval is increased to 180ms, and the average time is still 2ms. I measured it one night and the maximum interval was 1.8 seconds.

So you :

A: have to live with this timing.

B: use other operating system (Linux should be better here.)

C: prevent any other action on your system, especially on all USB connections;

Windows will sometimes execute very "blocking" actions, like anti-virus defender, update loading, or more like this.

(I had on my Win11 Laptop , when opening a jpg picture (usually instant) to wait 54 sec (i looked at a clock - unbelievable ! ) until pic come up. And task-manager just showing 20% cpu load - all cheating )

If you feel a post has answered your question, please click "Accept as Solution".
BOEINGNG
Associate II

I changed the USB protocol to virtual serial port and solved the problem. The read interval is now very stable, with a read interval of about 1.3 seconds appearing every few hours.