NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
help with home-designed USB device
Hi,
this is not strictly NetBSD-related, although the device in question
is connected to a NetBSD host, and its firmware is developed on
NetBSD :), and I know some peoples are knowlegeable in this area here.
I've build a custom low-speed USB device around a microchip pic18f4550,
which uses the CDC class, and NetBSD sees it as umodem+ucom
(the goal being that communication with the device can be done over RS232 or
USB, and the medium used is transparent to the software running on the
host). The software connects to /dev/ttyU0 4 times every minute to
gather data.
Now the problem: after a variable amount of time (from a few minutes to
several days), the NetBSD host prints:
uhci1: host controller process error
uhci1: host controller halted
uhci1 regs: cmd=0080, sts=0020, intr=000f, frnum=06d6, flbase=25585b58,
sof=0040, portsc1=0080, portsc2=01a5
intrs=233670
QH(0xffffa0001bd80f80) at 25581f80: hlink=25581fa2 elink=00000001
and communications with the device over USB becomes impossible.
On the device side, the pic18f4550 asserts an "USB error" interrupt,
the error register containing 0x1. From the microchip docs this value means
"PID check failed", but I didn't find details about what this exactly means
(is it a data toggle mismatch, a crc failure on the PID field in the USB
tocken, or a PID value which doesn't match with the configuration of
the chip - e.g. a setup tocken on a data-only endpoint ?). Once this happens,
the USB port on the NetBSD box is dead, and I have to reboot it to
get it working again (disconnecting/reconnecting the device doesn't help).
I tried different things at the firmware level to try to find the cause of
this error, but I'm running out of idea. Does anyone familiar with USB
designs have an idea ?
--
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
NetBSD: 26 ans d'experience feront toujours la difference
--
Home |
Main Index |
Thread Index |
Old Index