aboutsummaryrefslogtreecommitdiff
path: root/fpga.wiki
blob: dcf84c2a3c3488941a8a66e9f66f4a9957748eb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
`/lib/firmware` `fpga.dtbo`

dtc -O dtb -o fpga.dtbo -b 0 -@ fpga.dts

{{{chip
mount -t configfs configfs /config
# /sys/kernel/config

mkdir /config/device-tree/overlays/test
echo fpga.dtbo > /config/device-tree/overlays/test/path

echo 1 > /sys/class/leds/fpga_led2/brightness
}}}

Demonstration/SoC_FPGA/DE10_Stardard_GHRD/fpga.dts

=== Send file ===
{{{sh
#!/bin/sh

sudo -l || exit 1

tmp=$(mktemp)
echo -n "$1 " | sudo tee /dev/ttyUSB0
base64 "$1" > $tmp
cat $tmp | wc -c | sudo tee /dev/ttyUSB0
cat $tmp |sudo tee /dev/ttyUSB0
md5sum "$1"
}}}

=== Recv file ===
{{{sh
#!/bin/sh
IFS=' ' filename bytes 
dd bs=1 count=$bytes | base64 --decode > $filename
md5sum $filename
}}}