mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
create board specific init script and use with fmu-v5
This commit is contained in:
@@ -126,6 +126,20 @@ if(config_bl_file)
|
|||||||
)
|
)
|
||||||
endif()
|
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"
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND extras_dependencies
|
||||||
|
${romfs_gen_root_dir}/init.d/rc.board
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_custom_command(OUTPUT romfs_extras.stamp
|
add_custom_command(OUTPUT romfs_extras.stamp
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${romfs_gen_root_dir}/extras/
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${romfs_gen_root_dir}/extras/
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${PX4_BINARY_DIR}/romfs_extras/
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${PX4_BINARY_DIR}/romfs_extras/
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
set LOGGER_ARGS ""
|
set LOGGER_ARGS ""
|
||||||
set LOGGER_BUF 14
|
|
||||||
|
|
||||||
if param greater UAVCAN_ENABLE 1
|
if param greater UAVCAN_ENABLE 1
|
||||||
then
|
then
|
||||||
@@ -17,7 +16,7 @@ fi
|
|||||||
# Begin Setup for board specific configurations. #
|
# Begin Setup for board specific configurations. #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
if ver hwcmp PX4_FMU_V5 AV_X_V1
|
if ver hwcmp AV_X_V1
|
||||||
then
|
then
|
||||||
set LOGGER_BUF 64
|
set LOGGER_BUF 64
|
||||||
fi
|
fi
|
||||||
@@ -44,4 +43,3 @@ fi
|
|||||||
logger start -b ${LOGGER_BUF} -t ${LOGGER_ARGS}
|
logger start -b ${LOGGER_BUF} -t ${LOGGER_ARGS}
|
||||||
|
|
||||||
unset LOGGER_ARGS
|
unset LOGGER_ARGS
|
||||||
unset LOGGER_BUF
|
|
||||||
|
|||||||
@@ -325,35 +325,6 @@ then
|
|||||||
rm3100 start
|
rm3100 start
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ver hwcmp PX4_FMU_V5
|
|
||||||
then
|
|
||||||
|
|
||||||
# Internal SPI bus ICM-20602
|
|
||||||
mpu6000 -R 8 -s -T 20602 start
|
|
||||||
|
|
||||||
# Internal SPI bus ICM-20689
|
|
||||||
mpu6000 -R 8 -z -T 20689 start
|
|
||||||
|
|
||||||
# Internal SPI bus BMI055 accel
|
|
||||||
bmi055 -A -R 10 start
|
|
||||||
|
|
||||||
# Internal SPI bus BMI055 gyro
|
|
||||||
bmi055 -G -R 10 start
|
|
||||||
|
|
||||||
# Possible external compasses
|
|
||||||
hmc5883 -C -T -X start
|
|
||||||
|
|
||||||
# Possible external compasses
|
|
||||||
ist8310 -C -b 1 start
|
|
||||||
ist8310 -C -b 2 start
|
|
||||||
|
|
||||||
# Possible internal compass
|
|
||||||
ist8310 -C -b 5 start
|
|
||||||
|
|
||||||
# Possible pmw3901 optical flow sensor
|
|
||||||
pmw3901 start
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ver hwcmp ATMEL_SAME70XPLAINED_V1
|
if ver hwcmp ATMEL_SAME70XPLAINED_V1
|
||||||
then
|
then
|
||||||
# External I2C bus
|
# External I2C bus
|
||||||
|
|||||||
@@ -27,18 +27,6 @@ set +e
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# 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
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# UART mapping on OMNIBUSF4SD:
|
# UART mapping on OMNIBUSF4SD:
|
||||||
#
|
#
|
||||||
# USART1 /dev/ttyS0 SerialRX
|
# USART1 /dev/ttyS0 SerialRX
|
||||||
@@ -63,6 +51,7 @@ set +e
|
|||||||
# it wastes flash
|
# it wastes flash
|
||||||
#
|
#
|
||||||
set AUX_MODE pwm
|
set AUX_MODE pwm
|
||||||
|
set BOARD_RC /etc/init.d/rc.board
|
||||||
set DATAMAN_OPT ""
|
set DATAMAN_OPT ""
|
||||||
set FAILSAFE none
|
set FAILSAFE none
|
||||||
set FAILSAFE_AUX none
|
set FAILSAFE_AUX none
|
||||||
@@ -74,6 +63,7 @@ set FMU_MODE pwm
|
|||||||
set IOFW "/etc/extras/px4_io-v2_default.bin"
|
set IOFW "/etc/extras/px4_io-v2_default.bin"
|
||||||
set IO_PRESENT no
|
set IO_PRESENT no
|
||||||
set LOG_FILE /fs/microsd/bootlog.txt
|
set LOG_FILE /fs/microsd/bootlog.txt
|
||||||
|
set LOGGER_BUF 14
|
||||||
set MAV_TYPE none
|
set MAV_TYPE none
|
||||||
set MIXER none
|
set MIXER none
|
||||||
set MIXER_AUX none
|
set MIXER_AUX none
|
||||||
@@ -275,6 +265,15 @@ else
|
|||||||
# Begin setup for board specific configurations. #
|
# Begin setup for board specific configurations. #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# run boards rc.board if available
|
||||||
|
#
|
||||||
|
if [ -f $BOARD_RC ]
|
||||||
|
then
|
||||||
|
echo "Board init: ${BOARD_RC}"
|
||||||
|
sh $BOARD_RC
|
||||||
|
fi
|
||||||
|
|
||||||
if ver hwcmp GUMSTIX_AEROCORE2
|
if ver hwcmp GUMSTIX_AEROCORE2
|
||||||
then
|
then
|
||||||
set DATAMAN_OPT "-f /fs/mtd_dataman"
|
set DATAMAN_OPT "-f /fs/mtd_dataman"
|
||||||
@@ -565,7 +564,7 @@ else
|
|||||||
#
|
#
|
||||||
# Launch the flow sensor as a background task.
|
# Launch the flow sensor as a background task.
|
||||||
#
|
#
|
||||||
if ver hwcmp PX4_FMU_V2 PX4_FMU_V4 PX4_FMU_V4PRO AIRMIND_MINDPX_V2 PX4_FMU_V5 OMNIBUS_F4SD
|
if ver hwcmp PX4_FMU_V2 PX4_FMU_V4 PX4_FMU_V4PRO AIRMIND_MINDPX_V2 OMNIBUS_F4SD
|
||||||
then
|
then
|
||||||
px4flow start &
|
px4flow start &
|
||||||
fi
|
fi
|
||||||
@@ -598,6 +597,7 @@ unset FMU_MODE
|
|||||||
unset IOFW
|
unset IOFW
|
||||||
unset IO_PRESENT
|
unset IO_PRESENT
|
||||||
unset LOG_FILE
|
unset LOG_FILE
|
||||||
|
unset LOGGER_BUF
|
||||||
unset MAV_TYPE
|
unset MAV_TYPE
|
||||||
unset MIXER
|
unset MIXER
|
||||||
unset MIXER_AUX
|
unset MIXER_AUX
|
||||||
|
|||||||
52
boards/px4/fmu-v5/init/rc.board
Normal file
52
boards/px4/fmu-v5/init/rc.board
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
#!nsh
|
||||||
|
#
|
||||||
|
# PX4 FMUv5 specific board 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
|
||||||
|
|
||||||
|
# Internal SPI bus ICM-20689
|
||||||
|
mpu6000 -R 8 -z -T 20689 start
|
||||||
|
|
||||||
|
# Internal SPI bus BMI055 accel
|
||||||
|
bmi055 -A -R 10 start
|
||||||
|
|
||||||
|
# Internal SPI bus BMI055 gyro
|
||||||
|
bmi055 -G -R 10 start
|
||||||
|
|
||||||
|
# Possible external compasses
|
||||||
|
hmc5883 -C -T -X start
|
||||||
|
|
||||||
|
# Possible external compasses
|
||||||
|
ist8310 -C -b 1 start
|
||||||
|
ist8310 -C -b 2 start
|
||||||
|
|
||||||
|
# Possible internal compass
|
||||||
|
ist8310 -C -b 5 start
|
||||||
|
|
||||||
|
# Possible pmw3901 optical flow sensor
|
||||||
|
pmw3901 start
|
||||||
|
|
||||||
|
px4flow start &
|
||||||
Reference in New Issue
Block a user