From 43722eff8b4a22fe469b8a32081ec91656effbe4 Mon Sep 17 00:00:00 2001 From: Stewart Mackenzie Date: Fri, 24 Jan 2020 07:51:29 +0800 Subject: [PATCH] add support for cora z7 in tmux script --- openocd/gdb-zynq-commands | 3 +-- tmux.sh | 35 ++++++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/openocd/gdb-zynq-commands b/openocd/gdb-zynq-commands index cca9608..1d9bc10 100644 --- a/openocd/gdb-zynq-commands +++ b/openocd/gdb-zynq-commands @@ -8,8 +8,7 @@ end def zynq-restart mon xilinx_ps7_init - #mon load_image zc706.elf 0x00000000 elf - load zc706.elf + load end # easily typed shortcuts diff --git a/tmux.sh b/tmux.sh index c0f8345..0dcde6b 100755 --- a/tmux.sh +++ b/tmux.sh @@ -2,17 +2,30 @@ #! nix-shell -i bash -p gdb openocd cgdb tmux SESSION=$USER -tmux -2 new-session -d -s $SESSION -tmux new-window -t $SESSION:1 -n 'ZC706' -tmux split-window -h -tmux select-pane -t 0 -tmux send-keys "stty 115200 < /dev/ttyUSB1 && cat /dev/ttyUSB1" C-m -tmux select-pane -t 1 -tmux send-keys "sleep 10 && cgdb zc706.elf -x openocd/gdb-zynq-commands" C-m -tmux split-window -v -tmux resize-pane -D 20 -tmux send-keys "cd openocd && openocd -f zc706.cfg -c reset init" C-m - +if [ $1 -eq 0 ] +then + tmux -2 new-session -d -s $SESSION + tmux new-window -t $SESSION:1 -n 'ZC706' + tmux split-window -h + tmux select-pane -t 0 + tmux send-keys "stty 115200 < /dev/ttyUSB1 && cat /dev/ttyUSB1" C-m + tmux select-pane -t 1 + tmux send-keys "sleep 10 && cgdb zc706.elf -x openocd/gdb-zynq-commands" C-m + tmux split-window -v + tmux resize-pane -D 20 + tmux send-keys "cd openocd && openocd -f zc706.cfg -c reset init" C-m +else + tmux -2 new-session -d -s $SESSION + tmux new-window -t $SESSION:1 -n 'CORA Z7' + tmux split-window -h + tmux select-pane -t 0 + tmux send-keys "stty 115200 < /dev/ttyUSB1 && cat /dev/ttyUSB1" C-m + tmux select-pane -t 1 + tmux send-keys "sleep 10 && cgdb target/armv7-none-eabihf/release/zc706-experiments -x openocd/gdb-zynq-commands" C-m + tmux split-window -v + tmux resize-pane -D 20 + tmux send-keys "cd openocd && openocd -f cora-z7-10.cfg -c reset init" C-m +fi # Set default window tmux select-window -t $SESSION:1