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.

usb question

Hi. 
we have an issue about usb device. (using dm8167 DVRRDK_03.50.00.00)

we are using usb to uart converter (XR21B1411) 
(http://www.exar.com/connectivity/uart-and-bridging-solutions/usb-uarts/xr21b1411

driver insmod is ok and /dev/ttyUSB0 is registered . 
but when i open /dev/ttyUSB0 , i can't open the device.  
is there any issue like another davinch issue(http://e2e.ti.com/support/embedded/linux/f/354/p/197489/838791.aspx

i attiched my kernel log and hw configuration . how can i check it? any advice will be appreciated.

Linux version 2.6.37 (tidvr@build-desktop) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #11 Tue Feb 26 14:27:48 KST 2013
CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: ud8168_dvr
vram size = 20971520 at 0x0
ti81xx_reserve: ### Reserved DDR region @dff00000
reserved size = 20971520 at 0x0
FB: Reserving 20971520 bytes SDRAM for VRAM
Memory policy: ECC disabled, Data cache writeback
OMAP chip is TI8168 2.0
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 124672
Kernel command line: mem=512M console=ttyO2,115200n8 root=/dev/ram0 ramdisk_size=83388608 ro initrd=0xC2000000,8M  ip=off vram=20M notifyk.vpssm3_sva=0xBFB00000 ddr_mem=2048M v 
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 490MB 1MB = 491MB total
Memory: 484080k/484080k available, 40208k reserved, 72704K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xda800000 - 0xf8000000   ( 472 MB)
    lowmem  : 0xc0000000 - 0xda400000   ( 420 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .init : 0xc0008000 - 0xc0041000   ( 228 kB)
      .text : 0xc0041000 - 0xc0547000   (5144 kB)
      .data : 0xc0548000 - 0xc0592b00   ( 299 kB)
SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:407
IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
Total of 128 interrupts on 1 active controller
GPMC revision 6.0
Trying to install interrupt handler for IRQ400
Trying to install interrupt handler for IRQ401
Trying to install interrupt handler for IRQ402
Trying to install interrupt handler for IRQ403
Trying to install interrupt handler for IRQ404
Trying to install interrupt handler for IRQ405
Trying to install interrupt handler for IRQ406
Trying to install type control for IRQ407
Trying to set irq flags for IRQ407
OMAP clockevent source: GPTIMER1 at 27000000 Hz
Console: colour dummy device 80x30
Calibrating delay loop... 1199.30 BogoMIPS (lpj=5996544)
pid_max: default: 32768 minimum: 301
Security Framework initialized
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
TI81XX: Map 0xdff00000 to 0xfe500000 for dram barrier
TI81XX: Map 0x40300000 to 0xfe600000 for sram barrier
omap_voltage_early_init: voltage driver support not added
regulator: core version 0.5
regulator: dummy: 
NET: Registered protocol family 16
omap_voltage_domain_lookup: Voltage driver init not yet happened.Faulting!
omap_voltage_add_dev: VDD specified does not exist!
OMAP GPIO hardware version 0.1
OMAP GPIO hardware version 0.1
omap_mux_init: Add partition: #1: core, flags: 0
3-wired eeprom init done. (H/W ver:00)
_omap_mux_get_by_name: Could not find signal i2c2_scl.i2c2_scl
_omap_mux_get_by_name: Could not find signal i2c2_sda.i2c2_sda
Cannot clk_get ck_32
pm_dbg_init: only OMAP3 supported
registered ti81xx_vpss device
registered ti81xx_vidout device
registered ti81xx on-chip HDMI device
registered ti81xx_fb device
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
USBSS revision 4ea20809
registerd cppi-dma Intr @ IRQ 17
Cppi41 Init Done
omap_i2c omap_i2c.1: bus 1 rev4.0 at 100 kHz
omap_i2c omap_i2c.2: bus 2 rev4.0 at 100 kHz
Advanced Linux Sound Architecture Driver Version 1.0.23.
Switching to clocksource gp timer
musb-hdrc: version 6.0, host, debug=0
musb-hdrc musb-hdrc.0: dma type: dma-cppi41
MUSB controller-0 revision 4ea20800
musb-hdrc musb-hdrc.0: MUSB HDRC host driver
musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: MUSB HDRC host driver
usb usb1: Manufacturer: Linux 2.6.37 musb-hcd
usb usb1: SerialNumber: musb-hdrc.0
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
musb-hdrc musb-hdrc.0: USB Host mode controller at da81e000 using DMA, IRQ 18
musb-hdrc musb-hdrc.1: dma type: dma-cppi41
MUSB controller-1 revision 4ea20800
musb-hdrc musb-hdrc.1: MUSB HDRC host driver
musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 2
usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: MUSB HDRC host driver
usb usb2: Manufacturer: Linux 2.6.37 musb-hcd
usb usb2: SerialNumber: musb-hdrc.1
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
musb-hdrc musb-hdrc.1: USB Host mode controller at da828800 using DMA, IRQ 19
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 8192K
NetWinder Floating Point Emulator V0.97 (double precision)
PMU: registered new PMU device of type 0
omap-iommu omap-iommu.0: ducati registered
omap-iommu omap-iommu.1: sys registered
highmem bounce pool size: 64 pages
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
fuse init (API version 7.15)
SGI XFS with security attributes, large block/inode numbers, no debug enabled
msgmni has been set to 819
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
omap_uart.0: ttyO0 at MMIO 0x48020000 (irq = 72) is a OMAP UART0
omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
console [ttyO2] enabled
brd: module loaded
loop: module loaded
ahci probe: devid name is ahci
ahci CAP register dump =0x6726ff81
Modified ahci CAP register dump =0x6f26ff81
ahci ahci.0: forcing PORTS_IMPL to 0x3
ahci: SSS flag set, parallel bus scan disabled
ahci ahci.0: AHCI 0001.0100 32 slots 2 ports 3 Gbps 0x3 impl platform mode
ahci ahci.0: flags: ncq sntf stag pm led clo only pmp pio slum part ccc 
scsi0 : ahci_platform
scsi1 : ahci_platform
ata1: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x100 irq 16
ata2: SATA max UDMA/133 irq_stat 0x00000040, connection status changed irq 16
omap2-nand driver initializing
NAND device: Maf ID: 0xec, Chip ID: 0xf1 (Samsung, )
 erasesize: 0x20000, writesize: 2048, oobsize: 64
Creating 12 MTD partitions on "omap2-nand.0":
0x000000000000-0x000000240000 : "U-Boot"
0x000000240000-0x000000280000 : "U-Boot Env"
0x000000280000-0x000000580000 : "U-Boot Logo"
0x000000580000-0x0000009c0000 : "Kernel"
0x0000009c0000-0x0000011c0000 : "File System"
0x0000011c0000-0x0000031c0000 : "APP"
0x0000031c0000-0x000003600000 : "Kernel Ex"
0x000003600000-0x000003e00000 : "File System Ex"
0x000003e00000-0x000005e00000 : "APP Ex"
0x000005e00000-0x000006000000 : "INI"
0x000006000000-0x000006200000 : "LOG"
0x000006200000-0x000008000000 : "Reserved"
davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
davinci_mdio davinci_mdio.0: detected phy mask fffffffd
davinci_mdio.0: probed
davinci_mdio davinci_mdio.0: phy[1]: device 0:01, driver unknown
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver dm9601
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
usbserial: USB Serial Driver core
mice: PS/2 mouse device common for all mice
rtc-ds1307: probe of 1-0068 failed with error -5
rtc-isl12022 1-006f: rtc core: registered rtc-isl12022 as rtc0
omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc1
i2c /dev entries driver
Linux video capture interface: v2.00
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v1.0.0)
OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
notify_init : notify drivercreated  for  remote proc id 2 at physical Address 0xbfb00000
usbcore: registered new interface driver snd-usb-audio
Registered tvp5158 audio codec
asoc: tvp5158-hifi <-> davinci-mcasp.0 mapping ok
asoc: tlv320aic3x-hifi <-> davinci-mcasp.2 mapping ok
asoc: HDMI-DAI-CODEC <-> hdmi-dai mapping ok
ALSA device list:
  #0: TI81XX_DVR_CARD0
  #1: TI81XX_DVR_CARD1
TCP cubic registered
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
omap_voltage_late_init: Voltage driver support not added
Power Management for TI81XX.
davinci_emac_probe: using random MAC addr: 92:0f:7e:ea:83:14
davinci_emac_probe: using random MAC addr: fa:64:d4:43:e4:e4
usb 1-1: new full speed USB device using musb-hdrc and address 2
rtc-isl12022 1-006f: setting system clock to 2010-01-01 04:54:36 UTC (1262321676)
ata1: SATA link down (SStatus 0 SControl 300)
usb 1-1: New USB device found, idVendor=04e2, idProduct=1411
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: XR21B1411
usb 1-1: Manufacturer: Exar Corp.
usb 1-1: SerialNumber: C7575664131
usb 2-1: new high speed USB device using musb-hdrc and address 2
usb 2-1: New USB device found, idVendor=0424, idProduct=2513
usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
hub 2-1:1.0: USB hub found
hub 2-1:1.0: 3 ports detected
ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata2.15: Port Multiplier 1.2, 0x197b:0x3215 r0, 5 ports, feat 0x5/0xf
ata2.00: hard resetting link
ata2.00: SATA link down (SStatus 0 SControl 320)
ata2.01: hard resetting link
ata2.01: SATA link down (SStatus 0 SControl 320)
ata2.02: hard resetting link
ata2.02: SATA link down (SStatus 0 SControl 320)
ata2.03: hard resetting link
ata2.03: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
ata2.04: hard resetting link
ata2.04: SATA link down (SStatus 0 SControl 320)
ata2.03: ATA-8: ST3250312CS, SC13, max UDMA/133
ata2.03: 488397168 sectors, multi 0: LBA48 NCQ (depth 31/32)
ata2.03: configured for UDMA/133
ata2: EH complete
scsi 1:3:0:0: Direct-Access     ATA      ST3250312CS      SC13 PQ: 0 ANSI: 5
sd 1:3:0:0: Attached scsi generic sg0 type 0
sd 1:3:0:0: [sda] 488397168 512-byte logical blocks: (250 GB/232 GiB)
sd 1:3:0:0: [sda] Write Protect is off
sd 1:3:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3
sd 1:3:0:0: [sda] Attached SCSI disk
RAMDISK: gzip image found at block 0
EXT3-fs: barriers not enabled
kjournald starting.  Commit interval 5 seconds
EXT3-fs (ram0): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) readonly on device 1:0.
devtmpfs: mounted
Freeing init memory: 228K
Setting the hostname to dm816xdvr
Mounting filesystems
EXT3-fs (ram0): using internal journal
mount: mounting devpts on /dev/pts failed: No such file or directory
Empty flash at 0x000471ac ends at 0x00047800
Running sysctl
Setting up networking on loopback device: 
Setting up networking on eth0: 
davinci_mdio davinci_mdio.0: resetting idled controller
net eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:01, id=2430d91)
Adding static route for default gateway to 192.168.0.1: 
Setting nameserver to 168.126.63.1 in /etc/resolv.conf: 
Starting inetd: 
JFFS2 notice: (69) check_node_data: wrong data CRC in data node at 0x00046ccc: read 0xfc6048f0, calculated 0x7f08beb6.

