(credit to Mitch Miers <mmiers@mmiers.com>):
setup() is attempting to initialize the hardware, and while doing so
is attempting to output some text via the console (and maybe mavlink
data). The problem is, the output isn't going to complete once a
write buffer is full, because LinuxUARTDriver::_timer_tick() doesn't
perform work until _initialized is true. So, what happens is,
setup() (and subroutines) call LinuxUARTDriver::_write(uint8_t c),
which loops waiting for buffer space to become available (once the
write buffer is full). The buffer never gets space, because the
UART thread is waiting for initialization to complete before it
will write out data and drain the buffer, but that doesn't happen
until setup() returns (see AP_HAL_Linux_main.h).
Refer to https://groups.google.com/forum/#!topic/beaglepilot/dQlxse11JNI