aboutsummaryrefslogtreecommitdiff
path: root/ROMFS/px4fmu_test/init.d
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-03-03 10:32:01 +0100
committerLorenz Meier <lm@inf.ethz.ch>2014-03-03 10:32:01 +0100
commit5cefd4811f7913402baabf93939ed4fbf4727654 (patch)
tree5e97cf7a45c4c5b7fd6e01e05e2ec87bd2aaf2aa /ROMFS/px4fmu_test/init.d
parent7bb583d6e21a0fa7e51f147d23997aaeb7e218c9 (diff)
parent3dd3ba4637bfe6d665f20c1e5712ac22131b5b22 (diff)
downloadpx4-firmware-mavlink_variable_length.tar.gz
px4-firmware-mavlink_variable_length.tar.bz2
px4-firmware-mavlink_variable_length.zip
Merged with master, cleanup of varlength prototypemavlink_variable_length
Diffstat (limited to 'ROMFS/px4fmu_test/init.d')
-rw-r--r--ROMFS/px4fmu_test/init.d/rc.standalone13
-rw-r--r--ROMFS/px4fmu_test/init.d/rcS77
2 files changed, 90 insertions, 0 deletions
diff --git a/ROMFS/px4fmu_test/init.d/rc.standalone b/ROMFS/px4fmu_test/init.d/rc.standalone
new file mode 100644
index 000000000..67e95215b
--- /dev/null
+++ b/ROMFS/px4fmu_test/init.d/rc.standalone
@@ -0,0 +1,13 @@
+#!nsh
+#
+# Flight startup script for PX4FMU standalone configuration.
+#
+
+echo "[init] doing standalone PX4FMU startup..."
+
+#
+# Start the ORB
+#
+uorb start
+
+echo "[init] startup done"
diff --git a/ROMFS/px4fmu_test/init.d/rcS b/ROMFS/px4fmu_test/init.d/rcS
new file mode 100644
index 000000000..56482d140
--- /dev/null
+++ b/ROMFS/px4fmu_test/init.d/rcS
@@ -0,0 +1,77 @@
+#!nsh
+#
+# PX4FMU startup script for test hackery.
+#
+uorb start
+
+if sercon
+then
+ echo "[init] USB interface connected"
+
+ # Try to get an USB console
+ nshterm /dev/ttyACM0 &
+fi
+
+#
+# Try to mount the microSD card.
+#
+echo "[init] looking for microSD..."
+if mount -t vfat /dev/mmcsd0 /fs/microsd
+then
+ echo "[init] card mounted at /fs/microsd"
+ # Start playing the startup tune
+ tone_alarm start
+else
+ echo "[init] no microSD card found"
+ # Play SOS
+ tone_alarm error
+fi
+
+#
+# Start a minimal system
+#
+
+if [ -f /etc/extras/px4io-v2_default.bin ]
+then
+ set io_file /etc/extras/px4io-v2_default.bin
+else
+ set io_file /etc/extras/px4io-v1_default.bin
+fi
+
+if px4io start
+then
+ echo "PX4IO OK"
+fi
+
+if px4io checkcrc $io_file
+then
+ echo "PX4IO CRC OK"
+else
+ echo "PX4IO CRC failure"
+ tone_alarm MBABGP
+ if px4io forceupdate 14662 $io_file
+ then
+ usleep 500000
+ if px4io start
+ then
+ echo "PX4IO restart OK"
+ tone_alarm MSPAA
+ else
+ echo "PX4IO restart failed"
+ tone_alarm MNGGG
+ sleep 5
+ reboot
+ fi
+ else
+ echo "PX4IO update failed"
+ tone_alarm MNGGG
+ fi
+fi
+
+#
+# The presence of this file suggests we're running a mount stress test
+#
+if [ -f /fs/microsd/mount_test_cmds.txt ]
+then
+ tests mount
+fi