2022-12-07 02:17 AM
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
Solved! Go to Solution.
2022-12-07 05:41 AM
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"
2022-12-07 05:41 AM
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"
2022-12-07 07:14 AM
Hello Danish,
Thank you for highlighting this !
I'll look into it !
Best regards,
Stephane