bunnie edited this page Oct 17, 2018 · 3 revisions

Welcome to the exclave wiki!

Random tips and tricks

  • "expect" (the TCL package; sudo yum install expect) is extremely helpful for integrating with serial terminals. Here's a short script example:
#!/usr/bin/expect                                                                                                                                                                       

set timeout 1
spawn /home/pi/code/netv2-tests/bin/flterm/flterm --port /dev/ttyAMA0 --speed 115200

set try 0
expect {
    "TESTER_NX8D" {
	send "\n\r"
    }
    timeout {
	if {$try < 10} {
            send "\n\r"
            incr try
            exp_continue
	}
        failed "Tester REPL prompt"
    }
}
# kill the flterm so it doesn't hang around and muck with the next process                                                                                                              
set tpid [exp_pid -i $spawn_id]
exec kill -9 $tpid

The above loop starts flterm (an interactive serial terminal, you could also use minicom, etc.) and then sends a CR/LF once every second for up to 10 seconds or until it gets the prompt "TESTER_NX8D" which in this case is the shell prompt of the firmware running on the DUT.

Failures exit 1, success exits 0, and serial console output is relayed in real time to stdout.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.