USB OTG as Host


  • Hi,

    I'm trying to test USB OTG in host mode - just connecting a USB device like a memory stick or USB/Serial (FTDI) via USB OTG cable to the USB OTG port of the board.

    If I do that nothing happen. I would expect that the device ist listed in the output of the lsusb command.

    I only booted the Yocto image via SD card from:
    https://hq0epm0west0us0storage.blob.core.windows.net/%24web/public/SMARC/LEC-iMX8MP/Images/Yocto/LEC-IMX8MP-2G-IPi-SMARC-PLUS_Yocto-hardknott_v1_2_20220409.rootfs.zip

    Any ideas?

    Regards,
    Sven

     



  • Dear @Sven Brandau, The Yocto image won't support USB Utils commands by default. So, you can't use "lsusb" command. Instead of that, you can use the following commands to check your USB drive and other drives.

    sh# df  -h (to view the drives) or sh# lsblk

    sh# cd /run/media/sd (to go inside the usb_drive)

    If you are still unable to see your drive please mount your USB drive manually yourself.


  • Dear @Kothandaraman Kannadasan, The Yocto version I'm running supports lsusb:

    root@lec-imx8mp:~# lsusb
    Bus 002 Device 002: ID 1d5c:5500 Fresco Logic Frescologic USB3.1Gen2 HUB
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 002: ID 1d5c:5510 Fresco Logic Frescologic USB2.0 HUB
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    So I can't see any USB device connected to the USB OTG port. If the USB drive is not recognized, no auto mount will happen. Also a manual mount is not possible.

    I guess the USB OTG role switching to host mode doesn't work. It would be nice if you have any suggestions.

    Regards,
    Sven

     


  • Dear @Sven Brandau, I verified there was a software bug in that image. We updated the new image for IMX8MP 2G and 4G. Please download the updated image for IMX8MP-2G by clicking the below link.

    (https://www.ipi.wiki/pages/downloads-imx8mplus)


  • Dear @Kothandaraman Kannadasan, I've downloaded the Yocto image:

    https://hq0epm0west0us0storage.z22.web.core.windows.net/public/SMARC/LEC-iMX8MP/Images/Yocto/LEC-IMX8MP-2G-IPi-SMARC-PLUS_Yocto-hardknott_V1_R3_2022_11_17.zip

    If I try to boot this image, nothing happen on the screen (HDMI) and also console ttymxc1 shows no login.

    I re-tried the image before this - this runs a expected.

    So, do we need another Yocto image?

    Regards,
    Sven


  • Hi @Sven Brandau, We have fixed some software bugs and added build package information with the latest image. The latest image Yocto image working fine. If you want to see the serial output logs you may follow the below instruction.

    Use the DB9 to USB cable and connect it to the following pins,

    Header 2: 40-Pin Expansion

    SER 1 RX - 1

    SER 1 TX -3

    GND -5 

    For more details, please go to, https://www.ipi.wiki/pages/imx8mp-docs?page=UserInterfaces.html 


  • Dear @Kothandaraman Kannadasan, I was able to boot the new Yocto image. It was very confusing that the serial port (SER 1) using a inverted logic. So only with a help of a logic analyzer the output of U-Boot was readable.

    But the main problem with USB OTG is still not solved. To make it comprehensible here are my steps:

    1. Boot image
    2. Connect a OSB OTG cable (Micro USB <--> USB A port) like this:
      https://www.bestbuy.com/site/tripp-lite-5-9-micro-usb-to-usb-type-a-cable-black/4585503.p?skuId=4585503 to Micro USB OTG port on board
    3. Insert an USB memory stick

    I would expect that the USB OTG controller switches its own role to host mode. So the memory stick should be visable via lsusb command.

    To verify the booted image here is an output of cat /etc/build:
    -----------------------
    Build Configuration:  |
    -----------------------
    DISTRO = fsl-imx-xwayland
    DISTRO_VERSION = 5.10-hardknott
    MACHINE = lec-imx8mp
    DEVICE_MODEL =
    DEVICE_TYPE = LPDDR4_2GB
    BSP_VERSION = LEC-iMX8MP-YOCTO-ARM64-NXP-iMX8MP-LPDDR4_2GB-2V1.4.0.0
    IMX_GPU_VERSION = 6.4.3.p2.4
    RELEASE_VERSION = LEC-iMX8MP-PREBUILD-2022-07-04

    Regards, Sven

     


  • Dear @Sven Brandau, I have validated the following image as you requested

    ( https://hq0epm0west0us0storage.blob.core.windows.net/$web/public/SMARC/LEC-iMX8MP/Images/Yocto/old_releases/LEC-IMX8MP-2G-IPi-SMARC-PLUS_Hardknott_1v7_20210826.zip ).

    Please download it. It can able to detect the USB drive via an OTG cable. We will update our latest image soon.


  • Dear @Kothandaraman Kannadasan, thanks for providing the image.

    Now I'm able to detect an USB decice on the USB OTG connector.

    But now it's NOT possible to connect to a PC using the board as device (role switch). This was working in the 1st original image.

    If I try to load a serial device driver the message shows:
    modprobe g_serial
    [  355.901693] udc-core: couldn't find an available UDC - added [g_serial] to list of pending drivers

    Regards,
    Sven


  • Dear @Sven Brandau, in order to enable this feature, the kernel configurations "USB_DWC3_DUAL_ROLE=y" must be added. The process of modifying the kernel and rebuilding the image takes time. You will be notified once the image is released, so please be patient.


  • Dear @Kothandaraman Kannadasan, are there any news regarding the new image?

    Regards,
    Sven


  • Dear @Sven Brandau, Sorry for the inconvenience. A kernel upgrades from Zeus to Kirkstone is currently underway. Additionally, it is a time-consuming process. The software will be available for all products by the end of this month.


  • Dear @Kothandaraman Kannadasan, are there any news regarding the new image?

    Regards,
    Sven


Please login to reply this topic!