From 792667e311d5e09443bd7f05ea1ce71155e2f11a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 16 Jan 2014 12:47:48 +1100 Subject: [PATCH] PX4: test MTD device on boot full rwtest on FMUv2, read test on FMUv1 --- mk/PX4/ROMFS/init.d/rc.APM | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/mk/PX4/ROMFS/init.d/rc.APM b/mk/PX4/ROMFS/init.d/rc.APM index 2f9bad7ab4..90a7854c1b 100644 --- a/mk/PX4/ROMFS/init.d/rc.APM +++ b/mk/PX4/ROMFS/init.d/rc.APM @@ -261,9 +261,35 @@ then echo "started mtd driver OK" else echo "failed to start mtd driver" + echo "failed to start mtd driver" >> $logfile sh /etc/init.d/rc.error 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 if ArduPilot -d $deviceA -d2 $deviceC -d3 $deviceD start then