cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5 USB Eye diagram

stephane.c
Associate

Hello,

I'm working on STM32U5. We integrated the USB lib without AzureRTOS using the stm32_mw_usb_device (from STM github) as example.

I use my STM32U5 as a USB device CDC, using the USB_OTG_FS. Everything seems to be working fine (Linux can mount it and send/receive data to/from it).

Now, I want to test the eye diagram required by the USB 2.0 specification but I could not find any example code for this.

I saw in the code a function called "USBD_RunTestMode()" but unfortunately, it is empty.

Do you have an example of this ?

If not, could you give me some hints on how I should do this ?

Thank you.

Best regards,

Stephane

1 ACCEPTED SOLUTION

Accepted Solutions
Danish1
Lead II

Have you studied the Reference Manual for your stm32?

In the stm32f4xx Reference Manual there is a whole chapter on its full-speed USB-OTG-FS, and another on its USB-OTG-HS interfaces.

In (for example) OTG_FS there is OTG_FS Host port control and status register (OTG_FS_HPRT) which has bits PTCTL: Port test control

"The application writes a nonzero value to this field to put the port into a Test mode, and the corresponding pattern is signaled on the port.

0000: Test mode disabled

0001: Test_J mode

0010: Test_K mode

0011: Test_SE0_NAK mode

0100: Test_Packet mode

0101: Test_Force_Enable"

View solution in original post

2 REPLIES 2
Danish1
Lead II

Have you studied the Reference Manual for your stm32?

In the stm32f4xx Reference Manual there is a whole chapter on its full-speed USB-OTG-FS, and another on its USB-OTG-HS interfaces.

In (for example) OTG_FS there is OTG_FS Host port control and status register (OTG_FS_HPRT) which has bits PTCTL: Port test control

"The application writes a nonzero value to this field to put the port into a Test mode, and the corresponding pattern is signaled on the port.

0000: Test mode disabled

0001: Test_J mode

0010: Test_K mode

0011: Test_SE0_NAK mode

0100: Test_Packet mode

0101: Test_Force_Enable"

stephane.c
Associate

Hello Danish,

Thank you for highlighting this !

I'll look into it !

Best regards,

Stephane