login[107]: root login on 'ttyO2'
Welcome root login
tdvr service not running
mmc mount fail
[usb_mount]usb_path:/dev/sda
FwUpdate >>> Detected USB opendir:/mnt/usb1/update
Directory Open Error!!
ECC failed: 0
ECC corrected: 0
Number of bad blocks: 1
Number of bbt blocks: 0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x02000000...
PHY: 0:01 - Link is Up - 100/Full
mount: mounting /dev/loop0 on /opt/dvr failed: Invalid argument
SECOND APPLICATION
umount: can't umount /opt/dvr: Invalid argument
ECC failed: 0
ECC corrected: 0
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x02000000...
mount: mounting /dev/loop0 on /opt/dvr failed: Invalid argument
-sh: /opt/dvr/insmod.sh: not found
-sh: /opt/dvr/linklib.sh: not found
~ # cd /opt/dvr
/opt/dvr # cd /mnt/ini
/mnt/ini # ./nfs.sh 
umount: can't umount /opt/dvr: Invalid argument
/mnt/ini # cd /opt/dvr
/opt/dvr # insmod drv/xr21b1411.ko 
USB Serial support registered for xr21b1411 USB serial port
xr21b1411 1-1:1.0: xr21b1411 USB serial port converter detected
usb 1-1: xr21b1411 USB serial port converter now attached to ttyUSB0
usbcore: registered new interface driver xr21b1411
USB Driver for xr21b1411 USB serial port: v.0.2


