forked from M-Labs/zynq-rs
improved the development process
This commit is contained in:
parent
688e3b4432
commit
738ee32a51
|
@ -1 +1,2 @@
|
|||
/target
|
||||
zc706.elf
|
||||
|
|
40
README.md
40
README.md
|
@ -51,3 +51,43 @@ nix-shell --command "cargo xbuild --release --no-default-features --features=tar
|
|||
cd openocd
|
||||
openocd -f cora-z7-10.cfg
|
||||
```
|
||||
|
||||
### Development Process
|
||||
|
||||
Clone this repo onto your development/build machine and the raspberry pi that controls the Xilinx 7000 board
|
||||
|
||||
On the dev machine, the below script builds zc706 and secure copies it to the target pi (in your pi $HOME directory)
|
||||
```shell
|
||||
cd ~/zc706
|
||||
./build.sh $your_user/ssh_id
|
||||
```
|
||||
|
||||
On the pi, we need an information rich environment that includes a relatively reliable `gdb` experience (that includes `ctrl-p` and `ctrl-n` command history that persists across `cgdb` executions), run:
|
||||
```shell
|
||||
ssh pi4
|
||||
cd zc706
|
||||
./tmux.sh
|
||||
```
|
||||
|
||||
Time to run your code with:
|
||||
```shell
|
||||
zynq-connect
|
||||
zynq-restart
|
||||
c
|
||||
```
|
||||
or, for a more succinct experience, (identical to above)
|
||||
```shell
|
||||
dc
|
||||
dr
|
||||
c
|
||||
```
|
||||
|
||||
After every build on your dev machine, simply run:
|
||||
```shell
|
||||
dr
|
||||
c
|
||||
```
|
||||
Sometimes you might need to type `load` after `dr`.
|
||||
|
||||
Note, to exit `picocom` hit `ctrl-a x`
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
nix-shell --command "cargo xbuild --release" && scp -P 2204 -C target/armv7-none-eabihf/release/zc706-experiments $1@nixbld.m-labs.hk:/home/$1/zc706/zc706.elf
|
|
@ -0,0 +1,29 @@
|
|||
def zynq-connect
|
||||
target remote :3333
|
||||
end
|
||||
|
||||
def zynq-fsbl-restart
|
||||
mon xilinx_ps7_init
|
||||
end
|
||||
|
||||
def zynq-restart
|
||||
mon xilinx_ps7_init
|
||||
#mon load_image zc706.elf 0x00000000 elf
|
||||
load zc706.elf
|
||||
end
|
||||
|
||||
# easily typed shortcuts
|
||||
# device connect
|
||||
def dc
|
||||
zynq-connect
|
||||
end
|
||||
# device restart
|
||||
def dr
|
||||
zynq-restart
|
||||
end
|
||||
|
||||
def dfr
|
||||
zynq-fsbl-restart
|
||||
end
|
||||
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg]
|
||||
source [find xilinx-tcl.cfg]
|
||||
adapter_khz 1000
|
||||
|
||||
set PL_TAPID 0x23731093
|
||||
|
@ -41,4 +42,6 @@ arm mcr 15 0 1 0 0 [expr [arm mrc 15 0 1 0 0] & ~0xd]
|
|||
targets $_TARGETNAME_0
|
||||
arm mcr 15 0 1 0 0 [expr [arm mrc 15 0 1 0 0] & ~0xd]
|
||||
|
||||
|
||||
# uncomment the below to load up a bitstream onto the fpga
|
||||
#pld load 0 blinker_migen.bit
|
||||
#exit
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p gdb openocd cgdb picocom 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 "picocom --b 115200 /dev/ttyUSB1" C-m
|
||||
#tmux send-keys "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
|
||||
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue