Looking for FreeBSD u-boot/kernel debugging help (BeagleBone Black)

Asked by 3 months ago
I'm looking for any wisdom on debugging FreeBSD/u-boot on the BBB. I have had some luck with 11-CURRENT, but I think 10-STABLE is probably a more realistic target. I did find this while Googling: https://wiki.freebsd.org/EmbeddedHandbook But it's not very complete. I also discovered that if I disconnect my serial terminal and reconnect it, it seems to bring the FreeBSD kernel to a debug prompt of sorts -- is there any documentation on this? Thanks.

Your Answer

Name:
Reply:

All Answers

Answer by 3 months ago
I suspect disconnecting/reconnecting the serial cable looks like a break to the kernel and that drops it into the debugger "ddb". [Though I can't seem to send a real break to it using kermit!] Type c and hit return to continue. To disable this behavior I think you can do sysctl debug.kbd.break_to_debugger=0 or add debug.kbd.break_to_debugger=0 to /etc/sysctl.conf man 1 ddb -- for debugger commands man 4 ddb -- for kernel config options to control ddb behavior
Answer by 3 months ago
That's exactly correct -- connecting the cable sometimes leads to a spurious break being asserted on the line (a break is just a long sequence of zeroes with no start/stop/data bit transitions). It's possible to configure a kernel without BREAK_TO_DEBUGGER and with ALT_BREAK_TO_DEBUGGER. That eliminates most line-noise spurious breaks but still allows the <CR> ~ ^b break sequence (which could theoretically happen in a burst of line noise, but not likely). A few of our kernels have BREAK_TO_DEBUGGER in the config, and I think that's probably a mistake. Most folks these days don't know anything about breaks or how to generate one on purpose. Any objections to removing them and using only the safer ALT_BREAK option? -- Ian
Answer by 3 months ago
Quoted message by Bakul Shah 3 months ago
I suspect disconnecting/reconnecting the serial cable looks like a break to the kernel and that drops it into the debugger "ddb". [Though I can't seem to send a real break to it using kermit!] Type c and hit return to continue. To disable this behavior I think you can do sysctl debug.kbd.break_to_debugger=0 or add debug.kbd.break_to_debugger=0 to /etc/sysctl.conf man 1 ddb -- for debugger commands man 4 ddb -- for kernel config options to control ddb behavior
Please leave it in the ATMEL config, but I think you can remove it from the rest (including the specific atmel SoC boards). Warner