Moved to USART1 for the main console, starting a 2nd NSH instance on USB if needed, reworked start scripts to not fall over

This commit is contained in:
Lorenz Meier
2013-08-22 09:25:13 +02:00
parent 3005c8aae0
commit cfa9054aa4
7 changed files with 97 additions and 65 deletions
+5 -7
View File
@@ -98,10 +98,8 @@ multirotor_att_control start
# #
sdlog2 start -r 50 -a -b 14 sdlog2 start -r 50 -a -b 14
# # Try to get an USB console
# Start system state nshterm /dev/ttyACM0 &
#
if blinkm start # Exit, because /dev/ttyS0 is needed for MAVLink
then exit
blinkm systemstate
fi
+1 -1
View File
@@ -88,7 +88,7 @@ pwm -u 400 -m 0xff
multirotor_att_control start multirotor_att_control start
# #
# Start logging # Start logging once armed
# #
sdlog2 start -r 50 -a -b 14 sdlog2 start -r 50 -a -b 14
+6 -19
View File
@@ -3,12 +3,6 @@
# Flight startup script for PX4FMU on PX4IOAR carrier board. # Flight startup script for PX4FMU on PX4IOAR carrier board.
# #
# Disable the USB interface
set USB no
# Disable autostarting other apps
set MODE ardrone
echo "[init] doing PX4IOAR startup..." echo "[init] doing PX4IOAR startup..."
# #
@@ -70,30 +64,23 @@ multirotor_att_control start
ardrone_interface start -d /dev/ttyS1 ardrone_interface start -d /dev/ttyS1
# #
# Start logging # Start logging once armed
# #
sdlog start -s 10 sdlog2 start -r 50 -a -b 14
# #
# Start GPS capture # Start GPS capture
# #
gps start gps start
#
# Start system state
#
if blinkm start
then
echo "using BlinkM for state indication"
blinkm systemstate
else
echo "no BlinkM found, OK."
fi
# #
# startup is done; we don't want the shell because we # startup is done; we don't want the shell because we
# use the same UART for telemetry # use the same UART for telemetry
# #
echo "[init] startup done" echo "[init] startup done"
# Try to get an USB console
nshterm /dev/ttyACM0 &
# Exit, because /dev/ttyS0 is needed for MAVLink
exit exit
+9 -6
View File
@@ -3,12 +3,6 @@
# Flight startup script for PX4FMU on PX4IOAR carrier board. # Flight startup script for PX4FMU on PX4IOAR carrier board.
# #
# Disable the USB interface
set USB no
# Disable autostarting other apps
set MODE ardrone
echo "[init] doing PX4IOAR startup..." echo "[init] doing PX4IOAR startup..."
# #
@@ -85,10 +79,19 @@ flow_speed_control start
# #
ardrone_interface start -d /dev/ttyS1 ardrone_interface start -d /dev/ttyS1
#
# Start logging once armed
#
sdlog2 start -r 50 -a -b 14
# #
# startup is done; we don't want the shell because we # startup is done; we don't want the shell because we
# use the same UART for telemetry # use the same UART for telemetry
# #
echo "[init] startup done" echo "[init] startup done"
# Try to get an USB console
nshterm /dev/ttyACM0 &
# Exit, because /dev/ttyS0 is needed for MAVLink
exit exit
+25 -26
View File
@@ -3,10 +3,6 @@
# Flight startup script for PX4FMU+PX4IO on an F330 quad. # Flight startup script for PX4FMU+PX4IO on an F330 quad.
# #
# disable USB and autostart
set USB no
set MODE custom
# #
# Start the ORB (first app to start) # Start the ORB (first app to start)
# #
@@ -60,34 +56,37 @@ commander start
# #
if px4io start if px4io start
then then
#
# This sets a PWM right after startup (regardless of safety button)
#
px4io idle 900 900 900 900
pwm -u 400 -m 0xff pwm -u 400 -m 0xff
#
# Allow PX4IO to recover from midair restarts.
# this is very unlikely, but quite safe and robust.
px4io recovery
#
# The values are for spinning motors when armed using DJI ESCs
#
px4io min 1200 1200 1200 1200
#
# Upper limits could be higher, this is on the safe side
#
px4io max 1800 1800 1800 1800
mixer load /dev/pwm_output /etc/mixers/FMU_quad_x.mix
else else
# SOS # SOS
tone_alarm 6 tone_alarm 6
fi fi
#
# Allow PX4IO to recover from midair restarts.
# this is very unlikely, but quite safe and robust.
px4io recovery
#
# This sets a PWM right after startup (regardless of safety button)
#
px4io idle 900 900 900 900
#
# The values are for spinning motors when armed using DJI ESCs
#
px4io min 1200 1200 1200 1200
#
# Upper limits could be higher, this is on the safe side
#
px4io max 1800 1800 1800 1800
mixer load /dev/pwm_output /etc/mixers/FMU_quad_x.mix
# #
# Start the sensors (depends on orb, px4io) # Start the sensors (depends on orb, px4io)
# #
+46 -1
View File
@@ -61,7 +61,13 @@ then
# #
# Start terminal # Start terminal
# #
sercon if sercon
then
echo "USB connected"
else
# second attempt
sercon &
fi
# #
# Start the ORB (first app to start) # Start the ORB (first app to start)
@@ -128,45 +134,84 @@ fi
if param compare SYS_AUTOSTART 1 if param compare SYS_AUTOSTART 1
then then
sh /etc/init.d/01_fmu_quad_x sh /etc/init.d/01_fmu_quad_x
set MODE custom
fi fi
if param compare SYS_AUTOSTART 2 if param compare SYS_AUTOSTART 2
then then
sh /etc/init.d/02_io_quad_x sh /etc/init.d/02_io_quad_x
set MODE custom
fi fi
if param compare SYS_AUTOSTART 8 if param compare SYS_AUTOSTART 8
then then
sh /etc/init.d/08_ardrone sh /etc/init.d/08_ardrone
set MODE custom
fi fi
if param compare SYS_AUTOSTART 9 if param compare SYS_AUTOSTART 9
then then
sh /etc/init.d/09_ardrone_flow sh /etc/init.d/09_ardrone_flow
set MODE custom
fi fi
if param compare SYS_AUTOSTART 10 if param compare SYS_AUTOSTART 10
then then
sh /etc/init.d/10_io_f330 sh /etc/init.d/10_io_f330
set MODE custom
fi fi
if param compare SYS_AUTOSTART 15 if param compare SYS_AUTOSTART 15
then then
sh /etc/init.d/15_io_tbs sh /etc/init.d/15_io_tbs
set MODE custom
fi fi
if param compare SYS_AUTOSTART 30 if param compare SYS_AUTOSTART 30
then then
sh /etc/init.d/30_io_camflyer sh /etc/init.d/30_io_camflyer
set MODE custom
fi fi
if param compare SYS_AUTOSTART 31 if param compare SYS_AUTOSTART 31
then then
sh /etc/init.d/31_io_phantom sh /etc/init.d/31_io_phantom
set MODE custom
fi fi
# Try to get an USB console # Try to get an USB console
nshterm /dev/ttyACM0 & nshterm /dev/ttyACM0 &
# If none of the autostart scripts triggered, get a minimal setup
if [ $MODE == autostart ]
then
# Telemetry port is on both FMU boards ttyS1
mavlink start -b 57600 -d /dev/ttyS1
# Start commander
commander start
# Start px4io if present
if px4io start
then
echo "PX4IO driver started"
else
if fmu mode_serial
then
echo "FMU driver started"
fi
fi
# Start sensors
sh /etc/init.d/rc.sensors
# Start one of the estimators
attitude_estimator_ekf start
# Start GPS
gps start
fi
# End of autostart # End of autostart
fi fi
+4 -4
View File
@@ -368,7 +368,7 @@ CONFIG_TASK_NAME_SIZE=24
CONFIG_START_YEAR=1970 CONFIG_START_YEAR=1970
CONFIG_START_MONTH=1 CONFIG_START_MONTH=1
CONFIG_START_DAY=1 CONFIG_START_DAY=1
# CONFIG_DEV_CONSOLE is not set CONFIG_DEV_CONSOLE=y
# CONFIG_MUTEX_TYPES is not set # CONFIG_MUTEX_TYPES is not set
CONFIG_PRIORITY_INHERITANCE=y CONFIG_PRIORITY_INHERITANCE=y
CONFIG_SEM_PREALLOCHOLDERS=0 CONFIG_SEM_PREALLOCHOLDERS=0
@@ -476,11 +476,11 @@ CONFIG_ARCH_HAVE_USART6=y
CONFIG_MCU_SERIAL=y CONFIG_MCU_SERIAL=y
CONFIG_STANDARD_SERIAL=y CONFIG_STANDARD_SERIAL=y
CONFIG_SERIAL_NPOLLWAITERS=2 CONFIG_SERIAL_NPOLLWAITERS=2
# CONFIG_USART1_SERIAL_CONSOLE is not set CONFIG_USART1_SERIAL_CONSOLE=y
# CONFIG_USART2_SERIAL_CONSOLE is not set # CONFIG_USART2_SERIAL_CONSOLE is not set
# CONFIG_UART5_SERIAL_CONSOLE is not set # CONFIG_UART5_SERIAL_CONSOLE is not set
# CONFIG_USART6_SERIAL_CONSOLE is not set # CONFIG_USART6_SERIAL_CONSOLE is not set
CONFIG_NO_SERIAL_CONSOLE=y # CONFIG_NO_SERIAL_CONSOLE is not set
# #
# USART1 Configuration # USART1 Configuration
@@ -550,7 +550,7 @@ CONFIG_USBDEV_MAXPOWER=500
# CONFIG_USBDEV_COMPOSITE is not set # CONFIG_USBDEV_COMPOSITE is not set
# CONFIG_PL2303 is not set # CONFIG_PL2303 is not set
CONFIG_CDCACM=y CONFIG_CDCACM=y
CONFIG_CDCACM_CONSOLE=y CONFIG_CDCACM_CONSOLE=n
CONFIG_CDCACM_EP0MAXPACKET=64 CONFIG_CDCACM_EP0MAXPACKET=64
CONFIG_CDCACM_EPINTIN=1 CONFIG_CDCACM_EPINTIN=1
CONFIG_CDCACM_EPINTIN_FSSIZE=64 CONFIG_CDCACM_EPINTIN_FSSIZE=64