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.

AM620-Q1: USB test in U-Boot

Part Number: AM620-Q1
Other Parts Discussed in Thread: SK-AM62B, SK-AM62-LP

Tool/software:

I am try to get your "tisdk-base-image-am62xx-evm.wic.xz" image to boot on custom hardware.  I am able to get to the u-boot diagnostics.  Can I still test my USB with the base image?  I was able to start the USB controller using "tisdk-default-image-am62xx-lp-evm.wic.xz" image but I'm not able to with the base image:

U-Boot 2023.04-dirty (Jun 28 2024 - 14:40:19 -0400)

SoC:   AM62X SR1.0 HS-FS
Model: Texas Instruments AM625 SK
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -121
DRAM:  no bloblist found!2 GiB
Core:  66 devices, 28 uclasses, devicetree: separate
MMC:   mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -121
Net:
Warning: ethernet@8000000port@2 (eth1) using random MAC address - 76:74:85:25:27:77
eth1: ethernet@8000000port@2
Hit any key to stop autoboot:  0
=> usb start
starting USB...
Bus usb@31000000: generic_phy_get_bulk : no phys property
Register 1000840 NbrPorts 1
Starting the controller
USB XHCI 1.10
scanning bus usb@31000000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
=> usb info
1: Hub,  USB Revision 3.0
 - U-Boot XHCI Host Controller
 - Class: Hub
 - PacketSize: 512  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

=>

Should I be able to detect a thumb drive present using the u-boot diagnostics and how would I go about doing that?  Also, is there any reason I would not be able to see the USB controller with the "base" image?

I reviewed my configuration files and was able to start the USB controller within the base image:

U-Boot 2023.04-dirty (Jul 02 2024 - 16:34:54 -0400)

SoC:   AM62X SR1.0 HS-FS
Model: Texas Instruments AM625 SK
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -121
DRAM:  no bloblist found!2 GiB
Core:  66 devices, 28 uclasses, devicetree: separate
MMC:   mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
EEPROM not available at 80, trying to read at 81
Reading on-board EEPROM at 0x51 failed -121
Net:   eth0: ethernet@8000000port@1
Warning: ethernet@8000000port@2 (eth1) using random MAC address - e2:41:81:60:b3:9b
, eth1: ethernet@8000000port@2
Hit any key to stop autoboot:  0
=> usb start
starting USB...
Bus usb@31000000: generic_phy_get_bulk : no phys property
Register 1000840 NbrPorts 1
Starting the controller
USB XHCI 1.10
scanning bus usb@31000000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
=> usb info
1: Hub,  USB Revision 3.0
 - U-Boot XHCI Host Controller
 - Class: Hub
 - PacketSize: 512  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

=>

