2020-01-15 05:07:19 +08:00
|
|
|
#! /usr/bin/env nix-shell
|
2020-01-16 02:14:42 +08:00
|
|
|
#! nix-shell -i bash -p gdb openocd cgdb tmux
|
2020-01-15 05:07:19 +08:00
|
|
|
SESSION=$USER
|
|
|
|
|
2020-01-24 07:51:29 +08:00
|
|
|
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
|
2020-03-06 18:37:15 +08:00
|
|
|
tmux send-keys "sleep 10 && cgdb zc706.elf -x openocd/gdb-zynq-commands.gdb" C-m
|
2020-01-24 07:51:29 +08:00
|
|
|
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
|
2020-03-06 18:37:15 +08:00
|
|
|
tmux send-keys "sleep 3 && cgdb target/armv7-none-eabihf/release/zc706-experiments -x openocd/gdb-zynq-commands.gdb" C-m
|
2020-01-24 07:51:29 +08:00
|
|
|
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
|
2020-01-15 05:07:19 +08:00
|
|
|
# Set default window
|
|
|
|
tmux select-window -t $SESSION:1
|
|
|
|
|
|
|
|
# Set focus on gdb
|
|
|
|
tmux select-pane -t $SESSION:.-
|
|
|
|
|
|
|
|
# Attach to session
|
|
|
|
tmux -2 attach-session -t $SESSION
|