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.

OMAP L137 EVM ttyUSB0 console

Other Parts Discussed in Thread: AM1705

The OMAPL137 EVM only has one serial port available as ttyS2.  Uboot uses this port to boot from, and the console is typically used on ttyS2 as well.

My problem is that I need to use ttyS2 for something else.  

I have tried installing a ftdi based usb to serial converter on the usb port, setting the bootargs in Uboot to use console=ttyUSB0,115200n8, and enabling a getty in my inittab on ttyUSB0 rather than ttyS2.  When I boot the board, the uboot command line comes up on ttyS2 as it should, but then the kernel boot messages continue to output on ttyS2 (nothing on ttyUSB0).     

At the end of the kernel boot log, when the getty should come up, it prints:

"can't open /dev/ttyUSB0: No such device".  

At that point, I have a line in my inittab that forces the ftdi adapter to install, because it hasn't been automounted yet.  I use:

"tty1::once:/sbin/modprobe ftdi_sio vendor=0x0403 product=0x6001"

Then, still on ttyS2, the I see the kernel boot info where it detects the ftdi device on the USB and puts it on ttyUSB0.  For some reason it continues with all of the same output the first time it set up USB, it detects the ftdi device AGAIN.  Then i see "console [ttyUSB0] enabled".  Nothing comes up on ttyUSB0, but ttyS2 does show "ftdi_sio ttyUSB0: ftdi_submit_read_urb - failed submitting read urb, error -22".  It waits a few seconds and then repeats that like 5 times.  Then I see "can't open /dev/ttyUSB0: Invalid argument".  Meanwhile, I'm getting output on ttyUSB0 but it's all gibberish.  I'm not entirely certain I'm using the right cabling between my PC and the EVM.

 

For reference, if I leave the bootargs in Uboot to conole=ttyS2 and just set the getty in my inittab to use ttyUSB0, I see the kernel boot on ttyS2 and the login prompt comes up as expected on ttyUSB0.  

The problem with this is that I think the port is still occupied by the console because when I try to read from the port, the read() blocks indefinitely even though I know data is being transmitted.  I'm certain that my application is working correctly, because when I boot with ttyS2 in my bootargs and as the getty in inittab, I can receive data fine over the ttyUSB0.

I'm not too concerned about uboot coming up over ttyUSB0, because I think that would take a lot of work, but can anyone help me get the console to come up over ttyUSB0 so that ttyS2 is free?

 

 

  • I've made some progress on this.  If I have two terminals watching ttyS2 and ttyUSB0, I can see that the console does begin displaying on ttyUSB0 once the FTDI driver is installed.  However, the errors begin once the getty starts.  It doesn't seem to make any difference if I have a getty on ttyS2 or not.  

    I did try to remove the console parameter from my bootargs, which causes the console to default to tty1.  I also took the getty off of ttyS2.  Now uboot will continue to display the kernel boot messages on ttyS2 until the getty starts up on ttyUSB0.  At this point I "think" the console is on tty1 (I'm not sure if there is a way to check what the console is running on) and the getty is on ttyUSB0.  I can then run my application on ttyS2 and the read operation doesn't block anymore.

    If anyone has any ideas, I'd still like to be able to assign the console onto ttyUSB0 if possible.

  • Please look at the steps below on this,

    1) Open “filesystem/etc/init.d/rcS” and add “mknod /dev/ttyUSB0 c 188 0” just below line “mknod /dev/ttyS1 c 4 64”

    2) Open “filesystem/etc/inittab” and replace the line

    " ::respawn:/sbin/getty -L ttyS1 $(fw_printenv baudrate | cut -d "=" -f 2) vt100" with

    " ::respawn:/sbin/getty -L ttyUSB0 $(fw_printenv baudrate | cut -d "=" -f 2) vt100".

    3) Rebuild the file system.

    4) Use the Linux kernel with built-in USB host driver and USB serial class driver.

    5) Connect the USB serial cable to Host machine.

    6) Boot the Linux kernel, you should get the console.

    Note: Please note that serial baud-rate value will be taken from u-boot environment variable

    ajay

  • Well, the ttyUSB0 node already exists in my NFS filesystem.   But I deleted it and tried your way anyway.  No dice.

  • Hi Ajay!

    I also need to use ttyUSB device as a console interface. But I'm using AM1705 with reduced USB pins count. There is only USB DP,  DM,  VDDA1.2 ,  VDDA1.8,  VDDA3.3 pins in flat 176-pin package.

    I tried your suggestions but my PC (Windows) doesn't see my USB console.

     What I did:

    1) I enabled USB in PSC1 register. So, USB unit is enabled during u-boot loading.

    2) I enabled USB unit in linux kernel (3.2.2): "USB support" --> "Support for Host-side USB" --> "USB Serial Converter support"  -- > "USB Serial Console device support". I also read "GSG: Building Software Components for OMAP-L1/AM1x" (http://processors.wiki.ti.com/index.php/GSG:_Building_Software_Components_for_OMAP-L1#USB_2.0), but didn't find my case. 

    3) I use myboard_usb_init() function, that's default for EVM to init USB interface. I see in my boot log:

    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb

    ...

    usbcore: registered new interface driver usbserial
    usbserial: USB Serial Driver core

    4) I change rcS and inittab files as you wrote.

    So, I have some questions:

    1) Can I use USB 2.0 interface on AM1705 as a serial console?

    2) Is my configuration complete?

    3) Do I need to install any drivers in my Windows OS (host PC) to see pseudo-serial interface? How to see my USB in PC?

    4) Can I find some reference design (schematic) or guide for usbserial, based on AM17xx (OMAP-137) USB device?

     5) Why AM1705 is positioned as a host for usbserial? It doesn't source VBUS.

     

    Thank you! Bakir