• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » Linux » Linux forum » U-Boot USB Console and OMAP-L137/L138
Share
Linux
  • Forum
Options
  • Subscribe via RSS

U-Boot USB Console and OMAP-L137/L138

U-Boot USB Console and OMAP-L137/L138

This question is not answered
JT19586
Posted by JT19586
on Aug 13 2010 12:38 PM
Prodigy170 points

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.

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Ajay
    Posted by Ajay
    on Aug 14 2010 00:28 AM
    Genius9470 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"

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • JT19586
    Posted by JT19586
    on Aug 16 2010 09:30 AM
    Prodigy170 points

    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.

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • JT19586
    Posted by JT19586
    on Aug 17 2010 15:49 PM
    Prodigy170 points

    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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ajay
    Posted by Ajay
    on Aug 18 2010 00:07 AM
    Genius9470 points

    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"

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ajay
    Posted by Ajay
    on Aug 18 2010 00:32 AM
    Genius9470 points

    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"

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • JT19586
    Posted by JT19586
    on Aug 18 2010 18:44 PM
    Prodigy170 points

    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

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • JT19586
    Posted by JT19586
    on Aug 19 2010 19:36 PM
    Prodigy170 points

    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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ajay
    Posted by Ajay
    on Aug 19 2010 23:25 PM
    Genius9470 points

    >>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"

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • JT19586
    Posted by JT19586
    on Aug 20 2010 07:18 AM
    Prodigy170 points

    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.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • JT19586
    Posted by JT19586
    on Aug 23 2010 16:54 PM
    Prodigy170 points

    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.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ajay
    Posted by Ajay
    on Aug 25 2010 00:54 AM
    Genius9470 points

    JT,

    Please enable MUSB_DEBUG at drivers/usb/musb/musb_udc.c file and post the logs to denx uboot list for further debugging.

     

    -------

    /* #define MUSB_DEBUG */

    --------

    Regards,
    Ajay

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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Seth Dziengeleski
    Posted by Seth Dziengeleski
    on Feb 09 2011 12:40 PM
    Intellectual260 points

    I'm running into the same problem as JT mentioned and I was wondering if this issue was ever resolved?  I enabled MUSB_DEBUG and nothing changed.

     

    I grabbed release 2010.12 of u-boot from denx and had to port forward some changes from the DaVinci PSP 3.20.00.14 version of u-boot to build for the da850.  Once I did that I was able to configure for USB and get a clean compile.  Once I switched over to usbtty though I was unable to interact.  Like JT if I only switched stdout over things worked a bit better.  I could enter input to the serial console, and see the output on the usb console.  The output on the usb console looked a bit garbled though.  I've included a sample below

     

    DA850-evm > printenv

    00

      rate=115200

                 boinitrd ip=dhcp

    bootdelay=3

    bootfile="uImage"

    stdout=usbtty

    oinitrd ip=dhcp

    bootdelay=3

    bootfile="uImage"

    stdout=usbtty

    usbtty=cdc_acm

    ver=U-Boot 2010.12 (Feb 09 2011 - 06:50:44)

    EDA850-evm > size: 214/65532 bytes

    DA850-evm >

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Seth Dziengeleski
    Posted by Seth Dziengeleski
    on Feb 22 2011 10:32 AM
    Intellectual260 points

    *Bump*

    Any progress on this?  Patches from 3.20.00.xx PSP for u-boot don't seem to have been merged into the mainline u-boot tree so building that for the AM1808 eval kit (da850_omapl138_evm_config) is problematic, and the usb console option doesn't exist for the version of u-boot provided with the dev kit.

    It's a requirement for me so I'll have to decide which direction I want to start patching if this hasn't already been addressed.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ajay
    Posted by Ajay
    on Feb 22 2011 23:03 PM
    Genius9470 points

    Seth,

    MUSB support in uboot for AM1xx is already merged and available at http://git.denx.de/?p=u-boot.git;a=summary

    You can browse the code at drivers/usb/musb/da8xx.c

    Regards,

    Ajay

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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Seth Dziengeleski
    Posted by Seth Dziengeleski
    on Feb 28 2011 14:24 PM
    Intellectual260 points

    Ajay, I think you misunderstand what I am asking.

     

    This is what I was talking about in previous posts.  I know the usb console drivers appear in mainline, complete with the da8xx driver but clearly some changes were not pushed as I cannot build for a da850_omapl138_evm_config... the config does not exist.  So what else is missing is missing on mainline?  I had made a quick stab and making the required changes to build for the config I need but the usb console still wasn't working 100% correctly.  I was unsure if this was issues with the usb driver or simply that I missed something when reviewing TI's patch list, or if there was some incompatibility I was just unaware of.

     

    In TI's provided version of u-boot the config exists and without enabling usb device support builds and runs well on the evm.  However, when attempting to follow the instructions provided above u-boot fails to build.  JT did good job of pointing out all the errors (both for compiling TI's u-boot, and mainline's usb tty behavior) in some of his original posts.

     

    So neither version of u-boot (TI or denx) is an ideal solution.  Since this has apparently been a problem for some time I thought there was a chance some work had been done to improve this and I didn't want to repeat the effort.  Based on your response nothing has been done.  TI has not and is not planning to push out a new version with some updates support for usbtty.  TI has not and is not planning on pushing back patches to get the da850 config building and running on the mainline.  Are those two assumptions correct?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
123
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use