####### HW configuration belows ######## 
USB0 -> XR21B1411 (USB to UART) 
 : USB Full Speed, Idle Data Normal Operation.

USB1 -> USB HUB(3 Port) [USB2513B] : it works good

####### it's debug info ####### 
/opt/dvr # insmod drv/xr21b1411.ko 
USB Serial support registered for xr21b1411 USB serial port 
xr21b1411 1-1:1.0: xr21b1411 USB serial port converter detected 
usb 1-1: xr21b1411 USB serial port converter now attached to ttyUSB0 
usbcore: registered new interface driver xr21b1411 
USB Driver for xr21b1411 USB serial port: v.0.2 
/opt/dvr # lsusb 
Bus 001 Device 001: ID 1d6b:0002 
Bus 002 Device 001: ID 1d6b:0002 
Bus 001 Device 002: ID 04e2:1411 
Bus 002 Device 002: ID 0424:2513 
/opt/dvr # lsusb -t 
Bus 001 Device 001: ID 1d6b:0002 
Bus 002 Device 001: ID 1d6b:0002 
Bus 001 Device 002: ID 04e2:1411 
Bus 002 Device 002: ID 0424:2513 
/opt/dvr # lsusb -v 
Bus 001 Device 001: ID 1d6b:0002 
Bus 002 Device 001: ID 1d6b:0002 
Bus 001 Device 002: ID 04e2:1411 
Bus 002 Device 002: ID 0424:2513 

