• Not Answered

U-Boot USB Console and OMAP-L137/L138

Hello.  I would like to enable U-Boot to use USB (usbtty) instead of the serial port.  I've followed the instructions in U-Boot's README for enabling usbtty; however, I can't get the version of U-Boot supplied with the 137 and 138 to compile when I enable "CONFIG_USB_TTY" 

Has anyone been successful in enabling USB console input/output with U-Boot on either the 137 and/or 138?  Any help would be appreciated.

 

Thanks.

33 Replies

  • Genius 9460 points

    JT,

    Please provide the error you are getting when enabling CONFIG_USB_TTY.

    I would suggest you to use denx latet uboot tree to verify this. You can follow the steps as given below,

    Please follow the steps below to enable USBtty in uboot.

    • Enable MUSB_UDC at board config file such as, include/configs/davinci_dm365evm.h for dm 365

    /* #define CONFIG_MUSB_HCD */
    #define CONFIG_MUSB_UDC 1

     

    • Compile and flash the board with new uboot.
    • Power up the board
    • $ setenv usbtty cdc_acm
    • $ setenv stdout usbtty; setenv stdin usbtty; setenv stderr usbtty
    • Now connect the cable to Linux Host
    • Use minicom on Linux host over /dev/ttyACM0

    Regards,
    ajay

    If my reply answers your question then please click on the green button "Verify Answer"

  • In reply to Ajay:

    Ajay,

    Thanks for the helpful reply.

    Per your instructions, I downloaded the latest version of u-boot from denx.  I was using the version of uboot supplied with the L138 board.  So, to be clear, has the L138-specific patches been applied to the current u-boot source tree (I can only assume this).  I had to add the following to da850evm.h to get a clean build when enabling usbtty:

    #define CONFIG_USB_DA8XX     // added to resolve "USB Lowlevel not defined" error in usb.h
    #define CONFIG_MUSB_UDC     // added per Ajay
    #define CONFIG_USB_DEVICE  // added per uboot's README
    #define CONFIG_USB_TTY          // added per uboot's README

    #define CONFIG_SYS_CONSOLE_IS_IN_ENV // added per uboot's README

    FYI, unti I added "CONFIG_USB_DA8XX" to da850evm.h, I was getting the following error at compile time: "USB Lowlevel not defined".

     The header file in "include/configs/da850evm.h" from the latest uboot source tree does not contain any USB-specific #defines, as the uboot supplied with the L138 board support package.

     At this point, I have an error-free build.  I need to test it out on the L138 board.

     

    Thanks.

     

  • In reply to Ajay:

    The latest uboot source tree appears to "support" the #define CONFIG_MUSB_UDC.  However, in the version of Uboot provided with the 138 EVM, it is not present.  Here are some of the errors I'm seeing when trying to enable USBTTY (uboot supplied with 138):

    uboot-03.20.00.06/drivers/serial/usbtty.c:840: undefined reference to `udc_endpoint_write'

    uboot-03.20.00.06/drivers/serial/usbtty.c:983: undefined reference to `udc_irq'

    uboot-03.20.00.06/drivers/serial/usbtty.c:721: undefined reference to `udc_setup_ep'

     uboot-03.20.00.06/drivers/serial/usbtty.c:548: undefined reference to `udc_init'

    So, here is the issue:

    1) I can enable and build usbtty support using the current UBoot source tree; however, I'm unable to get SPI and Ethernet working;

    2) With uboot supplied with 138 EVM, I'm able to rebuild the image and burn onto the EVM, but not enable usbtty

  • Genius 9460 points

    In reply to JT19586:

    JT,

    The latest denx uboot tree has all the required USB configs in include/configs/da830evm.h  and not yet available at include/configs/da850evm.h. We would require to copy

    all the USb configs (below) from da830evm.h to da850evm.h.

    -------------------------------------

    /*
     * USB configuration
     */
    #define CONFIG_USB_DA8XX        /* Platform hookup to MUSB controller */
    #define CONFIG_MUSB_UDC

    #ifdef CONFIG_USB_DA8XX

    #ifdef CONFIG_MUSB_HCD          /* include support for usb host */
    #define CONFIG_CMD_USB          /* include support for usb cmd */

    #define CONFIG_USB_STORAGE      /* MSC class support */
    #define CONFIG_CMD_STORAGE      /* inclue support for usb-storage cmd */
    #define CONFIG_CMD_FAT          /* inclue support for FAT/storage */
    #define CONFIG_DOS_PARTITION    /* inclue support for FAT/storage */

    #ifdef CONFIG_USB_KEYBOARD      /* HID class support */
    #define CONFIG_SYS_USB_EVENT_POLL
    #define CONFIG_PREBOOT "usb start"
    #endif /* CONFIG_USB_KEYBOARD */

    #endif /* CONFIG_MUSB_HCD */

    #ifdef CONFIG_MUSB_UDC
    /* USB device configuration */
    #define CONFIG_USB_DEVICE               1
    #define CONFIG_USB_TTY                  1
    #define CONFIG_SYS_CONSOLE_IS_IN_ENV    1
    /* Change these to suit your needs */
    #define CONFIG_USBD_VENDORID            0x0451
    #define CONFIG_USBD_PRODUCTID           0x5678
    #define CONFIG_USBD_MANUFACTURER        "Texas Instruments"
    #define CONFIG_USBD_PRODUCT_NAME        "DA830EVM"
    #endif /* CONFIG_MUSB_UDC */

    #endif /* CONFIG_USB_DA8XX */

    ----------------------------------------------------------

    I think the uboot supplied with EVM is older version and thus doesn;t have all the necessary features/fixes.

    Can you provide the details of uboot version supplied with EVM ? and also check if there are any new version of TI supported uboot available.

    Regards,
    Ajay

     

    If my reply answers your question then please click on the green button "Verify Answer"

  • Genius 9460 points

    In reply to Ajay:

    I just submitted below patch to denx list to add this support on DA850. You can use this instead.

    http://lists.denx.de/pipermail/u-boot/2010-August/075760.html

    Regards,
    Ajay

    If my reply answers your question then please click on the green button "Verify Answer"

  • In reply to Ajay:

    Ajay,

    I obtained the Davinci PSP 03.20.00.12 Release, which appears to be the latest release.  I'm using the uboot per the PSP release notes, per the following table:

    U-Boot 2009.11 http://arago-project.org/git/projects/?p=u-boot-omapl1.git;a=summary bb3bcfa2426cc6a0aecec7270e3ee67ca843a125 v2009.11_DAVINCIPSP_03.20.00.12

    When I try to enable #define CONFIG_MUSB_UDC in include/configs/da850evm.h (uboot version v2009.11_DAVINCIPSP_03.20.00.12), I get the followoing compile error:

    usbtty.c:125: error: 'EP0_MAX_PACKET_SIZE' undeclared here (not in a function)
    usbtty.c:218: error: 'UDC_INT_ENDPOINT' undeclared here (not in a function)
    usbtty.c:221: error: 'UDC_INT_PACKET_SIZE' undeclared here (not in a function)
    usbtty.c:244: error: 'UDC_OUT_ENDPOINT' undeclared here (not in a function)
    usbtty.c:248: error: 'UDC_BULK_PACKET_SIZE' undeclared here (not in a function)
    usbtty.c:255: error: 'UDC_IN_ENDPOINT' undeclared here (not in a function)
    usbtty.c:327: error: 'UDC_OUT_PACKET_SIZE' undeclared here (not in a function)
    usbtty.c:337: error: 'UDC_IN_PACKET_SIZE' undeclared here (not in a function)
    usbtty.c: In function 'usbtty_tstc':
    usbtty.c:398: warning: implicit declaration of function 'udc_unset_nak'
    usbtty.c: In function 'usbtty_getc':
    usbtty.c:423: warning: implicit declaration of function 'udc_set_nak'
    usbtty.c: In function 'drv_usbtty_init':
    usbtty.c:552: warning: implicit declaration of function 'udc_init'
    usbtty.c:557: warning: implicit declaration of function 'udc_startup_events'
    usbtty.c:558: warning: implicit declaration of function 'udc_connect'
    usbtty.c: In function 'usbtty_init_instances':
    usbtty.c:679: warning: implicit declaration of function 'udc_setup_ep'
    usbtty.c: In function 'write_buffer':
    usbtty.c:844: warning: implicit declaration of function 'udc_endpoint_write'
    usbtty.c: In function 'usbtty_poll':
    usbtty.c:987: warning: implicit declaration of function 'udc_irq'

    When I use the latest denx source release, I can get a clean compile when enabling #define CONFIG_MUSB_UDC.   However, I'm unable to get the ethernet and SPI flash to work properly.  I have used the same SPI Flash and and Ethernet settings as defined in include/configs/da850evm.h per the uboot version v2009.11_DAVINCIPSP_03.20.00.12.

    There have obviosly been major changes made to uboot since v2009.11_DAVINCIPSP_03.20.00.12; however, this version seems to work the best (out of the box) with the OMAPL138 EVM.  I have no issues using the latest version; however, I'm in a quandry, as version v2009.11_DAVINCIPSP_03.20.00.12 works LESS USBTTY enabled and the latest version allows USBTTY to be compiled, but does not recognize SPI or ethernet.

    Suggestions are much appreciated.

    Regards,
    jt

     

  • In reply to JT19586:

    After some additional though/analysis, I noticed the latest (2010.06) u-boot source code contains the musb_udc.c.  I therefore updated the uboot usb code for version v2009.11_DAVINCIPSP_03.20.00.12.  I'm now able to build u-boot, v2009.11_DAVINCIPSP_03.20.00.12, with USBTTY enabled.

    When I set the stdin and stdout to usbtty, on the Linux host (Red Hat Enterprise 4) using the "cu" utility I can see the u-boot prompt.  However, I'm unable to interact with the OMAP-L138 via USB.  On the Linux Host, I see /dev/ttyACM0 and I can successfully connect to the device.

    I've tried minicom, but I get no output.  

    Any suggestions?

    Thanks,

    JT

  • Genius 9460 points

    In reply to JT19586:

    >>When I set the stdin and stdout to usbtty, on the Linux host (Red Hat Enterprise 4) using the "cu" utility I can see the u-boot prompt

    You need to set stdin,stdout to usbtty on EVM side. Please follow the steps provided earlier.

    Regards,

    Ajay

    If my reply answers your question then please click on the green button "Verify Answer"

  • In reply to Ajay:

    Ajay

    >>When I set the stdin and stdout to usbtty, on the Linux host (Red Hat Enterprise 4) using the "cu" utility I can see the u-boot prompt

    You need to set stdin,stdout to usbtty on EVM side. Please follow the steps provided earlier.

    Regards,

    Ajay

    Ajay,

     

    Sorry, my last post was not clear.  I did set stdin and stdout to usbtty on the EVM.  In fact, I see the u-boot prompt on the RedHat box after I enter the stdin/stdout to usbtty on the EVM.  However, I'm unable to issue any commands vi CU and/or minicom; I only see the u-boot prompt only.  It's as if either the EVM is not responding and/or "cu" is not receiving any response.

  • In reply to JT19586:

    I've tested various scenarios...

    When I set just stdout to usbtty, and leave stdin to go over UART, I'm able to see all "output" go to the host, over USB, via minicom.  For example, I would enter commands via TeraTerm and receive the output via minicom, whose device is /dev/ttyUSB0.

    So, apparently, stdin appears to be the problem.  The EVM board apparently doesn't seem to receive the data via USB for usbtty stdin.

    Also, on the EVM, I've got setenv usbtty gserial.  I then used modprobe for the EVM board on the Linux host.  The linux host seemed to more reliably recognize the EVM when "setenv usbtty" is set to gserial vs cdc_acm.

    I've tried setting usbtty environment variable to "cdc_acm" but I get the same issue--there is only the "u-boot" prompt returned from the EVM upon changing stdout/stdin to usbtty.  The EVM does not appear to receive data via stdin over usbtty.