ROMFS split rc.board into defaults, sensors, and extras

This commit is contained in:
Daniel Agar 2018-12-14 12:36:32 -05:00 committed by Kabir Mohammed
parent d8ab059ff3
commit fef65bf5c8
38 changed files with 458 additions and 532 deletions

View File

@ -126,19 +126,32 @@ if(config_bl_file)
)
endif()
if(EXISTS "${PX4_BOARD_DIR}/init/rc.board")
add_custom_command(OUTPUT ${romfs_gen_root_dir}/init.d/rc.board
COMMAND ${CMAKE_COMMAND} -E copy ${PX4_BOARD_DIR}/init/rc.board ${romfs_gen_root_dir}/init.d/rc.board
DEPENDS
${PX4_BOARD_DIR}/init/rc.board
${romfs_gen_root_dir}/init.d/rcS
COMMENT "ROMFS: copying rc.board"
set(OPTIONAL_BOARD_RC)
list(APPEND OPTIONAL_BOARD_RC
rc.board_defaults
rc.board_sensors
rc.board_extras
)
foreach(board_rc_file ${OPTIONAL_BOARD_RC})
if(EXISTS "${PX4_BOARD_DIR}/init/${board_rc_file}")
message(STATUS "ROMFS: Adding ${board_rc_file}")
add_custom_command(OUTPUT ${romfs_gen_root_dir}/init.d/${board_rc_file}
COMMAND ${CMAKE_COMMAND} -E copy ${PX4_BOARD_DIR}/init/${board_rc_file} ${romfs_gen_root_dir}/init.d/${board_rc_file}
DEPENDS
${PX4_BOARD_DIR}/init/${board_rc_file}
${romfs_gen_root_dir}/init.d/rcS
COMMENT "ROMFS: copying ${board_rc_file}"
)
list(APPEND extras_dependencies
${romfs_gen_root_dir}/init.d/rc.board
)
endif()
list(APPEND extras_dependencies
${romfs_gen_root_dir}/init.d/${board_rc_file}
)
endif()
endforeach()
add_custom_command(OUTPUT romfs_extras.stamp
COMMAND ${CMAKE_COMMAND} -E make_directory ${romfs_gen_root_dir}/extras/

View File

@ -70,8 +70,6 @@ then
param set SENS_FLOW_MINRNG 0.05
param set SYS_FMU_TASK 1
fi
set PWM_DISARMED none

View File

@ -21,15 +21,15 @@ set +e
# it wastes flash
#
set AUX_MODE pwm
set BOARD_RC /etc/init.d/rc.board
set DATAMAN_OPT ""
set FAILSAFE none
set FAILSAFE_AUX none
set FCONFIG /fs/microsd/etc/config.txt
set FEXTRAS /fs/microsd/etc/extras.txt
set FRC /fs/microsd/etc/rc.txt
set FMU_ARGS ""
set FMU_MODE pwm
set FRC /fs/microsd/etc/rc.txt
set IO_PRESENT no
set IOFW "/etc/extras/px4_io-v2_default.bin"
set IO_PRESENT no
set LOG_FILE /fs/microsd/bootlog.txt
@ -134,22 +134,6 @@ if [ -f $FRC ]
then
sh $FRC
else
#
# Waypoint storage.
# REBOOTWORK this needs to start in parallel.
#
# TODO: fix board override $DATAMAN_OPT
dataman start $DATAMAN_OPT
#
# Start the socket communication send_event handler.
#
send_event start
#
# Start the resource load monitor.
#
load_mon start
#
# Set the parameter file if mtd starts successfully.
@ -169,67 +153,69 @@ else
fi
#
# Start the tone_alarm driver.
# Needs to be started after the parameters are loaded (for CBRK_BUZZER).
# Note that this will still play the already published startup tone.
# Optional board defaults: rc.board_defaults
#
tone_alarm start
#
# Start system state indicator.
#
if ! rgbled start
set BOARD_RC_DEFAULTS /etc/init.d/rc.board_defaults
if [ -f $BOARD_RC_DEFAULTS ]
then
if blinkm start
then
blinkm systemstate
fi
echo "Board defaults: ${BOARD_RC_DEFAULTS}"
sh $BOARD_RC_DEFAULTS
fi
rgbled_ncp5623c start
#
# FMUv5 may have both PWM I2C RGB LED support.
#
rgbled_pwm start
unset BOARD_RC_DEFAULTS
#
# Set AUTOCNF flag to use it in AUTOSTART scripts.
#
if param compare SYS_AUTOCONFIG 1
then
# Wipe out params except RC*, flight modes and total flight time.
# Wipe out params except RC*, flight modes, total flight time, accel cal, gyro cal
param reset_nostart RC* COM_FLTMODE* LND_FLIGHT_T_* TC_* CAL_ACC* CAL_GYRO*
set AUTOCNF yes
else
set AUTOCNF no
fi
#
# Waypoint storage.
# REBOOTWORK this needs to start in parallel.
#
dataman start $DATAMAN_OPT
#
# Start the socket communication send_event handler.
#
send_event start
#
# Start the resource load monitor.
#
load_mon start
#
# Start system state indicator.
#
if ! rgbled start
then
rgbled_ncp5623c start
#
# Release 1.4.0 transitional support: set to old default if unconfigured,
# this preserves the previous behaviour.
# FMUv5 may have both PWM I2C RGB LED support.
#
if param compare BAT_N_CELLS 0
rgbled_pwm start
if blinkm start
then
param set BAT_N_CELLS 3
blinkm systemstate
fi
fi
###############################################################################
# Begin setup for board specific configurations. #
###############################################################################
#
# run boards rc.board if available
# Start the tone_alarm driver.
# Needs to be started after the parameters are loaded (for CBRK_BUZZER).
# Note that this will still play the already published startup tone.
#
if [ -f $BOARD_RC ]
then
echo "Board init: ${BOARD_RC}"
sh $BOARD_RC
fi
###############################################################################
# End Setup for board specific configurations. #
###############################################################################
tone_alarm start
if param compare SYS_FMU_TASK 1
then
@ -343,9 +329,23 @@ else
set OUTPUT_MODE hil
sensors start -h
commander start --hil
# disable GPS
param set GPS_1_CONFIG 0
else
#
# board sensors: rc.sensors
#
set BOARD_RC_SENSORS /etc/init.d/rc.board_sensors
if [ -f $BOARD_RC_SENSORS ]
then
echo "Board sensors: ${BOARD_RC_SENSORS}"
sh $BOARD_RC_SENSORS
fi
unset BOARD_RC_SENSORS
sh /etc/init.d/rc.sensors
commander start
fi
@ -436,11 +436,6 @@ else
#
sh /etc/init.d/rc.thermal_cal
#
# Start the logger.
#
sh /etc/init.d/rc.logging
#
# Start vmount to control mounts such as gimbals, disabled by default.
#
@ -450,13 +445,30 @@ else
fi
#
# Start any custom addons.
# Optional board supplied extras: rc.board_extras
#
set BOARD_RC_EXTRAS /etc/init.d/rc.board_extras
if [ -f $BOARD_RC_EXTRAS ]
then
echo "Board extras: ${BOARD_RC_EXTRAS}"
sh $BOARD_RC_EXTRAS
fi
unset BOARD_RC_EXTRAS
#
# Start any custom addons from the sdcard.
#
if [ -f $FEXTRAS ]
then
echo "Addons script: ${FEXTRAS}"
sh $FEXTRAS
fi
#
# Start the logger.
#
sh /etc/init.d/rc.logging
#
# End of autostart.
#
@ -465,17 +477,18 @@ fi
#
# Unset all script parameters to free RAM.
#
unset AUTOCNF
unset AUX_MODE
unset DATAMAN_OPT
unset FAILSAFE
unset FAILSAFE_AUX
unset FCONFIG
unset FEXTRAS
unset FRC
unset FMU_ARGS
unset FMU_MODE
unset IOFW
unset FRC
unset IO_PRESENT
unset IOFW
unset LOG_FILE
unset LOGGER_ARGS
unset LOGGER_BUF
@ -492,16 +505,14 @@ unset PWM_AUX_MAX
unset PWM_AUX_MIN
unset PWM_AUX_OUT
unset PWM_AUX_RATE
unset PWM_OUT
unset PWM_RATE
unset PWM_DISARMED
unset PWM_MAX
unset PWM_MIN
unset PWM_OUT
unset PWM_RATE
unset SDCARD_MIXERS_PATH
unset USE_IO
unset VEHICLE_TYPE
unset BOARD_RC
unset AUTOCNF
#
# Boot is complete, inform MAVLink app(s) that the system is now fully up and running.

View File

@ -1,47 +0,0 @@
#!nsh
#
# Airmind Mindpx-v2 specific board init
#
#------------------------------------------------------------------------------
#
# UART mapping:
#
# UART1 /dev/ttyS0 wifi
# USART2 /dev/ttyS1 TELEM1 (flow control)
# USART3 /dev/ttyS2 TELEM2 (flow control)
# UART4
# UART7 CONSOLE
# UART8 /dev/ttyS6 SERIAL4/TELEM4
#
#------------------------------------------------------------------------------
#
# We know there are sketchy boards out there
# as chinese companies produce Pixracers without
# fully understanding the critical parts of the
# schematic and BOM, leading to sensor brownouts
# on boot. Original Pixracers following the
# open hardware design do not require this.
fmu sensor_reset 50
if [ $AUTOCNF = yes ]
then
# Disable safety switch by default
param set CBRK_IO_SAFETY 22027
param set SYS_FMU_TASK 1
fi
set MIXER_AUX none
# External I2C bus
hmc5883 -C -T -X start
# Internal I2C bus
hmc5883 -C -T -I -R 12 start
mpu6000 -s -R 8 start
mpu9250 -s -R 8 start
lsm303d -R 10 start
l3gd20 -R 14 start

View File

@ -0,0 +1,14 @@
#!/bin/sh
#
# Airmind Mindpx-v2 specific board defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
# Disable safety switch by default
param set CBRK_IO_SAFETY 22027
fi
set MIXER_AUX none

View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# Airmind Mindpx-v2 specific board sensors init
#------------------------------------------------------------------------------
# External I2C bus
hmc5883 -C -T -X start
# Internal I2C bus
hmc5883 -C -T -I -R 12 start
mpu6000 -s -R 8 start
mpu9250 -s -R 8 start
lsm303d -R 10 start
l3gd20 -R 14 start

View File

@ -1,14 +1,8 @@
#!nsh
#
# Atmel SAM E70 Xplained specific board init
#!/bin/sh
#
# Atmel SAM E70 Xplained specific board sensors init
#------------------------------------------------------------------------------
#
if [ $AUTOCNF = yes ]
then
fi
# External I2C bus
hmc5883 -C -T -X start

View File

@ -1,39 +0,0 @@
#!nsh
#
# AUAV/mRO x21 specific board init
#
#------------------------------------------------------------------------------
#
# UART mapping on x21:
#
# UART1 /dev/ttyS0 IO debug
# USART2 /dev/ttyS1 TELEM1 (flow control)
# USART3 /dev/ttyS2 TELEM2 (flow control)
# UART4
# UART7 CONSOLE
# UART8 /dev/ttyS6 SERIAL4/TELEM4
#
#------------------------------------------------------------------------------
#
if [ $AUTOCNF = yes ]
then
fi
# External I2C bus
hmc5883 -C -T -X start
lis3mdl -X start
ist8310 -C start
# Internal SPI bus ICM-20608-G is rotated 90 deg yaw
mpu6000 -R 2 -T 20608 start
# Internal SPI bus ICM-20602-G is rotated 90 deg yaw
mpu6000 -R 2 -T 20602 start
# Internal SPI bus mpu9250 is rotated 90 deg yaw
mpu9250 -R 2 start

View File

@ -0,0 +1,19 @@
#!/bin/sh
#
# AUAV/mRO x21 specific board sensors init
#------------------------------------------------------------------------------
# External I2C bus
hmc5883 -C -T -X start
lis3mdl -X start
ist8310 -C start
# Internal SPI bus ICM-20608-G is rotated 90 deg yaw
mpu6000 -R 2 -T 20608 start
# Internal SPI bus ICM-20602-G is rotated 90 deg yaw
mpu6000 -R 2 -T 20602 start
# Internal SPI bus mpu9250 is rotated 90 deg yaw
mpu9250 -R 2 start

View File

@ -0,0 +1,10 @@
#!/bin/sh
#
# AUAV/mRO x21 specific board defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
param set SYS_FMU_TASK 0
fi

View File

@ -1,31 +0,0 @@
#!nsh
#
# av_x1-v1 specific board init
#
#
if [ $AUTOCNF = yes ]
then
param set SYS_FMU_TASK 1
fi
set LOGGER_BUF 64
set MIXER_AUX none
adis16477 -R 8 start
#adis16497 start
lps22hb -S start
lsm303agr -R 4 start
ms4525_airspeed -T 4515 -b 3 start
# AV-X: start MAVLink to companion (connected to TX2)
mavlink start -d /dev/ttyS5 -r 20000 -b 460800 -m onboard
# AV-X: start MAVLink UDP port 14570
mavlink start -x -u 14570

View File

@ -0,0 +1,13 @@
#!/bin/sh
#
# av_x1-v1 specific board init
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
fi
set LOGGER_BUF 64
set MIXER_AUX none

View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# av_x1-v1 specific board init
#
#
# AV-X: start MAVLink to companion (connected to TX2)
mavlink start -d /dev/ttyS5 -r 20000 -b 460800 -m onboard
# AV-X: start MAVLink UDP port 14570
mavlink start -x -u 14570

View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# av_x1-v1 specific board sensors init
#------------------------------------------------------------------------------
adis16477 -R 8 start
#adis16497 start
lps22hb -S start
lsm303agr -R 4 start
ms4525_airspeed -T 4515 -b 3 start

View File

@ -1,9 +1,8 @@
#!nsh
#
# Bitcraze Crazyflie specific board init
#!/bin/sh
#
# Bitcraze Crazyflie specific board sensors init
#------------------------------------------------------------------------------
#
if param compare SYS_AUTOSTART 0
then
@ -17,13 +16,3 @@ then
fi
set MIXER_AUX none
# Onboard I2C
mpu9250 -R 12 start
# I2C bypass of mpu
lps25h start
# Optical flow deck
vl53lxx start
pmw3901 start

View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# Bitcraze Crazyflie specific board sensors init
#------------------------------------------------------------------------------
# Onboard I2C
mpu9250 -R 12 start
# I2C bypass of mpu
lps25h start
# Optical flow deck
vl53lxx start
pmw3901 start

View File

@ -1,20 +1,15 @@
#!nsh
#
# Gumstix Aerocore2 specific board init
#!/bin/sh
#
# Gumstix Aerocore2 specific board defaults
#------------------------------------------------------------------------------
#
if [ $AUTOCNF = yes ]
then
# Disable safety switch by default
param set CBRK_IO_SAFETY 22027
param set SYS_FMU_TASK 1
fi
set DATAMAN_OPT "-f /fs/mtd_dataman"
set MIXER_AUX none
l3gd20 -R 12 start
lsm303d start

View File

@ -0,0 +1,8 @@
#!/bin/sh
#
# Gumstix Aerocore2 specific board sensors init
#------------------------------------------------------------------------------
l3gd20 -R 12 start
lsm303d start

View File

@ -1,9 +1,8 @@
#!nsh
#
# intel aero specific board init
#!/bin/sh
#
# intel aero specific board defaults
#------------------------------------------------------------------------------
#
if param compare SYS_AUTOSTART 0
then
@ -26,22 +25,9 @@ then
param set ATT_W_GYRO_BIAS 0.0000
param set SYS_HAS_MAG 0
param set SYS_FMU_TASK 1
fi
set DATAMAN_OPT -i
set LOGGER_ARGS "-m mavlink"
set MIXER_AUX none
ms5611 -T 0 start
mpu9250 -s -R 14 start
# Possible external compasses
hmc5883 -X start
ist8310 -C -b 1 -R 4 start
aerofc_adc start
ll40ls start i2c

View File

@ -0,0 +1,16 @@
#!/bin/sh
#
# intel aero specific board sensors init
#------------------------------------------------------------------------------
ms5611 -T 0 start
mpu9250 -s -R 14 start
# Possible external compasses
hmc5883 -X start
ist8310 -C -b 1 -R 4 start
aerofc_adc start
ll40ls start i2c

View File

@ -1,42 +0,0 @@
#!nsh
#
# PX4 FMUv2 specific board init
#
#------------------------------------------------------------------------------
#
# UART mapping on NXP FMUK66-v3:
#
# LPUART0 /dev/ttyS0 P16 CONSOLE
# UART0 /dev/ttyS1 P7 IR
# UART1 /dev/ttyS2 P14-3, P15-2 RC input
# UART2 /dev/ttyS3 P3 GPS
# UART4 /dev/ttyS3 P10 TELEM1 (flow control)
#
#------------------------------------------------------------------------------
#
if [ $AUTOCNF = yes ]
then
param set SYS_FMU_TASK 1
fi
set MIXER_AUX none
# External I2C bus
hmc5883 -C -X start
# Possible external compasses
ist8310 -C -b 2 start
# External I2C bus
lis3mdl -X start
# Onboard I2C (baro) but an external bus on V3 RC15
mpl3115a2 -X start
# Internal SPI (accel + mag)
fxos8701cq start -R 0
# Internal SPI (gyro)
fxas21002c start -R 0

View File

@ -0,0 +1,12 @@
#!/bin/sh
#
# NXP fmuk66-v3 specific board defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
fi
set MIXER_AUX none

View File

@ -0,0 +1,23 @@
#!/bin/sh
#
# NXP fmuk66-v3 specific board defaults
#------------------------------------------------------------------------------
# External I2C bus
hmc5883 -C -X start
# Possible external compasses
ist8310 -C -b 2 start
# External I2C bus
lis3mdl -X start
# Onboard I2C (baro) but an external bus on V3 RC15
mpl3115a2 -X start
# Internal SPI (accel + mag)
fxos8701cq start -R 0
# Internal SPI (gyro)
fxas21002c start -R 0

View File

@ -1,56 +0,0 @@
#!nsh
#
# Omnibus F4SD specific board init
#
#------------------------------------------------------------------------------
#
# UART mapping on OMNIBUSF4SD:
#
# USART1 /dev/ttyS0 SerialRX
# (USART3 configured as I2C)
# USART4 /dev/ttyS1 TELEM2 (TX=RSSI, RX=PWM out 5)
# USART6 /dev/ttyS2 URT6
#
#------------------------------------------------------------------------------
#
# transision from params file to flash-based params (2018-12-20)
if [ -f $PARAM_FILE ]
then
param load $PARAM_FILE
param save
# create a backup
mv $PARAM_FILE ${PARAM_FILE}.bak
reboot
fi
if [ $AUTOCNF = yes ]
then
# Disable safety switch by default
param set CBRK_IO_SAFETY 22027
# use the Q attitude estimator, it works w/o mag or GPS.
param set SYS_MC_EST_GROUP 1
param set ATT_ACC_COMP 0
param set ATT_W_ACC 0.4000
param set ATT_W_GYRO_BIAS 0.0000
param set SYS_HAS_MAG 0
param set SYS_FMU_TASK 1
fi
set MIXER_AUX none
if ! mpu6000 -R 12 -s start
then
# some boards such as the Hobbywing XRotor F4 G2 use the ICM-20602
mpu6000 -R 12 -T 20602 -s start
fi
# Possible external compasses
hmc5883 -X start
bmp280 start
adc start

View File

@ -0,0 +1,31 @@
#!/bin/sh
#
# Omnibus F4SD specific board defaults
#------------------------------------------------------------------------------
# transition from params file to flash-based params (2018-12-20)
if [ -f $PARAM_FILE ]
then
param load $PARAM_FILE
param save
# create a backup
mv $PARAM_FILE ${PARAM_FILE}.bak
reboot
fi
if [ $AUTOCNF = yes ]
then
# Disable safety switch by default
param set CBRK_IO_SAFETY 22027
# use the Q attitude estimator, it works w/o mag or GPS.
param set SYS_MC_EST_GROUP 1
param set ATT_ACC_COMP 0
param set ATT_W_ACC 0.4000
param set ATT_W_GYRO_BIAS 0.0000
param set SYS_HAS_MAG 0
fi
set MIXER_AUX none

View File

@ -0,0 +1,17 @@
#!/bin/sh
#
# Omnibus F4SD specific board sensors init
#------------------------------------------------------------------------------
if ! mpu6000 -R 12 -s start
then
# some boards such as the Hobbywing XRotor F4 G2 use the ICM-20602
mpu6000 -R 12 -T 20602 -s start
fi
# Possible external compasses
hmc5883 -X start
bmp280 start
adc start

View File

@ -0,0 +1,28 @@
#!/bin/sh
#
# PX4 FMUv2 specific board defaults
#------------------------------------------------------------------------------
#
# Bootloader upgrade
#
set BL_FILE /etc/extras/px4fmuv3_bl.bin
if [ -f $BL_FILE ]
then
if param compare SYS_BL_UPDATE 1
then
param set SYS_BL_UPDATE 0
param save
echo "BL update..." >> $LOG_FILE
bl_update $BL_FILE
echo "BL update done" >> $LOG_FILE
reboot
fi
fi
unset BL_FILE
if [ $AUTOCNF = yes ]
then
param set SYS_FMU_TASK 0
fi

View File

@ -1,45 +1,7 @@
#!nsh
#
# PX4 FMUv2 specific board init
#!/bin/sh
#
# PX4 FMUv2 specific board sensors init
#------------------------------------------------------------------------------
#
# UART mapping on FMUv2:
#
# UART1 /dev/ttyS0 IO debug
# USART2 /dev/ttyS1 TELEM1 (flow control)
# USART3 /dev/ttyS2 TELEM2 (flow control)
# UART4
# UART7 CONSOLE
# UART8 /dev/ttyS6 SERIAL4/TELEM4
#
#------------------------------------------------------------------------------
#
#
# Bootloader upgrade
#
set BL_FILE /etc/extras/px4fmuv3_bl.bin
if [ -f $BL_FILE ]
then
if param compare SYS_BL_UPDATE 1
then
param set SYS_BL_UPDATE 0
param save
echo "BL update..." >> $LOG_FILE
bl_update $BL_FILE
echo "BL update done" >> $LOG_FILE
reboot
fi
fi
unset BL_FILE
if [ $AUTOCNF = yes ]
then
param set SYS_FMU_TASK 1
fi
# External I2C bus
hmc5883 -C -T -X start

View File

@ -0,0 +1,10 @@
#!/bin/sh
#
# PX4 FMUv3 specific board defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
param set SYS_FMU_TASK 0
fi

View File

@ -1,46 +1,7 @@
#!nsh
#
# PX4 FMUv2 specific board init
#!/bin/sh
#
# PX4 FMUv3 specific board sensors init
#------------------------------------------------------------------------------
#
# UART mapping on FMUv2:
#
# UART1 /dev/ttyS0 IO debug
# USART2 /dev/ttyS1 TELEM1 (flow control)
# USART3 /dev/ttyS2 TELEM2 (flow control)
# UART4
# UART7 CONSOLE
# UART8 /dev/ttyS6 SERIAL4/TELEM4
#
#------------------------------------------------------------------------------
#
#
# Bootloader upgrade
#
set BL_FILE /etc/extras/px4fmuv3_bl.bin
if [ -f $BL_FILE ]
then
if param compare SYS_BL_UPDATE 1
then
param set SYS_BL_UPDATE 0
param save
echo "BL update..." >> $LOG_FILE
bl_update $BL_FILE
echo "BL update done" >> $LOG_FILE
reboot
fi
fi
unset BL_FILE
if [ $AUTOCNF = yes ]
then
fi
# External I2C bus
hmc5883 -C -T -X start

View File

@ -0,0 +1,14 @@
#!/bin/sh
#
# PX4 FMUv4 specific board defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
# Disable safety switch by default
param set CBRK_IO_SAFETY 22027
fi
set MIXER_AUX none

View File

@ -0,0 +1,18 @@
#!/bin/sh
#
# PX4 FMUv4 specific board extras init
#------------------------------------------------------------------------------
# Pixracer: start MAVLink on Wifi (ESP8266 port). Except for the TealOne airframe.
if param compare SYS_AUTOSTART 4250
then
else
mavlink start -r 20000 -b 921600 -d /dev/ttyS0
fi
# Run FrSky Telemetry on Pixracer on the FrSky port if not enabled already
if param compare TEL_FRSKY_CONFIG 0
then
frsky_telemetry start -d /dev/ttyS6 -t 15
fi

View File

@ -1,20 +1,7 @@
#!nsh
#
# PX4 FMUv4 specific board init
#!/bin/sh
#
# PX4 FMUv4 specific board sensors init
#------------------------------------------------------------------------------
#
# UART mapping on FMUv5:
#
# UART1 /dev/ttyS0 wifi
# USART2 /dev/ttyS1 TELEM1 (flow control)
# USART3 /dev/ttyS2 TELEM2 (flow control)
# UART4
# UART7 CONSOLE
# UART8 /dev/ttyS6 SERIAL4/TELEM4
#
#------------------------------------------------------------------------------
#
# We know there are sketchy boards out there
# as chinese companies produce Pixracers without
@ -24,16 +11,6 @@
# open hardware design do not require this.
fmu sensor_reset 50
if [ $AUTOCNF = yes ]
then
# Disable safety switch by default
param set CBRK_IO_SAFETY 22027
param set SYS_FMU_TASK 1
fi
set MIXER_AUX none
# External I2C bus
hmc5883 -C -T -X start
@ -87,18 +64,3 @@ then
# BMI160 internal SPI bus
bmi160 start
fi
# Pixracer: start MAVLink on Wifi (ESP8266 port). Except for the TealOne airframe.
if param compare SYS_AUTOSTART 4250
then
else
mavlink start -r 20000 -b 921600 -d /dev/ttyS0
fi
# Run FrSky Telemetry on Pixracer on the FrSky port if not enabled already
if param compare TEL_FRSKY_CONFIG 0
then
frsky_telemetry start -d /dev/ttyS6 -t 15
fi

View File

@ -1,44 +0,0 @@
#!nsh
#
# PX4 FMUv4pro specific board init
#
#------------------------------------------------------------------------------
#
# UART mapping on FMUv4pro:
#
# UART1 /dev/ttyS0 TELEM3
# USART2 /dev/ttyS1 TELEM1 (flow control)
# USART3 /dev/ttyS2 TELEM2 (flow control)
# UART4 /dev/ttyS3 TELEM4
# USART6 /dev/ttyS4 TELEM3 (flow control)
# UART7 /dev/ttyS5
# UART8 /dev/ttyS6 CONSOLE
#
#------------------------------------------------------------------------------
#
if [ $AUTOCNF = yes ]
then
param set SYS_FMU_TASK 1
fi
set LOGGER_BUF 64
# Internal SPI bus ICM-20608-G
mpu6000 -R 2 -T 20608 start
# Internal SPI bus ICM-20602
mpu6000 -R 2 -T 20602 start
# Internal SPI bus mpu9250
mpu9250 -R 2 start
# Internal SPI bus
lis3mdl -R 0 start
# Possible external compasses
hmc5883 -C -T -X start
# RM3100
rm3100 start

View File

@ -0,0 +1,12 @@
#!/bin/sh
#
# PX4 FMUv4pro specific board defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
fi
set LOGGER_BUF 64

View File

@ -0,0 +1,22 @@
#!/bin/sh
#
# PX4 FMUv4pro specific board sensors init
#------------------------------------------------------------------------------
# Internal SPI bus ICM-20608-G
mpu6000 -R 2 -T 20608 start
# Internal SPI bus ICM-20602
mpu6000 -R 2 -T 20602 start
# Internal SPI bus mpu9250
mpu9250 -R 2 start
# Internal SPI bus
lis3mdl -R 0 start
# Possible external compasses
hmc5883 -C -T -X start
# RM3100
rm3100 start

View File

@ -0,0 +1,12 @@
#!/bin/sh
#
# PX4 FMUv5 specific board defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
fi
set LOGGER_BUF 64

View File

@ -1,28 +1,7 @@
#!nsh
#
# PX4 FMUv5 specific board init
#!/bin/sh
#
# PX4 FMUv5 specific board sensors init
#------------------------------------------------------------------------------
#
# UART mapping on FMUv5:
#
# UART1 /dev/ttyS0 GPS
# USART2 /dev/ttyS1 TELEM1 (flow control)
# USART3 /dev/ttyS2 TELEM2 (flow control)
# UART4 /dev/ttyS3 TELEM4
# USART6 /dev/ttyS4 TELEM3 (flow control)
# UART7 /dev/ttyS5
# UART8 /dev/ttyS6 CONSOLE
#
#------------------------------------------------------------------------------
#
if [ $AUTOCNF = yes ]
then
param set SYS_FMU_TASK 1
fi
set LOGGER_BUF 64
# Internal SPI bus ICM-20602
mpu6000 -R 8 -s -T 20602 start