NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/46616: Copy, echo, cat to /dev/ttyU0 ends badly, with "cp: /dev/ttyU0: Invalid argument"



>Number:         46616
>Category:       kern
>Synopsis:       Copy, echo, cat to /dev/ttyU0 ends badly, with "cp: 
>/dev/ttyU0: Invalid argument"
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 19 23:05:00 +0000 2012
>Originator:     Michael L. Riechers
>Release:        NetBSD 6.0_BETA
>Organization:
M L Riechers Systems Engineering
>Environment:
        
        
System: NetBSD rterm.rse.com 6.0_BETA NetBSD 6.0_BETA (GENERIC) #0: Mon Mar 26 
16:43:30 EDT 2012 
root%cterm.rse.com@localhost:/usr/local/src/usr/usr.201203110000Z/src/sys/arch/amd64/compile/obj/GENERIC
 amd64
Architecture: x86_64
Machine: amd64
>Description:
        
1. Attach a FTDI USB HS Serial Converter to a USB port.  Attach the other end
   to your favorite serial device (mine is a TA microBDM12XG BDM pod).

2. On the console, watch the USB device attach:

Jun 19 16:51:04 rterm /netbsd: ehci0: handing over full speed device on port 2 
to ohci0
Jun 19 16:51:06 rterm /netbsd: uftdi0 at uhub0 port 2
Jun 19 16:51:06 rterm /netbsd: uftdi0: FTDI USB HS Serial Converter, rev 
2.00/6.00, addr 4
Jun 19 16:51:06 rterm /netbsd: ucom0 at uftdi0 portno 1

3. Run CU, to set up the Serial Device, and to access the BDM:

Tue Jun 19 16:45:34 on rterm.rse.com ~ A)cu -l /dev/ttyU0 -s 115200 dir

Connected

Can't Communicate With Target CPU

1.) Set Target Speed (16000 KHz)
2.) Reset Target
3.) Reattempt Communication
4.) Erase & Unsecure
5.) Enter BDM debugger
? 

Which is all well and good, because the cpu's memory needs to be erased
before the BDM facility on the cpu will allow to "Communicate With Target CPU."

4. From another window, and with cu still running in the first (or not, both 
ways),
   Run the "unsec" script, which you don't have, but that doesn't matter. I get
   "./unsec: cannot create /dev/ttyU0: error 22" over and over, everytime
   the script executes something like "echo 'reset ' |tr '\n' '\r' 
>>"/dev/ttyU0";"

   So, alternatively, you can just do something like "cp fload3f0000 /dev/ttyU0"
   and get "cp: /dev/ttyU1: Invalid argument"

   Strangely, exactly the same thing happens if I "cp fload3f0000 /dev/ttyU1":
   "cp: /dev/ttyU1: Invalid argument", which is weird, because there ought not
   to be anything hung on ttyU1.  There's nothing physically there.

   If I "cp fload3f0000 /dev/tty00" it completes normally, even though there's
   a serial mouse hung on tty00.

   Here's a copy of my screen:

rterm\d \t on rterm.rse.com \w A) ls -al /dev/tty00 /dev/ttyU*
crw-------  1 uucp  wheel   8, 0 Jun 19 16:52 /dev/tty00
crw-rw-rw-  1 uucp  wheel  66, 0 Jun 19 16:55 /dev/ttyU0
crw-------  1 uucp  wheel  66, 1 Sep 14  2011 /dev/ttyU1

rterm\d \t on rterm.rse.com \w A) cp fload3f0000 /dev/tty00
rterm\d \t on rterm.rse.com \w A) cp fload3f0000 /dev/ttyU0
cp: /dev/ttyU0: Invalid argument
rterm\d \t on rterm.rse.com \w A) cp fload3f0000 /dev/ttyU1
cp: /dev/ttyU1: Invalid argument
rterm\d \t on rterm.rse.com \w A) 

5. This same procedure works fine on:

Tue Jun 19 17:27:08 on jterm.rse.com ~ A) uname -a
NetBSD jterm.rse.com 5.1 NetBSD 5.1 (GENERIC) #0: Sun Nov  7 14:39:56 UTC 2010  
builds%b6.netbsd.org@localhost:/home/builds/ab/netbsd-5-1-RELEASE/i386/201011061943Z-obj/home/builds/ab/netbsd-5-1-RELEASE/src/sys/arch/i386/compile/GENERIC
 i386

>How-To-Repeat:
        

1.  Initially, do a "cp somefile /dev/ttyU0".  This may give you an indication.

2.  Go through steps similar to what I outline above, using a serial emulation
    device such as the FTDI USB HS Serial Converter.

3.  Ask me to do something.  I'm willing.

>Fix:
        

>Unformatted:
 <synopsis of the problem (one line)>
        
        


Home | Main Index | Thread Index | Old Index