Morning: haul one carload of my father's books to storage, and two carloads of my assorted HAZMAT to official drop-off points. So there's that accomplished.
Afternoon: time to get some work done on a toaster project that I've been neglecting for far too long. Get the hardware all set up (this involves a considerable amount of searching for things that haven't gotten unpacked yet at the interim location). Build the new firmware-to-be-tested, and install it on the hardware... also updating the very outdated bootloader and FPGA code on that unit. Run the communication test script....
Oops. Won't run. Nor will various other flavors. Some of them have a flurry of syntax errors; seems Ruby 2.1.0 doesn't like having a when
statement terminated with a colon; this is easily fixed. More vexing, however, is the apparent absence of a Ruby binding for gnomecanvas2
, which I used in my old Ruby GUI library, without which these scripts don't work. And it looks like the not-so-new version of Debian I have installed here doesn't include any down-rev versions of Ruby.
I can't seem to find anything that'll fix this just offhand, so I fire up the archived VM of the classic development environment, assign the appropriate USB comm dongle to it, and run the script there.
Er... no communication? Well, maybe the protocol is messed up. Load the firmware for an older model, and run its test script. Still no communication.
Break out the scope, and start tracing signals. I see bits coming out of the dongle. On the transceiver chip on the target board ( a DFN, so a right pain to probe), I see bits coming in. And I see bits coming back out, indicating that the target is receiving valid messages and responding thereto.
Instrument the receive thread in the test script: it starts running, and no received character ever turns up. Wut?
So... the incoming bits are somehow not making it to the getc
. Either that, or the receive thread is dying early for some reason (getting such events reported in Ruby takes some extra attention, and I may not have included the necessary incantation in the script at hand). Time to refresh my memory on such matters.
Update: The serial-port getc
function is calling getbyte
to return the integer value of the character returned by the system-level getc
. Alas, while that is necessary on some newer version of Ruby, the function in question doesn't exist in the ancient version of Ruby in the archived environment.
Seems I need either an intermediate-vintage environment or a run-time test for availability of getbyte
. Growf.
Update 2: Came up with a hack that gets it running on the older version of Ruby (haven't yet confirmed that it still works on any newer version). Now the script runs... for a while. Then it gets a wedgie. Rather, it appears that the ftdi_sio
driver gets a wedgie. Maybe some issue with the VM? Unloading and reloading the driver unwedges it for a while.
Update 2½: I hit "Publish" on that last update... just as the U-Verse router decided to go offline for a moment. It does that a lot.
Recent Comments