USB monitoring on Linux
I am dying. The Java utility for viewing waveforms from my GW Instek GDS-2062 oscilloscope is coming along nicely. One of the nice things I can do now is to change the settings on the scope by clicking on the utility on my PC monitor. There's a proprietary flash-writing program on my laptop, connected via USB serial to some Silicon Labs' prototyping boards. I want to write my own re-flashing code, to run on the microcontroller, rather than on a PC. It's not working. The available examples don't work. Code written to the instructions in the manual doesn't work. I have a proprietary program that does work though, so I want to see how it does it.
The oscilloscope's firmware could be better. The manufacturer has alluded to an update, but a release eludes them. I could piece together pictures captured with their freewave utility, but that stopped working a couple of weeks ago. That method is painful because the scope's support for zooming and panning along the sample memory is broken. Instek does provide a programming guide for the oscilloscope's serial port command language. I used that to write the Java utility, coupled with the RXTX serial communications software for Java. It works sometimes, and sometimes it doesn't. Sometimes when it doesn't it appears that the scope makes a truncated reply. At least, that's what appears to happen from the desktop end. But does it really? Sometimes the oscilloscope locks up when this bug appears, and needs to be switched off and back on again. Sometimes it doesn't and appears to work normally.
I want to know exactly where the communication goes wrong. Since the PC and oscilloscope are connected by a USB lead, the best thing to do is to look at the USB traffic. I found a site that explains it: http://www.mail-archive.com/synce-devel@lists.sourceforge.net/msg00254.html
There's a recommendation to look at the documentation distributed with the Linux kernel for the usb monitoring code. You have to build a debug kernel to do what follows, so none of this will work on 'normal' kernels. That's got to be a good thing from the security point of view. If you're debugging hardware and drivers, rebuilding a kernel and rebooting probably isn't going to hurt you. That much. The output of the usbmon code is available as a plain text file. Nice! But it isn't exactly 'readable'. For that a couple of utilities are mentioned in the kernel documentation, usbdump and USBmon. usbdump doesn't seem to exist. I can see mail on mailing lists where people seem to be suggesting they're about to write it, but I can't find the actual software anywhere. USBmon was easier to find. Wouldn't compile. It looked like it might have compiled once, but the names of classes and files were ... odd.
I've been here before! Nothing works! Well, I'll try writing my own code to make the USB traffic a little more readable, and see if I can't pin down my serial comms woes a little better. Rather than try parsing the /proc/bus/usb/devices file myself, I downloaded the javax.usb software from http://javax-usb.org The install wasn't entirely straightforward, I still ended up editing a Makefile.
That might be my lot for today. It's looking quite cool outside this evening, must be under 30C. Time for me and the daughter to take a stroll. We're on the flight path for KLIA, and there's a lot of traffic in the late evening. She loves to point at the planes (so low you can see the windows sometimes!) and run after them, pointing and shouting "Ohhhhhhhh". She's 16 months old. I'd like to do the same thing, I'm 16 too (in base 34). More later.
Saturday, March 24, 2007
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2007
(29)
-
▼
March
(14)
- Something is workingI wouldn't be impressed if som...
- javax.usbOne day I'll work out whether a lot of my...
- USB monitoring on LinuxI am dying. The Java utilit...
- Kubuntu 0 Windows 1 (Skype stops play)After the DN...
- DNS woesThis is nothing to do with kubuntu. I was ...
- Kubuntu cheering up nicelyI would have greatly pre...
- Kubuntu woesI downloaded the firmware for my route...
- KubuntuWe have a PC here that's been recently reju...
- Getting there...A relatively early night tonight -...
- Instek oscilloscope, RXTX, USB serial woesLost a d...
- RXTX serial port painThe failure of the USB serial...
- RXTX BugA very, very small bug. I've never actuall...
- That oscilloscope softwareWill now plot the two wa...
- GW INSTEK GDS-2062I bought this oscilloscope only ...
-
▼
March
(14)
No comments:
Post a Comment