add board architecture specific init defaults

This commit is contained in:
Daniel Agar 2021-03-09 11:16:44 -05:00 committed by Lorenz Meier
parent e53e001de1
commit 4d288512b5
45 changed files with 151 additions and 288 deletions

View File

@ -83,7 +83,7 @@ if (px4_constrained_flash_build)
endif()
if(PX4_ETHERNET)
set(added_arguments ${added_arguments} --ethernet)
endif()
endif()
# create list of relative romfs file names
set(romfs_copy_files_relative)
foreach(romfs_file IN LISTS romfs_copy_files)
@ -158,6 +158,30 @@ if(config_build_bootloader)
)
endif()
# optional board architecture defaults
set(board_arch_rc_file "rc.board_arch_defaults")
if(EXISTS "${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/init/${CONFIG_ARCH_CHIP}/${board_arch_rc_file}")
message(STATUS "ROMFS: Adding ${board_arch_rc_file}")
add_custom_command(
OUTPUT
${romfs_gen_root_dir}/init.d/${board_arch_rc_file}
${board_arch_rc_file}.stamp
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/init/${CONFIG_ARCH_CHIP}/${board_arch_rc_file} ${romfs_gen_root_dir}/init.d/${board_arch_rc_file}
COMMAND ${CMAKE_COMMAND} -E touch ${board_arch_rc_file}.stamp
DEPENDS
${PX4_SOURCE_DIR}/platforms/${PX4_PLATFORM}/init/${CONFIG_ARCH_CHIP}/${board_arch_rc_file}
romfs_copy.stamp
COMMENT "ROMFS: copying ${board_arch_rc_file}"
)
list(APPEND extras_dependencies
${board_arch_rc_file}.stamp
)
endif()
set(OPTIONAL_BOARD_RC)
list(APPEND OPTIONAL_BOARD_RC
rc.board_defaults

View File

@ -49,6 +49,17 @@ then
param reset_all
fi
#
# Optional board architecture defaults: rc.board_arch_defaults
#
set BOARD_ARCH_RC_DEFAULTS ${R}etc/init.d/rc.board_arch_defaults
if [ -f $BOARD_ARCH_RC_DEFAULTS ]
then
echo "Board architecture defaults: ${BOARD_ARCH_RC_DEFAULTS}"
. $BOARD_ARCH_RC_DEFAULTS
fi
unset BOARD_ARCH_RC_DEFAULTS
#
# Optional board defaults: rc.board_defaults
#

View File

@ -4,12 +4,6 @@
# NOTE: Script variables are declared/initialized/unset in the rcS script.
#
if param greater -s UAVCAN_ENABLE 1
then
# Reduce logger buffer to free up some RAM for UAVCAN servers.
set LOGGER_BUF 6
fi
###############################################################################
# End Setup for board specific configurations. #
###############################################################################

View File

@ -180,6 +180,17 @@ else
set AUTOCNF yes
fi
#
# Optional board architecture defaults: rc.board_arch_defaults
#
set BOARD_ARCH_RC_DEFAULTS ${R}etc/init.d/rc.board_arch_defaults
if [ -f $BOARD_ARCH_RC_DEFAULTS ]
then
echo "Board architecture defaults: ${BOARD_ARCH_RC_DEFAULTS}"
. $BOARD_ARCH_RC_DEFAULTS
fi
unset BOARD_ARCH_RC_DEFAULTS
#
# Optional board defaults: rc.board_defaults
#

View File

@ -1,7 +0,0 @@
#!/bin/sh
#
# Airmind Mindpx-v2 specific board defaults
#------------------------------------------------------------------------------
# Disable safety switch by default
param set-default CBRK_IO_SAFETY 22027

View File

@ -1,9 +0,0 @@
#!/bin/sh
#
# board specific defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
fi

View File

@ -1,13 +1,7 @@
#!/bin/sh
#
# av_x1-v1 specific board init
# board specific defaults
#------------------------------------------------------------------------------
# system_power unavailable
param set-default CBRK_SUPPLY_CHK 894281
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
set LOGGER_BUF 64

View File

@ -1,10 +1,11 @@
#!/bin/sh
#
# Bitcraze Crazyflie specific board sensors init
# board specific defaults
#------------------------------------------------------------------------------
# system_power unavailable
param set-default CBRK_SUPPLY_CHK 894281
param set-default SYS_AUTOSTART 4900
# don't probe external I2C

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# Bitcraze Crazyflie specific board sensors init
# board specific defaults
#------------------------------------------------------------------------------
# system_power unavailable

View File

@ -3,12 +3,6 @@
# board specific defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
fi
neopixel start
safety_button start
tone_alarm start

View File

@ -30,19 +30,8 @@ param set-default BAT_A_PER_V 24
param set-default BAT1_A_PER_V 24
param set-default BAT2_A_PER_V 24
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 3
param set-default SENS_MAG_MODE 0
# Enable IMU thermal control
param set-default SENS_EN_THERMAL 1
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
rgbled_pwm start
safety_button start

View File

@ -30,19 +30,8 @@ param set-default BAT_A_PER_V 24
param set-default BAT1_A_PER_V 24
param set-default BAT2_A_PER_V 24
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 3
param set-default SENS_MAG_MODE 0
# Enable IMU thermal control
param set-default SENS_EN_THERMAL 1
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
rgbled_pwm start
safety_button start

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# Board specific defaults
# board specific defaults
#------------------------------------------------------------------------------
#
@ -30,17 +30,7 @@ param set-default BAT_A_PER_V 17
param set-default BAT1_A_PER_V 17
param set-default BAT2_A_PER_V 17
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 3
param set-default SENS_MAG_MODE 0
# Disable IMU thermal control
param set-default SENS_EN_THERMAL 0
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
set IOFW "/etc/extras/cubepilot_io-v2_default.bin"

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# Board specific defaults
# board specific defaults
#------------------------------------------------------------------------------
@ -12,15 +12,7 @@ param set-default BAT_A_PER_V 17
param set-default BAT1_A_PER_V 17
param set-default BAT2_A_PER_V 17
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
# Disable IMU thermal control
param set-default SENS_EN_THERMAL 0
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
set IOFW "/etc/extras/cubepilot_io-v2_default.bin"

View File

@ -3,4 +3,4 @@
# board specific defaults
#------------------------------------------------------------------------------
rgbled_ncp5623c -I -b 1 -a 0x39 start
rgbled_ncp5623c -I -b 1 -a 0x39 start

View File

@ -23,16 +23,5 @@ fi
unset BL_FILE
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 3
param set-default SENS_MAG_MODE 0
# Enable IMU thermal control
param set-default SENS_EN_THERMAL 1
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# KakuteF7 specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
# system_power unavailable

View File

@ -1,18 +1,7 @@
#!/bin/sh
#
# PX4 FMUv5 specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
# Multi-EKF
param set-default EKF2_MULTI_IMU 2
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 2
param set-default SENS_MAG_MODE 0
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
rgbled_pwm start
safety_button start

View File

@ -1,7 +1,6 @@
#!/bin/sh
#
# ModalAI FC-v1 specific board defaults
# Maintainer: travis@modalai.com
# board specific defaults
#------------------------------------------------------------------------------
#
@ -24,12 +23,6 @@
# V110 - J1011 pin 5
param set-default CBRK_IO_SAFETY 22027
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default UAVCAN_ENABLE 2
#
# Stand Alone configuration
#
@ -98,6 +91,5 @@ then
fi
fi
set LOGGER_BUF 64
safety_button start

View File

@ -1,19 +1,6 @@
#!/bin/sh
#
# mRo Control Zero specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
# Multi-EKF
param set EKF2_MULTI_IMU 3
param set SENS_IMU_MODE 0
param set UAVCAN_ENABLE 2
fi
set LOGGER_BUF 64
set MIXER_AUX none
safety_button start

View File

@ -1,16 +1,6 @@
#!/bin/sh
#
# mRo Control Zero specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
set MIXER_AUX none
safety_button start

View File

@ -6,7 +6,7 @@
#
# Bootloader upgrade
#
set BL_FILE /etc/extras/mro_ctrl-zero-h7_bootloader.bin
set BL_FILE /etc/extras/mro_ctrl-zero-h7-oem_bootloader.bin
if [ -f $BL_FILE ]
then
if param compare SYS_BL_UPDATE 1
@ -28,15 +28,5 @@ param set-default BAT1_V_DIV 10.1
param set-default BAT_A_PER_V 24
param set-default BAT1_A_PER_V 24
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 3
param set-default SENS_MAG_MODE 0
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
safety_button start

View File

@ -28,15 +28,5 @@ param set-default BAT1_V_DIV 10.1
param set-default BAT_A_PER_V 24
param set-default BAT1_A_PER_V 24
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 3
param set-default SENS_MAG_MODE 0
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
safety_button start

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# Board specific defaults
# board specific defaults
#------------------------------------------------------------------------------
#
@ -27,15 +27,3 @@ param set-default BAT1_V_DIV 10.1
param set-default BAT_A_PER_V 17
param set-default BAT1_A_PER_V 17
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 3
param set-default SENS_MAG_MODE 0
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
set MIXER_AUX none

View File

@ -1,13 +1,7 @@
#!/bin/sh
#
# NXP fmuk66-e specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
fi
rgbled_pwm start
safety_button start

View File

@ -1,14 +1,8 @@
#!/bin/sh
#
# NXP fmuk66-v3 specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
fi
rgbled_pwm start
safety_button start

View File

@ -1,15 +1,7 @@
#!/bin/sh
#
# PX4 FMUv5 specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
fi
set LOGGER_BUF 64
rgbled_pwm start
safety_button start

View File

@ -1,12 +1,6 @@
#!/bin/sh
#
# board defaults
# board specific defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
then
fi
pwm_out mode_pwm1 start

View File

@ -1,18 +1,11 @@
#!/bin/sh
#
# Omnibus F4SD specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
# system_power unavailable
param set-default CBRK_SUPPLY_CHK 894281
# transition from LPE+Q to Q estimator (2019-06-05)
if param compare SYS_MC_EST_GROUP 1
then
param set SYS_MC_EST_GROUP 3
fi
# Disable safety switch by default
param set-default CBRK_IO_SAFETY 22027

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# PX4 FMUv2 specific board defaults
# board specific defaults
#------------------------------------------------------------------------------

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# PX4 FMUv3 specific board defaults
# board specific defaults
#------------------------------------------------------------------------------

View File

@ -1,21 +1,15 @@
#!/bin/sh
#
# PX4 FMUv4 specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
if [ $AUTOCNF = yes ]
# start MAVLink on Wifi (ESP8266 port). Except for the TealOne airframe.
if ! param compare SYS_AUTOSTART 4250
then
# Disable safety switch by default
param set-default CBRK_IO_SAFETY 22027
# start MAVLink on Wifi (ESP8266 port). Except for the TealOne airframe.
if ! param compare SYS_AUTOSTART 4250
then
param set-default MAV_2_CONFIG 301
param set-default MAV_2_RATE 20000
param set-default SER_WIFI_BAUD 921600
fi
param set-default MAV_2_CONFIG 301
param set-default MAV_2_RATE 20000
param set-default SER_WIFI_BAUD 921600
fi
if param compare SER_WIFI_BAUD 1
@ -30,5 +24,5 @@ then
fi
fi
safety_button start
safety_button start

View File

@ -1,13 +1,10 @@
#!/bin/sh
#
# PX4 FMUv4pro specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default EKF2_MULTI_IMU 2
param set-default SENS_IMU_MODE 0
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# PX4 FMUv5 specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
@ -18,10 +18,5 @@ else
param set-default SENS_MAG_MODE 0
fi
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
rgbled_pwm start
safety_button start

View File

@ -1,15 +1,6 @@
#!/bin/sh
#
# PX4 FMUv5X specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
safety_button start

View File

@ -1,17 +1,6 @@
#!/bin/sh
#
# PX4 FMUv6U specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 3
param set-default SENS_MAG_MODE 0
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
safety_button start

View File

@ -1,17 +1,6 @@
#!/bin/sh
#
# PX4 FMUv6X specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 3
param set-default SENS_MAG_MODE 0
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64
safety_button start

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# SP Racing H7 EXTREME specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
# system_power unavailable
@ -9,9 +9,6 @@ param set-default CBRK_SUPPLY_CHK 894281
# Select the Generic 250 Racer by default
param set-default SYS_AUTOSTART 4050
# Disable safety switch by default
param set-default CBRK_IO_SAFETY 22027
# use the Q attitude estimator, it works w/o mag or GPS.
param set-default SYS_MC_EST_GROUP 3
param set-default ATT_ACC_COMP 0
@ -21,6 +18,3 @@ param set-default ATT_W_GYRO_BIAS 0.0000
param set-default SYS_HAS_MAG 0
param set-default DSHOT_CONFIG 600
set LOGGER_BUF 64

View File

@ -1,10 +1,7 @@
#!/bin/sh
#
# UVify Core specific board defaults
# board specific defaults
#------------------------------------------------------------------------------
# Disable safety switch by default
param set-default CBRK_IO_SAFETY 22027
# don't probe external I2C
param set-default SENS_EXT_I2C_PRB 0

View File

@ -1,4 +1,6 @@
#!/bin/sh
#
# mRo x21 specific board defaults
# imxrt specific defaults
#------------------------------------------------------------------------------
set LOGGER_BUF 32

View File

@ -0,0 +1,18 @@
#!/bin/sh
#
# Kinetis specific defaults
#------------------------------------------------------------------------------
# Multi-EKF (off by default)
param set-default EKF2_MULTI_IMU 0
param set-default SENS_IMU_MODE 1
param set-default EKF2_MULTI_MAG 0
param set-default SENS_MAG_MODE 1
set LOGGER_BUF 12
if param greater -s UAVCAN_ENABLE 1
then
# Reduce logger buffer to free up some RAM for UAVCAN servers.
set LOGGER_BUF 4
fi

View File

@ -0,0 +1,12 @@
#!/bin/sh
#
# S32K1XX specific defaults
#------------------------------------------------------------------------------
set LOGGER_BUF 12
if param greater -s UAVCAN_ENABLE 1
then
# Reduce logger buffer to free up some RAM for UAVCAN servers.
set LOGGER_BUF 4
fi

View File

@ -0,0 +1,18 @@
#!/bin/sh
#
# STM32 (STM32F4) specific defaults
#------------------------------------------------------------------------------
# Multi-EKF (off by default)
param set-default EKF2_MULTI_IMU 0
param set-default SENS_IMU_MODE 1
param set-default EKF2_MULTI_MAG 0
param set-default SENS_MAG_MODE 1
set LOGGER_BUF 12
if param greater -s UAVCAN_ENABLE 1
then
# Reduce logger buffer to free up some RAM for UAVCAN servers.
set LOGGER_BUF 4
fi

View File

@ -0,0 +1,14 @@
#!/bin/sh
#
# STM32F7 specific defaults
#------------------------------------------------------------------------------
# Multi-EKF (across IMUs only)
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 0
param set-default SENS_MAG_MODE 1
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64

View File

@ -1,16 +1,14 @@
#!/bin/sh
#
# Board specific defaults
# STM32H7 specific defaults
#------------------------------------------------------------------------------
# Multi-EKF
param set-default EKF2_MULTI_IMU 2
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 2
param set-default EKF2_MULTI_MAG 3
param set-default SENS_MAG_MODE 0
param set-default UAVCAN_ENABLE 2
set LOGGER_BUF 64