Sunday, August 28, 2011

DAS U-boot Sinks My Battleship


Today I set out to finish wiring up the IMU to the Overo serial port (/dev/ttyS2), but ran into a strange problem: with the IMU connected and talking, the Overo wouldn't boot. Connecting the IMU /after/ boot caused my ssh session started going molasses-like, and bizarre messages appeared in /var/log/messages:

Aug 28 07:53:25 quad SysRq : HELP : loglevel(0-9) reBoot Crash terminate-all-tasks(E) memory-full-oom-kill(F) kill-all-tasks(I) thaw-filesystems(J) saK show-memory-usage(M) nice-all-RT-tasks(N) powerOff show-registers(P) show-all-timers(Q) unRaw Sync show-task-states(T) Unmount show-blocked-tasks(W) 
Aug 28 07:53:25 quad SysRq : HELP : loglevel(0-9) reBoot Crash terminate-all-tasks(E) memory-full-oom-kill(F) kill-all-tasks(I) thaw-filesystems(J) saK show-memory-usage(M) nice-all-RT-tasks(N) powerOff show-registers(P) show-all-timers(Q) unRaw Sync show-task-states(T) Unmount show-blocked-tasks(W)

Some Googling revealed that this sort of message appears when certain character sequences are input to a console. Aha! It dawned on me that the Overo starts up a TTY session on /dev/ttyS2 by default so that you can watch (and optionally interrupt) the boot loader, and watch the kernel boot. The IMU was spewing characters into a getty session, thus the weird messages.
This explained the boot failure, too: u-boot pauses at a five-second countdown waiting for you to hit a key if you want to break into the boot loader prompt, aborting the kernel load. So, it looks like the boot loader was pausing for human input, and hearing all sorts of strangeness at the console, and freaking out (and not booting the kernel).

The fix was twofold:
- Broke into u-boot and set the 'console' environment to 'null' (from 'ttyS2,115200n8').
- In /etc/inittab, commented out the lines that set up getty for serial console sessions.

With that solved, I now need to solve my ongoing electrical interface issue with the 3DM-GX1 (nothing's ever easy, is it?) :)

No comments: