PX4: test MTD device on boot

full rwtest on FMUv2, read test on FMUv1
This commit is contained in:
Andrew Tridgell 2014-01-16 12:47:48 +11:00
parent e1f06c532a
commit 792667e311
1 changed files with 26 additions and 0 deletions

View File

@ -261,9 +261,35 @@ then
echo "started mtd driver OK" echo "started mtd driver OK"
else else
echo "failed to start mtd driver" echo "failed to start mtd driver"
echo "failed to start mtd driver" >> $logfile
sh /etc/init.d/rc.error sh /etc/init.d/rc.error
fi fi
if mtd readtest /fs/mtd
then
echo "mtd readtest OK"
else
echo "failed to read mtd"
echo "failed to read mtd" >> $logfile
sh /etc/init.d/rc.error
fi
if [ $BOARD == FMUv2 ]
then
# the ramtron on FMUv2 is very fast and can handle trillions of
# writes. This full rw test on each boot ensures it is working
# properly. We have one board that failed this, so
# the test is arguably worth having
if mtd rwtest /fs/mtd
then
echo "mtd rwtest OK"
else
echo "failed to test mtd"
echo "failed to test mtd" >> $logfile
sh /etc/init.d/rc.error
fi
fi
echo Starting ArduPilot $deviceA $deviceC $deviceD echo Starting ArduPilot $deviceA $deviceC $deviceD
if ArduPilot -d $deviceA -d2 $deviceC -d3 $deviceD start if ArduPilot -d $deviceA -d2 $deviceC -d3 $deviceD start
then then