-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from analogdevicesinc/rgetz-add-couple-scripts
- Loading branch information
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#~/bin/sh | ||
# This resets a connected pluto, loads firmware into ram, and boots it | ||
# | ||
|
||
#default IP address | ||
ipaddr=192.168.2.1 | ||
|
||
if [ ! -f ./build/pluto.dfu ] ; then | ||
echo no file to upload | ||
exit | ||
fi | ||
|
||
ssh_cmd() | ||
{ | ||
sshpass -v -panalog ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oCheckHostIP=no root@${ipaddr} "$1" 2>/dev/null | ||
if [ "$?" -ne "0" ] ; then | ||
echo ssh command $1 failed | ||
exit | ||
fi | ||
} | ||
ssh_cmd "device_reboot ram" | ||
|
||
lines=0 | ||
attempt=0 | ||
while [ "${lines}" -le "8" -a "${attempt}" -le "10" ] | ||
do | ||
lines=$(sudo dfu-util -l -d 0456:b673,0456:b674 | wc -l) | ||
if [ "${lines}" -le "8" ] ; then | ||
sleep 1 | ||
fi | ||
((attempt++)) | ||
done | ||
|
||
# -R resets/terminates the dfu after we are done | ||
sudo dfu-util -R -d 0456:b673,0456:b674 -D ./build/pluto.dfu -a firmware.dfu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/sh | ||
# | ||
# print out a few things to make it easier for people to set up their environment | ||
# | ||
|
||
PREFIX=/opt/Xilinx | ||
|
||
XILINX_REV=$(grep -e "set[[:space:]]*REQUIRED_VIVADO_VERSION" $(find ./hdl -name adi_project_xilinx.tcl) | awk '{print $NF}' | sed 's/"//g') | ||
echo trying to find Vivado $XILINX_REV | ||
|
||
echo "this can take a minute or two, please wait" | ||
|
||
for f in $(find ${PREFIX} -name vivado -executable -type f | grep ${XILINX_REV}) | ||
do | ||
b=$(file ${f} | grep ELF) | ||
if [ ! -z "${b}" ] ; then | ||
BITS=$(echo $b | sed 's/ /\n/g' | grep bit | sed 's/-bit//') | ||
fi | ||
done | ||
GCC=$(dirname $(find ${PREFIX} -name arm-linux-gnueabihf-gcc | grep ${XILINX_REV} )) | ||
SET=$(find ${PREFIX} -name settings${BITS}.sh | grep ${XILINX_REV} | grep Vivado) | ||
|
||
if [ -z "${CROSS_COMPILE}" ] ; then | ||
echo "export CROSS_COMPILE=arm-linux-gnueabihf-"A | ||
else | ||
if [ "${CROSS_COMPILE}" != "arm-linux-gnueabihf-" ] ; then | ||
echo "export CROSS_COMPILE=arm-linux-gnueabihf-" | ||
echo "#CROSS_COMPILE currently set to \"${CROSS_COMPILE}\"" | ||
else | ||
echo "#CROSS_COMPILE set properly" | ||
fi | ||
fi | ||
if [ -z "$(echo $PATH | grep -e ${GCC})" ] ; then | ||
echo "export PATH=\$PATH:${GCC}" | ||
else | ||
echo "#gcc already on PATH" | ||
fi | ||
if [ -z "${VIVADO_SETTINGS}" ] ; then | ||
echo "export VIVADO_SETTINGS=${SET}" | ||
else | ||
if [ "${VIVADO_SETTINGS}" != "${SET}" ] ; then | ||
echo "export VIVADO_SETTINGS=${SET}" | ||
echo "#VIVADO_SETTINGS currently set to \"${VIVADO_SETTINGS}\"" | ||
else | ||
echo "#VIVADO_SETTINGS set properly" | ||
fi | ||
fi | ||
echo "Copy/paste those into your environment" |