This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352: [Linux] How to enter USB 2.0 Host Eye Diagram Test Mode

Part Number: AM3352

Hi experts,

Our board is running on linux-4.19.38.

I've read the document here. (And also the TRM 16.2.10 USB 2.0 Test Modes)

It says that it is possible to use following commands to enter USB Test Mode.

Fullscreen
1
2
> mount -t debugfs none /sys/kernel/debug/
> echo "test packet" > /sys/kernel/debug/musb-hdrc.1/testmode
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

However, when I tried, it was not functioning. No pattern(wave) showed up on the analyzer's screen.

So, here are the questions.

1. How can I ensure the mode is set correctly?

2. If we use a hub, will it take any effect?

Thank you!

- Howard

  • Hi Howard,

    The command sequence should be correct.

    What does it print if you then run command 'cat /sys/kernel/debug/musb-hdrc.1/testmode'?

    I never tried to connect a hub to the usb port, but I don't remember if a USB device has to be attached while running the 'echo "test packet" ...' command, then detach the usb device and connect the scope or analyzer. I will give it a try early next week to refresh the sequence.

  • Hi Bin,

    We add the hub in schematics, it isn't a pluggable hub. Reference

    ~ # cat /sys/kernel/debug/musb-hdrc.1/testmode
    test packet

    - Howard

  • Hi Howard,

    Are you measuring the hub upstream port or downstream port?

    I don't think you can measure the hub downstream port, the test packets from the MUSB controller won't go through the hub.

  • Hi Bin,

    We attach the analyzer to the USB A after hub...

    So, in this case, I should rework schematics and test it from the upstream side?

    I will forward your message to our HW member.

    Thanks!

    - Howard

  • Hi Howard,

    If you have a on-board hub, you might want to measure the eye-diagram on the hub downstream port to ensure the entire usb subsystem doesn't have signal integrity problem.

    Please check the USB2.0 Specs, I vaguely remember the Specs define the hub to support test-packet test mode and the usb host should send a special SETUP packet to trigger the hub to test-packet test mode.

  • Hi Bin,

    I found another reference here.

    https://e2e.ti.com/support/interface/f/interface-forum/596356/linux-am5728-usb2-test-patterns-through-hub/2195870#2195870

    However, the CONTROL.C utility link is crashed. It seems like it can be used to generate test packets... though I am not sure about the difference between this utility and "echo "test packet" > /sys/kernel/debug/musb-hdrc.1/testmode".

    Whatever, it is likely to work with a hub.

    Do you know the new source code path?

    BTW, what does "(NOTE: My Linux guru tells me that this should be built on the target and not cross-compiled on the host)" means? Does the target mean the testing computer (not the board)?

    -Howard

  • Hi Howard,

    I found another reference here.

    https://e2e.ti.com/support/interface/f/interface-forum/596356/linux-am5728-usb2-test-patterns-through-hub/2195870#2195870

    However, the CONTROL.C utility link is crashed.

    Please try this link: https://github.com/felipebalbi/usb-tools

    It seems like it can be used to generate test packets... though I am not sure about the difference between this utility and "echo "test packet" > /sys/kernel/debug/musb-hdrc.1/testmode".

    control.c tells the USB host (AM3352 MUSB controller in your case) to command the USB hub to generate test packets. While 'echo "test packet" > .../musb-hdrc.1/testmode' tells the MUSB controller to generate test packets.

    BTW, what does "(NOTE: My Linux guru tells me that this should be built on the target and not cross-compiled on the host)" means? Does the target mean the testing computer (not the board)?

    The target is your AM3352 board. It is easier to do native compile on the board than cross-compile on a host PC. However you can still do cross-compile if you know how to do so.