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.

How to read USB->Serial data on ARM ?

Other Parts Discussed in Thread: SYSCONFIG, AM3517

Hello everybody,

Could anyone help me about how to read data over Serial (using USB->Serial conversor). 

When i connect the cable on my device i got this message on dmesg command

root@csi:~# usb 1-2.2: new full speed USB device using ehci-omap and address 8
usb 1-2.2: New USB device found, idVendor=067b, idProduct=2303
usb 1-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2.2: Product: USB-Serial Controller
usb 1-2.2: Manufacturer: Prolific Technology Inc.

And when i type lsusb i got it.

root@csi:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 
Bus 001 Device 006: ID 1a40:0101 
Bus 001 Device 008: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 002 Device 001: ID 1d6b:0002

Thanks

  • Not clear to me what exactly the connection is, but 'root@csi' should have /etc/ttyUSB*, just use it as regular serial port.

  • Sorry, but you told /etc or /dev ?

    See both below

    root@csi:/dev# ls
    XOR mtd1ro ram3 tty4
    bus mtd2 ram4 tty40
    console mtd2ro ram5 tty41
    cpu_dma_latency mtd3 ram6 tty42
    disk mtd3ro ram7 tty43
    fb mtd4 ram8 tty44
    fb0 mtd4ro ram9 tty45
    full mtdblock0 ramdisk tty46
    i2c-1 mtdblock1 random tty47
    i2c-2 mtdblock2 rtc tty48
    i2c-3 mtdblock3 rtc0 tty49
    initctl mtdblock4 shm tty5
    input network_latency snd tty50
    input0 network_throughput tty tty51
    input1 null tty0 tty52
    input10 output0 tty1 tty53
    input11 output1 tty10 tty54
    input12 output10 tty11 tty55
    input13 output11 tty12 tty56
    input14 output12 tty13 tty57
    input15 output13 tty14 tty58
    input2 output14 tty15 tty59
    input3 output15 tty16 tty6
    input4 output2 tty17 tty60
    input5 output3 tty18 tty61
    input6 output4 tty19 tty62
    input7 output5 tty2 tty63
    input8 output6 tty20 tty7
    input9 output7 tty21 tty8
    inputs output8 tty22 tty9
    kmem output9 tty23 ttyS0
    kmsg outputs tty24 ttyS1
    log pharosColor tty25 ttyS2
    loop0 pickByLightCommand tty26 ttyS3
    loop1 pickByLightEvent tty27 ubi_ctrl
    loop2 psaux tty28 udev_network_queue
    loop3 ptmx tty29 urandom
    loop4 pts tty3 vcs
    loop5 ram tty30 vcs1
    loop6 ram0 tty31 vcsa
    loop7 ram1 tty32 vcsa1
    mem ram10 tty33 video1
    mmcblk0 ram11 tty34 video2
    mmcblk0p1 ram12 tty35 watchdog
    modBypassInput ram13 tty36 zero
    mtd0 ram14 tty37
    mtd0ro ram15 tty38
    mtd1 ram2 tty39

    root@csi:/etc# ls
    X11 hostname protocols
    alsa hosts pulse
    alternatives hotplug.d rc0.d
    angstrom-version init.d rc1.d
    apm inittab rc2.d
    asound.conf inittab.orig rc3.d
    asound.state inputrc rc4.d
    avahi ipaq-sleep.conf rc5.d
    blkid.tab iproute2 rc6.d
    blkid.tab.old issue rcS.d
    bluetooth issue.net resolv.conf
    bonobo-activation keylaunchrc rpc
    busybox.links keylaunchrc.matchbox scsi_id.config
    cron localtime security
    cwiid mailcap.order services
    dbus-1 matchbox skel
    default mime.types sound
    device_table mke2fs.conf ssh
    dropbear modules sysconfig
    enlightenment modules.conf sysctl.conf
    environment modules.conf.old syslog.conf
    esd.conf modutils terminfo
    fb.modes motd timestamp
    filesystems mtab timezone
    fonts network tinylogin.links
    fstab nsswitch.conf ts.conf
    fstab.bak obex-data-server udev
    gnome-vfs-2.0 opkg udhcpc.d
    gpe opkg.conf update-fonts-common.d
    group pango volatile.cache
    gtk passwd wgetrc
    gtk-1.2 pointercal wpa_supplicant
    gtk-2.0 ppp xdg
    hal profile
    host.conf profile.d

  • I am sorry, it should be /dev/.

    If ttyUSB* is not under /dev, it probably because you don't have a udev rule for it. 'root@sci' is a host PC or  am335x board?

  • AM3517, any suggestion ?

  • Do you have usb_serial and proper ftdi (something else ) drivers in your kernel ?

    R,

    Karol

  • Hello Karol and all,

    I added USB serial support at kernel drivers but it still doesn't appear /dev/ttyUSB in /dev . Is there another tip to fix it ?

    Thanks

  • I have not tried to connect any usb-serial device to the evm. But my Linux PC did not create /dev/ttyUSB* either when connected the evm with g_serial.ko loaded, even though my Linux PC has usb serial support.

    After installed ftdi_sio.ko I kind of got /dev/ttyUSB* created for the evm, but it seems creating the udev rule is tricky.

  • Try add also USB_SERIAL_PL2303=y to your defconfig. As someone mentioned, you probably miss serial converter driver . I think that you don't need udev rule to play with ttyUS* as privileged user.

    R

    Karol

  • Ok guys. Karol was right.

    I was looking for in the Kernel menuconfig for USB and i found what i was needed.

    Thanks for all replies