CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/Linux_HAL_Essentials/startup.sh
Views: 1798
1
#!/usr/bin/env bash
2
3
if [ "`echo $1`" = "load" ]; then
4
echo "Loading Test_Capes..."
5
cp devicetree/pxf/BB-SPI0-PXF-01-00A0.dtbo /lib/firmware/
6
cp devicetree/pxf/BB-SPI1-PXF-01-00A0.dtbo /lib/firmware/
7
cp devicetree/pxf/BB-BONE-PRU-05-00A0.dtbo /lib/firmware/
8
cp rcinpru0 /lib/firmware
9
cp pwmpru1 /lib/firmware
10
echo BB-BONE-PRU-05 > /sys/devices/bone_capemgr.*/slots
11
echo BB-SPI0-PXF-01 > /sys/devices/bone_capemgr.*/slots
12
echo BB-SPI1-PXF-01 > /sys/devices/bone_capemgr.*/slots
13
echo am33xx_pwm > /sys/devices/bone_capemgr.*/slots
14
echo bone_pwm_P8_36 > /sys/devices/bone_capemgr.*/slots
15
dmesg | grep "SPI"
16
dmesg | grep "PRU"
17
cat /sys/devices/bone_capemgr.*/slots
18
elif [ "`echo $1`" = "reload" ]; then
19
echo "Loading Firmware..."
20
cp rcinpru0 /lib/firmware
21
cp pwmpru1 /lib/firmware
22
echo 0:rcinpru0,1:pwmpru1 > /sys/devices/ocp.3/4a300000.prurproc/load
23
else
24
echo "Usage:"
25
echo " ./startup.sh load : to load the capes and firmware"
26
echo " ./startup.sh reload: to reload firmware"
27
fi
28
29