-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremote.sh
executable file
·69 lines (49 loc) · 1.79 KB
/
remote.sh
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh
trap cleanup 1 2 3 6
PID=""
# TODO this is ...
#ALL_GPIOs="gpio10 gpio11 gpio110 gpio111 gpio112 gpio113 gpio114 gpio115 gpio116 gpio12 gpio13 gpio14 gpio15 gpio2 gpio20 gpio22 gpio23 gpio26 gpio27 gpio3 gpio30 gpio31 gpio32 gpio33 gpio34 gpio35 gpio36 gpio37 gpio38 gpio39 gpio4 gpio44 gpio45 gpio46 gpio47 gpio48 gpio49 gpio5 gpio50 gpio51 gpio60 gpio61 gpio62 gpio63 gpio65 gpio66 gpio67 gpio68 gpio69 gpio7 gpio70 gpio71 gpio72 gpio73 gpio74 gpio75 gpio76 gpio77 gpio78 gpio79 gpio8 gpio80 gpio81 gpio86 gpio87 gpio88 gpio89 gpio9"
#OUT_GPIOs="gpio17 gpio115"
#OUT_GPIOs=${ALL_GPIOs}
# OUT_GPIOs="gpio49 gpio44 gpio45" # P9.23 P8.11 P8.12
# IN_GPIOs="gpio117 gpio60" # P9.25 P9.12
LEDs="beaglebone:green:usr0 beaglebone:green:usr1 beaglebone:green:usr2 beaglebone:green:usr3"
cleanup()
{
kill -9 $PID
exit 1
}
configPins() {
echo "Configuring user LEDs"
for led in ${LEDs}; do
echo none > /sys/class/leds/${led}/trigger
done
# echo "Configuring GPIO pins"
# for gpio in ${OUT_GPIOs}; do
# echo out > /sys/class/gpio/${gpio}/direction
# done
# for gpio in ${IN_GPIOs}; do
# echo in > /sys/class/gpio/${gpio}/direction
# done
}
#configPins
# Works!
#config-pin P9_14 pwm
# Not sure how to get ecap0 in
#config-pin P9_92 pruin
#config-pin P9_42 pru_ecap
#config-pin P9_92 pruin
# echo "Stopping ..."
# echo stop > /sys/class/remoteproc/remoteproc1/state
# echo stop > /sys/class/remoteproc/remoteproc2/state
# mv example_pru0 /lib/firmware
# echo example_pru0 > /sys/class/remoteproc/remoteproc1/firmware
# echo "Starting ..."
# echo start > /sys/class/remoteproc/remoteproc1/state
# echo "State: ..."
# cat /sys/class/remoteproc/remoteproc1/state
RP=$1
FW=$2
mv supructl ./bin
mv ${FW} ./fw
./bin/supructl start --remoteproc ${RP} --firmware ./fw/${FW}