Skip to content

Commit

Permalink
Increase flexibility for serial devices in run-tool
Browse files Browse the repository at this point in the history
Instead of using a fixed command like picocom in the run tool,
it's better to have the flexibility to set the whole command that
connects to the serial device. Therefore, it's possible for instance
to connect to a remote serial device exported via TCP/IP by using tools
like socat.
  • Loading branch information
skalk committed May 28, 2013
1 parent 5e32173 commit 8ac5ae2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tool/run
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ set specs [get_cmd_arg --specs ""]
set repositories [get_cmd_arg --repositories ""]
set qemu_args [get_cmd_arg --qemu-args ""]
set run_target [get_cmd_arg --target "qemu"]
set serial_dev [get_cmd_arg --serial-dev "/dev/ttyUSB0"]
set serial_cmd [get_cmd_arg --serial-cmd "picocom -b 115200 /dev/ttyUSB0"]



Expand Down Expand Up @@ -674,7 +674,7 @@ proc exit {{status 0}} {
#
proc spawn_serial { wait_for_re timeout_value} {
global spawn_id
global serial_dev
global serial_cmd
global run_target

if {$wait_for_re == "forever"} {
Expand All @@ -686,8 +686,8 @@ proc spawn_serial { wait_for_re timeout_value} {
if {[regexp "reset" $run_target]} {
power_plug_reset
}
spawn picocom -b 115200 $serial_dev

eval spawn $serial_cmd
set serial_spawn_id $spawn_id
wait_for_output $wait_for_re $timeout_value $serial_spawn_id
}
Expand Down

0 comments on commit 8ac5ae2

Please sign in to comment.