I'd still like to know how to verify the presence of a storage device, though.

  • Hi Jim,

    I am not sure I fully understand your message.

    I was able to start the USB controller using "tisdk-default-image-am62xx-lp-evm.wic.xz" image but I'm not able to with the base image:
    Also, is there any reason I would not be able to see the USB controller with the "base" image?

    It seems you are not able to see the USB controller, but both U-Boot console log has the following message, which means the USB controller.

    scanning bus usb@31000000 for devices... 1 USB Device(s) found

    and the "usb info" command output also shows the information of the USB controller. Please let me know what I missed.

  • Bin,

    Sorry about the confusing post.  My initial log was before I made some configuration changes that allowed me to see the USB controller.  The second log is current.

    What I would like to know is if I can "see" through the u-boot utility a thumb drive I insert into the USB A connector on our board.  Will "usb storage" provide that information or is another command required.

    Thanks!

  • => usb start
    starting USB...
    Bus usb@31100000: generic_phy_get_bulk : no phys property
    Register 1000840 NbrPorts 1
    Starting the controller
    USB XHCI 1.10
    scanning bus usb@31100000 for devices... 2 USB Device(s) found
           scanning usb for storage devices... 1 Storage Device(s) found
    => usb tree
    USB device tree:
      1  Hub (5 Gb/s, 0mA)
      |  U-Boot XHCI Host Controller 
      |
      +-2  Mass Storage (480 Mb/s, 500mA)
           TS-RDF5  Transcend 000000000037
         
    => usb storage
      Device 0: Vendor: TS-RDF5  Rev: TS3A Prod: SD  Transcend   
                Type: Removable Hard Disk
                Capacity: 7580.0 MB = 7.4 GB (15523840 x 512)
    => ls usb 0:1
                EFI/
     19376640   Image
       609541   tiboot3-am64x-gp-evm.bin
       612130   tiboot3-am64x_sr2-hs-evm.bin
       612130   tiboot3-am64x_sr2-hs-fs-evm.bin
       612130   tiboot3.bin
      1017203   tispl.bin
      1335119   u-boot.img
         1124   uEnv.txt
    
    8 file(s), 1 dir(s)
    
    => ls usb 0:2
    <DIR>       4096 .
    <DIR>       4096 ..
    <DIR>      16384 lost+found
    <DIR>       4096 bin
    <DIR>       4096 boot
    <DIR>       4096 dev
    <DIR>       4096 etc
    <DIR>       4096 home
    <DIR>       4096 lib
    <SYM>         19 linuxrc
    <DIR>       4096 media
    <DIR>       4096 mnt
    <DIR>       4096 proc
    <DIR>       4096 run
    <DIR>       4096 sbin
    <DIR>       4096 srv
    <DIR>       4096 sys
    <DIR>       4096 tmp
    <DIR>       4096 usr
    <DIR>       4096 var
    <DIR>       4096 opt

  • Bin,

    OK!  I have a USB to micro-SD card adaptor I can try.  I'll follow up shortly.

  • Bin,

    What did you use for your test?  I have a UNI USB to micro-SD card adapter that I inserted into the USB A port and I get the following:

    I used your development board for this (booting off an SD card).

  • It sounds you did the same as what I did. I was booting the SK-AM62B from a SD card, inserted a "Transend" USB3.0 SD card reader with a bootable SD card for another EVM to the SK USB type-A port.

    If the UNI adapter doesn't work on your SK board, you can try with a USB thumb drive formatted in VFAT or EXT4.

  • Wait a minute, your console log shows USB@31000000 is being enabled, it is the SK USB type-C port, not the type-A port.

    The SDK U-Boot by default configures USB@31000000 in peripheral mode. Have you modified your U-Boot to configure this USB port to host mode?

  • Bin,

    I'm using the "tisdk-default-image-am62xx-lp-evm.wic.xz" from your web site with no modifications.  Should I modify the config?  Which file is it and is it in the u-boot or kernel directory?

    Thanks!

  • Jim,

    The 'lp' WIC image is for a different SK EVM, which I barely use. I am not sure why by default it enables USB@31000000 in host mode. Anyway, do you have a USB type-C adapter or type-C thumb drive to plug it into the SK type-C port (the port between the console micro-B port and power type-C port), to see if it can be enumerated?

  • Bin,

    I located a USBC adaptor that had slots for USB A type thumb drives and micro-SD cards.  I inserted one of each and neither was recognized.

  • Jim,

    I am out of office today and don't have access to my EVM setup. But can you please attach your USBC adapter to a Linux PC to check if it has a USB hub builtin? I am not sure if U-Boot supports USB hub, I never paid attention on this.

  • Bin,

    The manufacturer of the adaptor is MOKiN.  It has multiple adaptors on it... USB 2.0 A, USB 3.0 A, SD card, micro-SD card, etc.  I've attached a screen shot after inserting an SD card.  Prior to inserting the SD card, the adaptor was not recognized...

  • Hi Jim,

    The screen shot doesn't tell if the USB adapter has a built-in hub or not.

    I am not sure if U-Boot supports USB hub, I never paid attention on this.

    I just tested on my SK evm, and confirmed U-Boot doesn't support USB hub.

    So the easiest way to check on your setup is to directly use a USB thumb drive, not a SD card adapter.

  • Bin,

    OK!  I just inserted this adaptor and then inserted a USB 2.0 A thumb drive.  Like before, the adaptor wasn't detected until I inserted the USB thumb drive:

  • Jim,

    This still doesn't tell if the adapter has a hub or not. Please do this on your Linux PC:

    - run command 'dmesg -w' on your Linux PC terminal, you might need to use 'sudo' depending your PC configuration;
    - then insert the USB adapter to a PC USB port, you don't need to attach the USB thumb drive to the adapter;
    - the Linux terminal will print the adapter enumeration log. Please provide the log.

  • Bin,

    Yes, it looks like it's a hub:

    1135992.027055] usb 2-2: new SuperSpeed USB device number 13 using xhci_hcd
    [1135992.075946] usb 2-2: New USB device found, idVendor=2109, idProduct=0817, bcdDevice= 6.23
    [1135992.075950] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [1135992.075951] usb 2-2: Product: USB3.0 Hub             
    [1135992.075952] usb 2-2: Manufacturer: VIA Labs, Inc.         
    [1135992.075953] usb 2-2: SerialNumber: 000000000
    [1135992.078259] hub 2-2:1.0: USB hub found
    [1135992.079255] hub 2-2:1.0: 4 ports detected
    [1135992.202479] usb 1-2: new high-speed USB device number 30 using xhci_hcd
    [1135992.352685] usb 1-2: New USB device found, idVendor=2109, idProduct=2817, bcdDevice= 6.23
    [1135992.352689] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [1135992.352690] usb 1-2: Product: USB2.0 Hub             
    [1135992.352691] usb 1-2: Manufacturer: VIA Labs, Inc.         
    [1135992.352691] usb 1-2: SerialNumber: 000000000
    [1135992.353974] hub 1-2:1.0: USB hub found
    [1135992.354150] hub 1-2:1.0: 5 ports detected
    [1135993.765098] usb 2-2.1: new SuperSpeed USB device number 14 using xhci_hcd
    [1135993.986629] usb 1-2.2: new high-speed USB device number 32 using xhci_hcd
    [1135994.059917] usb 2-2.1: New USB device found, idVendor=0b95, idProduct=1790, bcdDevice= 2.00
    [1135994.059921] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [1135994.059922] usb 2-2.1: Product: AX88179A
    [1135994.059923] usb 2-2.1: Manufacturer: ASIX
    [1135994.059924] usb 2-2.1: SerialNumber: 00265B97
    [1135994.134960] usb 1-2.2: New USB device found, idVendor=1a40, idProduct=0101, bcdDevice= 1.11
    [1135994.134964] usb 1-2.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
    [1135994.134965] usb 1-2.2: Product: USB 2.0 Hub
    [1135994.250358] hub 1-2.2:1.0: USB hub found
    [1135994.250433] hub 1-2.2:1.0: 4 ports detected
    [1135994.349547] cdc_ncm 2-2.1:2.0: MAC-Address: 20:7b:d2:26:5b:97
    [1135994.349551] cdc_ncm 2-2.1:2.0: setting rx_max = 16384
    [1135994.362316] cdc_ncm 2-2.1:2.0: setting tx_max = 16384
    [1135994.372422] cdc_ncm 2-2.1:2.0 eth0: register 'cdc_ncm' at usb-0000:00:14.0-2.1, CDC NCM (NO ZLP), 20:7b:d2:26:5b:97
    [1135994.397685] cdc_ncm 2-2.1:2.0 enx207bd2265b97: renamed from eth0
    [1135996.344531] [UFW BLOCK] IN=enp3s0 OUT= MAC=b0:4f:13:10:b7:26:b0:4f:13:02:4a:e7:08:00 SRC=192.168.1.90 DST=192.168.1.41 LEN=1258 TOS=0x00 PREC=0x00 TTL=128 ID=55709 PROTO=UDP SPT=3702 DPT=40212 LEN=1238 
    [1135996.974662] usb 1-2.5: new high-speed USB device number 33 using xhci_hcd
    [1135997.076504] usb 1-2.5: New USB device found, idVendor=2109, idProduct=8884, bcdDevice= 0.01
    [1135997.076509] usb 1-2.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [1135997.076510] usb 1-2.5: Product: USB Billboard Device   
    [1135997.076511] usb 1-2.5: Manufacturer: VIA Labs, Inc.         
    [1135997.076512] usb 1-2.5: SerialNumber: 0000000000000001
    [1136022.694859] [UFW BLOCK] IN=wlo1 OUT= MAC=01:00:5e:00:00:01:24:f5:a2:55:83:56:08:00 SRC=10.0.0.1 DST=224.0.0.1 LEN=28 TOS=0x00 PREC=0xC0 TTL=1 ID=4537 PROTO=2 
    
    

  • Yes, it has a hub, which prevents U-Boot to detect the USB thumb drive attached to it.

    You might want get something like the adapter linked below.

    https://www.amazon.com/gp/product/B01GGKYXVE?th=1

  • Bin,

    OK!  I'll see what I can do!

    ...I found a USB c to USB A cable (male to male) and then I located a female-to-female USB A adapter to connect a USB A 3.0 thumb drive to after formatting a partition for Ext4.It still doesn't see it.

     

    => usb start
    starting USB...
    Bus usb@31000000: generic_phy_get_bulk : no phys property
    Register 1000840 NbrPorts 1
    Starting the controller
    USB XHCI 1.10
    scanning bus usb@31000000 for devices... 1 USB Device(s) found
           scanning usb for storage devices... 0 Storage Device(s) found
    => usb reset
    resetting USB...
    Host not halted after 16000 microseconds.
    Bus usb@31000000: generic_phy_get_bulk : no phys property
    Register 1000840 NbrPorts 1
    Starting the controller
    USB XHCI 1.10
    scanning bus usb@31000000 for devices... 1 USB Device(s) found
           scanning usb for storage devices... 0 Storage Device(s) found
    =>
    

    It may be that I'll need to wait until I can use the USB A connector on our custom board.

  • Hi Jim,

    I just tested this on my SK-AM62-LP board USB0 port and I can confirm the problem. "usb reset" command scans the USB0 (type-C) port @31000000, but it is unable to find the USB thumb drive. But last week when I tested on SK-AM62B board, "usb reset" command scans the USB1 (type-A) port @31100000, which can detect the USB thumb drive.

    Now, before I start to dig into the the EVMs, can you please explain your USB use case? Are you trying to use the USB0 or USB1 port in U-Boot? This is on your custom board, right?

  • Bin,

    Yes, we will be using USB0 (we only have one USB A connector on our board).  The customer didn't get into specifics for it's use, they just wanted it available.

    Thanks for your continued support!

  • Hi Jim,

    Thanks. I don't need to know the customer's USB usecase specifics. Knowing requiring USB0 in host mode in U-Boot is sufficient.

    I know USB0 is configured as device mode in U-Boot. But it is interesting to me that why the LP SK EVM "usb reset" command scans USB0 not USB1.

    I will look into it and provide U-Boot patch to make USB0 work in host mode if necessary. I currently have several work in the queue, so likely I won't be able to get in this until next week.

  • Excellent!  No problem.  Getting this to work would be great!

  • Hi Jim,

    Please try to apply the following u-boot patch to see if will make USB0 port to detect USB device. I tested it on my SK-AM62-LP EVM, I can see USB0 tries to detect, but eventually fails with xHCI timeout error, I am not sure if this is just a board related problem.

    diff --git a/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi b/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi
    index 4265b434168b..9db329975f06 100644
    --- a/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi
    +++ b/arch/arm/dts/k3-am62x-sk-common-u-boot.dtsi
    @@ -122,7 +122,7 @@
     };
     
     &usb0 {
    -       dr_mode = "peripheral";
    +       dr_mode = "host";
            /* Since role switching is not supported in U-Boot */
            /delete-property/ extcon;
            bootph-pre-ram;

  • Bin,

    OK!  I've already introduced those changes.

  • Then can USB0 detect USB devices on your board in U-Boot?

  • Bin,

    I'm currently working on multiple projects so this one will get a little more attention tomorrow afternoon.  Thanks!