all,
when debugging embedded system, as you know, we usually communicate target device over an uart console. Now I want to test “Magic sysrq” function in linux kernel, which need to send a “break” to console driver. I’ve found what does the “break” mean, seems I need to keep TX-line electrical low level for a while.
My question is how to send this break “character”, from APUE(Advanced program in unix), I have to call function “tcsendbreak”, which mean i have to write a program. I wander if i can use some specical keys to send that, like ^C etc.
Don’t methon “echo “x” > /proc/sysrq-trigger””, I know that, just have a discussion on other way 🙂
This is my terminal settings, I talk with target with ckermit.
stty -a < /dev/ttyUSB0
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc
-ixany -imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl
echoke
From the documentation, it looks like
Control-\ Bwill send a break in C-Kermit.Other ways…