Best Regards. CHO

  • Hello Cho,

    kisung cho said:
    but when i open /dev/ttyUSB0 , i can't open the device

    What exactly happens? You see no output? Or there is some error?

    How you are trying to open it? What is the exact command line with picocom/minicom? What are the picocom/minicom settings?

    What with what you are trying to connect?

    Thank you.

    BR

    Vladimir

  • Hi. thank you for your reply.

    i tested EXAR's usb2uart. when i test it , device probed, but it can't opend.  it always printed the message that 

    "[USB_Open]FAIL cannot device open serial node!!(/dev/ttyUSB0) fd:-1, Permission denied". 

    because of this issue i buy FTDI  USB2UART serial cable. and test it , it works good. 

    when i test EXAR's usb2uart device, there was none of  message.

    how can it check it?  

    <code>

    int USB_Open()
    {
    int fd = -1;
    struct termios oldtio, newtio;

    char szName[256];


    //strcpy( szName, "/dev/tty01" ); // FRONT UART
    strcpy( szName, "/dev/ttyUSB0" ); // TOUCH UART

    //fd = open( szName, O_RDWR | O_NOCTTY | O_NONBLOCK );
    fd = open( szName, O_RDONLY | O_NOCTTY );
    //fd = open( szName, O_RDWR, 0 );
    if( fd < 0 ) {
    printf( "[%s]FAIL cannot device open serial node!!(%s) fd:%d, %s\n", __func__, szName, fd, strerror(errno) );
    return -1;
    }

    </code>

    Best Regards. CHO

  • Hi

    i checked exar's latest driver and when i apply it, it works.

    thank you.  

  • Hi,

    This is great. Thank you very much for the feedback.

    BR

    Vladimir