Increase flexibility for serial devices in run-tool

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.
This commit is contained in:
Stefan Kalkowski 2013-05-28 11:40:56 +02:00
parent 5e321732df
commit 8ac5ae2248

View File

@ -266,7 +266,7 @@ set specs [get_cmd_arg --specs ""]
set repositories [get_cmd_arg --repositories ""] set repositories [get_cmd_arg --repositories ""]
set qemu_args [get_cmd_arg --qemu-args ""] set qemu_args [get_cmd_arg --qemu-args ""]
set run_target [get_cmd_arg --target "qemu"] 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"]
@ -674,7 +674,7 @@ proc exit {{status 0}} {
# #
proc spawn_serial { wait_for_re timeout_value} { proc spawn_serial { wait_for_re timeout_value} {
global spawn_id global spawn_id
global serial_dev global serial_cmd
global run_target global run_target
if {$wait_for_re == "forever"} { if {$wait_for_re == "forever"} {
@ -687,7 +687,7 @@ proc spawn_serial { wait_for_re timeout_value} {
power_plug_reset power_plug_reset
} }
spawn picocom -b 115200 $serial_dev eval spawn $serial_cmd
set serial_spawn_id $spawn_id set serial_spawn_id $spawn_id
wait_for_output $wait_for_re $timeout_value $serial_spawn_id wait_for_output $wait_for_re $timeout_value $serial_spawn_id
} }