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.

[FAQ] AM625: Configuring Am625 ALW usb0 in host mode

Part Number: AM625
Other Parts Discussed in Thread: SK-AM62B-P1, SK-AM62-LP, SK-AM62B, SK-AM62-SIP

Tool/software:

Hi all,

we are trying to configure usb0 to work as host so that when we connect a device like usb it will read the data from the usb.

our hardware connections are made in a way that Vbus, cc1 and CC2 are connected to the +5v. Usb id is connected to 1v8.

Rest of the connections are USB_1_D_CON_P and USB_1_D_CON_N are connected to the USB-c connector.

below are the device tree configurations:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Verdin USB_1_ID */
pinctrl_usb0_id: main-gpio1-19-pins-default {
pinctrl-single,pins = <
AM62X_IOPAD(0x01c4, PIN_INPUT_PULLUP, 7) /* (B14) SPI0_D1.GPIO1_19 */ /* SODIMM 161 */
>;
};
/* Verdin USB_1 */
&usbss0 {
ti,vbus-divider;
status = "okay";
connector {
compatible = "gpio-usb-b-connector", "usb-b-connector";
pinctrl-names = "default";
pinctrl-0 = <>;
label = "USB-C";
port {
usb_dr_connector: endpoint {
remote-endpoint = <&usb0_ep>;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

kindly check this and let me know if i am doing something wrong

  • Hi,

    For USB0 to be in host mode, the USB ID pin is not needed.

    In devicetree, only dr_mode = "host" is required, I don't think the connector/port node is needed either.

  • Hi,

    Thanks for your reply.

    currently below is my device tree changes:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    /* Verdin USB_1 */
    &usbss0 {
    ti,vbus-divider;
    status = "okay";
    debounce = <25>;
    id-gpio = < >;
    pinctrl-names = "default";
    };
    &usb0 {
    dr_mode = "host";
    status="okay";
    };
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    we are using a type-c port for connecting devices like usb storage devices. as mentioned above vbus, cc1 and cc2 are connected to the 5v and id is connected to the gnd. and drvvbus is not connected.

  • Hi,

    The "debounce" and "id-gpio" properties should be removed from &usbss0 node.

    The ID pin is not needed.

    When dr_mode is et to "host", the USB controller doesn't communicate with the type-C device for role switching, so the CC pins should be connected based on the type-C device requirement (which I am not familiar with though).

    If the USB drvvbus pin is not connected, the VBUS 5v power switch should be controlled by something else (the type-C device?).

  • Do we need usb controller ic in this case ? If we use the type c ? 

    Currently vbus is just directly connected to 5v!

    Any suggestions on how to usually make a usb type c to work as host

    Thanks in advance

  • Hi,

    Do we need usb controller ic in this case ? If we use the type c ? 

    That is a good question. From the software perspective, the type-C IC is not needed if the USB controller works in host-only mode. However, the USB type-C receptacle has two sets of DP/DM pins, without a type-C IC, both sets of DP/DM would have to be routed together to the DP/DM pins of the AM62x USB0 port, I am a software buy, but I believe this 'Y' type USB signal routing is not allowed, it could cause USB signal integrity problem. I am looping in our USB hardware expert to comment on this.

  • Hello Naveen, 

    You might want to refer to the different implementations we have on the SKs.

    Please review below 

    Recommended References for review and design of custom board
    AM62X
    Hardware Design Considerations
    www.ti.com/.../sprad05b.pdf
    Schematic Design and Review Checklist
    www.ti.com/.../sprad21c.pdf
    DDR Board Design and Layout Guidelines
    www.ti.com/.../sprad06.pdf
    Frequently Asked Questions FAQs
    e2e.ti.com/.../faq-custom-board-hardware-design---master-complete-list-of-faqs-for-all-sitara-processor-am62x-am64x-am243x-am335x-families
    e2e.ti.com/.../faq-am625-am623-am625sip-am625-q1-am620-q1-custom-board-hardware-design---faqs-related-to-processor-collaterals-functioning-peripherals-interface-and-starter-kit
    e2e.ti.com/.../faq-am625-am623-custom-board-hardware-design---design-and-review-notes-for-reuse-of-sk-am62b-schematics
    e2e.ti.com/.../faq-am625-am623-custom-board-hardware-design---design-and-review-notes-for-reuse-of-sk-am62b-p1-schematics
    e2e.ti.com/.../faq-am625-q1-am620-q1-custom-board-hardware-design---design-and-review-notes-for-reuse-of-sk-am62-lp-schematics
    e2e.ti.com/.../faq-am625sip---custom-board-hardware-design---design-and-review-notes-for-reuse-of-sk-am62-sip-schematics
    e2e.ti.com/.../faq-am62x-am64x-custom-board-hardware-design-how-to-handle-used-unused-pins-peripherals-e-g-gpios-serdes-usb-csi-mmc-emmc-sd-card-csi-oldi-dsi

    Downloadable design files on TI.com list for SK
    SK-AM62B-P1 Design Package Content Overview (Rev. A)
    www.ti.com/.../sprt777
    SK-AM62-LP Design Package Content Overview
    www.ti.com/.../sprt778
    SK-AM62B Design Package Folder and Files List
    www.ti.com/.../sprt784
    SK-AM62-SIP Design Package Folder and Files List
    https://www.ti.com/lit/pdf/sprt785

    Regards,

    Sreenivasa

  • HI all,

    Thanks all for your valuable inputs. I have shared everything to our hardware team. Below is the USB schematic configuration in our board.

    In this few changes were made recently were, VbUS is connected to +5V and CC1 And CC2 and also connected to +5v. It is a usb type-c port.

  • Hi,

    I guess I should have asked the question in the very beginning - are you looking for comments in your board USB design schematics, or your board USB doesn't work as expected and need debug?

  • Hi 

    Now that you have confirmed that about the device tree, we made changes and tested it, but still usb is not detecting any usb devices even when I connect a memory device, so i was wondering if anything needs to be changed in hardware.

  • have you measured the VBUS pin on the USB-C connector that the 5V presents when attaching a USB device?

    Please run the following script on your board and provide its output.

    2437.chkusb.sh.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    #!/bin/bash
    #
    # Util to check USB subsystem for Linux kernel 4.0+ on TI Sitara devices
    #
    # Copyright (C) 2018-2024 Texas Instruments Incorporated - http://www.ti.com/
    #
    #
    # Redistribution and use in source and binary forms, with or without
    # modification, are permitted provided that the following conditions
    # are met:
    #
    # Redistributions of source code must retain the above copyright
    # notice, this list of conditions and the following disclaimer.
    #
    # Redistributions in binary form must reproduce the above copyright
    # notice, this list of conditions and the following disclaimer in the
    # documentation and/or other materials provided with the
    # distribution.
    #
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi ,

    please find the output below,

     

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    chkusb.sh Version 0.4.0
    Linux verdin-am62-15133535 6.1.80-6.7.0-devel+git.603f75dc931d #1 SMP PREEMPT Wed Aug 28 15:15:41 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
    USB is initialized
    usb@31000000: host, okay
    usb@31100000: otg, (enabled)
    Gadget Kernel Config: g_zero is enabled
    Gadget Kernel Config: g_ether is enabled
    Gadget Kernel Config: g_ncm is enabled
    Gadget Kernel Config: g_mass_storage is enabled
    Gadget Kernel Config: g_serial is enabled
    gadget driver loaded: (none)
    The list of USB gadget drivers installed:
    /lib/modules/6.1.80-6.7.0-devel+git.603f75dc931d/kernel/drivers/usb/gadget/function/:
    u_ether.ko
    u_serial.ko
    usb_f_acm.ko
    usb_f_ecm.ko
    usb_f_ecm_subset.ko
    usb_f_eem.ko
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Currently Vbus is connected to a 5V using pullup resistor, it always stays at 5V

  • Hi,

    The log seems indicating the USB controller is in the correct state.

    Please use a scope to capture the waveform of DP/DM and VBUS lines when a USB device is attached.

  • Hi ,

    As i mentioned earlier the vbus is always pulled up to 5v, i see no activity on the Dp and DM lines

  • Hi,

    If DP or DM line doesn't pullup when the USB device is attached, mostly likely the device doesn't get 5V on VBUS. Please check on the type-C connector that 5V does present.

  • we are able to see DP and DM pulling up to 3.3v and vbus is also 5v.but still the device is not detected. anything else we can check.

  • What change have you made to make you see DP and DM pullup now? Please attach the scope screenshot.

    Does the board Linux console print any message when the USB device attached? If so, please attach the console log.

  • Hi,

    In device tree, no changes were made, but cc1 and cc2 are now pulled up.in linux console we are not getting any logs.

    even when i use lsblk, i cannot see any new device being connected.

  • Please attach the scope screenshot to show the waveform of DP/DM pulling up along with VBUS line when the USB device is attached.

  • we have captured the signal of DP/DM on the scope whenever we connect a device. we have measured the Vbus and it stays at 5V.

  • Please set the scope horizontal resolution to millisecond resolution, and compare the waveform with a working USB host.

    I believe, when you attach a high-speed USB device, it should only have DP get pulled up, DM should stay low. But I don't know why you see both DP and DM get pulled up.

  • Hi ,

    Thanks for your suggestion, we will check this and reply asap.

  • Hi ,

    Thanks for your help, we are able make usb work,

    below is the device tree:

    /* Verdin USB_1 */
    &usbss0 {
        ti,vbus-divider;
        status="okay";
    };

    &usb0 {
        dr_mode = "host";
        status = "okay";

    }

    The issue is that, the transformer used on the DP/DM was placed wrongly, now we have corrected at it worked.

  • Hi,

    Glad to hear the issue is resolved. Thanks for the update.