aboutsummaryrefslogtreecommitdiff
path: root/ROMFS
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2013-12-23 11:13:42 +0100
committerThomas Gubler <thomasgubler@gmail.com>2013-12-23 11:13:42 +0100
commit68d8230e78b9116da794e93a0a5edcce4d1d8ee4 (patch)
treee0c86a748a5604e042f1e56c464df117d4eb3030 /ROMFS
parent23d0c6f8dd1a0b9aa64dafe26cfd56e43637c5ee (diff)
parentf6176890947dd33f6b26fb2cad53263882fb8e3b (diff)
downloadpx4-firmware-68d8230e78b9116da794e93a0a5edcce4d1d8ee4.tar.gz
px4-firmware-68d8230e78b9116da794e93a0a5edcce4d1d8ee4.tar.bz2
px4-firmware-68d8230e78b9116da794e93a0a5edcce4d1d8ee4.zip
Merge remote-tracking branch 'upstream/control_groups' into fw_autoland_att_tecs_navigator_termination_controlgroups
Conflicts: src/systemcmds/tests/module.mk src/systemcmds/tests/tests.h
Diffstat (limited to 'ROMFS')
-rw-r--r--ROMFS/px4fmu_common/init.d/rc.sensors16
-rw-r--r--[-rwxr-xr-x]ROMFS/px4fmu_common/init.d/rcS47
-rw-r--r--ROMFS/px4fmu_logging/init.d/rcS88
-rw-r--r--[-rwxr-xr-x]ROMFS/px4fmu_test/init.d/rcS8
4 files changed, 143 insertions, 16 deletions
diff --git a/ROMFS/px4fmu_common/init.d/rc.sensors b/ROMFS/px4fmu_common/init.d/rc.sensors
index f17b650bc..070a4e7e3 100644
--- a/ROMFS/px4fmu_common/init.d/rc.sensors
+++ b/ROMFS/px4fmu_common/init.d/rc.sensors
@@ -19,12 +19,18 @@ fi
if mpu6000 start
then
echo "using MPU6000"
- set BOARD fmuv1
-else
- echo "using L3GD20 and LSM303D"
- l3gd20 start
- lsm303d start
+fi
+
+if l3gd20 start
+then
+ echo "using L3GD20(H)"
+fi
+
+if lsm303d start
+then
set BOARD fmuv2
+else
+ set BOARD fmuv1
fi
# Start airspeed sensors
diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS
index fc05d0b84..57e243292 100755..100644
--- a/ROMFS/px4fmu_common/init.d/rcS
+++ b/ROMFS/px4fmu_common/init.d/rcS
@@ -8,6 +8,8 @@
#
set MODE autostart
+set logfile /fs/microsd/bootlog.txt
+
#
# Try to mount the microSD card.
#
@@ -152,26 +154,49 @@ then
nshterm /dev/ttyACM0 &
fi
-
#
# Upgrade PX4IO firmware
#
- if px4io detect
+
+ 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 running, not upgrading"
+ echo "PX4IO OK"
+ echo "PX4IO OK" >> $logfile
+ fi
+
+ if px4io checkcrc $io_file
+ then
+ echo "PX4IO CRC OK"
+ echo "PX4IO CRC OK" >> $logfile
else
- echo "Attempting to upgrade PX4IO"
- if px4io update
+ echo "PX4IO CRC failure"
+ echo "PX4IO CRC failure" >> $logfile
+ tone_alarm MBABGP
+ if px4io forceupdate 14662 $io_file
then
- if [ -d /fs/microsd ]
+ usleep 200000
+ if px4io start
then
- echo "Flashed PX4IO Firmware OK" > /fs/microsd/px4io.log
+ echo "PX4IO restart OK"
+ echo "PX4IO restart OK" >> $logfile
+ tone_alarm MSPAA
+ else
+ echo "PX4IO restart failed"
+ echo "PX4IO restart failed" >> $logfile
+ tone_alarm MNGGG
+ sh /etc/init.d/rc.error
fi
-
- # Allow IO to safely kick back to app
- usleep 200000
else
- echo "No PX4IO to upgrade here"
+ echo "PX4IO update failed"
+ echo "PX4IO update failed" >> $logfile
+ tone_alarm MNGGG
fi
fi
diff --git a/ROMFS/px4fmu_logging/init.d/rcS b/ROMFS/px4fmu_logging/init.d/rcS
new file mode 100644
index 000000000..7b8856719
--- /dev/null
+++ b/ROMFS/px4fmu_logging/init.d/rcS
@@ -0,0 +1,88 @@
+#!nsh
+#
+# PX4FMU startup script for logging purposes
+#
+
+#
+# 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
+
+uorb start
+
+#
+# Start sensor drivers here.
+#
+
+ms5611 start
+adc start
+
+# mag might be external
+if hmc5883 start
+then
+ echo "using HMC5883"
+fi
+
+if mpu6000 start
+then
+ echo "using MPU6000"
+fi
+
+if l3gd20 start
+then
+ echo "using L3GD20(H)"
+fi
+
+if lsm303d start
+then
+ set BOARD fmuv2
+else
+ set BOARD fmuv1
+fi
+
+# Start airspeed sensors
+if meas_airspeed start
+then
+ echo "using MEAS airspeed sensor"
+else
+ if ets_airspeed start
+ then
+ echo "using ETS airspeed sensor (bus 3)"
+ else
+ if ets_airspeed start -b 1
+ then
+ echo "Using ETS airspeed sensor (bus 1)"
+ fi
+ fi
+fi
+
+#
+# Start the sensor collection task.
+# IMPORTANT: this also loads param offsets
+# ALWAYS start this task before the
+# preflight_check.
+#
+if sensors start
+then
+ echo "SENSORS STARTED"
+fi
+
+sdlog2 start -r 250 -e -b 16
+
+if sercon
+then
+ echo "[init] USB interface connected"
+
+ # Try to get an USB console
+ nshterm /dev/ttyACM0 &
+fi \ No newline at end of file
diff --git a/ROMFS/px4fmu_test/init.d/rcS b/ROMFS/px4fmu_test/init.d/rcS
index 7f161b053..6aa1d3d46 100755..100644
--- a/ROMFS/px4fmu_test/init.d/rcS
+++ b/ROMFS/px4fmu_test/init.d/rcS
@@ -2,3 +2,11 @@
#
# PX4FMU startup script for test hackery.
#
+
+if sercon
+then
+ echo "[init] USB interface connected"
+
+ # Try to get an USB console
+ nshterm /dev/ttyACM0 &
+fi \ No newline at end of file