diff --git a/.ackrc b/.ackrc
deleted file mode 100644
index 0215ca1eebeb..000000000000
--- a/.ackrc
+++ /dev/null
@@ -1 +0,0 @@
---ignore-dir=Documentation
diff --git a/.ci/Jenkinsfile-compile b/.ci/Jenkinsfile-compile
index c1907fa64c58..04c8c210b94a 100644
--- a/.ci/Jenkinsfile-compile
+++ b/.ci/Jenkinsfile-compile
@@ -40,16 +40,16 @@ pipeline {
"ark_can-flow_default",
"ark_can-gps_canbootloader",
"ark_can-gps_default",
- "ark_cannode_canbootloader",
- "ark_cannode_default",
"ark_can-rtk-gps_canbootloader",
"ark_can-rtk-gps_default",
+ "ark_cannode_canbootloader",
+ "ark_cannode_default",
"ark_fmu-v6x_bootloader",
"ark_fmu-v6x_default",
"atl_mantis-edu_default",
"av_x-v1_default",
- "bitcraze_crazyflie_default",
"bitcraze_crazyflie21_default",
+ "bitcraze_crazyflie_default",
"cuav_can-gps-v1_canbootloader",
"cuav_can-gps-v1_default",
"cuav_nora_default",
@@ -66,8 +66,8 @@ pipeline {
"holybro_durandal-v1_default",
"holybro_kakutef7_default",
"holybro_kakuteh7_default",
- "holybro_kakuteh7v2_default",
"holybro_kakuteh7mini_default",
+ "holybro_kakuteh7v2_default",
"holybro_pix32v5_default",
"matek_gnss-m9n-f4_canbootloader",
"matek_gnss-m9n-f4_default",
@@ -77,8 +77,8 @@ pipeline {
"modalai_fc-v1_default",
"modalai_fc-v2_default",
"mro_ctrl-zero-classic_default",
- "mro_ctrl-zero-f7_default",
"mro_ctrl-zero-f7-oem_default",
+ "mro_ctrl-zero-f7_default",
"mro_ctrl-zero-h7-oem_default",
"mro_ctrl-zero-h7_default",
"mro_pixracerpro_default",
@@ -104,22 +104,28 @@ pipeline {
"px4_fmu-v5_debug",
"px4_fmu-v5_default",
"px4_fmu-v5_lto",
+ "px4_fmu-v5_rover",
"px4_fmu-v5_stackcheck",
"px4_fmu-v5_uavcanv0periph",
"px4_fmu-v5x_default",
+ "px4_fmu-v5x_rover",
"px4_fmu-v6c_default",
+ "px4_fmu-v6c_rover",
"px4_fmu-v6u_default",
+ "px4_fmu-v6u_rover",
"px4_fmu-v6x_default",
+ "px4_fmu-v6x_rover",
"px4_fmu-v6xrt_bootloader",
"px4_fmu-v6xrt_default",
+ "px4_fmu-v6xrt_rover",
"px4_io-v2_default",
"raspberrypi_pico_default",
+ "siyi_n7_default",
"sky-drones_smartap-airlink_default",
"spracing_h7extreme_default",
"thepeach_k1_default",
"thepeach_r1_default",
"uvify_core_default",
- "siyi_n7_default"
],
image: docker_images.nuttx,
archive: true
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000000..87496c115e9e
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,6 @@
+root = true
+
+[*.{c,cpp,cc,h,hpp}]
+indent_style = tab
+tab_width = 8
+max_line_length = 120
diff --git a/.github/workflows/compile_nuttx.yml b/.github/workflows/compile_nuttx.yml
index f2ffbc745f3e..cf42be021321 100644
--- a/.github/workflows/compile_nuttx.yml
+++ b/.github/workflows/compile_nuttx.yml
@@ -25,6 +25,7 @@ jobs:
ark_can-rtk-gps,
ark_cannode,
ark_fmu-v6x,
+ ark_septentrio-gps,
atl_mantis-edu,
av_x-v1,
bitcraze_crazyflie,
@@ -48,6 +49,7 @@ jobs:
matek_h743-slim,
modalai_fc-v1,
modalai_fc-v2,
+ mro_ctrl-zero-classic,
mro_ctrl-zero-f7,
mro_ctrl-zero-f7-oem,
mro_ctrl-zero-h7,
diff --git a/.github_changelog_generator b/.github_changelog_generator
deleted file mode 100644
index b89c58ad0567..000000000000
--- a/.github_changelog_generator
+++ /dev/null
@@ -1,33 +0,0 @@
-# How to install:
-# gem install github_changelog_generator
-# How to run:
-# github_changelog_generator -u PX4 -p Firmware
-# Description:
-# The following params are sensible defaults for the PX4 project,
-# if you want to do a changelog before a release you need to update since-tag and future-releases,
-
-# Params:
-# github_changelog_generator --help for all options
-
-# max-issues
-# max threshold for github api queries
-# make sure you set your CHANGELOG_GITHUB_TOKEN before
-# running
-max-issues=1500
-
-# exclude-tags-regex
-# excludes release candidates
-exclude-tags-regex=rc[0-9]{1,}|beta[0-9]{1,}
-
-# since-tag
-# version of last stable release
-# you need to change this depending on what you need
-# if you want a changelog between versions this is the lowest version
-since-tag=1.6.5
-
-# future-release
-# version you are about to release
-# if you want a changelog between a version and all unreleased changes grouped as a release
-# eg: v1.6.5 to v1.7.0
-future-release=v1.7.0
-
diff --git a/.gitmodules b/.gitmodules
index 62b18dd75ce8..e443da19a290 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -79,3 +79,7 @@
[submodule "Tools/simulation/gz"]
path = Tools/simulation/gz
url = https://github.com/PX4/PX4-gazebo-models.git
+ branch = main
+[submodule "boards/modalai/voxl2/libfc-sensor-api"]
+ path = boards/modalai/voxl2/libfc-sensor-api
+ url = https://gitlab.com/voxl-public/voxl-sdk/core-libs/libfc-sensor-api.git
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 347ccc884c89..000000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-language: cpp
-
-git:
- depth: 100
- submodules: false
-
-matrix:
- fast_finish: true
- include:
- - os: linux
- dist: xenial
- # In order to stay under the coverity rate limit, we only run this weekly
- # and not on push which is configured in travis-ci settings.
- if: branch = main
-
-before_install:
- - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
-
-install:
- - export PATH=$HOME/.local/bin:$PATH
- - pip install --user --upgrade pip
- - pip install --user -r Tools/setup/requirements.txt
-
-script:
- - make
-
-addons:
- coverity_scan:
- project:
- name: "PX4/Firmware"
- description: "Build submitted via Travis CI"
- notification_email: ci@px4.io
- build_command_prepend: "make distclean"
- build_command: "make px4_sitl_default"
- branch_pattern: coverity_scan
diff --git a/.vscode/cmake-variants.yaml b/.vscode/cmake-variants.yaml
index c929a3054490..c2a057d68669 100644
--- a/.vscode/cmake-variants.yaml
+++ b/.vscode/cmake-variants.yaml
@@ -71,6 +71,26 @@ CONFIG:
buildType: MinSizeRel
settings:
CONFIG: px4_fmu-v5x_default
+ px4_fmu-v6c_default:
+ short: px4_fmu-v6c
+ buildType: MinSizeRel
+ settings:
+ CONFIG: px4_fmu-v6c_default
+ px4_fmu-v6c_bootloader:
+ short: px4_fmu-v6c_bootloader
+ buildType: MinSizeRel
+ settings:
+ CONFIG: px4_fmu-v6c_bootloader
+ px4_fmu-v6u_default:
+ short: px4_fmu-v6u
+ buildType: MinSizeRel
+ settings:
+ CONFIG: px4_fmu-v6u_default
+ px4_fmu-v6u_bootloader:
+ short: px4_fmu-v6u_bootloader
+ buildType: MinSizeRel
+ settings:
+ CONFIG: px4_fmu-v6u_bootloader
px4_fmu-v6x_default:
short: px4_fmu-v6x
buildType: MinSizeRel
@@ -131,6 +151,16 @@ CONFIG:
buildType: MinSizeRel
settings:
CONFIG: ark_can-rtk-gps_canbootloader
+ ark_septentrio_gps_default:
+ short: ark_septentrio_gps_default
+ buildType: MinSizeRel
+ settings:
+ CONFIG: ark_septentrio_gps_default
+ ark_septentrio_gps_canbootloader:
+ short: ark_septentrio_gps_canbootloader
+ buildType: MinSizeRel
+ settings:
+ CONFIG: ark_septentrio_gps_canbootloader
ark_cannode_default:
short: ark_cannode_default
buildType: MinSizeRel
diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py
deleted file mode 100644
index 4f7cfc202001..000000000000
--- a/.ycm_extra_conf.py
+++ /dev/null
@@ -1,172 +0,0 @@
-# This file is NOT licensed under the GPLv3, which is the license for the rest
-# of YouCompleteMe.
-#
-# Here's the license text for this file:
-#
-# This is free and unencumbered software released into the public domain.
-#
-# Anyone is free to copy, modify, publish, use, compile, sell, or
-# distribute this software, either in source code form or as a compiled
-# binary, for any purpose, commercial or non-commercial, and by any
-# means.
-#
-# In jurisdictions that recognize copyright laws, the author or authors
-# of this software dedicate any and all copyright interest in the
-# software to the public domain. We make this dedication for the benefit
-# of the public at large and to the detriment of our heirs and
-# successors. We intend this dedication to be an overt act of
-# relinquishment in perpetuity of all present and future rights to this
-# software under copyright law.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-#
-# For more information, please refer to
-
-import os
-import ycm_core
-
-# These are the compilation flags that will be used in case there's no
-# compilation database set (by default, one is not set).
-# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
-flags = [
-'-Wall',
-'-Wextra',
-'-Werror',
-#'-Wc++98-compat',
-'-Wno-long-long',
-'-Wno-variadic-macros',
-'-fexceptions',
-'-DNDEBUG',
-# You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM
-# source code needs it.
-#'-DUSE_CLANG_COMPLETER',
-# THIS IS IMPORTANT! Without a "-std=" flag, clang won't know which
-# language to use when compiling headers. So it will guess. Badly. So C++
-# headers will be compiled as C headers. You don't want that so ALWAYS specify
-# a "-std=".
-# For a C project, you would set this to something like 'c99' instead of
-# 'c++14'.
-'-std=c++14',
-# ...and the same thing goes for the magic -x option which specifies the
-# language that the files to be compiled are written in. This is mostly
-# relevant for c++ headers.
-# For a C project, you would set this to 'c' instead of 'c++'.
-'-x',
-'c++',
-'-undef', # get rid of standard definitions to allow us to include arm math header
-'-I', os.path.join(os.path.expanduser("~"),'gcc-arm-none-eabi-4_7-2013q3/arm-none-eabi/include'),
-'-I', 'Build/px4_io-v2_default.build/nuttx-export/include/',
-'-I', './NuttX/nuttx/arch/arm/include',
-'-include', './src/include/visibility.h',
-'-I', './src',
-'-I', './src/modules',
-'-I', './src/include',
-'-I', './src/lib',
-'-I', './NuttX',
-]
-
-
-# Set this to the absolute path to the folder (NOT the file!) containing the
-# compile_commands.json file to use that instead of 'flags'. See here for
-# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
-#
-# Most projects will NOT need to set this to anything; you can just change the
-# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
-compilation_database_folder = ''
-
-if os.path.exists( compilation_database_folder ):
- database = ycm_core.CompilationDatabase( compilation_database_folder )
-else:
- database = None
-
-SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
-
-def DirectoryOfThisScript():
- return os.path.dirname( os.path.abspath( __file__ ) )
-
-
-def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
- if not working_directory:
- return list( flags )
- new_flags = []
- make_next_absolute = False
- path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
- for flag in flags:
- new_flag = flag
-
- if make_next_absolute:
- make_next_absolute = False
- if not flag.startswith( '/' ):
- new_flag = os.path.join( working_directory, flag )
-
- for path_flag in path_flags:
- if flag == path_flag:
- make_next_absolute = True
- break
-
- if flag.startswith( path_flag ):
- path = flag[ len( path_flag ): ]
- new_flag = path_flag + os.path.join( working_directory, path )
- break
-
- if new_flag:
- new_flags.append( new_flag )
- return new_flags
-
-
-def IsHeaderFile( filename ):
- extension = os.path.splitext( filename )[ 1 ]
- return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
-
-
-def GetCompilationInfoForFile( filename ):
- # The compilation_commands.json file generated by CMake does not have entries
- # for header files. So we do our best by asking the db for flags for a
- # corresponding source file, if any. If one exists, the flags for that file
- # should be good enough.
- if IsHeaderFile( filename ):
- basename = os.path.splitext( filename )[ 0 ]
- for extension in SOURCE_EXTENSIONS:
- replacement_file = basename + extension
- if os.path.exists( replacement_file ):
- compilation_info = database.GetCompilationInfoForFile(
- replacement_file )
- if compilation_info.compiler_flags_:
- return compilation_info
- return None
- return database.GetCompilationInfoForFile( filename )
-
-
-def FlagsForFile( filename, **kwargs ):
- if database:
- # Bear in mind that compilation_info.compiler_flags_ does NOT return a
- # python list, but a "list-like" StringVec object
- compilation_info = GetCompilationInfoForFile( filename )
- if not compilation_info:
- return None
-
- final_flags = MakeRelativePathsInFlagsAbsolute(
- compilation_info.compiler_flags_,
- compilation_info.compiler_working_dir_ )
-
- # NOTE: This is just for YouCompleteMe; it's highly likely that your project
- # does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
- # ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT.
- #try:
- # final_flags.remove( '-stdlib=libc++' )
- #except ValueError:
- # pass
- else:
- relative_to = DirectoryOfThisScript()
- final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
-
- return {
- 'flags': final_flags,
- 'do_cache': True
- }
diff --git a/Firmware.sublime-project b/Firmware.sublime-project
deleted file mode 100644
index d89a58de3f19..000000000000
--- a/Firmware.sublime-project
+++ /dev/null
@@ -1,83 +0,0 @@
-{
- "folders":
- [
- {
- "path": ".",
- "file_exclude_patterns":
- [
- "*.o",
- "*.a",
- "*.d",
- ".built",
- ".context",
- ".depend",
- ".config",
- ".version",
- "Make.dep",
- ".configured",
- "*.sublime-project",
- "*.sublime-workspace",
- ".project",
- ".cproject",
- "cscope.out"
- ],
- "folder_exclude_patterns":
- [
- ".settings",
- "nuttx/arch/arm/src/board",
- "nuttx/arch/arm/src/chip",
- "build_*"
- ]
- }
- ],
- "settings":
- {
- "tab_size": 8,
- "translate_tabs_to_spaces": false,
- "highlight_line": true,
- "AStyleFormatter":
- {
- "options_c":
- {
- "use_only_additional_options": true,
- "additional_options_file": "${project_path}/Tools/astyle/astylerc"
- },
- "options_c++":
- {
- "use_only_additional_options": true,
- "additional_options_file": "${project_path}/Tools/astyle/astylerc"
- }
- }
- },
- "build_systems":
- [
- {
- "name": "PX4: make all",
- "working_dir": "${project_path}",
- "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
- "cmd": ["make"],
- "shell": true
- },
- {
- "name": "PX4: make and upload",
- "working_dir": "${project_path}",
- "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
- "cmd": ["make upload px4_fmu-v2_default -j8"],
- "shell": true
- },
- {
- "name": "PX4: make posix",
- "working_dir": "${project_path}",
- "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
- "cmd": ["make posix"],
- "shell": true
- },
- {
- "name": "MindPX_V2: make and upload",
- "working_dir": "${project_path}",
- "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
- "cmd": ["make upload mindpx-v2_default -j8"],
- "shell": true
- }
- ]
-}
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/10040_sihsim_quadx b/ROMFS/px4fmu_common/init.d-posix/airframes/10040_sihsim_quadx
index 3124ff4f69d5..0849dc91d6f4 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/10040_sihsim_quadx
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/10040_sihsim_quadx
@@ -22,18 +22,17 @@ param set-default CBRK_SUPPLY_CHK 894281
# - without safety switch
param set-default CBRK_IO_SAFETY 22027
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR0_KM 0.05
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR1_KM 0.05
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
param set-default PWM_MAIN_FUNC1 101
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/10041_sihsim_airplane b/ROMFS/px4fmu_common/init.d-posix/airframes/10041_sihsim_airplane
index 47f8c70b00e7..8580464c4906 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/10041_sihsim_airplane
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/10041_sihsim_airplane
@@ -26,7 +26,7 @@ param set-default CBRK_IO_SAFETY 22027
param set-default BAT_N_CELLS 3
-param set-default SIH_T_MAX 6.0
+param set-default SIH_T_MAX 6
param set-default SIH_MASS 0.3
param set-default SIH_IXX 0.00402
param set-default SIH_IYY 0.0144
@@ -45,9 +45,9 @@ param set-default CA_ROTOR_COUNT 1
param set-default CA_SV_CS_COUNT 3
param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
-param set-default CA_SV_CS1_TRQ_P 1.0
+param set-default CA_SV_CS1_TRQ_P 1
param set-default CA_SV_CS1_TYPE 3
-param set-default CA_SV_CS2_TRQ_Y 1.0
+param set-default CA_SV_CS2_TRQ_Y 1
param set-default CA_SV_CS2_TYPE 4
param set-default PWM_MAIN_FUNC3 201
param set-default PWM_MAIN_FUNC4 202
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/10042_sihsim_xvert b/ROMFS/px4fmu_common/init.d-posix/airframes/10042_sihsim_xvert
index 278281787361..536fc6076c39 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/10042_sihsim_xvert
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/10042_sihsim_xvert
@@ -35,14 +35,14 @@ param set-default CBRK_IO_SAFETY 22027
param set-default BAT_N_CELLS 3
-param set-default SIH_T_MAX 2.0
+param set-default SIH_T_MAX 2
param set-default SIH_Q_MAX 0.0165
param set-default SIH_MASS 0.2
# IXX and IZZ are inverted from the thesis as the body frame is pitched by 90 deg
param set-default SIH_IXX 0.00354
param set-default SIH_IYY 0.000625
param set-default SIH_IZZ 0.00300
-param set-default SIH_IXZ 0.0
+param set-default SIH_IXZ 0
param set-default SIH_KDV 0.2
param set-default SIH_L_ROLL 0.145
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1010_gazebo-classic_iris_opt_flow b/ROMFS/px4fmu_common/init.d-posix/airframes/1010_gazebo-classic_iris_opt_flow
index 28c3e34f7132..38d9019adc70 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1010_gazebo-classic_iris_opt_flow
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1010_gazebo-classic_iris_opt_flow
@@ -47,5 +47,5 @@ param set-default MPC_ALT_MODE 2
param set-default SENS_FLOW_ROT 6
param set-default SENS_FLOW_MINHGT 0.7
-param set-default SENS_FLOW_MAXHGT 3.0
+param set-default SENS_FLOW_MAXHGT 3
param set-default SENS_FLOW_MAXR 2.5
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1021_gazebo-classic_uuv_hippocampus b/ROMFS/px4fmu_common/init.d-posix/airframes/1021_gazebo-classic_uuv_hippocampus
index ca67af3f0187..f6f07d700ef7 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1021_gazebo-classic_uuv_hippocampus
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1021_gazebo-classic_uuv_hippocampus
@@ -8,34 +8,34 @@
param set-default CA_AIRFRAME 7
param set-default CA_ROTOR_COUNT 4
param set-default CA_R_REV 255
-param set-default CA_ROTOR0_AX 1.0000
-param set-default CA_ROTOR0_AY 0.0000
-param set-default CA_ROTOR0_AZ 0.0000
-param set-default CA_ROTOR0_KM 0.0000
-param set-default CA_ROTOR0_PX 0.0000
-param set-default CA_ROTOR0_PY -0.3000
-param set-default CA_ROTOR0_PZ -0.3000
-param set-default CA_ROTOR1_AX 1.0000
-param set-default CA_ROTOR1_AY 0.0000
-param set-default CA_ROTOR1_AZ 0.0000
-param set-default CA_ROTOR1_KM 0.0000
-param set-default CA_ROTOR1_PX 0.0000
-param set-default CA_ROTOR1_PY 0.3000
-param set-default CA_ROTOR1_PZ -0.3000
-param set-default CA_ROTOR2_AX 1.0000
-param set-default CA_ROTOR2_AY 0.0000
-param set-default CA_ROTOR2_AZ 0.0000
-param set-default CA_ROTOR2_KM 0.0000
-param set-default CA_ROTOR2_PX 0.0000
-param set-default CA_ROTOR2_PY 0.3000
-param set-default CA_ROTOR2_PZ 0.3000
-param set-default CA_ROTOR3_AX 1.0000
-param set-default CA_ROTOR3_AY 0.0000
-param set-default CA_ROTOR3_AZ 0.0000
-param set-default CA_ROTOR3_KM 0.0000
-param set-default CA_ROTOR3_PX 0.0000
-param set-default CA_ROTOR3_PY -0.3000
-param set-default CA_ROTOR3_PZ 0.3000
+param set-default CA_ROTOR0_AX 1
+param set-default CA_ROTOR0_AY 0
+param set-default CA_ROTOR0_AZ 0
+param set-default CA_ROTOR0_KM 0
+param set-default CA_ROTOR0_PX 0
+param set-default CA_ROTOR0_PY -0.3
+param set-default CA_ROTOR0_PZ -0.3
+param set-default CA_ROTOR1_AX 1
+param set-default CA_ROTOR1_AY 0
+param set-default CA_ROTOR1_AZ 0
+param set-default CA_ROTOR1_KM 0
+param set-default CA_ROTOR1_PX 0
+param set-default CA_ROTOR1_PY 0.3
+param set-default CA_ROTOR1_PZ -0.3
+param set-default CA_ROTOR2_AX 1
+param set-default CA_ROTOR2_AY 0
+param set-default CA_ROTOR2_AZ 0
+param set-default CA_ROTOR2_KM 0
+param set-default CA_ROTOR2_PX 0
+param set-default CA_ROTOR2_PY 0.3
+param set-default CA_ROTOR2_PZ 0.3
+param set-default CA_ROTOR3_AX 1
+param set-default CA_ROTOR3_AY 0
+param set-default CA_ROTOR3_AZ 0
+param set-default CA_ROTOR3_KM 0
+param set-default CA_ROTOR3_PX 0
+param set-default CA_ROTOR3_PY -0.3
+param set-default CA_ROTOR3_PZ 0.3
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1022_gazebo-classic_uuv_bluerov2_heavy b/ROMFS/px4fmu_common/init.d-posix/airframes/1022_gazebo-classic_uuv_bluerov2_heavy
index 71d0574e1df2..0c6c802f8d21 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1022_gazebo-classic_uuv_bluerov2_heavy
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1022_gazebo-classic_uuv_bluerov2_heavy
@@ -9,49 +9,49 @@ param set-default CA_AIRFRAME 7
param set-default CA_ROTOR_COUNT 8
param set-default CA_R_REV 255
-param set-default CA_ROTOR0_AX 1.0000
-param set-default CA_ROTOR0_AY -1.0000
-param set-default CA_ROTOR0_AZ 0.0000
-param set-default CA_ROTOR0_KM 0.0000
-param set-default CA_ROTOR0_PX 0.5000
-param set-default CA_ROTOR0_PY 0.3000
-param set-default CA_ROTOR0_PZ 0.2000
-param set-default CA_ROTOR1_AX 1.0000
-param set-default CA_ROTOR1_AY 1.0000
-param set-default CA_ROTOR1_AZ 0.0000
-param set-default CA_ROTOR1_KM 0.0000
-param set-default CA_ROTOR1_PX 0.5000
-param set-default CA_ROTOR1_PY -0.3000
-param set-default CA_ROTOR1_PZ 0.2000
-param set-default CA_ROTOR2_AX 1.0000
-param set-default CA_ROTOR2_AY 1.0000
-param set-default CA_ROTOR2_AZ 0.0000
-param set-default CA_ROTOR2_KM 0.0000
-param set-default CA_ROTOR2_PX -0.5000
-param set-default CA_ROTOR2_PY 0.3000
-param set-default CA_ROTOR2_PZ 0.2000
-param set-default CA_ROTOR3_AX 1.0000
-param set-default CA_ROTOR3_AY -1.0000
-param set-default CA_ROTOR3_AZ 0.0000
-param set-default CA_ROTOR3_KM 0.0000
-param set-default CA_ROTOR3_PX -0.5000
-param set-default CA_ROTOR3_PY -0.3000
-param set-default CA_ROTOR3_PZ 0.2000
-param set-default CA_ROTOR4_AZ -1.0000
-param set-default CA_ROTOR4_KM 0.0000
-param set-default CA_ROTOR4_PX 0.5000
-param set-default CA_ROTOR4_PY 0.5000
-param set-default CA_ROTOR5_AZ 1.0000
-param set-default CA_ROTOR5_KM 0.0000
-param set-default CA_ROTOR5_PX 0.5000
-param set-default CA_ROTOR5_PY -0.5000
-param set-default CA_ROTOR6_AZ 1.0000
-param set-default CA_ROTOR6_KM 0.0000
-param set-default CA_ROTOR6_PX -0.5000
-param set-default CA_ROTOR6_PY 0.5000
-param set-default CA_ROTOR7_KM 0.0000
-param set-default CA_ROTOR7_PX -0.5000
-param set-default CA_ROTOR7_PY -0.5000
+param set-default CA_ROTOR0_AX 1
+param set-default CA_ROTOR0_AY -1
+param set-default CA_ROTOR0_AZ 0
+param set-default CA_ROTOR0_KM 0
+param set-default CA_ROTOR0_PX 0.5
+param set-default CA_ROTOR0_PY 0.3
+param set-default CA_ROTOR0_PZ 0.2
+param set-default CA_ROTOR1_AX 1
+param set-default CA_ROTOR1_AY 1
+param set-default CA_ROTOR1_AZ 0
+param set-default CA_ROTOR1_KM 0
+param set-default CA_ROTOR1_PX 0.5
+param set-default CA_ROTOR1_PY -0.3
+param set-default CA_ROTOR1_PZ 0.2
+param set-default CA_ROTOR2_AX 1
+param set-default CA_ROTOR2_AY 1
+param set-default CA_ROTOR2_AZ 0
+param set-default CA_ROTOR2_KM 0
+param set-default CA_ROTOR2_PX -0.5
+param set-default CA_ROTOR2_PY 0.3
+param set-default CA_ROTOR2_PZ 0.2
+param set-default CA_ROTOR3_AX 1
+param set-default CA_ROTOR3_AY -1
+param set-default CA_ROTOR3_AZ 0
+param set-default CA_ROTOR3_KM 0
+param set-default CA_ROTOR3_PX -0.5
+param set-default CA_ROTOR3_PY -0.3
+param set-default CA_ROTOR3_PZ 0.2
+param set-default CA_ROTOR4_AZ -1
+param set-default CA_ROTOR4_KM 0
+param set-default CA_ROTOR4_PX 0.5
+param set-default CA_ROTOR4_PY 0.5
+param set-default CA_ROTOR5_AZ 1
+param set-default CA_ROTOR5_KM 0
+param set-default CA_ROTOR5_PX 0.5
+param set-default CA_ROTOR5_PY -0.5
+param set-default CA_ROTOR6_AZ 1
+param set-default CA_ROTOR6_KM 0
+param set-default CA_ROTOR6_PX -0.5
+param set-default CA_ROTOR6_PY 0.5
+param set-default CA_ROTOR7_KM 0
+param set-default CA_ROTOR7_PX -0.5
+param set-default CA_ROTOR7_PY -0.5
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1030_gazebo-classic_plane b/ROMFS/px4fmu_common/init.d-posix/airframes/1030_gazebo-classic_plane
index 462cfe50100a..f203ee14cc48 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1030_gazebo-classic_plane
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1030_gazebo-classic_plane
@@ -54,9 +54,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1031_gazebo-classic_plane_cam b/ROMFS/px4fmu_common/init.d-posix/airframes/1031_gazebo-classic_plane_cam
index 743698450c56..3dc3c9ee1a54 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1031_gazebo-classic_plane_cam
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1031_gazebo-classic_plane_cam
@@ -57,9 +57,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1032_gazebo-classic_plane_catapult b/ROMFS/px4fmu_common/init.d-posix/airframes/1032_gazebo-classic_plane_catapult
index 9ce6cb61ddfd..f8fd54636649 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1032_gazebo-classic_plane_catapult
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1032_gazebo-classic_plane_catapult
@@ -57,9 +57,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1033_jsbsim_rascal b/ROMFS/px4fmu_common/init.d-posix/airframes/1033_jsbsim_rascal
index 89675aed623d..06a845be30a3 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1033_jsbsim_rascal
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1033_jsbsim_rascal
@@ -42,9 +42,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1034_flightgear_rascal-electric b/ROMFS/px4fmu_common/init.d-posix/airframes/1034_flightgear_rascal-electric
index e90fb1c65771..7cb6a3bf811e 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1034_flightgear_rascal-electric
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1034_flightgear_rascal-electric
@@ -42,9 +42,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1035_gazebo-classic_techpod b/ROMFS/px4fmu_common/init.d-posix/airframes/1035_gazebo-classic_techpod
index 2c2d18380677..a8b29db64c6b 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1035_gazebo-classic_techpod
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1035_gazebo-classic_techpod
@@ -40,9 +40,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1036_jsbsim_malolo b/ROMFS/px4fmu_common/init.d-posix/airframes/1036_jsbsim_malolo
index 89675aed623d..06a845be30a3 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1036_jsbsim_malolo
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1036_jsbsim_malolo
@@ -42,9 +42,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1037_gazebo-classic_believer b/ROMFS/px4fmu_common/init.d-posix/airframes/1037_gazebo-classic_believer
index fc329d376eb0..83f63cec3842 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1037_gazebo-classic_believer
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1037_gazebo-classic_believer
@@ -48,9 +48,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1038_gazebo-classic_glider b/ROMFS/px4fmu_common/init.d-posix/airframes/1038_gazebo-classic_glider
index 294c07b3efc9..d5b59f700792 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1038_gazebo-classic_glider
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1038_gazebo-classic_glider
@@ -55,9 +55,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1039_flightgear_rascal b/ROMFS/px4fmu_common/init.d-posix/airframes/1039_flightgear_rascal
index 490d15b9c7f6..836615e635a2 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1039_flightgear_rascal
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1039_flightgear_rascal
@@ -47,9 +47,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1039_gazebo-classic_advanced_plane b/ROMFS/px4fmu_common/init.d-posix/airframes/1039_gazebo-classic_advanced_plane
index a998b8783108..1fafd1d4880f 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1039_gazebo-classic_advanced_plane
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1039_gazebo-classic_advanced_plane
@@ -45,9 +45,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1040_gazebo-classic_standard_vtol b/ROMFS/px4fmu_common/init.d-posix/airframes/1040_gazebo-classic_standard_vtol
index 9ad99c1d83ba..0e25b5633037 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1040_gazebo-classic_standard_vtol
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1040_gazebo-classic_standard_vtol
@@ -27,8 +27,8 @@ param set-default CA_ROTOR2_KM -0.05
param set-default CA_ROTOR3_PX -0.1515
param set-default CA_ROTOR3_PY 0.1875
param set-default CA_ROTOR3_KM -0.05
-param set-default CA_ROTOR4_AX 1.0
-param set-default CA_ROTOR4_AZ 0.0
+param set-default CA_ROTOR4_AX 1
+param set-default CA_ROTOR4_AZ 0
param set-default CA_ROTOR4_PX 0.2
param set-default CA_SV_CS_COUNT 3
@@ -37,7 +37,7 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS1_TYPE 2
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1041_gazebo-classic_tailsitter b/ROMFS/px4fmu_common/init.d-posix/airframes/1041_gazebo-classic_tailsitter
index 1fe1fdde6e33..8a3d5d1a4965 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1041_gazebo-classic_tailsitter
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1041_gazebo-classic_tailsitter
@@ -50,11 +50,11 @@ param set-default SENS_IMU_MODE 1
param set-default FW_P_TC 0.6
-param set-default FW_PR_FF 0.1
+param set-default FW_PR_FF 0.0
param set-default FW_PSP_OFF 2
param set-default FW_RR_FF 0.1
param set-default FW_RR_I 0.2
-param set-default FW_RR_P 0.3
+param set-default FW_RR_P 0.5
param set-default FW_THR_TRIM 0.35
param set-default FW_THR_MAX 0.8
param set-default FW_THR_MIN 0.05
@@ -66,8 +66,6 @@ param set-default FW_T_SINK_MIN 1.6
param set-default MC_AIRMODE 1
param set-default MC_ROLL_P 3
param set-default MC_PITCH_P 3
-param set-default MC_ROLLRATE_P 0.3
-param set-default MC_PITCHRATE_P 0.3
param set-default VT_ARSP_TRANS 10
param set-default VT_B_TRANS_DUR 5
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1042_gazebo-classic_tiltrotor b/ROMFS/px4fmu_common/init.d-posix/airframes/1042_gazebo-classic_tiltrotor
index 9293cd3140b1..060399be7690 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1042_gazebo-classic_tiltrotor
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1042_gazebo-classic_tiltrotor
@@ -31,7 +31,7 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
param set-default CA_SV_CS_COUNT 3
param set-default CA_SV_TL_COUNT 2
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1043_gazebo-classic_standard_vtol_drop b/ROMFS/px4fmu_common/init.d-posix/airframes/1043_gazebo-classic_standard_vtol_drop
index f029918529f2..29f09dc47c9d 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1043_gazebo-classic_standard_vtol_drop
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1043_gazebo-classic_standard_vtol_drop
@@ -27,8 +27,8 @@ param set-default CA_ROTOR2_KM -0.05
param set-default CA_ROTOR3_PX -0.1515
param set-default CA_ROTOR3_PY 0.1875
param set-default CA_ROTOR3_KM -0.05
-param set-default CA_ROTOR4_AX 1.0
-param set-default CA_ROTOR4_AZ 0.0
+param set-default CA_ROTOR4_AX 1
+param set-default CA_ROTOR4_AZ 0
param set-default CA_ROTOR4_PX 0.2
param set-default CA_SV_CS_COUNT 3
@@ -37,7 +37,7 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS1_TYPE 2
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1044_gazebo-classic_plane_lidar b/ROMFS/px4fmu_common/init.d-posix/airframes/1044_gazebo-classic_plane_lidar
index a92e0cf2c806..22d7e21119ee 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1044_gazebo-classic_plane_lidar
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1044_gazebo-classic_plane_lidar
@@ -57,9 +57,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1060_gazebo-classic_rover b/ROMFS/px4fmu_common/init.d-posix/airframes/1060_gazebo-classic_rover
index d58f5aebaec1..ab8d12109205 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1060_gazebo-classic_rover
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1060_gazebo-classic_rover
@@ -22,7 +22,7 @@ param set-default NAV_ACC_RAD 0.5
param set-default NAV_LOITER_RAD 2
param set-default GND_MAX_ANG 0.6
-param set-default GND_WHEEL_BASE 2.0
+param set-default GND_WHEEL_BASE 2
param set-default CA_AIRFRAME 5
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1062_flightgear_tf-r1 b/ROMFS/px4fmu_common/init.d-posix/airframes/1062_flightgear_tf-r1
index 40c5cb8d04f9..f3a6cd1aded5 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1062_flightgear_tf-r1
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1062_flightgear_tf-r1
@@ -29,7 +29,7 @@ param set-default NAV_ACC_RAD 0.5
param set-default NAV_LOITER_RAD 2
param set-default GND_MAX_ANG 0.6
-param set-default GND_WHEEL_BASE 3.0
+param set-default GND_WHEEL_BASE 3
param set-default CA_AIRFRAME 5
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/1070_gazebo-classic_boat b/ROMFS/px4fmu_common/init.d-posix/airframes/1070_gazebo-classic_boat
index c173598078c8..01ada36f3510 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/1070_gazebo-classic_boat
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/1070_gazebo-classic_boat
@@ -22,7 +22,7 @@ param set-default NAV_ACC_RAD 0.5
param set-default NAV_LOITER_RAD 2
param set-default GND_MAX_ANG 0.6
-param set-default GND_WHEEL_BASE 2.0
+param set-default GND_WHEEL_BASE 2
param set-default CA_AIRFRAME 9
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/17001_flightgear_tf-g1 b/ROMFS/px4fmu_common/init.d-posix/airframes/17001_flightgear_tf-g1
index f733f9cf25f2..9c9b2c7f6312 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/17001_flightgear_tf-g1
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/17001_flightgear_tf-g1
@@ -14,7 +14,7 @@
param set-default FW_AIRSPD_STALL 8
-param set-default FW_P_RMAX_NEG 20.0
+param set-default FW_P_RMAX_NEG 20
param set-default FW_W_RMAX 10
param set-default FW_W_EN 1
@@ -37,7 +37,7 @@ param set-default FW_P_LIM_MAX 25
param set-default FW_P_LIM_MIN -5
param set-default FW_R_LIM 30
-param set-default FW_MAN_R_MAX 30.0
+param set-default FW_MAN_R_MAX 30
param set-default FW_THR_TRIM 0.8
param set-default FW_THR_IDLE 0
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/17002_flightgear_tf-g2 b/ROMFS/px4fmu_common/init.d-posix/airframes/17002_flightgear_tf-g2
index 5ed2fbf9667d..74b6d2a31679 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/17002_flightgear_tf-g2
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/17002_flightgear_tf-g2
@@ -14,7 +14,7 @@
param set-default FW_AIRSPD_STALL 5
-param set-default FW_P_RMAX_NEG 20.0
+param set-default FW_P_RMAX_NEG 20
param set-default FW_W_RMAX 10
param set-default FW_W_EN 1
@@ -29,9 +29,9 @@ param set-default NAV_LOITER_RAD 50
# Parameters related to autogyro takeoff PR
#param set-default AG_TKOFF 1
#param set-default AG_PROT_TYPE 1
-#param set-default AG_PROT_MIN_RPM 50.0
-#param set-default AG_PROT_TRG_RPM 900.0
-#param set-defoult AG_ROTOR_RPM 900.0
+#param set-default AG_PROT_MIN_RPM 50
+#param set-default AG_PROT_TRG_RPM 900
+#param set-defoult AG_ROTOR_RPM 900
param set-default FW_ARSP_SCALE_EN 0
@@ -42,7 +42,7 @@ param set-default FW_P_LIM_MAX 25
param set-default FW_P_LIM_MIN -5
param set-default FW_R_LIM 30
-param set-default FW_MAN_R_MAX 30.0
+param set-default FW_MAN_R_MAX 30
param set-default FW_THR_CRUISE 0.8
param set-default FW_THR_IDLE 0
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/2507_gazebo-classic_cloudship b/ROMFS/px4fmu_common/init.d-posix/airframes/2507_gazebo-classic_cloudship
index 01f7c2ac2b48..153247203da6 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/2507_gazebo-classic_cloudship
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/2507_gazebo-classic_cloudship
@@ -14,21 +14,21 @@
param set-default CA_AIRFRAME 9
param set-default CA_ROTOR_COUNT 3
-param set-default CA_ROTOR0_AX 1.0000
-param set-default CA_ROTOR0_AZ 0.0000
-param set-default CA_ROTOR0_KM 0.0000
-param set-default CA_ROTOR0_PY 2.0000
-param set-default CA_ROTOR1_AX 1.0000
-param set-default CA_ROTOR1_AZ 0.0000
-param set-default CA_ROTOR1_KM 0.0000
-param set-default CA_ROTOR1_PY -2.0000
-param set-default CA_ROTOR2_AY -1.0000
-param set-default CA_ROTOR2_AZ 0.0000
-param set-default CA_ROTOR2_KM 0.0000
-param set-default CA_ROTOR2_PX -10.0000
+param set-default CA_ROTOR0_AX 1
+param set-default CA_ROTOR0_AZ 0
+param set-default CA_ROTOR0_KM 0
+param set-default CA_ROTOR0_PY 2
+param set-default CA_ROTOR1_AX 1
+param set-default CA_ROTOR1_AZ 0
+param set-default CA_ROTOR1_KM 0
+param set-default CA_ROTOR1_PY -2
+param set-default CA_ROTOR2_AY -1
+param set-default CA_ROTOR2_AZ 0
+param set-default CA_ROTOR2_KM 0
+param set-default CA_ROTOR2_PX -10
param set-default CA_SV_CS_COUNT 1
-param set-default CA_SV_CS0_TRQ_P 1.0000
+param set-default CA_SV_CS0_TRQ_P 1
param set-default CA_R_REV 7
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/3011_jsbsim_hexarotor_x b/ROMFS/px4fmu_common/init.d-posix/airframes/3011_jsbsim_hexarotor_x
index b17de91d1b57..a3fd956dfd59 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/3011_jsbsim_hexarotor_x
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/3011_jsbsim_hexarotor_x
@@ -13,9 +13,9 @@ param set-default MAV_TYPE 13
param set-default MC_PITCHRATE_P 0.1
param set-default MC_PITCHRATE_I 0.05
-param set-default MC_PITCH_P 6.0
+param set-default MC_PITCH_P 6
param set-default MC_ROLLRATE_I 0.1
-param set-default MC_ROLL_P 6.0
+param set-default MC_ROLL_P 6
param set-default MPC_XY_VEL_I_ACC 4
param set-default MPC_XY_VEL_P_ACC 3
@@ -27,11 +27,11 @@ param set-default MNT_MODE_IN 4
param set-default MNT_DO_STAB 2
-param set-default CA_ROTOR0_PX 0.0
-param set-default CA_ROTOR0_PY 1.0
+param set-default CA_ROTOR0_PX 0
+param set-default CA_ROTOR0_PY 1
param set-default CA_ROTOR0_KM -0.05
-param set-default CA_ROTOR1_PX 0.0
-param set-default CA_ROTOR1_PY -1.0
+param set-default CA_ROTOR1_PX 0
+param set-default CA_ROTOR1_PY -1
param set-default CA_ROTOR1_KM 0.05
param set-default CA_ROTOR2_PX 0.866025
param set-default CA_ROTOR2_PY -0.5
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/4003_gz_rc_cessna b/ROMFS/px4fmu_common/init.d-posix/airframes/4003_gz_rc_cessna
index e87e013e5d77..d7ea1f3b37a4 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/4003_gz_rc_cessna
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/4003_gz_rc_cessna
@@ -70,9 +70,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/4004_gz_standard_vtol b/ROMFS/px4fmu_common/init.d-posix/airframes/4004_gz_standard_vtol
index 57fd1d68669d..3390ee525cc4 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/4004_gz_standard_vtol
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/4004_gz_standard_vtol
@@ -40,8 +40,8 @@ param set-default CA_ROTOR2_KM -0.05
param set-default CA_ROTOR3_PX -0.1515
param set-default CA_ROTOR3_PY 0.1875
param set-default CA_ROTOR3_KM -0.05
-param set-default CA_ROTOR4_AX 1.0
-param set-default CA_ROTOR4_AZ 0.0
+param set-default CA_ROTOR4_AX 1
+param set-default CA_ROTOR4_AZ 0
param set-default CA_ROTOR4_PX 0.2
param set-default SIM_GZ_EC_FUNC1 101
@@ -73,7 +73,7 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS1_TYPE 2
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default NPFG_PERIOD 12
param set-default FW_PR_FF 0.2
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/4006_gz_px4vision b/ROMFS/px4fmu_common/init.d-posix/airframes/4006_gz_px4vision
index 2b67f387f223..92560eb160df 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/4006_gz_px4vision
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/4006_gz_px4vision
@@ -105,31 +105,19 @@ param set-default CBRK_IO_SAFETY 22027
param set-default THR_MDL_FAC 0.3
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR0_KM 0.05
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR1_KM 0.05
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
-# Outputs
-# param set-default PWM_AUX_FUNC1 101
-# param set-default PWM_AUX_FUNC2 102
-# param set-default PWM_AUX_FUNC3 103
-# param set-default PWM_AUX_FUNC4 104
-
-# param set-default PWM_MAIN_FUNC1 101
-# param set-default PWM_MAIN_FUNC2 102
-# param set-default PWM_MAIN_FUNC3 103
-# param set-default PWM_MAIN_FUNC4 104
-
param set-default SIM_GZ_EC_FUNC1 101
param set-default SIM_GZ_EC_FUNC2 102
param set-default SIM_GZ_EC_FUNC3 103
@@ -144,5 +132,3 @@ param set-default SIM_GZ_EC_MAX1 1100
param set-default SIM_GZ_EC_MAX2 1100
param set-default SIM_GZ_EC_MAX3 1100
param set-default SIM_GZ_EC_MAX4 1100
-
-
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/4008_gz_advanced_plane b/ROMFS/px4fmu_common/init.d-posix/airframes/4008_gz_advanced_plane
index 37a407383fce..2a49b085416f 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/4008_gz_advanced_plane
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/4008_gz_advanced_plane
@@ -63,9 +63,9 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_CS4_TYPE 9
param set-default CA_SV_CS5_TYPE 10
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/4011_gz_lawnmower b/ROMFS/px4fmu_common/init.d-posix/airframes/4011_gz_lawnmower
new file mode 100644
index 000000000000..1dcb917a09ad
--- /dev/null
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/4011_gz_lawnmower
@@ -0,0 +1,80 @@
+#!/bin/sh
+# @name Gazebo lawnmower
+# @type Rover
+# @class Rover
+
+. ${R}etc/init.d/rc.rover_differential_defaults
+
+PX4_SIMULATOR=${PX4_SIMULATOR:=gz}
+PX4_GZ_WORLD=${PX4_GZ_WORLD:=default}
+PX4_SIM_MODEL=${PX4_SIM_MODEL:=lawnmower}
+
+param set-default SIM_GZ_EN 1 # Gazebo bridge
+
+# Simulated sensors
+param set-default SENS_EN_GPSSIM 1
+param set-default SENS_EN_BAROSIM 0
+param set-default SENS_EN_MAGSIM 1
+param set-default SENS_EN_ARSPDSIM 1
+# We can arm and drive in manual mode when it slides and GPS check fails:
+param set-default COM_ARM_WO_GPS 1
+
+# Set Differential Drive Kinematics Library parameters:
+param set RDD_WHEEL_BASE 0.9
+param set RDD_WHEEL_RADIUS 0.22
+param set RDD_WHEEL_SPEED 10.0 # Maximum wheel speed rad/s, approx 8 km/h
+
+# Actuator mapping - set SITL motors/servos output parameters:
+
+# "Motors" - motor channels 0 (Right) and 1 (Left) - via Wheels GZ bridge:
+param set-default SIM_GZ_WH_FUNC1 101 # right wheel
+#param set-default SIM_GZ_WH_MIN1 0
+#param set-default SIM_GZ_WH_MAX1 200
+#param set-default SIM_GZ_WH_DIS1 100
+#param set-default SIM_GZ_WH_FAIL1 100
+
+param set-default SIM_GZ_WH_FUNC2 102 # left wheel
+#param set-default SIM_GZ_WH_MIN2 0
+#param set-default SIM_GZ_WH_MAX2 200
+#aram set-default SIM_GZ_WH_DIS2 100
+#param set-default SIM_GZ_WH_FAIL2 100
+
+param set-default SIM_GZ_WH_REV 0 # no need to reverse any wheels
+
+# Note: The servo configurations ( SIM_GZ_SV_FUNC*) outlined below are intended for educational purposes in this simulation.
+# They do not have physical effects in the simulated environment, except for actuating the joints. Their definitions are meant to demonstrate
+# how actuators could be mapped and configured in a real-world application, providing a foundation for understanding and implementing actuator
+# controls in practical scenarios.
+
+# Cutter deck blades clutch, PCA9685 servo channel 3, "RC FLAPS" (406) - leftmost switch, or "Servo 3" (203):
+param set-default SIM_GZ_SV_FUNC3 203
+param set-default SIM_GZ_SV_MIN3 0
+param set-default SIM_GZ_SV_MAX3 1000
+param set-default SIM_GZ_SV_DIS3 500
+param set-default SIM_GZ_SV_FAIL3 500
+
+# Gas engine throttle, PCA9685 servo channel 4, "RC AUX1" (407) - left knob, or "Servo 4" (204):
+# - on minimum when disarmed or failed:
+param set-default SIM_GZ_SV_FUNC4 204
+param set-default SIM_GZ_SV_MIN4 0
+param set-default SIM_GZ_SV_MAX4 1000
+param set-default SIM_GZ_SV_DIS4 500
+param set-default SIM_GZ_SV_FAIL4 500
+
+# Controlling PCA9685 servos 5,6,7,8 directly via "Servo 5..8" setting, by publishing actuator_servos.control[]:
+
+# Strobes, PCA9685 servo channel 5, "Servo 5" (205) - flashing indicates Mission mode:
+#param set-default SIM_GZ_SV_FUNC5 205
+#param set-default SIM_GZ_SV_MIN5 1000
+#param set-default SIM_GZ_SV_MAX5 2000
+#param set-default SIM_GZ_SV_DIS5 1000
+#param set-default SIM_GZ_SV_FAIL5 1000
+
+# Horn, PCA9685 servo channel 6, "Servo 6" (206) - for alarms like GPS failure:
+#param set-default SIM_GZ_SV_FUNC6 206
+
+# Spare PCA9685 servo channel 7 on "RC AUX2" (408) - right knob, or "Servo 7" (207):
+#param set-default SIM_GZ_SV_FUNC7 207
+
+# Spare PCA9685 servo channel 8 - "Servo 8" (208):
+#param set-default SIM_GZ_SV_FUNC8 208
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/6011_gazebo-classic_typhoon_h480 b/ROMFS/px4fmu_common/init.d-posix/airframes/6011_gazebo-classic_typhoon_h480
index 05ae1af81a5a..0174411c73a6 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/6011_gazebo-classic_typhoon_h480
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/6011_gazebo-classic_typhoon_h480
@@ -9,14 +9,14 @@
param set-default MAV_TYPE 13
-param set-default MC_PITCHRATE_P 0.0800
-param set-default MC_PITCHRATE_I 0.0400
-param set-default MC_PITCHRATE_D 0.0010
-param set-default MC_PITCH_P 9.0
-param set-default MC_ROLLRATE_P 0.0800
-param set-default MC_ROLLRATE_I 0.0400
-param set-default MC_ROLLRATE_D 0.0010
-param set-default MC_ROLL_P 9.0
+param set-default MC_PITCHRATE_P 0.08
+param set-default MC_PITCHRATE_I 0.04
+param set-default MC_PITCHRATE_D 0.001
+param set-default MC_PITCH_P 9
+param set-default MC_ROLLRATE_P 0.08
+param set-default MC_ROLLRATE_I 0.04
+param set-default MC_ROLLRATE_D 0.001
+param set-default MC_ROLL_P 9
param set-default MPC_XY_VEL_I_ACC 4
param set-default MPC_XY_VEL_P_ACC 3
@@ -31,11 +31,11 @@ param set-default MAV_PROTO_VER 2
param set-default CA_AIRFRAME 0
param set-default CA_ROTOR_COUNT 6
-param set-default CA_ROTOR0_PX 0.0
-param set-default CA_ROTOR0_PY 1.0
+param set-default CA_ROTOR0_PX 0
+param set-default CA_ROTOR0_PY 1
param set-default CA_ROTOR0_KM -0.05
-param set-default CA_ROTOR1_PX 0.0
-param set-default CA_ROTOR1_PY -1.0
+param set-default CA_ROTOR1_PX 0
+param set-default CA_ROTOR1_PY -1
param set-default CA_ROTOR1_KM 0.05
param set-default CA_ROTOR2_PX 0.866025
param set-default CA_ROTOR2_PY -0.5
diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt b/ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt
index ed460d992993..9277ad303947 100644
--- a/ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt
+++ b/ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt
@@ -82,6 +82,7 @@ px4_add_romfs_files(
4008_gz_advanced_plane
4009_gz_r1_rover
4010_gz_x500_mono_cam
+ 4011_gz_lawnmower
6011_gazebo-classic_typhoon_h480
6011_gazebo-classic_typhoon_h480.post
diff --git a/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator b/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator
index d8ea0f3b95a8..8121f3914c2a 100644
--- a/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator
+++ b/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator
@@ -41,19 +41,6 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" = "1" ]; then
echo "INFO [init] Gazebo simulator"
- # set local coordinate frame reference
- if [ -n "${PX4_HOME_LAT}" ]; then
- param set SIM_GZ_HOME_LAT ${PX4_HOME_LAT}
- fi
-
- if [ -n "${PX4_HOME_LON}" ]; then
- param set SIM_GZ_HOME_LON ${PX4_HOME_LON}
- fi
-
- if [ -n "${PX4_HOME_ALT}" ]; then
- param set SIM_GZ_HOME_ALT ${PX4_HOME_ALT}
- fi
-
# Only start up Gazebo if PX4_GZ_STANDALONE is not set.
if [ -z "${PX4_GZ_STANDALONE}" ]; then
@@ -64,6 +51,13 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" = "1" ]; then
# "gz sim" from Garden on
gz_command="gz"
gz_sub_command="sim"
+
+ # Specify render engine if `GZ_SIM_RENDER_ENGINE` is set
+ # (for example, if you want to use Ogre 1.x instead of Ogre 2.x):
+ if [ -n "${PX4_GZ_SIM_RENDER_ENGINE}" ]; then
+ echo "INFO [init] Setting Gazebo render engine to '${PX4_GZ_SIM_RENDER_ENGINE}'!"
+ gz_sub_command="${gz_sub_command} --render-engine ${PX4_GZ_SIM_RENDER_ENGINE}"
+ fi
else
echo "ERROR [init] Gazebo gz please install gz-garden"
exit 1
@@ -173,6 +167,12 @@ elif [ "$PX4_SIM_MODEL" = "jmavsim_iris" ] || [ "$(param show -q SYS_AUTOSTART)"
else
# otherwise start simulator (mavlink) module
+
+ # EKF2 specifics
+ param set-default EKF2_GPS_DELAY 10
+ param set-default EKF2_MULTI_IMU 3
+ param set-default SENS_IMU_MODE 0
+
simulator_tcp_port=$((4560+px4_instance))
# Check if PX4_SIM_HOSTNAME environment variable is empty
diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS
index dbd837d40b04..0084a6701e6d 100644
--- a/ROMFS/px4fmu_common/init.d-posix/rcS
+++ b/ROMFS/px4fmu_common/init.d-posix/rcS
@@ -164,10 +164,6 @@ param set-default COM_RC_IN_MODE 1
# Speedup SITL startup
param set-default EKF2_REQ_GPS_H 0.5
-# Multi-EKF
-param set-default EKF2_MULTI_IMU 3
-param set-default SENS_IMU_MODE 0
-
param set-default IMU_GYRO_FFT_EN 1
param set-default MAV_PROTO_VER 2 # Ensures QGC does not drop the first few packets after a SITL restart due to MAVLINK 1 packets
@@ -248,7 +244,12 @@ then
fi
load_mon start
-battery_simulator start
+
+if param compare SIM_BAT_ENABLE 1
+then
+ battery_simulator start
+fi
+
tone_alarm start
rc_update start
manual_control start
diff --git a/ROMFS/px4fmu_common/init.d/CMakeLists.txt b/ROMFS/px4fmu_common/init.d/CMakeLists.txt
index 4b45187ff5b7..34b255e2555f 100644
--- a/ROMFS/px4fmu_common/init.d/CMakeLists.txt
+++ b/ROMFS/px4fmu_common/init.d/CMakeLists.txt
@@ -34,28 +34,79 @@
add_subdirectory(airframes)
px4_add_romfs_files(
- rc.airship_apps
- rc.airship_defaults
+
rc.autostart_ext
- rc.balloon_apps
- rc.balloon_defaults
- rc.boat_defaults
- rc.fw_apps
- rc.fw_defaults
- rc.heli_defaults
- rc.logging
- rc.mc_apps
- rc.mc_defaults
+
rcS
rc.sensors
- rc.thermal_cal
- rc.rover_apps
- rc.rover_defaults
- rc.rover_differential_apps
- rc.rover_differential_defaults
- rc.uuv_apps
- rc.uuv_defaults
rc.vehicle_setup
- rc.vtol_apps
- rc.vtol_defaults
+
+ # TODO
+ rc.balloon_apps
+ rc.balloon_defaults
)
+
+if(CONFIG_MODULES_AIRSHIP_ATT_CONTROL)
+ px4_add_romfs_files(
+ rc.airship_apps
+ rc.airship_defaults
+ )
+endif()
+
+if(CONFIG_MODULES_FW_RATE_CONTROL)
+ px4_add_romfs_files(
+ rc.fw_apps
+ rc.fw_defaults
+ )
+endif()
+
+if(CONFIG_MODULES_MC_RATE_CONTROL)
+ px4_add_romfs_files(
+ rc.heli_defaults
+ rc.mc_apps
+ rc.mc_defaults
+ )
+endif()
+
+if(CONFIG_MODULES_ROVER_POS_CONTROL)
+ px4_add_romfs_files(
+ rc.rover_apps
+ rc.rover_defaults
+
+ rc.boat_defaults # hack
+ )
+endif()
+
+if(CONFIG_MODULES_DIFFERENTIAL_DRIVE)
+ px4_add_romfs_files(
+ rc.rover_differential_apps
+ rc.rover_differential_defaults
+ )
+endif()
+
+if(CONFIG_MODULES_UUV_ATT_CONTROL)
+ px4_add_romfs_files(
+ rc.uuv_apps
+ rc.uuv_defaults
+ )
+endif()
+
+if(CONFIG_MODULES_VTOL_ATT_CONTROL)
+ px4_add_romfs_files(
+ rc.vtol_apps
+ rc.vtol_defaults
+ )
+endif()
+
+
+if(CONFIG_MODULES_LOGGER)
+ px4_add_romfs_files(
+ rc.logging
+ )
+endif()
+
+if(CONFIG_MODULES_TEMPERATURE_COMPENSATION)
+ px4_add_romfs_files(
+ rc.thermal_cal
+ )
+endif()
diff --git a/ROMFS/px4fmu_common/init.d/airframes/1001_rc_quad_x.hil b/ROMFS/px4fmu_common/init.d/airframes/1001_rc_quad_x.hil
index 9cbf0286603b..1b04f904c9be 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/1001_rc_quad_x.hil
+++ b/ROMFS/px4fmu_common/init.d/airframes/1001_rc_quad_x.hil
@@ -11,30 +11,30 @@
. ${R}etc/init.d/rc.mc_defaults
-
param set SYS_HITL 1
param set UAVCAN_ENABLE 0
+# disable some checks to allow to fly
+# - without real battery
+param set-default CBRK_SUPPLY_CHK 894281
+# - without safety switch
+param set-default CBRK_IO_SAFETY 22027
+
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
param set-default HIL_ACT_FUNC1 101
param set-default HIL_ACT_FUNC2 102
param set-default HIL_ACT_FUNC3 103
param set-default HIL_ACT_FUNC4 104
-
-# disable some checks to allow to fly
-# - without real battery
-param set-default CBRK_SUPPLY_CHK 894281
-# - without safety switch
-param set-default CBRK_IO_SAFETY 22027
diff --git a/ROMFS/px4fmu_common/init.d/airframes/1002_standard_vtol.hil b/ROMFS/px4fmu_common/init.d/airframes/1002_standard_vtol.hil
index 60a01fb403e6..461120e57203 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/1002_standard_vtol.hil
+++ b/ROMFS/px4fmu_common/init.d/airframes/1002_standard_vtol.hil
@@ -14,7 +14,6 @@
. ${R}etc/init.d/rc.vtol_defaults
-
param set-default BAT1_N_CELLS 3
param set-default COM_RC_IN_MODE 1
@@ -55,26 +54,29 @@ param set-default VT_TYPE 2
param set-default CA_AIRFRAME 2
param set-default CA_ROTOR_COUNT 5
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR4_AX 1
+param set-default CA_ROTOR4_AZ 0
+param set-default CA_ROTOR4_PX 0.2
+
+# Square quadrotor X PX4 numbering
+param set-default CA_ROTOR_COUNT 4
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
-param set-default CA_ROTOR4_AX 1.0
-param set-default CA_ROTOR4_AZ 0.0
-param set-default CA_ROTOR4_PX 0.2
param set-default CA_SV_CS_COUNT 3
param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
param set-default HIL_ACT_FUNC1 101
@@ -98,5 +100,3 @@ param set-default CBRK_SUPPLY_CHK 894281
param set-default CBRK_IO_SAFETY 22027
param set-default MAV_TYPE 22
-
-
diff --git a/ROMFS/px4fmu_common/init.d/airframes/1100_rc_quad_x_sih.hil b/ROMFS/px4fmu_common/init.d/airframes/1100_rc_quad_x_sih.hil
index b1b42bd3e35a..2aab1ebe47f6 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/1100_rc_quad_x_sih.hil
+++ b/ROMFS/px4fmu_common/init.d/airframes/1100_rc_quad_x_sih.hil
@@ -12,26 +12,8 @@
. ${R}etc/init.d/rc.mc_defaults
-
param set UAVCAN_ENABLE 0
-param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
-param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
-param set-default CA_ROTOR3_KM -0.05
-
-param set-default HIL_ACT_FUNC1 101
-param set-default HIL_ACT_FUNC2 102
-param set-default HIL_ACT_FUNC3 103
-param set-default HIL_ACT_FUNC4 104
-
# set SYS_HITL to 2 to start the SIH and avoid sensors startup
param set SYS_HITL 2
@@ -42,3 +24,21 @@ param set-default CBRK_SUPPLY_CHK 894281
param set-default CBRK_IO_SAFETY 22027
param set SIH_VEHICLE_TYPE 0
+
+# Square quadrotor X PX4 numbering
+param set-default CA_ROTOR_COUNT 4
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
+param set-default CA_ROTOR2_KM -0.05
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
+param set-default CA_ROTOR3_KM -0.05
+
+param set-default HIL_ACT_FUNC1 101
+param set-default HIL_ACT_FUNC2 102
+param set-default HIL_ACT_FUNC3 103
+param set-default HIL_ACT_FUNC4 104
diff --git a/ROMFS/px4fmu_common/init.d/airframes/1101_rc_plane_sih.hil b/ROMFS/px4fmu_common/init.d/airframes/1101_rc_plane_sih.hil
index 0ec506b68f95..07c7d925c238 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/1101_rc_plane_sih.hil
+++ b/ROMFS/px4fmu_common/init.d/airframes/1101_rc_plane_sih.hil
@@ -21,9 +21,9 @@ param set-default CA_ROTOR0_PX 0.3
param set-default CA_SV_CS_COUNT 4
param set-default CA_SV_CS0_TRQ_R 0.5
param set-default CA_SV_CS0_TYPE 2
-param set-default CA_SV_CS1_TRQ_P 1.0
+param set-default CA_SV_CS1_TRQ_P 1
param set-default CA_SV_CS1_TYPE 3
-param set-default CA_SV_CS2_TRQ_Y 1.0
+param set-default CA_SV_CS2_TRQ_Y 1
param set-default CA_SV_CS2_TYPE 4
param set-default CA_SV_CS3_TYPE 10
@@ -46,7 +46,7 @@ param set-default CBRK_IO_SAFETY 22027
param set-default BAT_N_CELLS 3
-param set SIH_T_MAX 6.0
+param set SIH_T_MAX 6
param set SIH_MASS 0.3
param set SIH_IXX 0.00402
param set SIH_IYY 0.0144
diff --git a/ROMFS/px4fmu_common/init.d/airframes/1102_tailsitter_duo_sih.hil b/ROMFS/px4fmu_common/init.d/airframes/1102_tailsitter_duo_sih.hil
index d47d11545be5..6ac7bea691c4 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/1102_tailsitter_duo_sih.hil
+++ b/ROMFS/px4fmu_common/init.d/airframes/1102_tailsitter_duo_sih.hil
@@ -71,7 +71,7 @@ param set SIH_MASS 0.2
param set SIH_IXX 0.00354
param set SIH_IYY 0.000625
param set SIH_IZZ 0.00300
-param set SIH_IXZ 0.0
+param set SIH_IXZ 0
param set SIH_KDV 0.2
param set SIH_L_ROLL 0.145
diff --git a/ROMFS/px4fmu_common/init.d/airframes/13000_generic_vtol_standard b/ROMFS/px4fmu_common/init.d/airframes/13000_generic_vtol_standard
index 38dc721bc785..d360b3835e57 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/13000_generic_vtol_standard
+++ b/ROMFS/px4fmu_common/init.d/airframes/13000_generic_vtol_standard
@@ -14,6 +14,21 @@
param set-default CA_AIRFRAME 2
param set-default CA_ROTOR_COUNT 5
+param set-default CA_ROTOR4_AX 1
+param set-default CA_ROTOR4_AZ 0
+param set-default CA_SV_CS_COUNT 4
+param set-default CA_SV_CS0_TYPE 1
+param set-default CA_SV_CS0_TRQ_R -0.5
+param set-default CA_SV_CS1_TYPE 2
+param set-default CA_SV_CS1_TRQ_R 0.5
+param set-default CA_SV_CS2_TYPE 3
+param set-default CA_SV_CS2_TRQ_P 1
+param set-default CA_SV_CS3_TRQ_Y 1
+param set-default CA_SV_CS3_TYPE 4
+param set-default VT_TYPE 2
+param set-default MAV_TYPE 22
+
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR0_PX 1
param set-default CA_ROTOR0_PY 1
param set-default CA_ROTOR1_PX -1
@@ -24,16 +39,3 @@ param set-default CA_ROTOR2_KM -0.05
param set-default CA_ROTOR3_PX -1
param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
-param set-default CA_ROTOR4_AX 1.0
-param set-default CA_ROTOR4_AZ 0.0
-param set-default CA_SV_CS_COUNT 4
-param set-default CA_SV_CS0_TYPE 1
-param set-default CA_SV_CS0_TRQ_R -0.5
-param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS1_TRQ_R 0.5
-param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS2_TRQ_P 1.0
-param set-default CA_SV_CS3_TRQ_Y 1.0
-param set-default CA_SV_CS3_TYPE 4
-param set-default VT_TYPE 2
-param set-default MAV_TYPE 22
diff --git a/ROMFS/px4fmu_common/init.d/airframes/13013_deltaquad b/ROMFS/px4fmu_common/init.d/airframes/13013_deltaquad
index a6d97aedc1e4..0b2ea2596637 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/13013_deltaquad
+++ b/ROMFS/px4fmu_common/init.d/airframes/13013_deltaquad
@@ -120,8 +120,8 @@ param set-default CA_ROTOR2_KM -0.05
param set-default CA_ROTOR3_PX -0.1515
param set-default CA_ROTOR3_PY 0.1875
param set-default CA_ROTOR3_KM -0.05
-param set-default CA_ROTOR4_AX 1.0
-param set-default CA_ROTOR4_AZ 0.0
+param set-default CA_ROTOR4_AX 1
+param set-default CA_ROTOR4_AZ 0
param set-default CA_ROTOR4_PX 0.2
param set-default CA_SV_CS_COUNT 3
@@ -130,4 +130,4 @@ param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS1_TYPE 2
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
diff --git a/ROMFS/px4fmu_common/init.d/airframes/13014_vtol_babyshark b/ROMFS/px4fmu_common/init.d/airframes/13014_vtol_babyshark
index ac5931075862..cc8db21732a1 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/13014_vtol_babyshark
+++ b/ROMFS/px4fmu_common/init.d/airframes/13014_vtol_babyshark
@@ -80,6 +80,10 @@ param set-default VT_TYPE 2
param set-default CA_AIRFRAME 2
param set-default CA_ROTOR_COUNT 5
+param set-default CA_ROTOR4_AX 1
+param set-default CA_ROTOR4_AZ 0
+
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR0_PX 1
param set-default CA_ROTOR0_PY 1
param set-default CA_ROTOR1_PX -1
@@ -90,18 +94,16 @@ param set-default CA_ROTOR2_KM -0.05
param set-default CA_ROTOR3_PX -1
param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
-param set-default CA_ROTOR4_AX 1.0
-param set-default CA_ROTOR4_AZ 0.0
param set-default CA_SV_CS_COUNT 3
param set-default CA_SV_CS0_TYPE 15
-param set-default CA_SV_CS0_TRQ_R 1.0
-param set-default CA_SV_CS1_TRQ_P 0.5000
-param set-default CA_SV_CS1_TRQ_R 0.0000
-param set-default CA_SV_CS1_TRQ_Y -0.5000
+param set-default CA_SV_CS0_TRQ_R 1
+param set-default CA_SV_CS1_TRQ_P 0.5
+param set-default CA_SV_CS1_TRQ_R 0
+param set-default CA_SV_CS1_TRQ_Y -0.5
param set-default CA_SV_CS1_TYPE 13
-param set-default CA_SV_CS2_TRQ_P 0.5000
-param set-default CA_SV_CS2_TRQ_Y 0.5000
+param set-default CA_SV_CS2_TRQ_P 0.5
+param set-default CA_SV_CS2_TRQ_Y 0.5
param set-default CA_SV_CS2_TYPE 14
param set-default PWM_MAIN_FUNC1 201
diff --git a/ROMFS/px4fmu_common/init.d/airframes/13030_generic_vtol_quad_tiltrotor b/ROMFS/px4fmu_common/init.d/airframes/13030_generic_vtol_quad_tiltrotor
index 7c0c1af8a51f..783b6463919c 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/13030_generic_vtol_quad_tiltrotor
+++ b/ROMFS/px4fmu_common/init.d/airframes/13030_generic_vtol_quad_tiltrotor
@@ -19,30 +19,30 @@ param set-default MAV_TYPE 21
param set-default VT_TYPE 1
param set-default CA_AIRFRAME 3
-param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
param set-default CA_ROTOR0_TILT 1
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
param set-default CA_ROTOR1_TILT 2
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
-param set-default CA_ROTOR2_KM -0.05
param set-default CA_ROTOR2_TILT 3
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
-param set-default CA_ROTOR3_KM -0.05
param set-default CA_ROTOR3_TILT 4
param set-default CA_SV_CS_COUNT 4
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
param set-default CA_SV_TL_COUNT 4
-
+# Square quadrotor X PX4 numbering
+param set-default CA_ROTOR_COUNT 4
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
+param set-default CA_ROTOR2_KM -0.05
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
+param set-default CA_ROTOR3_KM -0.05
diff --git a/ROMFS/px4fmu_common/init.d/airframes/13100_generic_vtol_tiltrotor b/ROMFS/px4fmu_common/init.d/airframes/13100_generic_vtol_tiltrotor
index 19f9a95eb9e0..be1d47979dfc 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/13100_generic_vtol_tiltrotor
+++ b/ROMFS/px4fmu_common/init.d/airframes/13100_generic_vtol_tiltrotor
@@ -12,19 +12,22 @@
. ${R}etc/init.d/rc.vtol_defaults
param set-default CA_AIRFRAME 3
+param set-default CA_ROTOR0_TILT 2
+param set-default CA_ROTOR2_TILT 1
+
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
param set-default CA_ROTOR0_PX 1
param set-default CA_ROTOR0_PY 1
-param set-default CA_ROTOR0_TILT 2
param set-default CA_ROTOR1_PX -1
param set-default CA_ROTOR1_PY -1
param set-default CA_ROTOR2_PX 1
param set-default CA_ROTOR2_PY -1
-param set-default CA_ROTOR2_TILT 1
param set-default CA_ROTOR2_KM -0.05
param set-default CA_ROTOR3_PX -1
param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
+
param set-default CA_SV_CS_COUNT 4
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS0_TRQ_R -0.5
diff --git a/ROMFS/px4fmu_common/init.d/airframes/14001_generic_mc_with_tilt b/ROMFS/px4fmu_common/init.d/airframes/14001_generic_mc_with_tilt
index e675cafe1b95..3eb558c46e78 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/14001_generic_mc_with_tilt
+++ b/ROMFS/px4fmu_common/init.d/airframes/14001_generic_mc_with_tilt
@@ -20,16 +20,16 @@ param set-default MAV_TYPE 15
param set-default CA_AIRFRAME 8
# Tricopter
-param set-default CA_ROTOR0_PX 0.2500
-param set-default CA_ROTOR0_PY 0.4330
-param set-default CA_ROTOR1_PX 0.2500
-param set-default CA_ROTOR1_PY -0.4300
-param set-default CA_ROTOR2_PX -0.5000
-param set-default CA_ROTOR2_PY 0.0000
+param set-default CA_ROTOR0_PX 0.25
+param set-default CA_ROTOR0_PY 0.433
+param set-default CA_ROTOR1_PX 0.25
+param set-default CA_ROTOR1_PY -0.43
+param set-default CA_ROTOR2_PX -0.5
+param set-default CA_ROTOR2_PY 0
param set-default CA_ROTOR2_TILT 1
param set-default CA_ROTOR_COUNT 3
-param set-default CA_SV_TL0_MAXA 45.0000
-param set-default CA_SV_TL0_MINA -45.0000
+param set-default CA_SV_TL0_MAXA 45
+param set-default CA_SV_TL0_MINA -45
param set-default CA_SV_TL0_TD 90
param set-default CA_SV_TL_COUNT 1
diff --git a/ROMFS/px4fmu_common/init.d/airframes/2100_standard_plane b/ROMFS/px4fmu_common/init.d/airframes/2100_standard_plane
index cd454eafed46..d872654722a3 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/2100_standard_plane
+++ b/ROMFS/px4fmu_common/init.d/airframes/2100_standard_plane
@@ -18,7 +18,7 @@ param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2
-param set-default CA_SV_CS2_TRQ_P 1.0
+param set-default CA_SV_CS2_TRQ_P 1
param set-default CA_SV_CS2_TYPE 3
-param set-default CA_SV_CS3_TRQ_Y 1.0
+param set-default CA_SV_CS3_TRQ_Y 1
param set-default CA_SV_CS3_TYPE 4
diff --git a/ROMFS/px4fmu_common/init.d/airframes/2106_albatross b/ROMFS/px4fmu_common/init.d/airframes/2106_albatross
index 3b51c32f61be..feac59e94ef5 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/2106_albatross
+++ b/ROMFS/px4fmu_common/init.d/airframes/2106_albatross
@@ -35,17 +35,17 @@ param set-default FW_W_RMAX 0
param set-default CA_AIRFRAME 1
param set-default CA_ROTOR_COUNT 1
param set-default CA_SV_CS_COUNT 7
-param set-default CA_SV_CS0_TRQ_R -0.5000
+param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS0_TYPE 1 #left aileron
-param set-default CA_SV_CS1_TRQ_R 0.5000
+param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS1_TYPE 2 #right aileron
-param set-default CA_SV_CS2_TRQ_P 0.5000
-param set-default CA_SV_CS2_TRQ_Y -0.5000
+param set-default CA_SV_CS2_TRQ_P 0.5
+param set-default CA_SV_CS2_TRQ_Y -0.5
param set-default CA_SV_CS2_TYPE 13 #left A-tail
-param set-default CA_SV_CS3_TRQ_P 0.5000
-param set-default CA_SV_CS3_TRQ_Y 0.5000
+param set-default CA_SV_CS3_TRQ_P 0.5
+param set-default CA_SV_CS3_TRQ_Y 0.5
param set-default CA_SV_CS3_TYPE 14 #right A-tail
-param set-default CA_SV_CS4_TRQ_Y 1.0000
+param set-default CA_SV_CS4_TRQ_Y 1
param set-default CA_SV_CS4_TYPE 12
param set-default CA_SV_CS5_TYPE 9 #left flap
param set-default CA_SV_CS6_TYPE 10 #right flap
diff --git a/ROMFS/px4fmu_common/init.d/airframes/2507_cloudship b/ROMFS/px4fmu_common/init.d/airframes/2507_cloudship
index a458d830ea65..65ecfe25eb0a 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/2507_cloudship
+++ b/ROMFS/px4fmu_common/init.d/airframes/2507_cloudship
@@ -21,21 +21,21 @@ param set-default CBRK_IO_SAFETY 22027
param set-default CA_AIRFRAME 9
param set-default CA_ROTOR_COUNT 3
-param set-default CA_ROTOR0_AX 1.0000
-param set-default CA_ROTOR0_AZ 0.0000
-param set-default CA_ROTOR0_KM 0.0000
-param set-default CA_ROTOR0_PY 2.0000
-param set-default CA_ROTOR1_AX 1.0000
-param set-default CA_ROTOR1_AZ 0.0000
-param set-default CA_ROTOR1_KM 0.0000
-param set-default CA_ROTOR1_PY -2.0000
-param set-default CA_ROTOR2_AY -1.0000
-param set-default CA_ROTOR2_AZ 0.0000
-param set-default CA_ROTOR2_KM 0.0000
-param set-default CA_ROTOR2_PX -10.0000
+param set-default CA_ROTOR0_AX 1
+param set-default CA_ROTOR0_AZ 0
+param set-default CA_ROTOR0_KM 0
+param set-default CA_ROTOR0_PY 2
+param set-default CA_ROTOR1_AX 1
+param set-default CA_ROTOR1_AZ 0
+param set-default CA_ROTOR1_KM 0
+param set-default CA_ROTOR1_PY -2
+param set-default CA_ROTOR2_AY -1
+param set-default CA_ROTOR2_AZ 0
+param set-default CA_ROTOR2_KM 0
+param set-default CA_ROTOR2_PX -10
param set-default CA_SV_CS_COUNT 1
-param set-default CA_SV_CS0_TRQ_P 1.0000
+param set-default CA_SV_CS0_TRQ_P 1
param set-default CA_R_REV 7
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4001_quad_x b/ROMFS/px4fmu_common/init.d/airframes/4001_quad_x
index c3df7a9c58a3..47c11b7ccecf 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4001_quad_x
+++ b/ROMFS/px4fmu_common/init.d/airframes/4001_quad_x
@@ -10,15 +10,15 @@
. ${R}etc/init.d/rc.mc_defaults
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
-
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4014_s500 b/ROMFS/px4fmu_common/init.d/airframes/4014_s500
index 309e949adb9c..41fc2b7f93a6 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4014_s500
+++ b/ROMFS/px4fmu_common/init.d/airframes/4014_s500
@@ -18,14 +18,15 @@ param set-default MC_PITCHRATE_P 0.18
param set-default MC_ROLLRATE_I 0.15
param set-default MC_PITCHRATE_I 0.15
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4015_holybro_s500 b/ROMFS/px4fmu_common/init.d/airframes/4015_holybro_s500
index 37cf5bb6f990..e78cbf44243c 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4015_holybro_s500
+++ b/ROMFS/px4fmu_common/init.d/airframes/4015_holybro_s500
@@ -22,14 +22,15 @@ param set-default MC_PITCHRATE_I 0.3
param set-default MC_ROLLRATE_D 0.004
param set-default MC_PITCHRATE_D 0.004
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4016_holybro_px4vision b/ROMFS/px4fmu_common/init.d/airframes/4016_holybro_px4vision
index d56fcfb939db..77e51bf08e35 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4016_holybro_px4vision
+++ b/ROMFS/px4fmu_common/init.d/airframes/4016_holybro_px4vision
@@ -97,18 +97,17 @@ param set-default CBRK_IO_SAFETY 22027
param set-default THR_MDL_FAC 0.3
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR0_KM 0.05
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR1_KM 0.05
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
# Outputs
@@ -116,4 +115,3 @@ param set-default PWM_AUX_FUNC1 101
param set-default PWM_AUX_FUNC2 102
param set-default PWM_AUX_FUNC3 103
param set-default PWM_AUX_FUNC4 104
-
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4017_nxp_hovergames b/ROMFS/px4fmu_common/init.d/airframes/4017_nxp_hovergames
index 7094a554618b..03adea0bee67 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4017_nxp_hovergames
+++ b/ROMFS/px4fmu_common/init.d/airframes/4017_nxp_hovergames
@@ -21,14 +21,15 @@ param set-default MC_ROLLRATE_I 0.15
param set-default MC_PITCHRATE_P 0.18
param set-default MC_PITCHRATE_I 0.15
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4019_x500_v2 b/ROMFS/px4fmu_common/init.d/airframes/4019_x500_v2
index e9127020c357..4b56f8ae3a54 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4019_x500_v2
+++ b/ROMFS/px4fmu_common/init.d/airframes/4019_x500_v2
@@ -22,19 +22,20 @@ param set-default MC_PITCHRATE_I 0.3
param set-default MC_ROLLRATE_D 0.004
param set-default MC_PITCHRATE_D 0.004
-param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.25
-param set-default CA_ROTOR0_PY 0.25
-param set-default CA_ROTOR1_PX -0.25
-param set-default CA_ROTOR1_PY -0.25
-param set-default CA_ROTOR2_PX 0.25
-param set-default CA_ROTOR2_PY -0.25
-param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.25
-param set-default CA_ROTOR3_PY 0.25
-param set-default CA_ROTOR3_KM -0.05
-
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
+
+# Square quadrotor X PX4 numbering
+param set-default CA_ROTOR_COUNT 4
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
+param set-default CA_ROTOR2_KM -0.05
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
+param set-default CA_ROTOR3_KM -0.05
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4020_holybro_px4vision_v1_5 b/ROMFS/px4fmu_common/init.d/airframes/4020_holybro_px4vision_v1_5
index 3d094d231ac7..8ef02418928e 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4020_holybro_px4vision_v1_5
+++ b/ROMFS/px4fmu_common/init.d/airframes/4020_holybro_px4vision_v1_5
@@ -98,18 +98,17 @@ param set-default CBRK_IO_SAFETY 22027
param set-default THR_MDL_FAC 0.3
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR0_KM 0.05
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR1_KM 0.05
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
# Outputs
@@ -117,4 +116,3 @@ param set-default PWM_AUX_FUNC1 101
param set-default PWM_AUX_FUNC2 102
param set-default PWM_AUX_FUNC3 103
param set-default PWM_AUX_FUNC4 104
-
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4041_beta75x b/ROMFS/px4fmu_common/init.d/airframes/4041_beta75x
index 9c723c74fd1a..5549255ec452 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4041_beta75x
+++ b/ROMFS/px4fmu_common/init.d/airframes/4041_beta75x
@@ -46,22 +46,20 @@ param set-default SYS_HAS_MAG 0
param set-default BAT1_N_CELLS 2
+# Square quadrotor X with reverse turn direction
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.03
-param set-default CA_ROTOR0_PY 0.03
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
param set-default CA_ROTOR0_KM -0.05
-param set-default CA_ROTOR1_PX -0.03
-param set-default CA_ROTOR1_PY -0.03
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
param set-default CA_ROTOR1_KM -0.05
-param set-default CA_ROTOR2_PX 0.03
-param set-default CA_ROTOR2_PY -0.03
-param set-default CA_ROTOR2_KM 0.05
-param set-default CA_ROTOR3_PX -0.03
-param set-default CA_ROTOR3_PY 0.03
-param set-default CA_ROTOR3_KM 0.05
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default PWM_MAIN_FUNC1 104
param set-default PWM_MAIN_FUNC2 101
param set-default PWM_MAIN_FUNC3 102
param set-default PWM_MAIN_FUNC4 103
-
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4050_generic_250 b/ROMFS/px4fmu_common/init.d/airframes/4050_generic_250
index efc06c3a3a23..d460138cc815 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4050_generic_250
+++ b/ROMFS/px4fmu_common/init.d/airframes/4050_generic_250
@@ -36,16 +36,15 @@ param set-default SDLOG_PROFILE 19
param set-default IMU_DGYRO_CUTOFF 50
param set-default IMU_GYRO_CUTOFF 90
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
-
-
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4052_holybro_qav250 b/ROMFS/px4fmu_common/init.d/airframes/4052_holybro_qav250
index a01c35a3ac85..4dc7f90aea95 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4052_holybro_qav250
+++ b/ROMFS/px4fmu_common/init.d/airframes/4052_holybro_qav250
@@ -46,20 +46,20 @@ param set-default MPC_Z_VEL_I_ACC 1.7
param set-default THR_MDL_FAC 0.3
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
-
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4053_holybro_kopis2 b/ROMFS/px4fmu_common/init.d/airframes/4053_holybro_kopis2
index 64d14b8d5c40..81e4b26d4837 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4053_holybro_kopis2
+++ b/ROMFS/px4fmu_common/init.d/airframes/4053_holybro_kopis2
@@ -53,16 +53,17 @@ param set-default MC_AIRMODE 1
param set-default EV_TSK_RC_LOSS 1
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
param set-default PWM_MAIN_FUNC1 104
@@ -72,5 +73,3 @@ param set-default PWM_MAIN_FUNC4 103
param set-default PWM_MAIN_TIM0 -2
param set-default PWM_MAIN_TIM1 -2
-
-
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4061_atl_mantis_edu b/ROMFS/px4fmu_common/init.d/airframes/4061_atl_mantis_edu
index bcfcd10fda0b..d3f48bcc0780 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4061_atl_mantis_edu
+++ b/ROMFS/px4fmu_common/init.d/airframes/4061_atl_mantis_edu
@@ -11,12 +11,11 @@
. ${R}etc/init.d/rc.mc_defaults
-
# Battery settings
param set-default BAT_CRIT_THR 0.20
param set-default BAT_LOW_THR 0.25
-param set-default BAT1_CAPACITY 2800.0
+param set-default BAT1_CAPACITY 2800
param set-default BAT1_N_CELLS 3
param set-default BAT1_R_INTERNAL 0.02
param set-default BAT1_V_CHARGED 4.26
@@ -38,7 +37,7 @@ param set-default COM_RC_LOSS_T 3
# ekf2
param set-default EKF2_TERR_MASK 1
-param set-default EKF2_BARO_NOISE 2.0
+param set-default EKF2_BARO_NOISE 2
param set-default EKF2_BCOEF_X 31.5
param set-default EKF2_BCOEF_Y 25.5
@@ -56,11 +55,11 @@ param set-default EKF2_MAG_NOISE 0.1
param set-default EKF2_MIN_RNG 0.15
param set-default EKF2_OF_DELAY 38
-param set-default EKF2_OF_GATE 2.0
+param set-default EKF2_OF_GATE 2
param set-default EKF2_OF_POS_X -0.035
param set-default EKF2_OF_POS_Z 0.033
param set-default EKF2_OF_MIN_RNG 0.01
-param set-default EKF2_OF_A_HMAX 7.0
+param set-default EKF2_OF_A_HMAX 7
param set-default EKF2_OF_QMIN 30
param set-default EKF2_PCOEF_XN -0.3
@@ -68,18 +67,18 @@ param set-default EKF2_PCOEF_XP -0.4
param set-default EKF2_PCOEF_YN -0.4
param set-default EKF2_PCOEF_YP -0.4
-param set-default EKF2_RNG_A_VMAX 1.0
+param set-default EKF2_RNG_A_VMAX 1
param set-default EKF2_RNG_CTRL 0
param set-default EKF2_RNG_DELAY 55
param set-default EKF2_RNG_POS_X -0.035
-param set-default EKF2_RNG_POS_Y 0.0
+param set-default EKF2_RNG_POS_Y 0
param set-default EKF2_RNG_POS_Z 0.033
-param set-default EKF2_TERR_NOISE 1.0
+param set-default EKF2_TERR_NOISE 1
# Maximum allowed angle velocity in the landed state
-param set-default LNDMC_ROT_MAX 40.0
+param set-default LNDMC_ROT_MAX 40
# Maximum vertical velocity allowed in the landed state
param set-default LNDMC_Z_VEL_MAX 0.7
@@ -94,36 +93,36 @@ param set-default IMU_GYRO_CUTOFF 65
param set-default MC_PITCHRATE_P 0.075
param set-default MC_PITCHRATE_I 0.1
param set-default MC_PITCHRATE_D 0.0005
-param set-default MC_PITCHRATE_MAX 360.0
-param set-default MC_PITCH_P 8.0
+param set-default MC_PITCHRATE_MAX 360
+param set-default MC_PITCH_P 8
# Roll angle & rate setting
param set-default MC_ROLLRATE_P 0.055
param set-default MC_ROLLRATE_I 0.1
param set-default MC_ROLLRATE_D 0.0005
-param set-default MC_ROLLRATE_MAX 360.0
-param set-default MC_ROLL_P 8.0
+param set-default MC_ROLLRATE_MAX 360
+param set-default MC_ROLL_P 8
# Yaw angle & rate setting
param set-default MC_YAWRATE_P 0.1
-param set-default MC_YAWRATE_MAX 120.0
+param set-default MC_YAWRATE_MAX 120
param set-default MC_YAW_P 2.5
-param set-default MPC_ACC_DOWN_MAX 2.0
-param set-default MPC_ACC_HOR 3.0
-param set-default MPC_ACC_HOR_MAX 10.0
-param set-default MPC_ACC_UP_MAX 3.0
+param set-default MPC_ACC_DOWN_MAX 2
+param set-default MPC_ACC_HOR 3
+param set-default MPC_ACC_HOR_MAX 10
+param set-default MPC_ACC_UP_MAX 3
param set-default MPC_ALT_MODE 0
param set-default MPC_LAND_SPEED 0.5
param set-default MPC_MAN_TILT_MAX 20
-param set-default MPC_YAWRAUTO_MAX 80.0
+param set-default MPC_YAWRAUTO_MAX 80
param set-default MPC_THR_HOVER 0.54
param set-default MPC_THR_MAX 0.9
param set-default MPC_THR_MIN 0.06
param set-default MPC_TILTMAX_AIR 30
-param set-default MPC_XY_P 1.0
-param set-default MPC_Z_P 2.0
-param set-default MPC_Z_VEL_MAX_DN 2.0
+param set-default MPC_XY_P 1
+param set-default MPC_Z_P 2
+param set-default MPC_Z_VEL_MAX_DN 2
# gimbal configuration
param set-default MNT_MODE_IN 0
@@ -150,21 +149,22 @@ param set-default RC1_TRIM 1000
# optical flow
param set-default SENS_FLOW_MAXR 7.4
param set-default SENS_FLOW_MINHGT 0.15
-param set-default SENS_FLOW_MAXHGT 5.0
+param set-default SENS_FLOW_MAXHGT 5
# ignore the SD card errors and use normal startup sound
set STARTUP_TUNE "1"
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
param set-default TAP_ESC_FUNC1 101
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4071_ifo b/ROMFS/px4fmu_common/init.d/airframes/4071_ifo
index fdb02714c2a5..ce1c3f8f0e54 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4071_ifo
+++ b/ROMFS/px4fmu_common/init.d/airframes/4071_ifo
@@ -73,23 +73,22 @@ param set-default MAV_1_CONFIG 102
param set-default MAV_1_MODE 0
param set-default SER_TEL2_BAUD 57600
+param set-default PWM_MAIN_TIM0 0
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
-param set-default PWM_MAIN_TIM0 0
-
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
-
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4073_ifo-s b/ROMFS/px4fmu_common/init.d/airframes/4073_ifo-s
index b87002620520..a544a49e0367 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4073_ifo-s
+++ b/ROMFS/px4fmu_common/init.d/airframes/4073_ifo-s
@@ -91,22 +91,22 @@ param set-default EKF2_OF_POS_Z -0.07
# Failsafe
param set-default COM_LOW_BAT_ACT 3
+param set-default PWM_MAIN_TIM0 -3
+
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
-param set-default PWM_MAIN_TIM0 -3
-
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
param set-default PWM_MAIN_FUNC4 104
-
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4500_clover4 b/ROMFS/px4fmu_common/init.d/airframes/4500_clover4
index cbfbc1c6bae2..22f8d74462be 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4500_clover4
+++ b/ROMFS/px4fmu_common/init.d/airframes/4500_clover4
@@ -27,16 +27,17 @@ param set-default MPC_XY_P 1.1
param set-default MPC_Z_VEL_P_ACC 4.8
param set-default MPC_Z_P 1.2
+# Square quadrotor X PX4 numbering
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY -1
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
param set-default PWM_MAIN_FUNC1 101
diff --git a/ROMFS/px4fmu_common/init.d/airframes/4901_crazyflie21 b/ROMFS/px4fmu_common/init.d/airframes/4901_crazyflie21
index f9bf887f1ed9..37dfc34def96 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/4901_crazyflie21
+++ b/ROMFS/px4fmu_common/init.d/airframes/4901_crazyflie21
@@ -17,7 +17,6 @@
#
. ${R}etc/init.d/rc.mc_defaults
-
param set-default SYS_MC_EST_GROUP 2
param set-default SYS_HAS_MAG 0
param set-default EKF2_OF_CTRL 1
@@ -50,22 +49,22 @@ param set-default MPC_MAX_FLOW_HGT 3
param set-default NAV_RCL_ACT 3
-param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.03
-param set-default CA_ROTOR0_PY 0.03
-param set-default CA_ROTOR1_PX -0.03
-param set-default CA_ROTOR1_PY 0.03
-param set-default CA_ROTOR1_KM -0.05
-param set-default CA_ROTOR2_PX -0.03
-param set-default CA_ROTOR2_PY -0.03
-param set-default CA_ROTOR3_PX 0.03
-param set-default CA_ROTOR3_PY -0.03
-param set-default CA_ROTOR3_KM -0.05
-
# Run the motors at 328.125 kHz (recommended)
param set-default PWM_MAIN_TIM0 3921
param set-default PWM_MAIN_TIM1 3921
+# Square quadrotor X clockwise numbering
+param set-default CA_ROTOR0_PX 1
+param set-default CA_ROTOR0_PY 1
+param set-default CA_ROTOR1_PX -1
+param set-default CA_ROTOR1_PY 1
+param set-default CA_ROTOR1_KM -0.05
+param set-default CA_ROTOR2_PX -1
+param set-default CA_ROTOR2_PY -1
+param set-default CA_ROTOR3_PX 1
+param set-default CA_ROTOR3_PY -1
+param set-default CA_ROTOR3_KM -0.05
+
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
param set-default PWM_MAIN_FUNC3 103
diff --git a/ROMFS/px4fmu_common/init.d/airframes/50004_nxpcup_car_dfrobot_gpx b/ROMFS/px4fmu_common/init.d/airframes/50004_nxpcup_car_dfrobot_gpx
index 6d4bd2f4f569..67620ddc0375 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/50004_nxpcup_car_dfrobot_gpx
+++ b/ROMFS/px4fmu_common/init.d/airframes/50004_nxpcup_car_dfrobot_gpx
@@ -36,9 +36,9 @@ param set-default GND_THR_MAX 0.5
param set-default GND_MAX_ANG 1.042
param set-default GND_WHEEL_BASE 0.17
-# TODO: Set to -1.0, to allow reversing. This will require many changes in the codebase
+# TODO: Set to -1, to allow reversing. This will require many changes in the codebase
# to support negative throttle.
-param set-default GND_THR_MIN 0.0
+param set-default GND_THR_MIN 0
param set-default GND_SPEED_P 0.25
param set-default GND_SPEED_I 3
param set-default GND_SPEED_D 0.001
diff --git a/ROMFS/px4fmu_common/init.d/airframes/5001_quad_+ b/ROMFS/px4fmu_common/init.d/airframes/5001_quad_+
index d68331179223..4f1f578ad170 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/5001_quad_+
+++ b/ROMFS/px4fmu_common/init.d/airframes/5001_quad_+
@@ -1,12 +1,10 @@
#!/bin/sh
#
-# @name Generic 10" Quad + geometry
+# @name Generic Quad + geometry
#
# @type Quadrotor +
# @class Copter
#
-# @maintainer Lorenz Meier
-#
# @board bitcraze_crazyflie exclude
# @board px4_fmu-v2 exclude
#
@@ -14,13 +12,17 @@
. ${R}etc/init.d/rc.mc_defaults
param set-default CA_ROTOR_COUNT 4
-param set-default CA_ROTOR0_PX 0.15
-param set-default CA_ROTOR0_PY 0.15
-param set-default CA_ROTOR0_KM -0.05
-param set-default CA_ROTOR1_PX -0.15
-param set-default CA_ROTOR1_PY -0.15
-param set-default CA_ROTOR1_KM -0.05
-param set-default CA_ROTOR2_PX 0.15
-param set-default CA_ROTOR2_PY -0.15
-param set-default CA_ROTOR3_PX -0.15
-param set-default CA_ROTOR3_PY 0.15
+
+param set-default CA_ROTOR0_PX 0
+param set-default CA_ROTOR0_PY 1
+
+param set-default CA_ROTOR1_PX 0
+param set-default CA_ROTOR1_PY -1
+
+param set-default CA_ROTOR2_PX 1
+param set-default CA_ROTOR2_PY 0
+param set-default CA_ROTOR2_KM -0.05
+
+param set-default CA_ROTOR3_PX -1
+param set-default CA_ROTOR3_PY 0
+param set-default CA_ROTOR3_KM -0.05
diff --git a/ROMFS/px4fmu_common/init.d/airframes/60000_uuv_generic b/ROMFS/px4fmu_common/init.d/airframes/60000_uuv_generic
index d6f84f0d44f0..3a9ceaa5d95f 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/60000_uuv_generic
+++ b/ROMFS/px4fmu_common/init.d/airframes/60000_uuv_generic
@@ -5,8 +5,6 @@
# @type Underwater Robot
# @class Underwater Robot
#
-# @maintainer
-#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
#
diff --git a/ROMFS/px4fmu_common/init.d/airframes/60001_uuv_hippocampus b/ROMFS/px4fmu_common/init.d/airframes/60001_uuv_hippocampus
index 672d411bc319..a94d0bd00e74 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/60001_uuv_hippocampus
+++ b/ROMFS/px4fmu_common/init.d/airframes/60001_uuv_hippocampus
@@ -12,38 +12,7 @@
#
. ${R}etc/init.d/rc.uuv_defaults
-
-param set-default CA_AIRFRAME 7
-param set-default CA_ROTOR_COUNT 4
-param set-default CA_R_REV 255
-param set-default CA_ROTOR0_AX 1
-param set-default CA_ROTOR0_AY 0
-param set-default CA_ROTOR0_AZ 0
-param set-default CA_ROTOR0_KM 0
-param set-default CA_ROTOR0_PX 0
-param set-default CA_ROTOR0_PY -0.3
-param set-default CA_ROTOR0_PZ -0.3
-param set-default CA_ROTOR1_AX 1
-param set-default CA_ROTOR1_AY 0
-param set-default CA_ROTOR1_AZ 0
-param set-default CA_ROTOR1_KM 0
-param set-default CA_ROTOR1_PX 0
-param set-default CA_ROTOR1_PY 0.3
-param set-default CA_ROTOR1_PZ -0.3
-param set-default CA_ROTOR2_AX 1
-param set-default CA_ROTOR2_AY 0
-param set-default CA_ROTOR2_AZ 0
-param set-default CA_ROTOR2_KM 0
-param set-default CA_ROTOR2_PX 0
-param set-default CA_ROTOR2_PY 0.3
-param set-default CA_ROTOR2_PZ 0.3
-param set-default CA_ROTOR3_AX 1
-param set-default CA_ROTOR3_AY 0
-param set-default CA_ROTOR3_AZ 0
-param set-default CA_ROTOR3_KM 0
-param set-default CA_ROTOR3_PX 0
-param set-default CA_ROTOR3_PY -0.3
-param set-default CA_ROTOR3_PZ 0.3
+. ${R}etc/init.d/airframes/60000_uuv_generic
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
diff --git a/ROMFS/px4fmu_common/init.d/airframes/60002_uuv_bluerov2_heavy b/ROMFS/px4fmu_common/init.d/airframes/60002_uuv_bluerov2_heavy
index fb63525159cd..2afdc17eee63 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/60002_uuv_bluerov2_heavy
+++ b/ROMFS/px4fmu_common/init.d/airframes/60002_uuv_bluerov2_heavy
@@ -30,7 +30,7 @@ param set-default MAV_1_CONFIG 102
param set-default BAT1_A_PER_V 37.8798
param set-default BAT1_CAPACITY 18000
-param set-default BAT1_V_DIV 11.0
+param set-default BAT1_V_DIV 11
param set-default BAT1_N_CELLS 4
param set-default BAT_V_OFFS_CURR 0.33
@@ -38,49 +38,49 @@ param set-default CA_AIRFRAME 7
param set-default CA_ROTOR_COUNT 8
param set-default CA_R_REV 255
-param set-default CA_ROTOR0_AX 1.0000
-param set-default CA_ROTOR0_AY -1.0000
-param set-default CA_ROTOR0_AZ 0.0000
-param set-default CA_ROTOR0_KM 0.0000
-param set-default CA_ROTOR0_PX 0.5000
-param set-default CA_ROTOR0_PY 0.3000
-param set-default CA_ROTOR0_PZ 0.2000
-param set-default CA_ROTOR1_AX 1.0000
-param set-default CA_ROTOR1_AY 1.0000
-param set-default CA_ROTOR1_AZ 0.0000
-param set-default CA_ROTOR1_KM 0.0000
-param set-default CA_ROTOR1_PX 0.5000
-param set-default CA_ROTOR1_PY -0.3000
-param set-default CA_ROTOR1_PZ 0.2000
-param set-default CA_ROTOR2_AX 1.0000
-param set-default CA_ROTOR2_AY 1.0000
-param set-default CA_ROTOR2_AZ 0.0000
-param set-default CA_ROTOR2_KM 0.0000
-param set-default CA_ROTOR2_PX -0.5000
-param set-default CA_ROTOR2_PY 0.3000
-param set-default CA_ROTOR2_PZ 0.2000
-param set-default CA_ROTOR3_AX 1.0000
-param set-default CA_ROTOR3_AY -1.0000
-param set-default CA_ROTOR3_AZ 0.0000
-param set-default CA_ROTOR3_KM 0.0000
-param set-default CA_ROTOR3_PX -0.5000
-param set-default CA_ROTOR3_PY -0.3000
-param set-default CA_ROTOR3_PZ 0.2000
-param set-default CA_ROTOR4_AZ -1.0000
-param set-default CA_ROTOR4_KM 0.0000
-param set-default CA_ROTOR4_PX 0.5000
-param set-default CA_ROTOR4_PY 0.5000
-param set-default CA_ROTOR5_AZ 1.0000
-param set-default CA_ROTOR5_KM 0.0000
-param set-default CA_ROTOR5_PX 0.5000
-param set-default CA_ROTOR5_PY -0.5000
-param set-default CA_ROTOR6_AZ 1.0000
-param set-default CA_ROTOR6_KM 0.0000
-param set-default CA_ROTOR6_PX -0.5000
-param set-default CA_ROTOR6_PY 0.5000
-param set-default CA_ROTOR7_KM 0.0000
-param set-default CA_ROTOR7_PX -0.5000
-param set-default CA_ROTOR7_PY -0.5000
+param set-default CA_ROTOR0_AX 1
+param set-default CA_ROTOR0_AY -1
+param set-default CA_ROTOR0_AZ 0
+param set-default CA_ROTOR0_KM 0
+param set-default CA_ROTOR0_PX 0.5
+param set-default CA_ROTOR0_PY 0.3
+param set-default CA_ROTOR0_PZ 0.2
+param set-default CA_ROTOR1_AX 1
+param set-default CA_ROTOR1_AY 1
+param set-default CA_ROTOR1_AZ 0
+param set-default CA_ROTOR1_KM 0
+param set-default CA_ROTOR1_PX 0.5
+param set-default CA_ROTOR1_PY -0.3
+param set-default CA_ROTOR1_PZ 0.2
+param set-default CA_ROTOR2_AX 1
+param set-default CA_ROTOR2_AY 1
+param set-default CA_ROTOR2_AZ 0
+param set-default CA_ROTOR2_KM 0
+param set-default CA_ROTOR2_PX -0.5
+param set-default CA_ROTOR2_PY 0.3
+param set-default CA_ROTOR2_PZ 0.2
+param set-default CA_ROTOR3_AX 1
+param set-default CA_ROTOR3_AY -1
+param set-default CA_ROTOR3_AZ 0
+param set-default CA_ROTOR3_KM 0
+param set-default CA_ROTOR3_PX -0.5
+param set-default CA_ROTOR3_PY -0.3
+param set-default CA_ROTOR3_PZ 0.2
+param set-default CA_ROTOR4_AZ -1
+param set-default CA_ROTOR4_KM 0
+param set-default CA_ROTOR4_PX 0.5
+param set-default CA_ROTOR4_PY 0.5
+param set-default CA_ROTOR5_AZ 1
+param set-default CA_ROTOR5_KM 0
+param set-default CA_ROTOR5_PX 0.5
+param set-default CA_ROTOR5_PY -0.5
+param set-default CA_ROTOR6_AZ 1
+param set-default CA_ROTOR6_KM 0
+param set-default CA_ROTOR6_PX -0.5
+param set-default CA_ROTOR6_PY 0.5
+param set-default CA_ROTOR7_KM 0
+param set-default CA_ROTOR7_PX -0.5
+param set-default CA_ROTOR7_PY -0.5
param set-default PWM_MAIN_FUNC1 101
param set-default PWM_MAIN_FUNC2 102
diff --git a/ROMFS/px4fmu_common/init.d/airframes/6001_hexa_x b/ROMFS/px4fmu_common/init.d/airframes/6001_hexa_x
index 73c2f5ca4274..ec8720d1dc34 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/6001_hexa_x
+++ b/ROMFS/px4fmu_common/init.d/airframes/6001_hexa_x
@@ -16,10 +16,10 @@
param set-default MAV_TYPE 13
param set-default CA_ROTOR_COUNT 6
-param set-default CA_ROTOR0_PX 0.0
+param set-default CA_ROTOR0_PX 0
param set-default CA_ROTOR0_PY 0.5
param set-default CA_ROTOR0_KM -0.05
-param set-default CA_ROTOR1_PX 0.0
+param set-default CA_ROTOR1_PX 0
param set-default CA_ROTOR1_PY -0.5
param set-default CA_ROTOR2_PX 0.43
param set-default CA_ROTOR2_PY -0.25
diff --git a/ROMFS/px4fmu_common/init.d/airframes/6002_draco_r b/ROMFS/px4fmu_common/init.d/airframes/6002_draco_r
index ec3b5c608960..e0eefa351bd8 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/6002_draco_r
+++ b/ROMFS/px4fmu_common/init.d/airframes/6002_draco_r
@@ -97,10 +97,10 @@ param set-default SER_TEL2_BAUD 921600
param set-default CA_ROTOR_COUNT 6
-param set-default CA_ROTOR0_PX 0.0
+param set-default CA_ROTOR0_PX 0
param set-default CA_ROTOR0_PY 0.5
param set-default CA_ROTOR0_KM -0.05
-param set-default CA_ROTOR1_PX 0.0
+param set-default CA_ROTOR1_PX 0
param set-default CA_ROTOR1_PY -0.5
param set-default CA_ROTOR2_PX 0.43
param set-default CA_ROTOR2_PY -0.25
diff --git a/ROMFS/px4fmu_common/init.d/airframes/7001_hexa_+ b/ROMFS/px4fmu_common/init.d/airframes/7001_hexa_+
index 308bdfb1b857..b22afec00ea1 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/7001_hexa_+
+++ b/ROMFS/px4fmu_common/init.d/airframes/7001_hexa_+
@@ -17,10 +17,10 @@ param set-default MAV_TYPE 13
param set-default CA_ROTOR_COUNT 6
param set-default CA_ROTOR0_PX 0.5
-param set-default CA_ROTOR0_PY 0.0
+param set-default CA_ROTOR0_PY 0
param set-default CA_ROTOR0_KM -0.05
param set-default CA_ROTOR1_PX -0.5
-param set-default CA_ROTOR1_PY 0.0
+param set-default CA_ROTOR1_PY 0
param set-default CA_ROTOR2_PX -0.25
param set-default CA_ROTOR2_PY -0.43
param set-default CA_ROTOR2_KM -0.05
diff --git a/ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt b/ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt
index 8fbccdee547c..66e29e32b4dd 100644
--- a/ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt
+++ b/ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt
@@ -32,94 +32,127 @@
############################################################################
px4_add_romfs_files(
- # [0-999] Reserved (historical)"
-
- # [1000, 1999] Simulation setups"
- 1001_rc_quad_x.hil
- 1002_standard_vtol.hil
- 1100_rc_quad_x_sih.hil
- 1101_rc_plane_sih.hil
- 1102_tailsitter_duo_sih.hil
-
- # [2000, 2999] Standard planes"
- 2100_standard_plane
- 2106_albatross
-
- 2507_cloudship
-
- # [3000, 3999] Flying wing"
- 3000_generic_wing
-
- # [4000, 4999] Quadrotor x"
- 4001_quad_x
- 4014_s500
- 4015_holybro_s500
- 4016_holybro_px4vision
- 4017_nxp_hovergames
- 4019_x500_v2
- 4020_holybro_px4vision_v1_5
- 4041_beta75x
- 4050_generic_250
- 4052_holybro_qav250
- 4053_holybro_kopis2
- 4061_atl_mantis_edu
- 4071_ifo
- 4073_ifo-s
- 4500_clover4
- 4901_crazyflie21
-
- # [5000, 5999] Quadrotor +"
- 5001_quad_+
-
- # [6000, 6999] Hexarotor x"
- 6001_hexa_x
- 6002_draco_r
-
- # [7000, 7999] Hexarotor +"
- 7001_hexa_+
-
- # [8000, 8999] Octorotor +"
- 8001_octo_x
-
- # [9000, 9999] Octorotor +"
- 9001_octo_+
-
- # [11000, 11999] Hexa Cox
- 11001_hexa_cox
-
- # [12000, 12999] Octo Cox
- 12001_octo_cox
-
- # [13000, 13999] VTOL
- 13000_generic_vtol_standard
- 13100_generic_vtol_tiltrotor
- 13013_deltaquad
- 13014_vtol_babyshark
- 13030_generic_vtol_quad_tiltrotor
- 13200_generic_vtol_tailsitter
-
- # [14000, 14999] MC with tilt
- 14001_generic_mc_with_tilt
-
- 16001_helicopter
-
- # [17000, 17999] Autogyro
- 17002_TF-AutoG2
- 17003_TF-G2
+ # [0-999] Reserved (historical)
# [18000, 18999] High-altitude balloons
18001_TF-B1
# [22000, 22999] Reserve for custom models
-
- 24001_dodeca_cox
-
- 50000_generic_ground_vehicle
- 50004_nxpcup_car_dfrobot_gpx
- 50003_aion_robotics_r1_rover
-
- # [60000, 61000] (Unmanned) Underwater Robots
- 60000_uuv_generic
- 60001_uuv_hippocampus
- 60002_uuv_bluerov2_heavy
)
+
+if(CONFIG_MODULES_SIMULATION_PWM_OUT_SIM)
+ px4_add_romfs_files(
+ # [1000, 1999] Simulation setups
+ 1001_rc_quad_x.hil
+ 1002_standard_vtol.hil
+ 1100_rc_quad_x_sih.hil
+ 1101_rc_plane_sih.hil
+ 1102_tailsitter_duo_sih.hil
+ )
+endif()
+
+if(CONFIG_MODULES_MC_RATE_CONTROL)
+ px4_add_romfs_files(
+ # [4000, 4999] Quadrotor x
+ 4001_quad_x
+ 4014_s500
+ 4015_holybro_s500
+ 4016_holybro_px4vision
+ 4017_nxp_hovergames
+ 4019_x500_v2
+ 4020_holybro_px4vision_v1_5
+ 4041_beta75x
+ 4050_generic_250
+ 4052_holybro_qav250
+ 4053_holybro_kopis2
+ 4061_atl_mantis_edu
+ 4071_ifo
+ 4073_ifo-s
+ 4500_clover4
+ 4901_crazyflie21
+
+ # [5000, 5999] Quadrotor +
+ 5001_quad_+
+
+ # [6000, 6999] Hexarotor x
+ 6001_hexa_x
+ 6002_draco_r
+
+ # [7000, 7999] Hexarotor +
+ 7001_hexa_+
+
+ # [8000, 8999] Octorotor +
+ 8001_octo_x
+
+ # [9000, 9999] Octorotor +
+ 9001_octo_+
+
+ # [11000, 11999] Hexa Cox
+ 11001_hexa_cox
+
+ # [12000, 12999] Octo Cox
+ 12001_octo_cox
+
+ # [14000, 14999] MC with tilt
+ 14001_generic_mc_with_tilt
+
+ 16001_helicopter
+
+ 24001_dodeca_cox
+ )
+endif()
+
+if(CONFIG_MODULES_FW_RATE_CONTROL)
+ px4_add_romfs_files(
+ # [2000, 2999] Standard planes
+ 2100_standard_plane
+ 2106_albatross
+
+ # [3000, 3999] Flying wing
+ 3000_generic_wing
+
+ # [17000, 17999] Autogyro
+ 17002_TF-AutoG2
+ 17003_TF-G2
+ )
+endif()
+
+if(CONFIG_MODULES_AIRSHIP_ATT_CONTROL)
+ px4_add_romfs_files(
+ 2507_cloudship
+ )
+endif()
+
+if(CONFIG_MODULES_VTOL_ATT_CONTROL)
+ px4_add_romfs_files(
+ # [13000, 13999] VTOL
+ 13000_generic_vtol_standard
+ 13100_generic_vtol_tiltrotor
+ 13013_deltaquad
+ 13014_vtol_babyshark
+ 13030_generic_vtol_quad_tiltrotor
+ 13200_generic_vtol_tailsitter
+ )
+endif()
+
+if(CONFIG_MODULES_ROVER_POS_CONTROL)
+ px4_add_romfs_files(
+ 50000_generic_ground_vehicle
+ 50004_nxpcup_car_dfrobot_gpx
+ )
+endif()
+
+if(CONFIG_MODULES_DIFFERENTIAL_DRIVE)
+ px4_add_romfs_files(
+ 50003_aion_robotics_r1_rover
+ )
+endif()
+
+if(CONFIG_MODULES_UUV_ATT_CONTROL)
+ px4_add_romfs_files(
+ # [60000, 61000] (Unmanned) Underwater Robots
+ 60000_uuv_generic
+ 60001_uuv_hippocampus
+ 60002_uuv_bluerov2_heavy
+ )
+endif()
diff --git a/ROMFS/px4fmu_common/init.d/rc.fw_defaults b/ROMFS/px4fmu_common/init.d/rc.fw_defaults
index f63c1901b185..32991e59b98c 100644
--- a/ROMFS/px4fmu_common/init.d/rc.fw_defaults
+++ b/ROMFS/px4fmu_common/init.d/rc.fw_defaults
@@ -28,13 +28,12 @@ param set-default EKF2_ARSP_THR 8
param set-default EKF2_FUSE_BETA 1
param set-default EKF2_GPS_CHECK 21
param set-default EKF2_MAG_ACCLIM 0
-param set-default EKF2_MAG_YAWLIM 0
param set-default EKF2_REQ_EPH 10
param set-default EKF2_REQ_EPV 10
param set-default EKF2_REQ_HDRIFT 0.5
param set-default EKF2_REQ_SACC 1
-param set-default EKF2_REQ_VDRIFT 1.0
-param set-default EKF2_RNG_QLTY_T 3.0
+param set-default EKF2_REQ_VDRIFT 1
+param set-default EKF2_RNG_QLTY_T 3
param set-default RTL_TYPE 1
param set-default RTL_RETURN_ALT 100
diff --git a/ROMFS/px4fmu_common/init.d/rc.rover_differential_apps b/ROMFS/px4fmu_common/init.d/rc.rover_differential_apps
index 31c79ac9801e..848527a9e975 100644
--- a/ROMFS/px4fmu_common/init.d/rc.rover_differential_apps
+++ b/ROMFS/px4fmu_common/init.d/rc.rover_differential_apps
@@ -5,7 +5,7 @@
ekf2 start &
# Start rover differential drive controller.
-differential_drive_control start
+differential_drive start
# Start Land Detector.
land_detector start rover
diff --git a/ROMFS/px4fmu_common/init.d/rc.thermal_cal b/ROMFS/px4fmu_common/init.d/rc.thermal_cal
index 484b9af69fb6..9614c15b1945 100644
--- a/ROMFS/px4fmu_common/init.d/rc.thermal_cal
+++ b/ROMFS/px4fmu_common/init.d/rc.thermal_cal
@@ -22,6 +22,11 @@ then
set TEMP_COMP_START "true"
fi
+if param compare -s TC_M_ENABLE 1
+then
+ set TEMP_COMP_START "true"
+fi
+
if [ "x$TEMP_COMP_START" != "x" ]
then
temperature_compensation start
diff --git a/ROMFS/px4fmu_common/init.d/rc.vtol_defaults b/ROMFS/px4fmu_common/init.d/rc.vtol_defaults
index 5e6d041221dc..b666d59bb862 100644
--- a/ROMFS/px4fmu_common/init.d/rc.vtol_defaults
+++ b/ROMFS/px4fmu_common/init.d/rc.vtol_defaults
@@ -21,7 +21,7 @@ param set-default MIS_YAW_TMT 10
param set-default EKF2_ARSP_THR 10
param set-default EKF2_FUSE_BETA 1
-param set-default HTE_VXY_THR 2.0
+param set-default HTE_VXY_THR 2
param set-default MIS_TKO_LAND_REQ 2
diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS
index 0e0041223a5d..466fed1f624d 100644
--- a/ROMFS/px4fmu_common/init.d/rcS
+++ b/ROMFS/px4fmu_common/init.d/rcS
@@ -170,7 +170,7 @@ else
param select-backup $PARAM_BACKUP_FILE
fi
- if ver hwcmp PX4_FMU_V5X PX4_FMU_V6X ARK_FMU_V6X PX4_FMU_V6XRT
+ if mft query -q -k MFT -s MFT_ETHERNET -v 1
then
netman update -i eth0
fi
@@ -439,7 +439,12 @@ else
#
# Start a thermal calibration if required.
#
- . ${R}etc/init.d/rc.thermal_cal
+ set RC_THERMAL_CAL ${R}etc/init.d/rc.thermal_cal
+ if [ -f ${RC_THERMAL_CAL} ]
+ then
+ . ${RC_THERMAL_CAL}
+ fi
+ unset RC_THERMAL_CAL
#
# Start gimbal to control mounts such as gimbals, disabled by default.
@@ -500,7 +505,12 @@ else
#
# Start the logger.
#
- . ${R}etc/init.d/rc.logging
+ set RC_LOGGING ${R}etc/init.d/rc.logging
+ if [ -f ${RC_LOGGING} ]
+ then
+ . ${RC_LOGGING}
+ fi
+ unset RC_LOGGING
#
# Set additional parameters and env variables for selected AUTOSTART.
diff --git a/Tools/astyle/files_to_check_code_style.sh b/Tools/astyle/files_to_check_code_style.sh
index 486eac9464ce..734d6f5323d5 100755
--- a/Tools/astyle/files_to_check_code_style.sh
+++ b/Tools/astyle/files_to_check_code_style.sh
@@ -30,4 +30,5 @@ exec find boards msg src platforms test \
-path src/lib/cdrstream/cyclonedds -prune -o \
-path src/lib/cdrstream/rosidl -prune -o \
-path src/modules/zenoh/zenoh-pico -prune -o \
+ -path boards/modalai/voxl2/libfc-sensor-api -prune -o \
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) | grep $PATTERN
diff --git a/Tools/msg/templates/uorb/msg.cpp.em b/Tools/msg/templates/uorb/msg.cpp.em
index b77c013b91e1..4ffe4c38d14c 100644
--- a/Tools/msg/templates/uorb/msg.cpp.em
+++ b/Tools/msg/templates/uorb/msg.cpp.em
@@ -73,9 +73,16 @@ struct_size, padding_end_size = add_padding_bytes(sorted_fields, search_path)
#include
#include
+@{
+queue_length = 1
+for constant in spec.constants:
+ if constant.name == 'ORB_QUEUE_LENGTH':
+ queue_length = constant.val
+}@
+
@[for topic in topics]@
static_assert(static_cast(ORB_ID::@topic) == @(all_topics.index(topic)), "ORB_ID index mismatch");
-ORB_DEFINE(@topic, struct @uorb_struct, @(struct_size-padding_end_size), @(message_hash)u, static_cast(ORB_ID::@topic));
+ORB_DEFINE(@topic, struct @uorb_struct, @(struct_size-padding_end_size), @(message_hash)u, static_cast(ORB_ID::@topic), @queue_length);
@[end for]
void print_message(const orb_metadata *meta, const @uorb_struct& message)
diff --git a/Tools/simulation/gazebo-classic/sitl_gazebo-classic b/Tools/simulation/gazebo-classic/sitl_gazebo-classic
index 33ac87a37676..da7206e05770 160000
--- a/Tools/simulation/gazebo-classic/sitl_gazebo-classic
+++ b/Tools/simulation/gazebo-classic/sitl_gazebo-classic
@@ -1 +1 @@
-Subproject commit 33ac87a37676fb597de110e926bbf0a080169ffe
+Subproject commit da7206e057703cc645770f02437013358b71e1c0
diff --git a/Tools/simulation/gz b/Tools/simulation/gz
index c78f7f014171..6b4ed09d1b49 160000
--- a/Tools/simulation/gz
+++ b/Tools/simulation/gz
@@ -1 +1 @@
-Subproject commit c78f7f01417168e8faab7a83ade2129c0d26b39d
+Subproject commit 6b4ed09d1b495fbff663f098979cc046df013abd
diff --git a/_last_entry b/_last_entry
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index e7f57cbb2f94..000000000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-# Build version
-version: "{build}"
-# do not shallow clone because we want to infer the version from the last tag
-
-branches:
- only:
- - master
- - beta
- - stable
-
-# Build worker image (build VM template)
-image: Visual Studio 2017
-
-environment:
- matrix:
- - PX4_CONFIG: tests # this builds posix in px4_sitl_test folder and runs tests
- - PX4_CONFIG: px4_fmu-v5_default
-
-install:
-# if the toolchain wasn't restored from build cache download and install it
-- ps: >-
- if (-not (Test-Path C:\PX4)) {
- Invoke-WebRequest https://s3-us-west-2.amazonaws.com/px4-tools/PX4+Windows+Cygwin+Toolchain/PX4+Windows+Cygwin+Toolchain+0.9.msi -OutFile C:\Toolchain.msi
- Start-Process -Wait msiexec -ArgumentList '/I C:\Toolchain.msi /quiet /qn /norestart /log C:\install.log'
- }
-
-# Note: using Start-Process -Wait is important
-# because otherwise the install begins but non-blocking and the result cannot be used just after
-
-build_script:
-# FIXME Temporary we need to create the home folder because it's not contained in installer 0.5 and CI fails if it doesn't exist
-- if not exist "C:\PX4\home" mkdir C:\PX4\home
-# setup the environmental variables to work within the installed cygwin toolchain
-- call C:\PX4\toolchain\scripts\setup-environment.bat x
-# safe the repopath for switching to it in cygwin bash
-- for /f %%i in ('cygpath -u %%CD%%') do set repopath=%%i
-# build the make target
-- call bash --login -c "cd $repopath && make $PX4_CONFIG"
-
-# Note: using bash --login is important
-# because otherwise certain things (like python; import numpy) do not work
-
-cache:
-# cache the entire toolchain installation folder to avoid
-# downloading it from AWS S3 and installing the MSI each time
-# it's ~1.8GB > 1GB free limit for build caches
-- C:\PX4 -> appveyor.yml
diff --git a/boards/ark/can-flow/firmware.prototype b/boards/ark/can-flow/firmware.prototype
index a59e1adca629..fc0df258228e 100644
--- a/boards/ark/can-flow/firmware.prototype
+++ b/boards/ark/can-flow/firmware.prototype
@@ -4,7 +4,7 @@
"description": "Firmware for the ARK flow board",
"image": "",
"build_time": 0,
- "summary": "ARFFLOW",
+ "summary": "ARKFLOW",
"version": "0.1",
"image_size": 0,
"image_maxsize": 2080768,
diff --git a/boards/ark/fmu-v6x/init/rc.board_defaults b/boards/ark/fmu-v6x/init/rc.board_defaults
index 87451b0c52ea..52d098101df1 100644
--- a/boards/ark/fmu-v6x/init/rc.board_defaults
+++ b/boards/ark/fmu-v6x/init/rc.board_defaults
@@ -22,12 +22,12 @@ param set-default SENS_IMU_TEMP 10.0
#param set-default SENS_IMU_TEMP_I 0.025
#param set-default SENS_IMU_TEMP_P 1.0
-if ver hwtypecmp ARKV6X000000 ARKV6X001000 ARKV6X002000 ARKV6X003000 ARKV6X004000 ARKV6X005000 ARKV6X006000 ARKV6X007000
+if ver hwtypecmp ARKV6X000
then
param set-default SENS_TEMP_ID 2818058
fi
-if ver hwtypecmp ARKV6X000001 ARKV6X001001 ARKV6X002001 ARKV6X003001 ARKV6X004001 ARKV6X005001 ARKV6X006001 ARKV6X007001
+if ver hwtypecmp ARKV6X001
then
param set-default SENS_TEMP_ID 3014666
fi
diff --git a/boards/ark/fmu-v6x/init/rc.board_sensors b/boards/ark/fmu-v6x/init/rc.board_sensors
index 20f0c228d59b..a3e32486df80 100644
--- a/boards/ark/fmu-v6x/init/rc.board_sensors
+++ b/boards/ark/fmu-v6x/init/rc.board_sensors
@@ -5,7 +5,7 @@
set HAVE_PM2 yes
set HAVE_PM3 yes
-if ver hwtypecmp ARKV6X005000 ARKV6X005001 ARKV6X005002 ARKV6X005003 ARKV6X005004
+if mft query -q -k MFT -s MFT_PM2 -v 0
then
set HAVE_PM2 no
set HAVE_PM3 no
@@ -66,7 +66,7 @@ then
fi
fi
-if ver hwtypecmp ARKV6X000000 ARKV6X001000 ARKV6X002000 ARKV6X003000 ARKV6X004000 ARKV6X005000 ARKV6X006000 ARKV6X007000
+if ver hwtypecmp ARKV6X000
then
# Internal SPI bus IIM42652 with SPIX measured frequency of 32.051kHz
iim42652 -R 3 -s -b 1 -C 32051 start
@@ -78,7 +78,7 @@ then
icm42688p -R 6 -s -b 3 -C 32051 start
fi
-if ver hwtypecmp ARKV6X000001 ARKV6X001001 ARKV6X002001 ARKV6X003001 ARKV6X004001 ARKV6X005001 ARKV6X006001 ARKV6X007001
+if ver hwtypecmp ARKV6X001
then
# Internal SPI bus IIM42653 with SPIX measured frequency of 32.051kHz
#iim42653 -R 3 -s -b 1 -C 32051 start
diff --git a/boards/ark/fmu-v6x/nuttx-config/include/board.h b/boards/ark/fmu-v6x/nuttx-config/include/board.h
index 333c20905d21..fa82671a826f 100644
--- a/boards/ark/fmu-v6x/nuttx-config/include/board.h
+++ b/boards/ark/fmu-v6x/nuttx-config/include/board.h
@@ -248,7 +248,7 @@
/* ADC 1 2 3 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2
/* FDCAN 1 2 clock source */
@@ -380,7 +380,7 @@
#define GPIO_UART5_RX GPIO_UART5_RX_3 /* PD2 */
#define GPIO_UART5_TX GPIO_UART5_TX_3 /* PC12 */
// GPIO_UART5_RTS No remap /* PC8 */
-// GPIO_UART5_CTS No remap /* PC9 */
+#define GPIO_UART5_CTS (GPIO_ALT|GPIO_AF8|GPIO_PORTC|GPIO_PIN9|GPIO_PULLDOWN) /* PC9 */
#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */
#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */
diff --git a/boards/ark/fmu-v6x/src/CMakeLists.txt b/boards/ark/fmu-v6x/src/CMakeLists.txt
index 3135751c666e..78b8222f19d8 100644
--- a/boards/ark/fmu-v6x/src/CMakeLists.txt
+++ b/boards/ark/fmu-v6x/src/CMakeLists.txt
@@ -55,7 +55,6 @@ else()
init.c
led.c
mtd.cpp
- manifest.c
sdio.c
spi.cpp
spix_sync.c
diff --git a/boards/ark/fmu-v6x/src/board_config.h b/boards/ark/fmu-v6x/src/board_config.h
index 4782fc7efdd8..04b84631c760 100644
--- a/boards/ark/fmu-v6x/src/board_config.h
+++ b/boards/ark/fmu-v6x/src/board_config.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
- * Copyright (c) 2016-2022 PX4 Development Team. All rights reserved.
+ * Copyright (c) 2016-2024 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -204,25 +204,17 @@
#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f)
/* HW Version and Revision drive signals Default to 1 to detect */
-#define BOARD_HAS_HW_VERSIONING
+#define BOARD_HAS_HW_SPLIT_VERSIONING
#define GPIO_HW_VER_REV_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0)
#define GPIO_HW_REV_SENSE /* PH4 */ GPIO_ADC3_INP15
#define GPIO_HW_VER_SENSE /* PH3 */ GPIO_ADC3_INP14
#define HW_INFO_INIT_PREFIX "ARKV6X"
-#define BOARD_NUM_SPI_CFG_HW_VERSIONS 8 // Rev 0 and Rev 1
+#define BOARD_NUM_SPI_CFG_HW_VERSIONS 2
// Base/FMUM
-#define ARKV6X00 HW_VER_REV(0x0,0x0) // ARKV6X, Sensor Set Rev 0
-#define ARKV6X01 HW_VER_REV(0x0,0x1) // ARKV6X, Sensor Set Rev 1
-//#define ARKV6X03 HW_VER_REV(0x0,0x3) // ARKV6X, Sensor Set Rev 3
-//#define ARKV6X04 HW_VER_REV(0x0,0x4) // ARKV6X, Sensor Set Rev 4
-#define ARKV6X10 HW_VER_REV(0x1,0x0) // NO PX4IO, Sensor Set Rev 0
-#define ARKV6X11 HW_VER_REV(0x1,0x1) // NO PX4IO, Sensor Set Rev 1
-#define ARKV6X40 HW_VER_REV(0x4,0x0) // ARKV6X, Sensor Set Rev 0 HB CM4 base Rev 3
-#define ARKV6X41 HW_VER_REV(0x4,0x1) // ARKV6X, Sensor Set Rev 1 HB CM4 base Rev 4
-#define ARKV6X50 HW_VER_REV(0x5,0x0) // ARKV6X, Sensor Set Rev 0 HB Mini Rev 5
-#define ARKV6X51 HW_VER_REV(0x5,0x1) // ARKV6X, Sensor Set Rev 1 HB Mini Rev 1 // never shipped
+#define ARKV6X_0 HW_FMUM_ID(0x0) // ARKV6X, Sensor Set Rev 0
+#define ARKV6X_1 HW_FMUM_ID(0x1) // ARKV6X, Sensor Set Rev 1
#define UAVCAN_NUM_IFACES_RUNTIME 1
diff --git a/boards/ark/fmu-v6x/src/manifest.c b/boards/ark/fmu-v6x/src/manifest.c
deleted file mode 100644
index f4e012bfb068..000000000000
--- a/boards/ark/fmu-v6x/src/manifest.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/****************************************************************************
- *
- * Copyright (c) 2022 PX4 Development Team. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name PX4 nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/**
- * @file manifest.c
- *
- * This module supplies the interface to the manifest of hardware that is
- * optional and dependent on the HW REV and HW VER IDs
- *
- * The manifest allows the system to know whether a hardware option
- * say for example the PX4IO is an no-pop option vs it is broken.
- *
- */
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-#include
-
-#include
-#include
-#include
-
-#include "systemlib/px4_macros.h"
-
-/****************************************************************************
- * Pre-Processor Definitions
- ****************************************************************************/
-
-typedef struct {
- uint32_t hw_ver_rev; /* the version and revision */
- const px4_hw_mft_item_t *mft; /* The first entry */
- uint32_t entries; /* the lenght of the list */
-} px4_hw_mft_list_entry_t;
-
-typedef px4_hw_mft_list_entry_t *px4_hw_mft_list_entry;
-#define px4_hw_mft_list_uninitialized (px4_hw_mft_list_entry) -1
-
-static const px4_hw_mft_item_t device_unsupported = {0, 0, 0};
-
-// List of components on a specific board configuration
-// The index of those components is given by the enum (px4_hw_mft_item_id_t)
-// declared in board_common.h
-static const px4_hw_mft_item_t hw_mft_list_v0600[] = {
- {
- // PX4_MFT_PX4IO
- .present = 1,
- .mandatory = 1,
- .connection = px4_hw_con_onboard,
- },
- {
- // PX4_MFT_USB
- .present = 1,
- .mandatory = 1,
- .connection = px4_hw_con_onboard,
- },
- {
- // PX4_MFT_CAN2
- .present = 1,
- .mandatory = 1,
- .connection = px4_hw_con_onboard,
- },
-};
-
-static const px4_hw_mft_item_t hw_mft_list_v0610[] = {
- {
- // PX4_MFT_PX4IO
- .present = 0,
- .mandatory = 0,
- .connection = px4_hw_con_unknown,
- },
- {
- // PX4_MFT_USB
- .present = 1,
- .mandatory = 1,
- .connection = px4_hw_con_onboard,
- },
- {
- // PX4_MFT_CAN2
- .present = 1,
- .mandatory = 1,
- .connection = px4_hw_con_onboard,
- },
-};
-
-static const px4_hw_mft_item_t hw_mft_list_v0640[] = {
- {
- // PX4_MFT_PX4IO
- .present = 1,
- .mandatory = 1,
- .connection = px4_hw_con_onboard,
- },
- {
- // PX4_MFT_USB
- .present = 1,
- .mandatory = 1,
- .connection = px4_hw_con_onboard,
- },
- {
- // PX4_MFT_CAN2
- .present = 1,
- .mandatory = 1,
- .connection = px4_hw_con_onboard,
- },
-};
-
-static const px4_hw_mft_item_t hw_mft_list_v0650[] = {
- {
- // PX4_MFT_PX4IO
- .present = 1,
- .mandatory = 1,
- .connection = px4_hw_con_unknown,
- },
- {
- // PX4_MFT_USB
- .present = 1,
- .mandatory = 1,
- .connection = px4_hw_con_onboard,
- },
- {
- // PX4_MFT_CAN2
- .present = 0,
- .mandatory = 0,
- .connection = px4_hw_con_unknown,
- },
-};
-
-
-static px4_hw_mft_list_entry_t mft_lists[] = {
-// ver_rev
- {ARKV6X00, hw_mft_list_v0600, arraySize(hw_mft_list_v0600)}, // ARKV6X, Sensor Set Rev 0
- {ARKV6X01, hw_mft_list_v0600, arraySize(hw_mft_list_v0600)}, // ARKV6X, Sensor Set Rev 1
- {ARKV6X10, hw_mft_list_v0610, arraySize(hw_mft_list_v0610)}, // NO PX4IO, Sensor Set Rev 0
- {ARKV6X11, hw_mft_list_v0610, arraySize(hw_mft_list_v0610)}, // NO PX4IO, Sensor Set Rev 1
- {ARKV6X40, hw_mft_list_v0640, arraySize(hw_mft_list_v0640)}, // ARKV6X, Sensor Set Rev 0 HB CM4 base Rev 3
- {ARKV6X41, hw_mft_list_v0640, arraySize(hw_mft_list_v0640)}, // ARKV6X, Sensor Set Rev 1 HB CM4 base Rev 4
- {ARKV6X50, hw_mft_list_v0650, arraySize(hw_mft_list_v0650)}, // ARKV6X, Sensor Set Rev 0 HB Mini Rev 5
- {ARKV6X51, hw_mft_list_v0650, arraySize(hw_mft_list_v0650)}, // ARKV6X, Sensor Set Rev 1 HB Mini Rev 1 // never shipped
-};
-
-/************************************************************************************
- * Name: board_query_manifest
- *
- * Description:
- * Optional returns manifest item.
- *
- * Input Parameters:
- * manifest_id - the ID for the manifest item to retrieve
- *
- * Returned Value:
- * 0 - item is not in manifest => assume legacy operations
- * pointer to a manifest item
- *
- ************************************************************************************/
-
-__EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id)
-{
- static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized;
-
- if (boards_manifest == px4_hw_mft_list_uninitialized) {
- uint32_t ver_rev = board_get_hw_version() << 16;
- ver_rev |= board_get_hw_revision();
-
- for (unsigned i = 0; i < arraySize(mft_lists); i++) {
- if (mft_lists[i].hw_ver_rev == ver_rev) {
- boards_manifest = &mft_lists[i];
- break;
- }
- }
-
- if (boards_manifest == px4_hw_mft_list_uninitialized) {
- syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev);
- }
- }
-
- px4_hw_mft_item rv = &device_unsupported;
-
- if (boards_manifest != px4_hw_mft_list_uninitialized &&
- id < boards_manifest->entries) {
- rv = &boards_manifest->mft[id];
- }
-
- return rv;
-}
diff --git a/boards/ark/fmu-v6x/src/mtd.cpp b/boards/ark/fmu-v6x/src/mtd.cpp
index 80d41e0b78a3..6e6004ad30bc 100644
--- a/boards/ark/fmu-v6x/src/mtd.cpp
+++ b/boards/ark/fmu-v6x/src/mtd.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
*
- * Copyright (C) 2022 PX4 Development Team. All rights reserved.
+ * Copyright (C) 2024 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,6 +31,9 @@
*
****************************************************************************/
+#include
+#include
+
#include
#include
// KiB BS nB
@@ -86,10 +89,16 @@ static const px4_mft_entry_s mtd_mft = {
.pmft = (void *) &board_mtd_config,
};
+static const px4_mft_entry_s mft_mft = {
+ .type = MFT,
+ .pmft = (void *) system_query_manifest,
+};
+
static const px4_mft_s mft = {
- .nmft = 1,
+ .nmft = 2,
.mfts = {
- &mtd_mft
+ &mtd_mft,
+ &mft_mft,
}
};
diff --git a/boards/ark/fmu-v6x/src/spi.cpp b/boards/ark/fmu-v6x/src/spi.cpp
index f83a5a91cd4b..fc60153efedf 100644
--- a/boards/ark/fmu-v6x/src/spi.cpp
+++ b/boards/ark/fmu-v6x/src/spi.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
*
- * Copyright (C) 2022 PX4 Development Team. All rights reserved.
+ * Copyright (C) 2024 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -36,7 +36,7 @@
#include
constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSIONS] = {
- initSPIHWVersion(ARKV6X00, {
+ initSPIFmumID(ARKV6X_0, {
initSPIBus(SPI::Bus::SPI1, {
initSPIDevice(DRV_IMU_DEVTYPE_IIM42652, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}),
}, {GPIO::PortI, GPIO::Pin11}),
@@ -59,145 +59,7 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
}),
}),
- initSPIHWVersion(ARKV6X01, {
- initSPIBus(SPI::Bus::SPI1, {
- initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}),
- }, {GPIO::PortI, GPIO::Pin11}),
- initSPIBus(SPI::Bus::SPI2, {
- initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}),
- }, {GPIO::PortF, GPIO::Pin4}),
- initSPIBus(SPI::Bus::SPI3, {
- initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}),
- }, {GPIO::PortE, GPIO::Pin7}),
- // initSPIBus(SPI::Bus::SPI4, {
- // // no devices
- // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
- // }, {GPIO::PortG, GPIO::Pin8}),
- initSPIBus(SPI::Bus::SPI5, {
- initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
- }),
- initSPIBusExternal(SPI::Bus::SPI6, {
- initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}),
- initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}),
- }),
- }),
-
- initSPIHWVersion(ARKV6X10, {
- initSPIBus(SPI::Bus::SPI1, {
- initSPIDevice(DRV_IMU_DEVTYPE_IIM42652, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}),
- }, {GPIO::PortI, GPIO::Pin11}),
- initSPIBus(SPI::Bus::SPI2, {
- initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}),
- }, {GPIO::PortF, GPIO::Pin4}),
- initSPIBus(SPI::Bus::SPI3, {
- initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}),
- }, {GPIO::PortE, GPIO::Pin7}),
- // initSPIBus(SPI::Bus::SPI4, {
- // // no devices
- // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
- // }, {GPIO::PortG, GPIO::Pin8}),
- initSPIBus(SPI::Bus::SPI5, {
- initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
- }),
- initSPIBusExternal(SPI::Bus::SPI6, {
- initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}),
- initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}),
- }),
- }),
-
- initSPIHWVersion(ARKV6X11, {
- initSPIBus(SPI::Bus::SPI1, {
- initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}),
- }, {GPIO::PortI, GPIO::Pin11}),
- initSPIBus(SPI::Bus::SPI2, {
- initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}),
- }, {GPIO::PortF, GPIO::Pin4}),
- initSPIBus(SPI::Bus::SPI3, {
- initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}),
- }, {GPIO::PortE, GPIO::Pin7}),
- // initSPIBus(SPI::Bus::SPI4, {
- // // no devices
- // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
- // }, {GPIO::PortG, GPIO::Pin8}),
- initSPIBus(SPI::Bus::SPI5, {
- initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
- }),
- initSPIBusExternal(SPI::Bus::SPI6, {
- initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}),
- initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}),
- }),
- }),
-
- initSPIHWVersion(ARKV6X40, {
- initSPIBus(SPI::Bus::SPI1, {
- initSPIDevice(DRV_IMU_DEVTYPE_IIM42652, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}),
- }, {GPIO::PortI, GPIO::Pin11}),
- initSPIBus(SPI::Bus::SPI2, {
- initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}),
- }, {GPIO::PortF, GPIO::Pin4}),
- initSPIBus(SPI::Bus::SPI3, {
- initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}),
- }, {GPIO::PortE, GPIO::Pin7}),
- // initSPIBus(SPI::Bus::SPI4, {
- // // no devices
- // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
- // }, {GPIO::PortG, GPIO::Pin8}),
- initSPIBus(SPI::Bus::SPI5, {
- initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
- }),
- initSPIBusExternal(SPI::Bus::SPI6, {
- initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}),
- initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}),
- }),
- }),
-
- initSPIHWVersion(ARKV6X41, {
- initSPIBus(SPI::Bus::SPI1, {
- initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}),
- }, {GPIO::PortI, GPIO::Pin11}),
- initSPIBus(SPI::Bus::SPI2, {
- initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}),
- }, {GPIO::PortF, GPIO::Pin4}),
- initSPIBus(SPI::Bus::SPI3, {
- initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}),
- }, {GPIO::PortE, GPIO::Pin7}),
- // initSPIBus(SPI::Bus::SPI4, {
- // // no devices
- // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
- // }, {GPIO::PortG, GPIO::Pin8}),
- initSPIBus(SPI::Bus::SPI5, {
- initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
- }),
- initSPIBusExternal(SPI::Bus::SPI6, {
- initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}),
- initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}),
- }),
- }),
-
- initSPIHWVersion(ARKV6X50, {
- initSPIBus(SPI::Bus::SPI1, {
- initSPIDevice(DRV_IMU_DEVTYPE_IIM42652, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}),
- }, {GPIO::PortI, GPIO::Pin11}),
- initSPIBus(SPI::Bus::SPI2, {
- initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortA, GPIO::Pin10}),
- }, {GPIO::PortF, GPIO::Pin4}),
- initSPIBus(SPI::Bus::SPI3, {
- initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}),
- }, {GPIO::PortE, GPIO::Pin7}),
- // initSPIBus(SPI::Bus::SPI4, {
- // // no devices
- // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h
- // }, {GPIO::PortG, GPIO::Pin8}),
- initSPIBus(SPI::Bus::SPI5, {
- initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7})
- }),
- initSPIBusExternal(SPI::Bus::SPI6, {
- initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}),
- initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}),
- }),
- }),
-
- initSPIHWVersion(ARKV6X51, {
+ initSPIFmumID(ARKV6X_1, {
initSPIBus(SPI::Bus::SPI1, {
initSPIDevice(DRV_IMU_DEVTYPE_IIM42653, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}),
}, {GPIO::PortI, GPIO::Pin11}),
diff --git a/boards/ark/septentrio-gps/canbootloader.px4board b/boards/ark/septentrio-gps/canbootloader.px4board
new file mode 100644
index 000000000000..46917280f6a4
--- /dev/null
+++ b/boards/ark/septentrio-gps/canbootloader.px4board
@@ -0,0 +1,5 @@
+CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
+CONFIG_BOARD_ARCHITECTURE="cortex-m4"
+CONFIG_BOARD_ROMFSROOT=""
+CONFIG_BOARD_CONSTRAINED_MEMORY=y
+CONFIG_DRIVERS_BOOTLOADERS=y
diff --git a/boards/ark/septentrio-gps/default.px4board b/boards/ark/septentrio-gps/default.px4board
new file mode 100644
index 000000000000..b62a95d689d5
--- /dev/null
+++ b/boards/ark/septentrio-gps/default.px4board
@@ -0,0 +1,38 @@
+CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
+CONFIG_BOARD_ARCHITECTURE="cortex-m4"
+CONFIG_BOARD_ROMFSROOT="cannode"
+CONFIG_BOARD_NO_HELP=y
+CONFIG_BOARD_CONSTRAINED_MEMORY=y
+CONFIG_DRIVERS_BAROMETER_BMP388=y
+CONFIG_DRIVERS_BOOTLOADERS=y
+CONFIG_DRIVERS_GPS=y
+CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
+CONFIG_DRIVERS_MAGNETOMETER_BOSCH_BMM150=y
+CONFIG_DRIVERS_SAFETY_BUTTON=y
+CONFIG_DRIVERS_TONE_ALARM=y
+CONFIG_BOARD_UAVCAN_INTERFACES=1
+CONFIG_DRIVERS_UAVCANNODE=y
+CONFIG_UAVCANNODE_BEEP_COMMAND=y
+CONFIG_UAVCANNODE_GNSS_FIX=y
+CONFIG_UAVCANNODE_LIGHTS_COMMAND=y
+CONFIG_UAVCANNODE_MAGNETIC_FIELD_STRENGTH=y
+CONFIG_UAVCANNODE_RTK_DATA=y
+CONFIG_UAVCANNODE_SAFETY_BUTTON=y
+CONFIG_UAVCANNODE_STATIC_PRESSURE=y
+CONFIG_UAVCANNODE_STATIC_TEMPERATURE=y
+CONFIG_MODULES_EKF2=y
+CONFIG_MODULES_GYRO_CALIBRATION=y
+CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
+CONFIG_MODULES_SENSORS=y
+# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set
+# CONFIG_SENSORS_VEHICLE_AIR_DATA is not set
+# CONFIG_SENSORS_VEHICLE_GPS_POSITION is not set
+CONFIG_SYSTEMCMDS_PARAM=y
+CONFIG_SYSTEMCMDS_PERF=y
+CONFIG_SYSTEMCMDS_REBOOT=y
+CONFIG_SYSTEMCMDS_SYSTEM_TIME=y
+CONFIG_SYSTEMCMDS_TOP=y
+CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
+CONFIG_SYSTEMCMDS_UORB=y
+CONFIG_SYSTEMCMDS_VER=y
+CONFIG_SYSTEMCMDS_WORK_QUEUE=y
diff --git a/boards/ark/septentrio-gps/firmware.prototype b/boards/ark/septentrio-gps/firmware.prototype
new file mode 100644
index 000000000000..a21fe346ffc8
--- /dev/null
+++ b/boards/ark/septentrio-gps/firmware.prototype
@@ -0,0 +1,13 @@
+{
+ "board_id": 84,
+ "magic": "PX4FWv1",
+ "description": "Firmware for the ARK Septentrio GPS board",
+ "image": "",
+ "build_time": 0,
+ "summary": "ARKSEPTENTRIOGPS",
+ "version": "0.1",
+ "image_size": 0,
+ "image_maxsize": 2080768,
+ "git_identity": "",
+ "board_revision": 0
+}
diff --git a/boards/ark/septentrio-gps/init/rc.board_defaults b/boards/ark/septentrio-gps/init/rc.board_defaults
new file mode 100644
index 000000000000..0db1234ce96d
--- /dev/null
+++ b/boards/ark/septentrio-gps/init/rc.board_defaults
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# board specific defaults
+#------------------------------------------------------------------------------
+
+param set-default CBRK_IO_SAFETY 0
+param set-default CANNODE_SUB_MBD 1
+param set-default CANNODE_SUB_RTCM 1
+param set-default MBE_ENABLE 1
+param set-default SENS_IMU_CLPNOTI 0
+
+safety_button start
+tone_alarm start
+
+ekf2 start
diff --git a/boards/ark/septentrio-gps/init/rc.board_sensors b/boards/ark/septentrio-gps/init/rc.board_sensors
new file mode 100644
index 000000000000..43e4e6c506cc
--- /dev/null
+++ b/boards/ark/septentrio-gps/init/rc.board_sensors
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# board sensors init
+#------------------------------------------------------------------------------
+gps start -d /dev/ttyS0 -p sbf
+
+icm42688p -R 0 -s start
+
+bmp388 -I -b 1 start
+
+bmm150 -I -b 1 start
diff --git a/boards/ark/septentrio-gps/nuttx-config/canbootloader/defconfig b/boards/ark/septentrio-gps/nuttx-config/canbootloader/defconfig
new file mode 100644
index 000000000000..0208af2cac25
--- /dev/null
+++ b/boards/ark/septentrio-gps/nuttx-config/canbootloader/defconfig
@@ -0,0 +1,57 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed .config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that includes your
+# modifications.
+#
+CONFIG_ARCH="arm"
+CONFIG_ARCH_BOARD_CUSTOM=y
+CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/septentrio-gps/nuttx-config"
+CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
+CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
+CONFIG_ARCH_CHIP="stm32"
+CONFIG_ARCH_CHIP_STM32=y
+CONFIG_ARCH_CHIP_STM32F412CE=y
+CONFIG_ARCH_INTERRUPTSTACK=4096
+CONFIG_ARMV7M_MEMCPY=y
+CONFIG_ARMV7M_USEBASEPRI=y
+CONFIG_BINFMT_DISABLE=y
+CONFIG_BOARDCTL=y
+CONFIG_BOARD_LOOPSPERMSEC=16717
+CONFIG_DEBUG_FULLOPT=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DEBUG_TCBINFO=y
+CONFIG_DEFAULT_SMALL=y
+CONFIG_DISABLE_MOUNTPOINT=y
+CONFIG_EXPERIMENTAL=y
+CONFIG_FDCLONE_DISABLE=y
+CONFIG_FDCLONE_STDIO=y
+CONFIG_HAVE_CXX=y
+CONFIG_HAVE_CXXINITIALIZE=y
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_INIT_STACKSIZE=4096
+CONFIG_LIBC_FLOATINGPOINT=y
+CONFIG_LIBC_LONG_LONG=y
+CONFIG_LIBC_STRERROR=y
+CONFIG_MM_REGIONS=2
+CONFIG_NAME_MAX=0
+CONFIG_NUNGET_CHARS=0
+CONFIG_PREALLOC_TIMERS=0
+CONFIG_PTHREAD_STACK_MIN=512
+CONFIG_RAM_SIZE=262144
+CONFIG_RAM_START=0x20010000
+CONFIG_RAW_BINARY=y
+CONFIG_SIG_DEFAULT=y
+CONFIG_SIG_SIGALRM_ACTION=y
+CONFIG_SIG_SIGUSR1_ACTION=y
+CONFIG_SIG_SIGUSR2_ACTION=y
+CONFIG_STACK_COLORATION=y
+CONFIG_START_DAY=30
+CONFIG_START_MONTH=11
+CONFIG_STDIO_DISABLE_BUFFERING=y
+CONFIG_STM32_FLASH_CONFIG_G=y
+CONFIG_STM32_NOEXT_VECTORS=y
+CONFIG_STM32_TIM8=y
+CONFIG_TASK_NAME_SIZE=0
+CONFIG_USEC_PER_TICK=1000
diff --git a/boards/ark/septentrio-gps/nuttx-config/include/board.h b/boards/ark/septentrio-gps/nuttx-config/include/board.h
new file mode 100644
index 000000000000..526392b92bbd
--- /dev/null
+++ b/boards/ark/septentrio-gps/nuttx-config/include/board.h
@@ -0,0 +1,152 @@
+/************************************************************************************
+ * configs/px4fmu/include/board.h
+ * include/arch/board/board.h
+ *
+ * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ************************************************************************************/
+#include "board_dma_map.h"
+
+#ifndef __ARCH_BOARD_BOARD_H
+#define __ARCH_BOARD_BOARD_H
+
+#include
+#ifndef __ASSEMBLY__
+# include
+#endif
+
+#include
+
+/* HSI - 8 MHz RC factory-trimmed
+ * LSI - 32 KHz RC
+ * HSE - 8 MHz Crystal
+ * LSE - not installed
+ */
+#define STM32_BOARD_USEHSE 1
+#define STM32_BOARD_XTAL 8000000
+#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL
+
+#define STM32_HSI_FREQUENCY 16000000ul
+#define STM32_LSI_FREQUENCY 32000
+
+/* Main PLL Configuration */
+#define STM32_PLLCFG_PLLM RCC_PLLCFG_PLLM(8)
+#define STM32_PLLCFG_PLLN RCC_PLLCFG_PLLN(384)
+#define STM32_PLLCFG_PLLP RCC_PLLCFG_PLLP_4
+#define STM32_PLLCFG_PLLQ RCC_PLLCFG_PLLQ(8)
+#define STM32_PLLCFG_PLLR RCC_PLLCFG_PLLR(2)
+
+#define STM32_RCC_PLLI2SCFGR_PLLI2SM RCC_PLLI2SCFGR_PLLI2SM(16)
+#define STM32_RCC_PLLI2SCFGR_PLLI2SN RCC_PLLI2SCFGR_PLLI2SN(192)
+#define STM32_RCC_PLLI2SCFGR_PLLI2SQ RCC_PLLI2SCFGR_PLLI2SQ(2)
+#define STM32_RCC_PLLI2SCFGR_PLLI2SR RCC_PLLI2SCFGR_PLLI2SR(2)
+#define STM32_RCC_PLLI2SCFGR_PLLI2SSRC RCC_PLLI2SCFGR_PLLI2SSRC(0) /* HSE or HSI depending on PLLSRC of PLLCFGR*/
+
+#define STM32_RCC_DCKCFGR2_CK48MSEL RCC_DCKCFGR2_CK48MSEL_PLL
+#define STM32_RCC_DCKCFGR2_FMPI2C1SEL RCC_DCKCFGR2_FMPI2C1SEL_APB
+#define STM32_RCC_DCKCFGR2_SDIOSEL RCC_DCKCFGR2_SDIOSEL_48MHZ
+
+#define STM32_SYSCLK_FREQUENCY 96000000ul
+
+/* AHB clock (HCLK) is SYSCLK (96MHz) */
+#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK /* HCLK = SYSCLK / 1 */
+#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY
+#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* Same as above, to satisfy compiler */
+
+/* APB1 clock (PCLK1) is HCLK/2 (48MHz) */
+#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */
+#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2)
+
+/* Timers driven from APB1 will be twice PCLK1 (see page 112 of reference manual) */
+#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM12_CLKIN (2*STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM13_CLKIN (2*STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM14_CLKIN (2*STM32_PCLK1_FREQUENCY)
+
+/* APB2 clock (PCLK2) is HCLK (96MHz) */
+#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK /* PCLK2 = HCLK */
+#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY)
+
+/* Timers driven from APB2 will be PCLK2 since no prescale division */
+#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY)
+#define STM32_APB2_TIM8_CLKIN (STM32_PCLK2_FREQUENCY)
+#define STM32_APB2_TIM9_CLKIN (STM32_PCLK2_FREQUENCY)
+#define STM32_APB2_TIM10_CLKIN (STM32_PCLK2_FREQUENCY)
+#define STM32_APB2_TIM11_CLKIN (STM32_PCLK2_FREQUENCY)
+
+/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx otherwise frequency is 2xAPBx. */
+#define BOARD_TIM2_FREQUENCY (2 * STM32_PCLK1_FREQUENCY)
+#define BOARD_TIM3_FREQUENCY (2 * STM32_PCLK1_FREQUENCY)
+#define BOARD_TIM4_FREQUENCY (2 * STM32_PCLK1_FREQUENCY)
+#define BOARD_TIM5_FREQUENCY (2 * STM32_PCLK1_FREQUENCY)
+#define BOARD_TIM6_FREQUENCY (2 * STM32_PCLK1_FREQUENCY)
+#define BOARD_TIM7_FREQUENCY (2 * STM32_PCLK1_FREQUENCY)
+#define BOARD_TIM8_FREQUENCY (2 * STM32_PCLK2_FREQUENCY)
+
+/* Alternate function pin selections ************************************************/
+
+/* UARTs */
+#define GPIO_USART1_RX GPIO_USART1_RX_2
+#define GPIO_USART1_TX GPIO_USART1_TX_3
+
+#define GPIO_USART2_RX GPIO_USART2_RX_1
+#define GPIO_USART2_TX GPIO_USART2_TX_1
+
+/* CAN */
+#define GPIO_CAN1_RX GPIO_CAN1_RX_1
+#define GPIO_CAN1_TX GPIO_CAN1_TX_1
+
+/* I2C */
+
+#define GPIO_MCU_I2C1_SCL
+#define GPIO_MCU_I2C1_SDA
+
+#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1
+#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1
+
+#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6)
+#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN7)
+
+#define GPIO_I2C2_SCL GPIO_I2C2_SCL_1
+#define GPIO_I2C2_SDA GPIO_I2C2_SDA_4
+
+#define GPIO_I2C2_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN9)
+#define GPIO_I2C2_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN |GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN10)
+
+/* SPI */
+#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1
+#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1
+#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1
+
+#endif /* __ARCH_BOARD_BOARD_H */
diff --git a/boards/ark/septentrio-gps/nuttx-config/include/board_dma_map.h b/boards/ark/septentrio-gps/nuttx-config/include/board_dma_map.h
new file mode 100644
index 000000000000..efa3d824b2f6
--- /dev/null
+++ b/boards/ark/septentrio-gps/nuttx-config/include/board_dma_map.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+ *
+ * Copyright (c) 2021 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#pragma once
+
+// DMA1 Channel/Stream Selections
+//--------------------------------------------//---------------------------//----------------
+
+
+// DMA2 Channel/Stream Selections
+//--------------------------------------------//---------------------------//----------------
+#define DMACHAN_SPI1_RX DMAMAP_SPI1_RX_1 // DMA2, Stream 0, Channel 3
+#define DMACHAN_SPI1_TX DMAMAP_SPI1_TX_1 // DMA2, Stream 3, Channel 3
+#define DMACHAN_USART1_RX DMAMAP_USART1_RX_1 // DMA2, Stream 2, Channel 4
+#define DMAMAP_USART1_RX DMAMAP_USART1_RX_1
+//#define DMACHAN_USART1_TX DMAMAP_USART1_TX // DMA2, Stream 7, Channel 4
diff --git a/boards/ark/septentrio-gps/nuttx-config/nsh/defconfig b/boards/ark/septentrio-gps/nuttx-config/nsh/defconfig
new file mode 100644
index 000000000000..176ae3eccc5b
--- /dev/null
+++ b/boards/ark/septentrio-gps/nuttx-config/nsh/defconfig
@@ -0,0 +1,153 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed .config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that includes your
+# modifications.
+#
+# CONFIG_DISABLE_ENVIRON is not set
+# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set
+# CONFIG_DISABLE_PTHREAD is not set
+# CONFIG_NSH_DISABLEBG is not set
+# CONFIG_NSH_DISABLESCRIPT is not set
+# CONFIG_NSH_DISABLE_CAT is not set
+# CONFIG_NSH_DISABLE_CD is not set
+# CONFIG_NSH_DISABLE_CP is not set
+# CONFIG_NSH_DISABLE_DATE is not set
+# CONFIG_NSH_DISABLE_DF is not set
+# CONFIG_NSH_DISABLE_ECHO is not set
+# CONFIG_NSH_DISABLE_ENV is not set
+# CONFIG_NSH_DISABLE_EXEC is not set
+# CONFIG_NSH_DISABLE_EXPORT is not set
+# CONFIG_NSH_DISABLE_FREE is not set
+# CONFIG_NSH_DISABLE_GET is not set
+# CONFIG_NSH_DISABLE_HELP is not set
+# CONFIG_NSH_DISABLE_ITEF is not set
+# CONFIG_NSH_DISABLE_KILL is not set
+# CONFIG_NSH_DISABLE_LOOPS is not set
+# CONFIG_NSH_DISABLE_LS is not set
+# CONFIG_NSH_DISABLE_MKDIR is not set
+# CONFIG_NSH_DISABLE_MOUNT is not set
+# CONFIG_NSH_DISABLE_MV is not set
+# CONFIG_NSH_DISABLE_PS is not set
+# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set
+# CONFIG_NSH_DISABLE_PWD is not set
+# CONFIG_NSH_DISABLE_RM is not set
+# CONFIG_NSH_DISABLE_RMDIR is not set
+# CONFIG_NSH_DISABLE_SEMICOLON is not set
+# CONFIG_NSH_DISABLE_SET is not set
+# CONFIG_NSH_DISABLE_SLEEP is not set
+# CONFIG_NSH_DISABLE_SOURCE is not set
+# CONFIG_NSH_DISABLE_TEST is not set
+# CONFIG_NSH_DISABLE_TIME is not set
+# CONFIG_NSH_DISABLE_UMOUNT is not set
+# CONFIG_NSH_DISABLE_UNSET is not set
+# CONFIG_NSH_DISABLE_USLEEP is not set
+CONFIG_ARCH="arm"
+CONFIG_ARCH_BOARD_CUSTOM=y
+CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/ark/septentrio-gps/nuttx-config"
+CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
+CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
+CONFIG_ARCH_CHIP="stm32"
+CONFIG_ARCH_CHIP_STM32=y
+CONFIG_ARCH_CHIP_STM32F412CE=y
+CONFIG_ARCH_INTERRUPTSTACK=768
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_ARMV7M_MEMCPY=y
+CONFIG_ARMV7M_USEBASEPRI=y
+CONFIG_BOARDCTL_RESET=y
+CONFIG_BOARD_ASSERT_RESET_VALUE=0
+CONFIG_BOARD_LOOPSPERMSEC=16717
+CONFIG_BOARD_RESET_ON_ASSERT=2
+CONFIG_BUILTIN=y
+CONFIG_DEBUG_FULLOPT=y
+CONFIG_DEBUG_HARDFAULT_ALERT=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DEBUG_TCBINFO=y
+CONFIG_DEFAULT_SMALL=y
+CONFIG_FDCLONE_STDIO=y
+CONFIG_FS_CROMFS=y
+CONFIG_FS_ROMFS=y
+CONFIG_GRAN=y
+CONFIG_GRAN_INTR=y
+CONFIG_HAVE_CXX=y
+CONFIG_HAVE_CXXINITIALIZE=y
+CONFIG_I2C=y
+CONFIG_I2C_RESET=y
+CONFIG_IDLETHREAD_STACKSIZE=750
+CONFIG_INIT_ENTRYPOINT="nsh_main"
+CONFIG_INIT_STACKSIZE=2624
+CONFIG_LIBC_FLOATINGPOINT=y
+CONFIG_LIBC_LONG_LONG=y
+CONFIG_LIBC_MAX_EXITFUNS=1
+CONFIG_MEMSET_64BIT=y
+CONFIG_MEMSET_OPTSPEED=y
+CONFIG_MM_REGIONS=2
+CONFIG_NAME_MAX=40
+CONFIG_NSH_ARCHINIT=y
+CONFIG_NSH_ARGCAT=y
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_CMDPARMS=y
+CONFIG_NSH_CROMFSETC=y
+CONFIG_NSH_LINELEN=128
+CONFIG_NSH_MAXARGUMENTS=15
+CONFIG_NSH_NESTDEPTH=8
+CONFIG_NSH_QUOTE=y
+CONFIG_NSH_ROMFSETC=y
+CONFIG_NSH_ROMFSSECTSIZE=128
+CONFIG_NSH_VARS=y
+CONFIG_PREALLOC_TIMERS=50
+CONFIG_PTHREAD_MUTEX_ROBUST=y
+CONFIG_PTHREAD_STACK_MIN=512
+CONFIG_RAM_SIZE=262144
+CONFIG_RAM_START=0x20000000
+CONFIG_RAW_BINARY=y
+CONFIG_SCHED_HPWORK=y
+CONFIG_SCHED_HPWORKPRIORITY=249
+CONFIG_SCHED_HPWORKSTACKSIZE=1280
+CONFIG_SCHED_INSTRUMENTATION=y
+CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y
+CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
+CONFIG_SCHED_WAITPID=y
+CONFIG_SERIAL_TERMIOS=y
+CONFIG_SIG_DEFAULT=y
+CONFIG_SIG_SIGALRM_ACTION=y
+CONFIG_SIG_SIGUSR1_ACTION=y
+CONFIG_SIG_SIGUSR2_ACTION=y
+CONFIG_SIG_SIGWORK=4
+CONFIG_STACK_COLORATION=y
+CONFIG_START_DAY=30
+CONFIG_START_MONTH=11
+CONFIG_STDIO_BUFFER_SIZE=32
+CONFIG_STM32_ADC1=y
+CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y
+CONFIG_STM32_DMA1=y
+CONFIG_STM32_DMA2=y
+CONFIG_STM32_FLASH_CONFIG_G=y
+CONFIG_STM32_FLASH_PREFETCH=y
+CONFIG_STM32_FLOWCONTROL_BROKEN=y
+CONFIG_STM32_I2C1=y
+CONFIG_STM32_I2C2=y
+CONFIG_STM32_JTAG_SW_ENABLE=y
+CONFIG_STM32_PWR=y
+CONFIG_STM32_SERIALBRK_BSDCOMPAT=y
+CONFIG_STM32_SERIAL_DISABLE_REORDERING=y
+CONFIG_STM32_SPI1=y
+CONFIG_STM32_SPI1_DMA=y
+CONFIG_STM32_SPI1_DMA_BUFFER=1024
+CONFIG_STM32_TIM8=y
+CONFIG_STM32_USART1=y
+CONFIG_STM32_USART2=y
+CONFIG_STM32_USART_BREAKS=y
+CONFIG_STM32_WWDG=y
+CONFIG_SYSTEM_NSH=y
+CONFIG_TASK_NAME_SIZE=24
+CONFIG_USART1_BAUD=57600
+CONFIG_USART1_RXBUFSIZE=2000
+CONFIG_USART1_RXDMA=y
+CONFIG_USART1_TXBUFSIZE=2000
+CONFIG_USART2_BAUD=57600
+CONFIG_USART2_RXBUFSIZE=600
+CONFIG_USART2_SERIAL_CONSOLE=y
+CONFIG_USART2_TXBUFSIZE=1100
+CONFIG_USEC_PER_TICK=1000
diff --git a/boards/ark/septentrio-gps/nuttx-config/scripts/canbootloader_script.ld b/boards/ark/septentrio-gps/nuttx-config/scripts/canbootloader_script.ld
new file mode 100644
index 000000000000..48a59fe92d0e
--- /dev/null
+++ b/boards/ark/septentrio-gps/nuttx-config/scripts/canbootloader_script.ld
@@ -0,0 +1,134 @@
+/****************************************************************************
+ * nuttx-config/scripts/canbootloader_script.ld
+ *
+ * Copyright (C) 2015 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/* The STM32F412 has 1M of FLASH beginning at address 0x0800:0000 and
+ * 256Kb of SRAM. SRAM is split up into three blocks:
+ *
+ * 1) 112Kb of SRAM beginning at address 0x2000:0000
+ * 2) 16Kb of SRAM beginning at address 0x2001:c000
+ * 3) 64Kb of SRAM beginning at address 0x2002:0000
+ * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000
+ *
+ * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000
+ * where the code expects to begin execution by jumping to the entry point in
+ * the 0x0800:0000 address range.
+ *
+ * The first 0x10000 of flash is reserved for the bootloader.
+ */
+
+MEMORY
+{
+ flash (rx) : ORIGIN = 0x08000000, LENGTH = 32K
+ sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K
+}
+
+OUTPUT_ARCH(arm)
+
+ENTRY(__start) /* treat __start as the anchor for dead code stripping */
+EXTERN(_vectors) /* force the vectors to be included in the output */
+
+/*
+ * Ensure that abort() is present in the final object. The exception handling
+ * code pulled in by libgcc.a requires it (and that code cannot be easily avoided).
+ */
+EXTERN(abort)
+SECTIONS
+{
+ .text : {
+ _stext = ABSOLUTE(.);
+ *(.vectors)
+ *(.text .text.*)
+ *(.fixup)
+ *(.gnu.warning)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.t.*)
+ *(.got)
+ *(.gcc_except_table)
+ *(.gnu.linkonce.r.*)
+ _etext = ABSOLUTE(.);
+ } > flash
+
+ /*
+ * Init functions (static constructors and the like)
+ */
+ .init_section : {
+ _sinit = ABSOLUTE(.);
+ KEEP(*(.init_array .init_array.*))
+ _einit = ABSOLUTE(.);
+ } > flash
+
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } > flash
+
+ __exidx_start = ABSOLUTE(.);
+ .ARM.exidx : {
+ *(.ARM.exidx*)
+ } > flash
+ __exidx_end = ABSOLUTE(.);
+
+ _eronly = ABSOLUTE(.);
+
+ .data : {
+ _sdata = ABSOLUTE(.);
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
+ CONSTRUCTORS
+ _edata = ABSOLUTE(.);
+ } > sram AT > flash
+
+ .bss : {
+ _sbss = ABSOLUTE(.);
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
+ *(COMMON)
+ . = ALIGN(4);
+ _ebss = ABSOLUTE(.);
+ } > sram
+
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_info 0 : { *(.debug_info) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+}
diff --git a/boards/ark/septentrio-gps/nuttx-config/scripts/script.ld b/boards/ark/septentrio-gps/nuttx-config/scripts/script.ld
new file mode 100644
index 000000000000..2f4769b8f5b4
--- /dev/null
+++ b/boards/ark/septentrio-gps/nuttx-config/scripts/script.ld
@@ -0,0 +1,146 @@
+/****************************************************************************
+ * scripts/ld.script
+ *
+ * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/* The STM32F412 has 1M of FLASH beginning at address 0x0800:0000 and
+ * 256Kb of SRAM. SRAM is split up into three blocks:
+ *
+ * 1) 112Kb of SRAM beginning at address 0x2000:0000
+ * 2) 16Kb of SRAM beginning at address 0x2001:c000
+ * 3) 64Kb of SRAM beginning at address 0x2002:0000
+ * 4) 64Kb of TCM SRAM beginning at address 0x1000:0000
+ *
+ * When booting from FLASH, FLASH memory is aliased to address 0x0000:0000
+ * where the code expects to begin execution by jumping to the entry point in
+ * the 0x0800:0000 address range.
+ *
+ * The first 0x10000 of flash is reserved for the bootloader.
+ */
+
+MEMORY
+{
+ flash (rx) : ORIGIN = 0x08010000, LENGTH = 928K
+ sram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K
+}
+
+OUTPUT_ARCH(arm)
+
+ENTRY(__start) /* treat __start as the anchor for dead code stripping */
+EXTERN(_vectors) /* force the vectors to be included in the output */
+
+/*
+ * Ensure that abort() is present in the final object. The exception handling
+ * code pulled in by libgcc.a requires it (and that code cannot be easily avoided).
+ */
+EXTERN(abort)
+EXTERN(_bootdelay_signature)
+
+SECTIONS
+{
+ .text : {
+ _stext = ABSOLUTE(.);
+ *(.vectors)
+ . = ALIGN(8);
+ /*
+ * This section positions the app_descriptor_t used
+ * by the make_can_boot_descriptor.py tool to set
+ * the application image's descriptor so that the
+ * uavcan bootloader has the ability to validate the
+ * image crc, size etc
+ */
+ KEEP(*(.app_descriptor))
+ *(.text .text.*)
+ *(.fixup)
+ *(.gnu.warning)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.t.*)
+ *(.got)
+ *(.gcc_except_table)
+ *(.gnu.linkonce.r.*)
+ _etext = ABSOLUTE(.);
+ } > flash
+
+ /*
+ * Init functions (static constructors and the like)
+ */
+ .init_section : {
+ _sinit = ABSOLUTE(.);
+ KEEP(*(.init_array .init_array.*))
+ _einit = ABSOLUTE(.);
+ } > flash
+
+
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } > flash
+
+ __exidx_start = ABSOLUTE(.);
+ .ARM.exidx : {
+ *(.ARM.exidx*)
+ } > flash
+ __exidx_end = ABSOLUTE(.);
+
+ _eronly = ABSOLUTE(.);
+
+ .data : {
+ _sdata = ABSOLUTE(.);
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
+ CONSTRUCTORS
+ _edata = ABSOLUTE(.);
+ } > sram AT > flash
+
+ .bss : {
+ _sbss = ABSOLUTE(.);
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
+ *(COMMON)
+ . = ALIGN(4);
+ _ebss = ABSOLUTE(.);
+ } > sram
+
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_info 0 : { *(.debug_info) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+}
diff --git a/boards/ark/septentrio-gps/src/CMakeLists.txt b/boards/ark/septentrio-gps/src/CMakeLists.txt
new file mode 100644
index 000000000000..06bd98156f22
--- /dev/null
+++ b/boards/ark/septentrio-gps/src/CMakeLists.txt
@@ -0,0 +1,67 @@
+############################################################################
+#
+# Copyright (c) 2020 PX4 Development Team. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name PX4 nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+if("${PX4_BOARD_LABEL}" STREQUAL "canbootloader")
+
+ add_library(drivers_board
+ boot_config.h
+ boot.c
+ led.c
+ led.h
+ )
+ target_link_libraries(drivers_board
+ PRIVATE
+ nuttx_arch
+ nuttx_drivers
+ canbootloader
+ )
+ target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/canbootloader)
+
+else()
+ add_library(drivers_board
+ can.c
+ i2c.cpp
+ init.c
+ led.c
+ spi.cpp
+ )
+
+ target_link_libraries(drivers_board
+ PRIVATE
+ arch_spi
+ drivers__led # drv_led_start
+ nuttx_arch
+ nuttx_drivers
+ px4_layer
+ )
+endif()
diff --git a/boards/ark/septentrio-gps/src/board_config.h b/boards/ark/septentrio-gps/src/board_config.h
new file mode 100644
index 000000000000..2263956bae0f
--- /dev/null
+++ b/boards/ark/septentrio-gps/src/board_config.h
@@ -0,0 +1,125 @@
+/****************************************************************************
+ *
+ * Copyright (c) 2021 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/**
+ * @file board_config.h
+ *
+ * board internal definitions
+ */
+
+#pragma once
+
+#include
+#include
+#include
+
+/* BUTTON */
+#define GPIO_BTN_SAFETY /* PB15 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_PORTB|GPIO_PIN15)
+
+/* Safety LED */
+#define GPIO_LED_SAFETY /* PA1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN1)
+
+/* Tone alarm output. */
+#define TONE_ALARM_TIMER 2 /* timer 2 */
+#define TONE_ALARM_CHANNEL 1 /* channel 1 */
+#define GPIO_TONE_ALARM_IDLE /* PA0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_TONE_ALARM /* PA0 */ (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN0)
+
+/* CAN Silent mode control */
+#define GPIO_CAN1_SILENT_S0 /* PB12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN12)
+
+/* CAN termination software control */
+#define GPIO_CAN1_TERMINATION /* PB13 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN13)
+#define GPIO_CAN_TERM GPIO_CAN1_TERMINATION
+
+/* ICM42688p FSYNC */
+#define GPIO_42688P_FSYNC /* PB8 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN8)
+
+/* Boot config */
+#define GPIO_BOOT_CONFIG /* PC15 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN15|GPIO_EXTI)
+
+/* LEDs are driven with open drain to support Anode to 5V or 3.3V */
+#define GPIO_TIM1_CH1 /* PA8 */ (GPIO_TIM1_CH1_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz)
+#define GPIO_TIM1_CH2 /* PA9 */ (GPIO_TIM1_CH2_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz)
+#define GPIO_TIM1_CH3 /* PA10 */ (GPIO_TIM1_CH3_1|GPIO_OPENDRAIN|GPIO_SPEED_2MHz)
+
+#define GPIO_I2C1_SCL_RESET /* PB6 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN6)
+#define GPIO_I2C1_SDA_RESET /* PB7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN7)
+
+#define GPIO_I2C2_SCL_RESET /* PB10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C2_SDA_RESET /* PB9 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN9)
+
+#define GPIO_I2C2_SCL_RESET /* PB10 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_I2C2_SDA_RESET /* PB9 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN9)
+
+#define GPIO_USART1_RX_GPIO (GPIO_INPUT|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTB|GPIO_PIN3)
+#define GPIO_USART1_TX_GPIO (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN15)
+
+#define GPIO_USART2_RX_GPIO (GPIO_INPUT|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN3)
+#define GPIO_USART2_TX_GPIO (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_PULLUP|GPIO_SPEED_50MHz|GPIO_PORTA|GPIO_PIN2)
+
+#define FLASH_BASED_PARAMS
+
+/* High-resolution timer */
+#define HRT_TIMER 3 /* use timer 3 for the HRT */
+#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel 4 */
+
+#define PX4_GPIO_INIT_LIST { \
+ GPIO_BTN_SAFETY, \
+ GPIO_LED_SAFETY, \
+ GPIO_I2C1_SCL_RESET, \
+ GPIO_I2C1_SDA_RESET, \
+ GPIO_I2C2_SCL_RESET, \
+ GPIO_I2C2_SDA_RESET, \
+ GPIO_42688P_FSYNC, \
+ GPIO_BOOT_CONFIG, \
+ GPIO_CAN1_TX, \
+ GPIO_CAN1_RX, \
+ GPIO_CAN1_SILENT_S0, \
+ GPIO_CAN1_TERMINATION, \
+ }
+
+__BEGIN_DECLS
+
+#define BOARD_HAS_N_S_RGB_LED 1
+#define BOARD_MAX_LEDS BOARD_HAS_N_S_RGB_LED
+
+#ifndef __ASSEMBLY__
+
+extern void stm32_spiinitialize(void);
+
+#include
+
+#endif /* __ASSEMBLY__ */
+
+__END_DECLS
diff --git a/boards/ark/septentrio-gps/src/boot.c b/boards/ark/septentrio-gps/src/boot.c
new file mode 100644
index 000000000000..a26034e254f6
--- /dev/null
+++ b/boards/ark/septentrio-gps/src/boot.c
@@ -0,0 +1,188 @@
+/****************************************************************************
+ *
+ * Copyright (c) 2021 PX4 Development Team. All rights reserved.
+ * Author: Ben Dyer
+ * Pavel Kirienko
+ * David Sidrane
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+#include
+#include "boot_config.h"
+#include "board.h"
+
+#include
+#include
+#include
+
+#include
+#include "led.h"
+
+/************************************************************************************
+ * Name: stm32_boardinitialize
+ *
+ * Description:
+ * All STM32 architectures must provide the following entry point. This entry point
+ * is called early in the initialization -- after all memory has been configured
+ * and mapped but before any devices have been initialized.
+ *
+ ************************************************************************************/
+
+__EXPORT void stm32_boardinitialize(void)
+{
+ putreg32(getreg32(STM32_RCC_APB1ENR) | RCC_APB1ENR_CAN1EN, STM32_RCC_APB1ENR);
+ stm32_configgpio(GPIO_CAN1_RX);
+ stm32_configgpio(GPIO_CAN1_TX);
+ stm32_configgpio(GPIO_CAN1_SILENT_S0);
+ stm32_configgpio(GPIO_CAN1_TERMINATION);
+ putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR);
+ putreg32(getreg32(STM32_RCC_APB1RSTR) & ~RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR);
+
+#if defined(OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO)
+ stm32_configgpio(GPIO_GETNODEINFO_JUMPER);
+#endif
+
+}
+
+/************************************************************************************
+ * Name: board_deinitialize
+ *
+ * Description:
+ * This function is called by the bootloader code prior to booting
+ * the application. Is should place the HW into an benign initialized state.
+ *
+ ************************************************************************************/
+
+void board_deinitialize(void)
+{
+ putreg32(getreg32(STM32_RCC_APB1RSTR) | RCC_APB1RSTR_CAN1RST, STM32_RCC_APB1RSTR);
+}
+
+/****************************************************************************
+ * Name: board_get_product_name
+ *
+ * Description:
+ * Called to retrieve the product name. The returned value is a assumed
+ * to be written to a pascal style string that will be length prefixed
+ * and not null terminated
+ *
+ * Input Parameters:
+ * product_name - A pointer to a buffer to write the name.
+ * maxlen - The maximum number of charter that can be written
+ *
+ * Returned Value:
+ * The length of characters written to the buffer.
+ *
+ ****************************************************************************/
+
+uint8_t board_get_product_name(uint8_t *product_name, size_t maxlen)
+{
+ DEBUGASSERT(maxlen > UAVCAN_STRLEN(HW_UAVCAN_NAME));
+ memcpy(product_name, HW_UAVCAN_NAME, UAVCAN_STRLEN(HW_UAVCAN_NAME));
+ return UAVCAN_STRLEN(HW_UAVCAN_NAME);
+}
+
+/****************************************************************************
+ * Name: board_get_hardware_version
+ *
+ * Description:
+ * Called to retrieve the hardware version information. The function
+ * will first initialize the the callers struct to all zeros.
+ *
+ * Input Parameters:
+ * hw_version - A pointer to a uavcan_hardwareversion_t.
+ *
+ * Returned Value:
+ * Length of the unique_id
+ *
+ ****************************************************************************/
+
+size_t board_get_hardware_version(uavcan_HardwareVersion_t *hw_version)
+{
+ memset(hw_version, 0, sizeof(uavcan_HardwareVersion_t));
+
+ hw_version->major = HW_VERSION_MAJOR;
+ hw_version->minor = HW_VERSION_MINOR;
+
+ return board_get_mfguid(*(mfguid_t *) hw_version->unique_id);
+}
+
+/****************************************************************************
+ * Name: board_indicate
+ *
+ * Description:
+ * Provides User feedback to indicate the state of the bootloader
+ * on board specific hardware.
+ *
+ * Input Parameters:
+ * indication - A member of the uiindication_t
+ *
+ * Returned Value:
+ * None
+ *
+ ****************************************************************************/
+#define led(n, code, r , g , b, h) {.red = (r),.green = (g), .blue = (b),.hz = (h)}
+
+typedef begin_packed_struct struct led_t {
+ uint8_t red;
+ uint8_t green;
+ uint8_t blue;
+ uint8_t hz;
+} end_packed_struct led_t;
+
+static const led_t i2l[] = {
+
+ led(0, off, 0, 0, 0, 0),
+ led(1, reset, 128, 128, 128, 30),
+ led(2, autobaud_start, 0, 128, 0, 1),
+ led(3, autobaud_end, 0, 128, 0, 2),
+ led(4, allocation_start, 0, 0, 64, 2),
+ led(5, allocation_end, 0, 128, 64, 3),
+ led(6, fw_update_start, 32, 128, 64, 3),
+ led(7, fw_update_erase_fail, 32, 128, 32, 3),
+ led(8, fw_update_invalid_response, 64, 0, 0, 1),
+ led(9, fw_update_timeout, 64, 0, 0, 2),
+ led(a, fw_update_invalid_crc, 64, 0, 0, 4),
+ led(b, jump_to_app, 0, 128, 0, 10),
+
+};
+
+void board_indicate(uiindication_t indication)
+{
+ rgb_led(i2l[indication].red,
+ i2l[indication].green,
+ i2l[indication].blue,
+ i2l[indication].hz);
+}
diff --git a/boards/ark/septentrio-gps/src/boot_config.h b/boards/ark/septentrio-gps/src/boot_config.h
new file mode 100644
index 000000000000..76782f9a93cb
--- /dev/null
+++ b/boards/ark/septentrio-gps/src/boot_config.h
@@ -0,0 +1,130 @@
+/****************************************************************************
+ *
+ * Copyright (c) 2021 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/*
+ * @file boot_config.h
+ *
+ * bootloader definitions that configures the behavior and options
+ * of the Boot loader
+ * This file is relies on the parent folder's boot_config.h file and defines
+ * different usages of the hardware for bootloading
+ */
+
+#pragma once
+
+/************************************************************************************
+ * Included Files
+ ************************************************************************************/
+
+/* Bring in the board_config.h definitions
+ * todo:make this be pulled in from a targed's build
+ * files in nuttx*/
+
+#include "board_config.h"
+#include "uavcan.h"
+#include
+
+#include
+
+#include
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define OPT_PREFERRED_NODE_ID ANY_NODE_ID
+
+//todo:wrap OPT_x in in ifdefs for command line definitions
+#define OPT_TBOOT_MS 3000
+#define OPT_NODE_STATUS_RATE_MS 800
+#define OPT_NODE_INFO_RATE_MS 50
+#define OPT_BL_NUMBER_TIMERS 7
+
+/*
+ * This Option set is set to 1 ensure a provider of firmware has an
+ * opportunity update the node's firmware.
+ * This Option is the default policy and can be overridden by
+ * a jumper
+ * When this Policy is set, the node will ignore tboot and
+ * wait indefinitely for a GetNodeInfo request before booting.
+ *
+ * OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT is used to allow
+ * the polarity of the jumper to be True Active
+ *
+ * wait OPT_WAIT_FOR_GETNODEINFO OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO
+ * Jumper
+ * yes 1 0 x
+ * yes 1 1 Active
+ * no 1 1 Not Active
+ * no 0 0 X
+ * yes 0 1 Active
+ * no 0 1 Not Active
+ *
+ */
+#define OPT_WAIT_FOR_GETNODEINFO 0
+#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO 1
+#define OPT_WAIT_FOR_GETNODEINFO_JUMPER_GPIO_INVERT 1
+
+#define OPT_ENABLE_WD 1
+
+#define OPT_RESTART_TIMEOUT_MS 20000
+
+/* Reserved for the Booloader */
+#define OPT_BOOTLOADER_SIZE_IN_K (1024*64)
+
+/* Reserved for the application out of the total
+ * system flash minus the BOOTLOADER_SIZE_IN_K
+ */
+#define OPT_APPLICATION_RESERVER_IN_K 0
+
+#define OPT_APPLICATION_IMAGE_OFFSET OPT_BOOTLOADER_SIZE_IN_K
+#define OPT_APPLICATION_IMAGE_LENGTH (FLASH_SIZE-(OPT_BOOTLOADER_SIZE_IN_K+OPT_APPLICATION_RESERVER_IN_K))
+
+
+#define FLASH_BASE STM32_FLASH_BASE
+#define FLASH_SIZE STM32_FLASH_SIZE
+
+#define APPLICATION_LOAD_ADDRESS (FLASH_BASE + OPT_APPLICATION_IMAGE_OFFSET)
+#define APPLICATION_SIZE (FLASH_SIZE-OPT_APPLICATION_IMAGE_OFFSET)
+#define APPLICATION_LAST_8BIT_ADDRRESS ((uint8_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint8_t)))
+#define APPLICATION_LAST_32BIT_ADDRRESS ((uint32_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint32_t)))
+#define APPLICATION_LAST_64BIT_ADDRRESS ((uint64_t *)((APPLICATION_LOAD_ADDRESS+APPLICATION_SIZE)-sizeof(uint64_t)))
+
+/* If this board uses big flash that have large sectors */
+
+#define OPT_USE_YIELD
+
+/* Bootloader Option*****************************************************************
+ *
+ */
+#define GPIO_GETNODEINFO_JUMPER (GPIO_BOOT_CONFIG & ~GPIO_EXTI)
diff --git a/boards/ark/septentrio-gps/src/can.c b/boards/ark/septentrio-gps/src/can.c
new file mode 100644
index 000000000000..7737965dc6ea
--- /dev/null
+++ b/boards/ark/septentrio-gps/src/can.c
@@ -0,0 +1,130 @@
+/****************************************************************************
+ *
+ * Copyright (C) 2021 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/**
+ * @file can.c
+ *
+ * Board-specific CAN functions.
+ */
+
+/************************************************************************************
+ * Included Files
+ ************************************************************************************/
+
+#include
+
+#include
+#include
+
+#include
+#include
+
+#include "chip.h"
+#include "arm_internal.h"
+
+#include "stm32.h"
+#include "stm32_can.h"
+#include "board_config.h"
+
+#ifdef CONFIG_CAN
+
+/************************************************************************************
+ * Pre-processor Definitions
+ ************************************************************************************/
+/* Configuration ********************************************************************/
+
+#if defined(CONFIG_STM32_CAN1) && defined(CONFIG_STM32_CAN2)
+# warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1."
+# undef CONFIG_STM32_CAN2
+#endif
+
+#ifdef CONFIG_STM32_CAN1
+# define CAN_PORT 1
+#else
+# define CAN_PORT 2
+#endif
+
+/************************************************************************************
+ * Private Functions
+ ************************************************************************************/
+
+/************************************************************************************
+ * Public Functions
+ ************************************************************************************/
+int can_devinit(void);
+
+/************************************************************************************
+ * Name: can_devinit
+ *
+ * Description:
+ * All STM32 architectures must provide the following interface to work with
+ * examples/can.
+ *
+ ************************************************************************************/
+
+int can_devinit(void)
+{
+ static bool initialized = false;
+ struct can_dev_s *can;
+ int ret;
+
+ /* Check if we have already initialized */
+
+ if (!initialized) {
+ /* Call stm32_caninitialize() to get an instance of the CAN interface */
+
+ can = stm32_caninitialize(CAN_PORT);
+
+ if (can == NULL) {
+ canerr("ERROR: Failed to get CAN interface\n");
+ return -ENODEV;
+ }
+
+ /* Register the CAN driver at "/dev/can0" */
+
+ ret = can_register("/dev/can0", can);
+
+ if (ret < 0) {
+ canerr("ERROR: can_register failed: %d\n", ret);
+ return ret;
+ }
+
+ /* Now we are initialized */
+
+ initialized = true;
+ }
+
+ return OK;
+}
+
+#endif
diff --git a/boards/ark/septentrio-gps/src/i2c.cpp b/boards/ark/septentrio-gps/src/i2c.cpp
new file mode 100644
index 000000000000..76486af73317
--- /dev/null
+++ b/boards/ark/septentrio-gps/src/i2c.cpp
@@ -0,0 +1,39 @@
+/****************************************************************************
+ *
+ * Copyright (C) 2021 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#include
+
+constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = {
+ initI2CBusInternal(1),
+ initI2CBusInternal(2),
+};
diff --git a/boards/ark/septentrio-gps/src/init.c b/boards/ark/septentrio-gps/src/init.c
new file mode 100644
index 000000000000..61226d675491
--- /dev/null
+++ b/boards/ark/septentrio-gps/src/init.c
@@ -0,0 +1,168 @@
+/****************************************************************************
+ *
+ * Copyright (c) 2021 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/**
+ * @file init.c
+ *
+ * board specific early startup code. This file implements the
+ * board_app_initialize() function that is called early by nsh during startup.
+ *
+ * Code here is run before the rcS script is invoked; it should start required
+ * subsystems and perform board-specific initialization.
+ */
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include
+#include "board_config.h"
+#include "led.h"
+#include
+
+#include
+
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+
+# if defined(FLASH_BASED_PARAMS)
+# include
+#endif
+
+/************************************************************************************
+ * Name: stm32_boardinitialize
+ *
+ * Description:
+ * All STM32 architectures must provide the following entry point. This entry point
+ * is called early in the initialization -- after all memory has been configured
+ * and mapped but before any devices have been initialized.
+ *
+ ************************************************************************************/
+
+__EXPORT void stm32_boardinitialize(void)
+{
+ watchdog_init();
+
+ /* configure pins */
+ const uint32_t gpio[] = PX4_GPIO_INIT_LIST;
+ px4_gpio_init(gpio, arraySize(gpio));
+
+ // Configure SPI all interfaces GPIO & enable power.
+ stm32_spiinitialize();
+
+ // Check if button is held. If so go into gps passthrough mode
+ if (stm32_gpioread(GPIO_BTN_SAFETY)) {
+ rgb_led(128, 128, 128, 10);
+ stm32_configgpio(GPIO_USART1_TX_GPIO);
+ stm32_configgpio(GPIO_USART1_RX_GPIO);
+ stm32_configgpio(GPIO_USART2_TX_GPIO);
+ stm32_configgpio(GPIO_USART2_RX_GPIO);
+
+ while (1) {
+ watchdog_pet();
+ stm32_gpiowrite(GPIO_USART2_TX_GPIO, stm32_gpioread(GPIO_USART1_RX_GPIO));
+ stm32_gpiowrite(GPIO_USART1_TX_GPIO, stm32_gpioread(GPIO_USART2_RX_GPIO));
+ }
+ }
+}
+
+/****************************************************************************
+ * Name: board_app_initialize
+ *
+ * Description:
+ * Perform application specific initialization. This function is never
+ * called directly from application code, but only indirectly via the
+ * (non-standard) boardctl() interface using the command BOARDIOC_INIT.
+ *
+ * Input Parameters:
+ * arg - The boardctl() argument is passed to the board_app_initialize()
+ * implementation without modification. The argument has no
+ * meaning to NuttX; the meaning of the argument is a contract
+ * between the board-specific initalization logic and the the
+ * matching application logic. The value cold be such things as a
+ * mode enumeration value, a set of DIP switch switch settings, a
+ * pointer to configuration data read from a file or serial FLASH,
+ * or whatever you would like to do with it. Every implementation
+ * should accept zero/NULL as a default configuration.
+ *
+ * Returned Value:
+ * Zero (OK) is returned on success; a negated errno value is returned on
+ * any failure to indicate the nature of the failure.
+ *
+ ****************************************************************************/
+
+__EXPORT int board_app_initialize(uintptr_t arg)
+{
+ px4_platform_init();
+
+#if defined(SERIAL_HAVE_RXDMA)
+ // set up the serial DMA polling at 1ms intervals for received bytes that have not triggered a DMA event.
+ static struct hrt_call serial_dma_call;
+ hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
+#endif
+
+#if defined(FLASH_BASED_PARAMS)
+ static sector_descriptor_t params_sector_map[] = {
+ {2, 16 * 1024, 0x08008000},
+ {3, 16 * 1024, 0x0800C000},
+ {0, 0, 0},
+ };
+
+ /* Initialize the flashfs layer to use heap allocated memory */
+ int result = parameter_flashfs_init(params_sector_map, NULL, 0);
+
+ if (result != OK) {
+ syslog(LOG_ERR, "[boot] FAILED to init params in FLASH %d\n", result);
+ }
+
+#endif // FLASH_BASED_PARAMS
+
+ /* Configure the HW based on the manifest */
+ //px4_platform_configure();
+
+ return OK;
+}
diff --git a/boards/ark/septentrio-gps/src/led.c b/boards/ark/septentrio-gps/src/led.c
new file mode 100644
index 000000000000..9a80cae08923
--- /dev/null
+++ b/boards/ark/septentrio-gps/src/led.c
@@ -0,0 +1,124 @@
+/****************************************************************************
+ *
+ * Copyright (c) 2021 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/**
+ * @file led.c
+ *
+ * LED backend.
+ */
+
+#include
+
+#include
+
+#include "chip.h"
+#include "stm32_gpio.h"
+#include "board_config.h"
+
+#include
+#include
+
+#include "led.h"
+
+#define TMR_BASE STM32_TIM1_BASE
+#define TMR_FREQUENCY STM32_APB2_TIM1_CLKIN
+#define TMR_REG(o) (TMR_BASE+(o))
+
+void rgb_led(int r, int g, int b, int freqs)
+{
+
+ long fosc = TMR_FREQUENCY;
+ long prescale = 2048;
+ long p1s = fosc / prescale;
+ long p0p5s = p1s / 2;
+ uint16_t val;
+ static bool once = 0;
+
+ if (!once) {
+ once = 1;
+
+ /* Enabel Clock to Block */
+ modifyreg32(STM32_RCC_APB2ENR, 0, RCC_APB2ENR_TIM1EN);
+
+ /* Reload */
+
+ val = getreg16(TMR_REG(STM32_BTIM_EGR_OFFSET));
+ val |= ATIM_EGR_UG;
+ putreg16(val, TMR_REG(STM32_BTIM_EGR_OFFSET));
+
+ /* Set Prescaler STM32_TIM_SETCLOCK */
+
+ putreg16(prescale, TMR_REG(STM32_BTIM_PSC_OFFSET));
+
+ /* Enable STM32_TIM_SETMODE*/
+
+ putreg16(ATIM_CR1_CEN | ATIM_CR1_ARPE, TMR_REG(STM32_BTIM_CR1_OFFSET));
+
+
+ putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC1M_SHIFT) | ATIM_CCMR1_OC1PE |
+ (ATIM_CCMR_MODE_PWM1 << ATIM_CCMR1_OC2M_SHIFT) | ATIM_CCMR1_OC2PE, TMR_REG(STM32_GTIM_CCMR1_OFFSET));
+ putreg16((ATIM_CCMR_MODE_PWM1 << ATIM_CCMR2_OC3M_SHIFT) | ATIM_CCMR2_OC3PE, TMR_REG(STM32_GTIM_CCMR2_OFFSET));
+ putreg16(ATIM_CCER_CC3E | ATIM_CCER_CC3P |
+ ATIM_CCER_CC2E | ATIM_CCER_CC2P |
+ ATIM_CCER_CC1E | ATIM_CCER_CC1P, TMR_REG(STM32_GTIM_CCER_OFFSET));
+
+
+ stm32_configgpio(GPIO_TIM1_CH1);
+ stm32_configgpio(GPIO_TIM1_CH2);
+ stm32_configgpio(GPIO_TIM1_CH3);
+
+ /* master output enable = on */
+ putreg16(ATIM_BDTR_MOE, (TMR_REG(STM32_ATIM_BDTR_OFFSET)));
+ }
+
+ long p = freqs == 0 ? p1s : p1s / freqs;
+ putreg32(p, TMR_REG(STM32_BTIM_ARR_OFFSET));
+
+ p = freqs == 0 ? p1s + 1 : p0p5s / freqs;
+
+ putreg32((r * p) / 255, TMR_REG(STM32_GTIM_CCR1_OFFSET));
+ putreg32((g * p) / 255, TMR_REG(STM32_GTIM_CCR2_OFFSET));
+ putreg32((b * p) / 255, TMR_REG(STM32_GTIM_CCR3_OFFSET));
+
+ val = getreg16(TMR_REG(STM32_BTIM_CR1_OFFSET));
+
+ if (freqs == 0) {
+ val &= ~ATIM_CR1_CEN;
+
+ } else {
+ val |= ATIM_CR1_CEN;
+ }
+
+ putreg16(val, TMR_REG(STM32_BTIM_CR1_OFFSET));
+
+}
diff --git a/boards/ark/septentrio-gps/src/led.h b/boards/ark/septentrio-gps/src/led.h
new file mode 100644
index 000000000000..b68e4aa70d0c
--- /dev/null
+++ b/boards/ark/septentrio-gps/src/led.h
@@ -0,0 +1,37 @@
+/****************************************************************************
+ *
+ * Copyright (C) 2015 PX4 Development Team. All rights reserved.
+ * Author: David Sidrane
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+__BEGIN_DECLS
+void rgb_led(int r, int g, int b, int freqs);
+__END_DECLS
diff --git a/boards/ark/septentrio-gps/src/spi.cpp b/boards/ark/septentrio-gps/src/spi.cpp
new file mode 100644
index 000000000000..baafb0354c6c
--- /dev/null
+++ b/boards/ark/septentrio-gps/src/spi.cpp
@@ -0,0 +1,44 @@
+/****************************************************************************
+ *
+ * Copyright (C) 2021 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#include
+#include
+#include
+
+constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
+ initSPIBus(SPI::Bus::SPI1, {
+ initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortB, GPIO::Pin0}, SPI::DRDY{GPIO::PortB, GPIO::Pin1}),
+ }),
+};
+
+static constexpr bool unused = validateSPIConfig(px4_spi_buses);
diff --git a/boards/ark/septentrio-gps/uavcan_board_identity b/boards/ark/septentrio-gps/uavcan_board_identity
new file mode 100644
index 000000000000..8a80380cf050
--- /dev/null
+++ b/boards/ark/septentrio-gps/uavcan_board_identity
@@ -0,0 +1,17 @@
+# UAVCAN boot loadable Module ID
+set(uavcanblid_sw_version_major ${PX4_VERSION_MAJOR})
+set(uavcanblid_sw_version_minor ${PX4_VERSION_MINOR})
+add_definitions(
+ -DAPP_VERSION_MAJOR=${uavcanblid_sw_version_major}
+ -DAPP_VERSION_MINOR=${uavcanblid_sw_version_minor}
+)
+
+set(uavcanblid_hw_version_major 0)
+set(uavcanblid_hw_version_minor 84)
+set(uavcanblid_name "\"org.ark.septentrio-gps\"")
+
+add_definitions(
+ -DHW_UAVCAN_NAME=${uavcanblid_name}
+ -DHW_VERSION_MAJOR=${uavcanblid_hw_version_major}
+ -DHW_VERSION_MINOR=${uavcanblid_hw_version_minor}
+)
diff --git a/boards/atl/mantis-edu/src/board_config.h b/boards/atl/mantis-edu/src/board_config.h
index 8b8a99b12e86..f589a6b728f8 100644
--- a/boards/atl/mantis-edu/src/board_config.h
+++ b/boards/atl/mantis-edu/src/board_config.h
@@ -64,9 +64,6 @@
// Hacks for MAVLink RC button input
#define ATL_MANTIS_RC_INPUT_HACKS
-// Hacks for MAVLink RC button input
-#define ATL_MANTIS_RC_INPUT_HACKS
-
/*
* ADC channels
*
diff --git a/boards/cuav/nora/nuttx-config/include/board.h b/boards/cuav/nora/nuttx-config/include/board.h
index ad4b16fbd518..9aaf12fcdaf4 100644
--- a/boards/cuav/nora/nuttx-config/include/board.h
+++ b/boards/cuav/nora/nuttx-config/include/board.h
@@ -192,7 +192,7 @@
#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 /* SPI45 clock source */
#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 /* SPI6 clock source */
#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */
#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */
#define STM32_FDCANCLK STM32_HSE_FREQUENCY
diff --git a/boards/cuav/x7pro/nuttx-config/include/board.h b/boards/cuav/x7pro/nuttx-config/include/board.h
index ad4b16fbd518..9aaf12fcdaf4 100644
--- a/boards/cuav/x7pro/nuttx-config/include/board.h
+++ b/boards/cuav/x7pro/nuttx-config/include/board.h
@@ -192,7 +192,7 @@
#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2 /* SPI45 clock source */
#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2 /* SPI6 clock source */
#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */
#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */
#define STM32_FDCANCLK STM32_HSE_FREQUENCY
diff --git a/boards/cubepilot/cubeorange/nuttx-config/include/board.h b/boards/cubepilot/cubeorange/nuttx-config/include/board.h
index 3a4abd0235e8..5827b1bc81d1 100644
--- a/boards/cubepilot/cubeorange/nuttx-config/include/board.h
+++ b/boards/cubepilot/cubeorange/nuttx-config/include/board.h
@@ -192,7 +192,7 @@
#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */
#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */
/* FLASH wait states */
#define BOARD_FLASH_WAITSTATES 2
diff --git a/boards/cubepilot/cubeorangeplus/nuttx-config/include/board.h b/boards/cubepilot/cubeorangeplus/nuttx-config/include/board.h
index 00a886d08601..d650c6169118 100644
--- a/boards/cubepilot/cubeorangeplus/nuttx-config/include/board.h
+++ b/boards/cubepilot/cubeorangeplus/nuttx-config/include/board.h
@@ -193,7 +193,7 @@
#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3 /* USB 1 and 2 clock source */
#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE /* FDCAN 1 2 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2 /* ADC 1 2 3 clock source */
/* FLASH wait states */
#define BOARD_FLASH_WAITSTATES 2
diff --git a/boards/holybro/durandal-v1/nuttx-config/include/board.h b/boards/holybro/durandal-v1/nuttx-config/include/board.h
index 2a475b7b49aa..e1f43bf7b9cd 100644
--- a/boards/holybro/durandal-v1/nuttx-config/include/board.h
+++ b/boards/holybro/durandal-v1/nuttx-config/include/board.h
@@ -248,7 +248,7 @@
/* ADC 1 2 3 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2
/* FDCAN 1 2 clock source */
diff --git a/boards/holybro/kakuteh7/nuttx-config/include/board.h b/boards/holybro/kakuteh7/nuttx-config/include/board.h
index 83245ff925a3..4d3ed5eb4766 100644
--- a/boards/holybro/kakuteh7/nuttx-config/include/board.h
+++ b/boards/holybro/kakuteh7/nuttx-config/include/board.h
@@ -245,7 +245,7 @@
/* ADC 1 2 3 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2
/* FDCAN 1 2 clock source */
diff --git a/boards/holybro/kakuteh7mini/nuttx-config/include/board.h b/boards/holybro/kakuteh7mini/nuttx-config/include/board.h
index 83245ff925a3..4d3ed5eb4766 100644
--- a/boards/holybro/kakuteh7mini/nuttx-config/include/board.h
+++ b/boards/holybro/kakuteh7mini/nuttx-config/include/board.h
@@ -245,7 +245,7 @@
/* ADC 1 2 3 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2
/* FDCAN 1 2 clock source */
diff --git a/boards/holybro/kakuteh7v2/nuttx-config/include/board.h b/boards/holybro/kakuteh7v2/nuttx-config/include/board.h
index 83245ff925a3..4d3ed5eb4766 100644
--- a/boards/holybro/kakuteh7v2/nuttx-config/include/board.h
+++ b/boards/holybro/kakuteh7v2/nuttx-config/include/board.h
@@ -245,7 +245,7 @@
/* ADC 1 2 3 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2
/* FDCAN 1 2 clock source */
diff --git a/boards/matek/h743-mini/nuttx-config/include/board.h b/boards/matek/h743-mini/nuttx-config/include/board.h
index 4bf2b6e45e0f..f8afe3e6b871 100644
--- a/boards/matek/h743-mini/nuttx-config/include/board.h
+++ b/boards/matek/h743-mini/nuttx-config/include/board.h
@@ -248,7 +248,7 @@
/* ADC 1 2 3 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2
/* FDCAN 1 clock source */
diff --git a/boards/matek/h743-slim/nuttx-config/include/board.h b/boards/matek/h743-slim/nuttx-config/include/board.h
index 4bf2b6e45e0f..f8afe3e6b871 100644
--- a/boards/matek/h743-slim/nuttx-config/include/board.h
+++ b/boards/matek/h743-slim/nuttx-config/include/board.h
@@ -248,7 +248,7 @@
/* ADC 1 2 3 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2
/* FDCAN 1 clock source */
diff --git a/boards/matek/h743/nuttx-config/include/board.h b/boards/matek/h743/nuttx-config/include/board.h
index 4bf2b6e45e0f..f8afe3e6b871 100644
--- a/boards/matek/h743/nuttx-config/include/board.h
+++ b/boards/matek/h743/nuttx-config/include/board.h
@@ -248,7 +248,7 @@
/* ADC 1 2 3 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2
/* FDCAN 1 clock source */
diff --git a/boards/modalai/fc-v1/default.px4board b/boards/modalai/fc-v1/default.px4board
index 5999659075b9..2a33d1ddb875 100644
--- a/boards/modalai/fc-v1/default.px4board
+++ b/boards/modalai/fc-v1/default.px4board
@@ -5,7 +5,7 @@ CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS6"
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS4"
CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS1"
CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS3"
-CONFIG_DRIVERS_ACTUATORS_MODAL_IO=y
+CONFIG_DRIVERS_ACTUATORS_VOXL_ESC=y
CONFIG_DRIVERS_ADC_ADS1115=y
CONFIG_DRIVERS_ADC_BOARD_ADC=y
CONFIG_COMMON_BAROMETERS=y
diff --git a/boards/modalai/fc-v1/init/rc.board_sensors b/boards/modalai/fc-v1/init/rc.board_sensors
index 7268fce687af..03824da992ab 100644
--- a/boards/modalai/fc-v1/init/rc.board_sensors
+++ b/boards/modalai/fc-v1/init/rc.board_sensors
@@ -3,9 +3,9 @@
# ModalAI FC-v1 specific board sensors init
#------------------------------------------------------------------------------
-if param greater MODAL_IO_CONFIG 0
+if param greater VOXL_ESC_CONFIG 0
then
- modal_io start
+ voxl_esc start
fi
board_adc start
diff --git a/boards/modalai/fc-v1/src/board_config.h b/boards/modalai/fc-v1/src/board_config.h
index dcc182420ab7..93032bb31fd9 100644
--- a/boards/modalai/fc-v1/src/board_config.h
+++ b/boards/modalai/fc-v1/src/board_config.h
@@ -264,7 +264,7 @@
#define BOARD_NUM_IO_TIMERS 5
// J4 / TELEM3 / UART2
-#define MODAL_IO_DEFAULT_PORT "/dev/ttyS1"
+#define VOXL_ESC_DEFAULT_PORT "/dev/ttyS1"
__BEGIN_DECLS
diff --git a/boards/modalai/fc-v2/default.px4board b/boards/modalai/fc-v2/default.px4board
index a34d1ad7a498..c4e7d3649597 100644
--- a/boards/modalai/fc-v2/default.px4board
+++ b/boards/modalai/fc-v2/default.px4board
@@ -3,7 +3,7 @@ CONFIG_BOARD_ARCHITECTURE="cortex-m7"
CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0"
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS6"
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS4"
-CONFIG_DRIVERS_ACTUATORS_MODAL_IO=y
+CONFIG_DRIVERS_ACTUATORS_VOXL_ESC=y
CONFIG_DRIVERS_ADC_ADS1115=y
CONFIG_DRIVERS_ADC_BOARD_ADC=y
CONFIG_DRIVERS_BAROMETER_INVENSENSE_ICP201XX=y
@@ -26,10 +26,8 @@ CONFIG_DRIVERS_POWER_MONITOR_VOXLPM=y
CONFIG_DRIVERS_PWM_OUT=y
CONFIG_DRIVERS_RC_INPUT=y
CONFIG_COMMON_TELEMETRY=y
-CONFIG_DRIVERS_UAVCAN=y
-CONFIG_BOARD_UAVCAN_INTERFACES=1
-CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE=2
CONFIG_MODULES_AIRSPEED_SELECTOR=y
+CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y
CONFIG_MODULES_CAMERA_FEEDBACK=y
CONFIG_MODULES_COMMANDER=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
@@ -48,6 +46,7 @@ CONFIG_MODULES_GYRO_FFT=y
CONFIG_MODULES_LAND_DETECTOR=y
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
CONFIG_MODULES_LOAD_MON=y
+CONFIG_MODULES_LOCAL_POSITION_ESTIMATOR=y
CONFIG_MODULES_LOGGER=y
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
CONFIG_MODULES_MANUAL_CONTROL=y
@@ -61,7 +60,7 @@ CONFIG_MODULES_NAVIGATOR=y
CONFIG_MODULES_RC_UPDATE=y
CONFIG_MODULES_ROVER_POS_CONTROL=y
CONFIG_MODULES_SENSORS=y
-CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y
+# CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y
CONFIG_MODULES_TEMPERATURE_COMPENSATION=y
CONFIG_MODULES_UXRCE_DDS_CLIENT=y
CONFIG_MODULES_VTOL_ATT_CONTROL=y
diff --git a/boards/modalai/fc-v2/init/rc.board_sensors b/boards/modalai/fc-v2/init/rc.board_sensors
index 318a8bc1467b..4fd143d50310 100644
--- a/boards/modalai/fc-v2/init/rc.board_sensors
+++ b/boards/modalai/fc-v2/init/rc.board_sensors
@@ -3,9 +3,9 @@
# ModalAI FC-v2 specific board sensors init
#------------------------------------------------------------------------------
-if param greater MODAL_IO_CONFIG 0
+if param greater VOXL_ESC_CONFIG 0
then
- modal_io start
+ voxl_esc start
fi
board_adc start
diff --git a/boards/modalai/fc-v2/nuttx-config/include/board.h b/boards/modalai/fc-v2/nuttx-config/include/board.h
index 34a8d2c2af74..b196e7a68c72 100644
--- a/boards/modalai/fc-v2/nuttx-config/include/board.h
+++ b/boards/modalai/fc-v2/nuttx-config/include/board.h
@@ -248,7 +248,7 @@
/* ADC 1 2 3 clock source */
-#define STM32_RCC_D3CCIPR_ADCSEL RCC_D3CCIPR_ADCSEL_PLL2
+#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2
/* FDCAN 1 2 clock source */
diff --git a/boards/modalai/fc-v2/src/board_config.h b/boards/modalai/fc-v2/src/board_config.h
index 7e0314cdbce8..987f692b221a 100644
--- a/boards/modalai/fc-v2/src/board_config.h
+++ b/boards/modalai/fc-v2/src/board_config.h
@@ -351,7 +351,7 @@
#define BOARD_NUM_IO_TIMERS 5
// J5 USART5 TELEM2 Port next to PWM connector
-#define MODAL_IO_DEFAULT_PORT "/dev/ttyS4"
+#define VOXL_ESC_DEFAULT_PORT "/dev/ttyS4"
__BEGIN_DECLS
diff --git a/boards/modalai/voxl2-io/default.px4board b/boards/modalai/voxl2-io/default.px4board
new file mode 100644
index 000000000000..9e69a1e7460d
--- /dev/null
+++ b/boards/modalai/voxl2-io/default.px4board
@@ -0,0 +1,5 @@
+CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
+CONFIG_BOARD_ARCHITECTURE="cortex-m3"
+CONFIG_BOARD_ROMFSROOT=""
+CONFIG_BOARD_CONSTRAINED_FLASH=y
+CONFIG_MODULES_PX4IOFIRMWARE=y
diff --git a/boards/modalai/voxl2-io/firmware.prototype b/boards/modalai/voxl2-io/firmware.prototype
new file mode 100644
index 000000000000..81665310ce5d
--- /dev/null
+++ b/boards/modalai/voxl2-io/firmware.prototype
@@ -0,0 +1,13 @@
+{
+ "board_id": 41777,
+ "magic": "PX4FWv2",
+ "description": "Firmware for the voxl2-io board",
+ "image": "",
+ "build_time": 0,
+ "summary": "voxl2io",
+ "version": "2.0",
+ "image_size": 0,
+ "image_maxsize": 61440,
+ "git_identity": "",
+ "board_revision": 0
+}
diff --git a/boards/modalai/voxl2-io/nuttx-config/include/board.h b/boards/modalai/voxl2-io/nuttx-config/include/board.h
new file mode 100644
index 000000000000..936360ab1333
--- /dev/null
+++ b/boards/modalai/voxl2-io/nuttx-config/include/board.h
@@ -0,0 +1,141 @@
+/************************************************************************************
+ * nuttx-configs/px4io/include/board.h
+ * include/arch/board/board.h
+ *
+ * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ * Copyright (C) 2012 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ************************************************************************************/
+
+#ifndef __ARCH_BOARD_BOARD_H
+#define __ARCH_BOARD_BOARD_H
+
+/************************************************************************************
+ * Included Files
+ ************************************************************************************/
+
+#include
+#ifndef __ASSEMBLY__
+# include
+#endif
+#include
+
+/************************************************************************************
+ * Definitions
+ ************************************************************************************/
+
+/* Clocking *************************************************************************/
+
+/* On-board crystal frequency is 24MHz (HSE) */
+
+#define STM32_BOARD_XTAL 16000000ul
+
+/* Use the HSE output as the system clock */
+
+#define STM32_SYSCLK_SW RCC_CFGR_SW_HSE
+#define STM32_SYSCLK_SWS RCC_CFGR_SWS_HSE
+#define STM32_SYSCLK_FREQUENCY STM32_BOARD_XTAL
+
+/* AHB clock (HCLK) is SYSCLK (24MHz) */
+
+#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK
+#define STM32_HCLK_FREQUENCY STM32_SYSCLK_FREQUENCY
+#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */
+
+/* APB2 clock (PCLK2) is HCLK (24MHz) */
+
+#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK
+#define STM32_PCLK2_FREQUENCY STM32_HCLK_FREQUENCY
+#define STM32_APB2_CLKIN (STM32_PCLK2_FREQUENCY) /* Timers 2-4 */
+
+/* APB2 timer 1 will receive PCLK2. */
+
+#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY)
+#define STM32_APB2_TIM15_CLKIN (STM32_PCLK2_FREQUENCY)
+#define STM32_APB2_TIM16_CLKIN (STM32_PCLK2_FREQUENCY)
+#define STM32_APB2_TIM17_CLKIN (STM32_PCLK2_FREQUENCY)
+
+/* APB1 clock (PCLK1) is HCLK (24MHz) */
+
+#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLK
+#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY)
+
+/* All timers run off PCLK */
+
+
+#define STM32_APB1_TIM2_CLKIN (STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM3_CLKIN (STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM4_CLKIN (STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM5_CLKIN (STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM6_CLKIN (STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM7_CLKIN (STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM12_CLKIN (STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM13_CLKIN (STM32_PCLK1_FREQUENCY)
+#define STM32_APB1_TIM14_CLKIN (STM32_PCLK1_FREQUENCY)
+
+/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx
+ * otherwise frequency is 2xAPBx.
+ * Note: TIM1, 15-17 are on APB2, others on APB1
+ */
+
+#define BOARD_TIM1_FREQUENCY STM32_APB2_TIM1_CLKIN
+#define BOARD_TIM2_FREQUENCY STM32_APB1_TIM2_CLKIN
+#define BOARD_TIM3_FREQUENCY STM32_APB1_TIM3_CLKIN
+#define BOARD_TIM4_FREQUENCY STM32_APB1_TIM4_CLKIN
+#define BOARD_TIM5_FREQUENCY STM32_APB1_TIM5_CLKIN
+#define BOARD_TIM6_FREQUENCY STM32_APB1_TIM6_CLKIN
+#define BOARD_TIM7_FREQUENCY STM32_APB1_TIM7_CLKIN
+#define BOARD_TIM12_FREQUENCY STM32_APB1_TIM12_CLKIN
+#define BOARD_TIM13_FREQUENCY STM32_APB1_TIM13_CLKIN
+#define BOARD_TIM14_FREQUENCY STM32_APB1_TIM14_CLKIN
+#define BOARD_TIM15_FREQUENCY STM32_APB2_TIM15_CLKIN
+#define BOARD_TIM16_FREQUENCY STM32_APB2_TIM16_CLKIN
+#define BOARD_TIM17_FREQUENCY STM32_APB2_TIM17_CLKIN
+
+
+/*
+ * Some of the USART pins are not available; override the GPIO
+ * definitions with an invalid pin configuration.
+ */
+#undef GPIO_USART2_CTS
+#define GPIO_USART2_CTS 0xffffffff
+#undef GPIO_USART2_RTS
+#define GPIO_USART2_RTS 0xffffffff
+#undef GPIO_USART2_CK
+#define GPIO_USART2_CK 0xffffffff
+#undef GPIO_USART3_CK
+#define GPIO_USART3_CK 0xffffffff
+#undef GPIO_USART3_CTS
+#define GPIO_USART3_CTS 0xffffffff
+#undef GPIO_USART3_RTS
+#define GPIO_USART3_RTS 0xffffffff
+
+#endif /* __ARCH_BOARD_BOARD_H */
diff --git a/boards/modalai/voxl2-io/nuttx-config/nsh/defconfig b/boards/modalai/voxl2-io/nuttx-config/nsh/defconfig
new file mode 100644
index 000000000000..2fec96fb2680
--- /dev/null
+++ b/boards/modalai/voxl2-io/nuttx-config/nsh/defconfig
@@ -0,0 +1,61 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed .config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that includes your
+# modifications.
+#
+# CONFIG_DEV_NULL is not set
+CONFIG_ARCH="arm"
+CONFIG_ARCH_BOARD_CUSTOM=y
+CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/modalai/voxl2-io/nuttx-config"
+CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
+CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
+CONFIG_ARCH_CHIP="stm32"
+CONFIG_ARCH_CHIP_STM32=y
+CONFIG_ARCH_CHIP_STM32F100C8=y
+CONFIG_ARMV7M_USEBASEPRI=y
+CONFIG_ARM_MPU_EARLY_RESET=y
+CONFIG_BOARD_LOOPSPERMSEC=2000
+CONFIG_DEBUG_FULLOPT=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DEFAULT_SMALL=y
+CONFIG_DISABLE_MOUNTPOINT=y
+CONFIG_FDCLONE_DISABLE=y
+CONFIG_FDCLONE_STDIO=y
+CONFIG_HAVE_CXX=y
+CONFIG_HAVE_CXXINITIALIZE=y
+CONFIG_IDLETHREAD_STACKSIZE=316
+CONFIG_INIT_ENTRYPOINT="user_start"
+CONFIG_INIT_STACKSIZE=1100
+CONFIG_MM_FILL_ALLOCATIONS=y
+CONFIG_MM_SMALL=y
+CONFIG_NAME_MAX=12
+CONFIG_PREALLOC_TIMERS=0
+CONFIG_RAM_SIZE=8192
+CONFIG_RAM_START=0x20000000
+CONFIG_RAW_BINARY=y
+CONFIG_SERIAL_TERMIOS=y
+CONFIG_STACK_COLORATION=y
+CONFIG_START_DAY=30
+CONFIG_START_MONTH=11
+CONFIG_STDIO_DISABLE_BUFFERING=y
+CONFIG_STM32_ADC1=y
+CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y
+CONFIG_STM32_DMA1=y
+CONFIG_STM32_JTAG_SW_ENABLE=y
+CONFIG_STM32_USART1=y
+CONFIG_STM32_USART2=y
+CONFIG_STM32_USART3=y
+CONFIG_STM32_USART_SINGLEWIRE=y
+CONFIG_TASK_NAME_SIZE=0
+CONFIG_USART1_RXBUFSIZE=64
+CONFIG_USART1_RXDMA=y
+CONFIG_USART1_SERIAL_CONSOLE=y
+CONFIG_USART1_TXBUFSIZE=32
+CONFIG_USART2_RXBUFSIZE=64
+CONFIG_USART2_TXBUFSIZE=64
+CONFIG_USART3_RXBUFSIZE=64
+CONFIG_USART3_RXDMA=y
+CONFIG_USART3_TXBUFSIZE=64
+CONFIG_USEC_PER_TICK=1000
diff --git a/boards/modalai/voxl2-io/nuttx-config/scripts/script.ld b/boards/modalai/voxl2-io/nuttx-config/scripts/script.ld
new file mode 100644
index 000000000000..c84215389d59
--- /dev/null
+++ b/boards/modalai/voxl2-io/nuttx-config/scripts/script.ld
@@ -0,0 +1,131 @@
+/****************************************************************************
+ * configs/px4io-v2/scripts/ld.script
+ *
+ * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/* The STM32F100C8 has 64Kb of FLASH beginning at address 0x0800:0000 and
+ * 8Kb of SRAM beginning at address 0x2000:0000. When booting from FLASH,
+ * FLASH memory is aliased to address 0x0000:0000 where the code expects to
+ * begin execution by jumping to the entry point in the 0x0800:0000 address
+ * range.
+ */
+
+MEMORY
+{
+ flash (rx) : ORIGIN = 0x08001000, LENGTH = 60K
+ sram (rwx) : ORIGIN = 0x20000000, LENGTH = 8K
+}
+
+OUTPUT_ARCH(arm)
+ENTRY(__start) /* treat __start as the anchor for dead code stripping */
+EXTERN(_vectors) /* force the vectors to be included in the output */
+
+/*
+ * Ensure that abort() is present in the final object. The exception handling
+ * code pulled in by libgcc.a requires it (and that code cannot be easily avoided).
+ */
+EXTERN(abort)
+
+SECTIONS
+{
+ .text : {
+ _stext = ABSOLUTE(.);
+ *(.vectors)
+ *(.text .text.*)
+ *(.fixup)
+ *(.gnu.warning)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.t.*)
+ *(.glue_7)
+ *(.glue_7t)
+ *(.got)
+ *(.gcc_except_table)
+ *(.gnu.linkonce.r.*)
+ _etext = ABSOLUTE(.);
+ } > flash
+
+ /*
+ * Init functions (static constructors and the like)
+ */
+ .init_section : {
+ _sinit = ABSOLUTE(.);
+ KEEP(*(.init_array .init_array.*))
+ _einit = ABSOLUTE(.);
+ } > flash
+
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } > flash
+
+ __exidx_start = ABSOLUTE(.);
+ .ARM.exidx : {
+ *(.ARM.exidx*)
+ } > flash
+ __exidx_end = ABSOLUTE(.);
+
+ _eronly = ABSOLUTE(.);
+
+ /* The STM32F100CB has 8Kb of SRAM beginning at the following address */
+
+ .data : {
+ _sdata = ABSOLUTE(.);
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
+ CONSTRUCTORS
+ _edata = ABSOLUTE(.);
+ . = ALIGN(4);
+ } > sram AT > flash
+
+ .bss : {
+ _sbss = ABSOLUTE(.);
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
+ *(COMMON)
+ . = ALIGN(4);
+ _ebss = ABSOLUTE(.);
+ } > sram
+
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_info 0 : { *(.debug_info) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+}
diff --git a/boards/modalai/voxl2-io/src/CMakeLists.txt b/boards/modalai/voxl2-io/src/CMakeLists.txt
new file mode 100644
index 000000000000..5cef2f668c57
--- /dev/null
+++ b/boards/modalai/voxl2-io/src/CMakeLists.txt
@@ -0,0 +1,42 @@
+############################################################################
+#
+# Copyright (c) 2015 PX4 Development Team. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name PX4 nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+add_library(drivers_board
+ init.c
+ timer_config.cpp
+)
+
+target_link_libraries(drivers_board
+ PRIVATE
+ nuttx_arch
+)
diff --git a/boards/modalai/voxl2-io/src/board_config.h b/boards/modalai/voxl2-io/src/board_config.h
new file mode 100644
index 000000000000..d69aee59b2dc
--- /dev/null
+++ b/boards/modalai/voxl2-io/src/board_config.h
@@ -0,0 +1,157 @@
+/****************************************************************************
+ *
+ * Copyright (c) 2013, 2014 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/**
+ * @file board_config.h
+ *
+ * PX4IOV2 internal definitions
+ */
+
+#pragma once
+
+/******************************************************************************
+ * Included Files
+ ******************************************************************************/
+
+#include
+#include
+#include
+
+/******************************************************************************
+ * Definitions
+ ******************************************************************************/
+/* Configuration **************************************************************/
+
+/******************************************************************************
+ * Serial
+ ******************************************************************************/
+#define PX4FMU_SERIAL_BASE STM32_USART2_BASE
+#define PX4FMU_SERIAL_VECTOR STM32_IRQ_USART2
+#define PX4FMU_SERIAL_TX_GPIO GPIO_USART2_TX
+#define PX4FMU_SERIAL_RX_GPIO GPIO_USART2_RX
+#define PX4FMU_SERIAL_TX_DMA DMACHAN_USART2_TX
+#define PX4FMU_SERIAL_RX_DMA DMACHAN_USART2_RX
+#define PX4FMU_SERIAL_CLOCK STM32_PCLK1_FREQUENCY
+#define PX4FMU_SERIAL_BITRATE 921600
+
+/******************************************************************************
+ * GPIOS
+ ******************************************************************************/
+
+/* LEDS **********************************************************************/
+
+#define GPIO_LED_BLUE (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN14)
+#define GPIO_LED_AMBER (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN15)
+#define GPIO_LED_SAFETY (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN13)
+
+#define LED_BLUE(on_true) stm32_gpiowrite(GPIO_LED_BLUE, !(on_true))
+#define LED_AMBER(on_true) stm32_gpiowrite(GPIO_LED_AMBER, !(on_true))
+#define LED_SAFETY(on_true) stm32_gpiowrite(GPIO_LED_SAFETY, !(on_true))
+
+//#define GPIO_LED4 (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN11)
+
+//#define GPIO_HEATER_OFF 0 // (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN14)
+
+#define GPIO_PC14 (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN14)
+#define GPIO_PC15 (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN15)
+
+#define GPIO_SENSE_PC14_DN (GPIO_INPUT|GPIO_CNF_INPULLDWN|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN14)
+#define GPIO_SENSE_PC15_UP (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTC|GPIO_PIN15)
+# define SENSE_PH1 0b10 /* Floating pulled as set */
+# define SENSE_PH2 0b01 /* Driven as tied */
+
+#define GPIO_USART1_RX_SPEKTRUM (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN10)
+
+/* Safety switch button *******************************************************/
+
+/* CONNECTED TO TP8 - pulled down via SW */
+
+#define GPIO_BTN_SAFETY (GPIO_INPUT|GPIO_CNF_INPULLDWN|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN5)
+
+/* Power switch controls ******************************************************/
+
+#define GPIO_SPEKTRUM_PWR_EN (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13)
+#define SPEKTRUM_POWER(_on_true) px4_arch_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (_on_true))
+
+#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_USART1_RX_SPEKTRUM, (_one_true))
+#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(GPIO_USART1_RX)
+#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_USART1_RX_SPEKTRUM)
+
+#define GPIO_SERVO_FAULT_DETECT 0 // (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN15)
+
+/* Analog inputs **************************************************************/
+
+/* PWM pins **************************************************************/
+
+#define GPIO_PWM1 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN0)
+#define GPIO_PWM2 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN1)
+#define GPIO_PWM3 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN8)
+#define GPIO_PWM4 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN9)
+#define GPIO_PWM5 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN6)
+#define GPIO_PWM6 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7)
+#define GPIO_PWM7 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN0)
+#define GPIO_PWM8 (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1)
+
+#define DIRECT_PWM_OUTPUT_CHANNELS 8
+#define BOARD_HAS_NO_CAPTURE
+
+/* SBUS pins *************************************************************/
+
+/* XXX these should be UART pins */
+#define GPIO_SBUS_INPUT (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN11)
+#define GPIO_SBUS_OUTPUT (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10)
+#define GPIO_SBUS_OENABLE 0 // (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4)
+
+/*
+ * High-resolution timer
+ */
+#define HRT_TIMER 1 /* use timer1 for the HRT */
+#define HRT_TIMER_CHANNEL 2 /* use capture/compare channel 2 */
+#define HRT_PPM_CHANNEL 1 /* use capture/compare channel 1 PA8 */
+#define GPIO_PPM_IN (GPIO_ALT|GPIO_CNF_INPULLUP|GPIO_PORTA|GPIO_PIN8)
+
+/* LED definitions ******************************************************************/
+/* PX4 has two LEDs that we will encode as: */
+
+#define LED_STARTED 0 /* LED? */
+#define LED_HEAPALLOCATE 1 /* LED? */
+#define LED_IRQSENABLED 2 /* LED? + LED? */
+#define LED_STACKCREATED 3 /* LED? */
+#define LED_INIRQ 4 /* LED? + LED? */
+#define LED_SIGNAL 5 /* LED? + LED? */
+#define LED_ASSERTION 6 /* LED? + LED? + LED? */
+#define LED_PANIC 7 /* N/C + N/C + N/C + LED? */
+
+#define BOARD_NUM_IO_TIMERS 3
+
+#include
diff --git a/boards/modalai/voxl2-io/src/init.c b/boards/modalai/voxl2-io/src/init.c
new file mode 100644
index 000000000000..1e432eb71fbb
--- /dev/null
+++ b/boards/modalai/voxl2-io/src/init.c
@@ -0,0 +1,133 @@
+/****************************************************************************
+ *
+ * Copyright (C) 2012 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/**
+ * @file init.c
+ *
+ * PX4FMU-specific early startup code. This file implements the
+ * stm32_boardinitialize() function that is called during cpu startup.
+ *
+ * Code here is run before the rcS script is invoked; it should start required
+ * subsystems and perform board-specific initialization.
+ */
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include
+#include "board_config.h"
+
+#include
+
+/****************************************************************************
+ * Pre-Processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Protected Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/************************************************************************************
+ * Name: stm32_boardinitialize
+ *
+ * Description:
+ * All STM32 architectures must provide the following entry point. This entry point
+ * is called early in the intitialization -- after all memory has been configured
+ * and mapped but before any devices have been initialized.
+ *
+ ************************************************************************************/
+
+__EXPORT void stm32_boardinitialize(void)
+{
+ /* configure GPIOs */
+
+ /* Set up for sensing HW */
+ stm32_configgpio(GPIO_SENSE_PC14_DN);
+ stm32_configgpio(GPIO_SENSE_PC15_UP);
+
+ /* LEDS - default to off */
+ stm32_configgpio(GPIO_LED_BLUE);
+ stm32_configgpio(GPIO_LED_AMBER);
+ stm32_configgpio(GPIO_LED_SAFETY);
+
+ stm32_configgpio(GPIO_PC14);
+ stm32_configgpio(GPIO_PC15);
+
+
+ stm32_configgpio(GPIO_BTN_SAFETY);
+
+ /* spektrum power enable is active high - enable it by default */
+ stm32_configgpio(GPIO_SPEKTRUM_PWR_EN);
+
+ stm32_configgpio(GPIO_SBUS_INPUT); /* xxx alternate function */
+ stm32_configgpio(GPIO_SBUS_OUTPUT);
+
+ stm32_gpiowrite(GPIO_PWM1, true);
+ stm32_configgpio(GPIO_PWM1);
+
+ stm32_gpiowrite(GPIO_PWM2, true);
+ stm32_configgpio(GPIO_PWM2);
+
+ stm32_gpiowrite(GPIO_PWM3, true);
+ stm32_configgpio(GPIO_PWM3);
+
+ stm32_gpiowrite(GPIO_PWM4, true);
+ stm32_configgpio(GPIO_PWM4);
+
+ stm32_gpiowrite(GPIO_PWM5, true);
+ stm32_configgpio(GPIO_PWM5);
+
+ stm32_gpiowrite(GPIO_PWM6, true);
+ stm32_configgpio(GPIO_PWM6);
+
+ stm32_gpiowrite(GPIO_PWM7, true);
+ stm32_configgpio(GPIO_PWM7);
+
+ stm32_gpiowrite(GPIO_PWM8, true);
+ stm32_configgpio(GPIO_PWM8);
+}
diff --git a/boards/modalai/voxl2-io/src/timer_config.cpp b/boards/modalai/voxl2-io/src/timer_config.cpp
new file mode 100644
index 000000000000..f84e69921cb0
--- /dev/null
+++ b/boards/modalai/voxl2-io/src/timer_config.cpp
@@ -0,0 +1,54 @@
+/****************************************************************************
+ *
+ * Copyright (C) 2012 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#include
+
+constexpr io_timers_t io_timers[MAX_IO_TIMERS] = {
+ initIOTimer(Timer::Timer2),
+ initIOTimer(Timer::Timer3),
+ initIOTimer(Timer::Timer4),
+};
+
+constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
+ initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}),
+ initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel2}, {GPIO::PortA, GPIO::Pin1}),
+ initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel3}, {GPIO::PortB, GPIO::Pin8}),
+ initIOTimerChannel(io_timers, {Timer::Timer4, Timer::Channel4}, {GPIO::PortB, GPIO::Pin9}),
+ initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel1}, {GPIO::PortA, GPIO::Pin6}),
+ initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel2}, {GPIO::PortA, GPIO::Pin7}),
+ initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}),
+ initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}),
+};
+
+constexpr io_timers_channel_mapping_t io_timers_channel_mapping =
+ initIOTimerChannelMapping(io_timers, timer_io_channels);
diff --git a/boards/modalai/voxl2-slpi/default.px4board b/boards/modalai/voxl2-slpi/default.px4board
index 8dcfe4c0d3b3..b6ce6133fcdf 100644
--- a/boards/modalai/voxl2-slpi/default.px4board
+++ b/boards/modalai/voxl2-slpi/default.px4board
@@ -1,18 +1,23 @@
CONFIG_PLATFORM_QURT=y
CONFIG_BOARD_TOOLCHAIN="qurt"
-CONFIG_DRIVERS_ACTUATORS_MODAL_IO=y
+CONFIG_DRIVERS_ACTUATORS_VOXL_ESC=y
CONFIG_DRIVERS_BAROMETER_INVENSENSE_ICP101XX=y
+CONFIG_DRIVERS_DISTANCE_SENSOR_VL53L0X=y
+CONFIG_DRIVERS_DISTANCE_SENSOR_VL53L1X=y
CONFIG_DRIVERS_GPS=y
+CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y
+CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8308=y
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y
CONFIG_DRIVERS_MAGNETOMETER_QMC5883L=y
CONFIG_DRIVERS_POWER_MONITOR_VOXLPM=y
CONFIG_DRIVERS_QSHELL_QURT=y
-CONFIG_DRIVERS_RC_CRSF_RC=y
CONFIG_MODULES_COMMANDER=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
CONFIG_MODULES_EKF2=y
+CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_LAND_DETECTOR=y
+CONFIG_MODULES_LOAD_MON=y
CONFIG_MODULES_MANUAL_CONTROL=y
CONFIG_MODULES_MC_ATT_CONTROL=y
CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
@@ -22,5 +27,8 @@ CONFIG_MODULES_MC_RATE_CONTROL=y
CONFIG_MODULES_MUORB_SLPI=y
CONFIG_MODULES_RC_UPDATE=y
CONFIG_MODULES_SENSORS=y
+CONFIG_MODULES_SIMULATION_PWM_OUT_SIM=y
CONFIG_SYSTEMCMDS_UORB=y
+CONFIG_SYSTEMCMDS_PARAM=y
CONFIG_ORB_COMMUNICATOR=y
+CONFIG_PARAM_REMOTE=y
diff --git a/boards/modalai/voxl2-slpi/src/CMakeLists.txt b/boards/modalai/voxl2-slpi/src/CMakeLists.txt
index 7d1867d1eca2..bb35ef068a33 100644
--- a/boards/modalai/voxl2-slpi/src/CMakeLists.txt
+++ b/boards/modalai/voxl2-slpi/src/CMakeLists.txt
@@ -44,7 +44,10 @@ add_library(drivers_board
)
# Add custom drivers for SLPI
-add_subdirectory(${PX4_BOARD_DIR}/src/drivers/icm42688p)
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/rc_controller)
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/mavlink_rc_in)
-add_subdirectory(${PX4_BOARD_DIR}/src/drivers/spektrum_rc)
+# add_subdirectory(${PX4_BOARD_DIR}/src/drivers/spektrum_rc)
+# add_subdirectory(${PX4_BOARD_DIR}/src/drivers/ghst_rc)
+add_subdirectory(${PX4_BOARD_DIR}/src/drivers/dsp_hitl)
+# add_subdirectory(${PX4_BOARD_DIR}/src/drivers/dsp_sbus)
+add_subdirectory(${PX4_BOARD_DIR}/src/drivers/elrs_led)
diff --git a/boards/modalai/voxl2-slpi/src/board_config.h b/boards/modalai/voxl2-slpi/src/board_config.h
index 2aa91b4b36fe..2729397967ed 100644
--- a/boards/modalai/voxl2-slpi/src/board_config.h
+++ b/boards/modalai/voxl2-slpi/src/board_config.h
@@ -62,4 +62,21 @@
/*
* Default port for the ESC
*/
-#define MODAL_IO_DEFAULT_PORT "2"
+#define VOXL_ESC_DEFAULT_PORT "2"
+
+/*
+ * Default port for the GHST RC
+ */
+#define GHST_RC_DEFAULT_PORT "7"
+
+/*
+ * Default port for M0065
+*/
+#define VOXL2_IO_DEFAULT_PORT "2"
+
+
+/*
+ * M0065 PWM
+ */
+#define DIRECT_PWM_OUTPUT_CHANNELS 4
+#define MAX_IO_TIMERS 3
diff --git a/boards/modalai/voxl2-slpi/src/drivers/dsp_hitl/CMakeLists.txt b/boards/modalai/voxl2-slpi/src/drivers/dsp_hitl/CMakeLists.txt
new file mode 100644
index 000000000000..65026b83cf78
--- /dev/null
+++ b/boards/modalai/voxl2-slpi/src/drivers/dsp_hitl/CMakeLists.txt
@@ -0,0 +1,49 @@
+############################################################################
+#
+# Copyright (c) 2023 PX4 Development Team. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name PX4 nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+message(STATUS "Mavlink include directory: ${PX4_SOURCE_DIR}/../build/modalai_voxl2_default/mavlink/common")
+
+px4_add_module(
+ MODULE drivers__modalai__dsp_hitl
+ MAIN dsp_hitl
+ INCLUDES
+ ${PX4_SOURCE_DIR}/src/drivers/dsp_hitl
+ ${PX4_SOURCE_DIR}/build/modalai_voxl2_default/mavlink/common
+ SRCS
+ dsp_hitl.cpp
+ DEPENDS
+ px4_work_queue
+ drivers_accelerometer
+ drivers_gyroscope
+ drivers_magnetometer
+ )
diff --git a/boards/modalai/voxl2-slpi/src/drivers/dsp_hitl/dsp_hitl.cpp b/boards/modalai/voxl2-slpi/src/drivers/dsp_hitl/dsp_hitl.cpp
new file mode 100644
index 000000000000..b26f56508216
--- /dev/null
+++ b/boards/modalai/voxl2-slpi/src/drivers/dsp_hitl/dsp_hitl.cpp
@@ -0,0 +1,1343 @@
+/****************************************************************************
+ *
+ * Copyright (c) 2023 PX4 Development Team. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name PX4 nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+
+#include
+
+#include
+#include
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include // For DeviceId union
+
+#include
+#include
+
+#include
+
+#include
+
+#define ASYNC_UART_READ_WAIT_US 2000
+
+extern "C" { __EXPORT int dsp_hitl_main(int argc, char *argv[]); }
+
+namespace dsp_hitl
+{
+
+using matrix::wrap_2pi;
+
+static bool _is_running = false;
+volatile bool _task_should_exit = false;
+static px4_task_t _task_handle = -1;
+int _uart_fd = -1;
+bool _debug = false;
+std::string port = "2";
+int baudrate = 921600;
+const unsigned mode_flag_custom = 1;
+const unsigned mode_flag_armed = 128;
+bool _send_mag = false;
+bool _send_distance = false;
+
+uORB::Publication _battery_pub{ORB_ID(battery_status)};
+uORB::PublicationMulti _sensor_gps_pub{ORB_ID(sensor_gps)};
+uORB::Publication _visual_odometry_pub{ORB_ID(vehicle_visual_odometry)};
+uORB::Publication _mocap_odometry_pub{ORB_ID(vehicle_mocap_odometry)};
+uORB::PublicationMulti _sensor_baro_pub{ORB_ID(sensor_baro)};
+uORB::Publication _esc_status_pub{ORB_ID(esc_status)};
+uORB::Publication _distance_sensor_pub{ORB_ID(distance_sensor)};
+uORB::Publication _sensor_optical_flow_pub{ORB_ID(sensor_optical_flow)};
+uORB::Subscription _battery_status_sub{ORB_ID(battery_status)};
+
+int32_t _output_functions[actuator_outputs_s::NUM_ACTUATOR_OUTPUTS] {};
+
+// hil_sensor and hil_state_quaternion
+enum SensorSource {
+ ACCEL = 0b111,
+ GYRO = 0b111000,
+ MAG = 0b111000000,
+ BARO = 0b1101000000000,
+ DIFF_PRESS = 0b10000000000
+};
+
+PX4Accelerometer *_px4_accel{nullptr};
+PX4Gyroscope *_px4_gyro{nullptr};
+PX4Magnetometer *_px4_mag{nullptr};
+
+bool got_first_sensor_msg = false;
+float x_accel = 0;
+float y_accel = 0;
+float z_accel = 0;
+float x_gyro = 0;
+float y_gyro = 0;
+float z_gyro = 0;
+uint64_t gyro_accel_time = 0;
+
+// Status counters
+uint32_t heartbeat_received_counter = 0;
+uint32_t heartbeat_sent_counter = 0;
+uint32_t imu_counter = 0;
+uint32_t hil_sensor_counter = 0;
+uint32_t mag_counter = 0;
+uint32_t baro_counter = 0;
+uint32_t actuator_sent_counter = 0;
+uint32_t odometry_received_counter = 0;
+uint32_t odometry_sent_counter = 0;
+uint32_t gps_received_counter = 0;
+uint32_t gps_sent_counter = 0;
+uint32_t distance_received_counter = 0;
+uint32_t distance_sent_counter = 0;
+uint32_t flow_received_counter = 0;
+uint32_t flow_sent_counter = 0;
+uint32_t unknown_msg_received_counter = 0;
+
+enum class position_source {GPS, VIO, FLOW, NUM_POSITION_SOURCES};
+
+struct position_source_data_s {
+ char label[8];
+ bool send;
+ bool fail;
+ uint32_t failure_duration;
+ uint64_t failure_duration_start;
+} position_source_data[(int) position_source::NUM_POSITION_SOURCES] = {
+ {"GPS", false, false, 0, 0},
+ {"VIO", false, false, 0, 0},
+ {"FLOW", false, false, 0, 0}
+};
+
+uint64_t first_sensor_msg_timestamp = 0;
+uint64_t first_sensor_report_timestamp = 0;
+uint64_t last_sensor_report_timestamp = 0;
+
+vehicle_status_s _vehicle_status{};
+vehicle_control_mode_s _control_mode{};
+actuator_outputs_s _actuator_outputs{};
+battery_status_s _battery_status{};
+
+sensor_accel_fifo_s accel_fifo{};
+sensor_gyro_fifo_s gyro_fifo{};
+
+int openPort(const char *dev, speed_t speed);
+int closePort();
+
+int readResponse(void *buf, size_t len);
+int writeResponse(void *buf, size_t len);
+
+int start(int argc, char *argv[]);
+int stop();
+void print_status();
+void clear_status_counters();
+bool isOpen() { return _uart_fd >= 0; };
+
+void usage();
+void task_main(int argc, char *argv[]);
+
+void *send_actuator(void *);
+void send_actuator_data();
+
+void handle_message_hil_sensor_dsp(mavlink_message_t *msg);
+void handle_message_hil_optical_flow(mavlink_message_t *msg);
+void handle_message_distance_sensor(mavlink_message_t *msg);
+void handle_message_hil_gps_dsp(mavlink_message_t *msg);
+void handle_message_odometry_dsp(mavlink_message_t *msg);
+void handle_message_command_long_dsp(mavlink_message_t *msg);
+
+void handle_message_dsp(mavlink_message_t *msg);
+void actuator_controls_from_outputs_dsp(mavlink_hil_actuator_controls_t *msg);
+void send_esc_status(mavlink_hil_actuator_controls_t hil_act_control);
+
+void
+handle_message_dsp(mavlink_message_t *msg)
+{
+ switch (msg->msgid) {
+ case MAVLINK_MSG_ID_HIL_SENSOR:
+ hil_sensor_counter++;
+ handle_message_hil_sensor_dsp(msg);
+ break;
+
+ case MAVLINK_MSG_ID_HIL_GPS:
+ gps_received_counter++;
+
+ if (position_source_data[(int) position_source::GPS].send) { handle_message_hil_gps_dsp(msg); }
+
+ break;
+
+ case MAVLINK_MSG_ID_ODOMETRY:
+ odometry_received_counter++;
+
+ if (position_source_data[(int) position_source::VIO].send) { handle_message_odometry_dsp(msg); }
+
+ break;
+
+ case MAVLINK_MSG_ID_HEARTBEAT:
+ heartbeat_received_counter++;
+
+ if (_debug) { PX4_INFO("Heartbeat msg received"); }
+
+ break;
+
+ case MAVLINK_MSG_ID_HIL_OPTICAL_FLOW:
+ flow_received_counter++;
+
+ if (position_source_data[(int) position_source::FLOW].send) { handle_message_hil_optical_flow(msg); }
+
+ break;
+
+ case MAVLINK_MSG_ID_DISTANCE_SENSOR:
+ distance_received_counter++;
+
+ if (_send_distance) { handle_message_distance_sensor(msg); }
+
+ break;
+
+ default:
+ unknown_msg_received_counter++;
+
+ if (_debug) { PX4_INFO("Unknown msg ID: %d", msg->msgid); }
+
+ break;
+ }
+}
+
+void *send_actuator(void *)
+{
+ send_actuator_data();
+ return nullptr;
+}
+
+void send_actuator_data()
+{
+
+ int _actuator_outputs_sub = orb_subscribe_multi(ORB_ID(actuator_outputs_sim), 0);
+ int _vehicle_control_mode_sub_ = orb_subscribe(ORB_ID(vehicle_control_mode));
+ int previous_timestamp = 0;
+ int previous_uorb_timestamp = 0;
+ int differential = 0;
+ bool first_sent = false;
+
+ while (true) {
+ bool controls_updated = false;
+ (void) orb_check(_vehicle_control_mode_sub_, &controls_updated);
+
+ if (controls_updated) {
+ orb_copy(ORB_ID(vehicle_control_mode), _vehicle_control_mode_sub_, &_control_mode);
+ }
+
+ bool actuator_updated = false;
+ (void) orb_check(_actuator_outputs_sub, &actuator_updated);
+
+ uint8_t newBuf[512];
+ uint16_t newBufLen = 0;
+
+ mavlink_hil_actuator_controls_t hil_act_control;
+ actuator_controls_from_outputs_dsp(&hil_act_control);
+
+ mavlink_message_t message{};
+ mavlink_msg_hil_actuator_controls_encode(1, 1, &message, &hil_act_control);
+
+ if (actuator_updated) {
+ orb_copy(ORB_ID(actuator_outputs), _actuator_outputs_sub, &_actuator_outputs);
+
+ if (_actuator_outputs.timestamp > 0) {
+ previous_timestamp = _actuator_outputs.timestamp;
+ previous_uorb_timestamp = _actuator_outputs.timestamp;
+
+ newBufLen = mavlink_msg_to_send_buffer(newBuf, &message);
+ int writeRetval = writeResponse(&newBuf, newBufLen);
+
+ actuator_sent_counter++;
+
+ if (_debug) { PX4_INFO("Succesful write of actuator back to jMAVSim: %d at %llu", writeRetval, hrt_absolute_time()); }
+
+ first_sent = true;
+
+ send_esc_status(hil_act_control);
+ }
+
+ } else if (! actuator_updated && first_sent && differential > 4000) {
+ previous_timestamp = hrt_absolute_time();
+
+ newBufLen = mavlink_msg_to_send_buffer(newBuf, &message);
+ int writeRetval = writeResponse(&newBuf, newBufLen);
+
+ actuator_sent_counter++;
+
+ if (_debug) { PX4_INFO("Succesful write of actuator back to jMAVSim: %d at %llu", writeRetval, hrt_absolute_time()); }
+
+ send_esc_status(hil_act_control);
+ }
+
+ differential = hrt_absolute_time() - previous_timestamp;
+
+ px4_usleep(1000);
+ }
+}
+
+void task_main(int argc, char *argv[])
+{
+ int ch;
+ int myoptind = 1;
+ const char *myoptarg = nullptr;
+
+ while ((ch = px4_getopt(argc, argv, "odmghfp:b:", &myoptind, &myoptarg)) != EOF) {
+ switch (ch) {
+ case 'd':
+ _debug = true;
+ break;
+
+ case 'p':
+ port = myoptarg;
+ break;
+
+ case 'b':
+ baudrate = atoi(myoptarg);
+ break;
+
+ case 'm':
+ _send_mag = true;
+ break;
+
+ case 'g':
+ position_source_data[(int) position_source::GPS].send = true;
+ break;
+
+ case 'o':
+ position_source_data[(int) position_source::VIO].send = true;
+ break;
+
+ case 'h':
+ _send_distance = true;
+ break;
+
+ case 'f':
+ position_source_data[(int) position_source::FLOW].send = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ const char *charport = port.c_str();
+ (void) openPort(charport, (speed_t) baudrate);
+
+ if ((_debug) && (isOpen())) { PX4_INFO("DSP HITL serial port initialized. Baudrate: %d", baudrate); }
+
+ if (! isOpen()) {
+ PX4_ERR("DSP HITL failed to open serial port");
+ return;
+ }
+
+ uint64_t last_heartbeat_timestamp = hrt_absolute_time();
+ uint64_t last_imu_update_timestamp = last_heartbeat_timestamp;
+
+ _px4_accel = new PX4Accelerometer(1310988);
+ _px4_gyro = new PX4Gyroscope(1310988);
+ _px4_mag = new PX4Magnetometer(197388);
+
+ // Create a thread for sending data to the simulator.
+ pthread_t sender_thread;
+ pthread_attr_t sender_thread_attr;
+ pthread_attr_init(&sender_thread_attr);
+ pthread_attr_setstacksize(&sender_thread_attr, PX4_STACK_ADJUSTED(8000));
+ pthread_create(&sender_thread, &sender_thread_attr, send_actuator, nullptr);
+ pthread_attr_destroy(&sender_thread_attr);
+
+ int _vehicle_status_sub = orb_subscribe(ORB_ID(vehicle_status));
+
+ _is_running = true;
+
+ while (!_task_should_exit) {
+ uint8_t rx_buf[1024];
+
+ uint64_t timestamp = hrt_absolute_time();
+
+ // Send out sensor messages every 10ms
+ if (got_first_sensor_msg) {
+ uint64_t delta_time = timestamp - last_imu_update_timestamp;
+
+ if ((imu_counter) && (delta_time > 15000)) {
+ PX4_WARN("Sending updates at %llu, delta %llu", timestamp, delta_time);
+ }
+
+ uint64_t _px4_gyro_accel_timestamp = hrt_absolute_time();
+ _px4_gyro->update(_px4_gyro_accel_timestamp, x_gyro, y_gyro, z_gyro);
+ _px4_accel->update(_px4_gyro_accel_timestamp, x_accel, y_accel, z_accel);
+ last_imu_update_timestamp = timestamp;
+ imu_counter++;
+ }
+
+ // Check for incoming messages from the simulator
+ int readRetval = readResponse(&rx_buf[0], sizeof(rx_buf));
+
+ if (readRetval) {
+ //Take readRetval and convert it into mavlink msg
+ mavlink_message_t msg;
+ mavlink_status_t _status{};
+
+ for (int i = 0; i <= readRetval; i++) {
+ if (mavlink_parse_char(MAVLINK_COMM_0, rx_buf[i], &msg, &_status)) {
+ //PX4_INFO("Value of msg id: %i", msg.msgid);
+ handle_message_dsp(&msg);
+ }
+ }
+ }
+
+ if ((timestamp - last_heartbeat_timestamp) > 1000000) {
+ mavlink_heartbeat_t hb = {};
+ mavlink_message_t hb_message = {};
+ hb.autopilot = 12;
+ hb.base_mode |= (_vehicle_status.arming_state == vehicle_status_s::ARMING_STATE_ARMED) ? 128 : 0;
+ mavlink_msg_heartbeat_encode(1, 1, &hb_message, &hb);
+
+ uint8_t hb_newBuf[MAVLINK_MAX_PACKET_LEN];
+ uint16_t hb_newBufLen = 0;
+ hb_newBufLen = mavlink_msg_to_send_buffer(hb_newBuf, &hb_message);
+ (void) writeResponse(&hb_newBuf, hb_newBufLen);
+ last_heartbeat_timestamp = timestamp;
+ heartbeat_sent_counter++;
+ }
+
+ bool vehicle_updated = false;
+ (void) orb_check(_vehicle_status_sub, &vehicle_updated);
+
+ if (vehicle_updated) {
+ // PX4_INFO("Value of updated vehicle status: %d", vehicle_updated);
+ orb_copy(ORB_ID(vehicle_status), _vehicle_status_sub, &_vehicle_status);
+ }
+
+ uint64_t elapsed_time = hrt_absolute_time() - timestamp;
+ // if (elapsed_time < 10000) usleep(10000 - elapsed_time);
+
+ if (elapsed_time < 5000) { usleep(5000 - elapsed_time); }
+ }
+
+ _is_running = false;
+}
+
+void send_esc_status(mavlink_hil_actuator_controls_t hil_act_control)
+{
+ esc_status_s esc_status{};
+ esc_status.timestamp = hrt_absolute_time();
+ const int max_esc_count = math::min(actuator_outputs_s::NUM_ACTUATOR_OUTPUTS, esc_status_s::CONNECTED_ESC_MAX);
+
+ const bool armed = (_vehicle_status.arming_state == vehicle_status_s::ARMING_STATE_ARMED);
+ int max_esc_index = 0;
+ _battery_status_sub.update(&_battery_status);
+
+ for (int i = 0; i < max_esc_count; i++) {
+ if (_output_functions[i] != 0) {
+ max_esc_index = i;
+ }
+
+ esc_status.esc[i].actuator_function = _output_functions[i]; // TODO: this should be in pwm_sim...
+ esc_status.esc[i].timestamp = esc_status.timestamp;
+ esc_status.esc[i].esc_errorcount = 0; // TODO
+ esc_status.esc[i].esc_voltage = _battery_status.voltage_v;
+ esc_status.esc[i].esc_current = armed ? 1.0f + math::abs_t(hil_act_control.controls[i]) * 15.0f :
+ 0.0f; // TODO: magic number
+ esc_status.esc[i].esc_rpm = hil_act_control.controls[i] * 6000; // TODO: magic number
+ esc_status.esc[i].esc_temperature = 20.0 + math::abs_t((double)hil_act_control.controls[i]) * 40.0;
+ }
+
+ esc_status.esc_count = max_esc_index + 1;
+ esc_status.esc_armed_flags = (1u << esc_status.esc_count) - 1;
+ esc_status.esc_online_flags = (1u << esc_status.esc_count) - 1;
+
+ _esc_status_pub.publish(esc_status);
+}
+
+void
+handle_message_command_long_dsp(mavlink_message_t *msg)
+{
+ mavlink_command_long_t cmd_mavlink;
+ mavlink_msg_command_long_decode(msg, &cmd_mavlink);
+
+ if (_debug) { PX4_INFO("Value of command_long.command: %d", cmd_mavlink.command); }
+
+ mavlink_command_ack_t ack = {};
+ ack.result = MAV_RESULT_UNSUPPORTED;
+
+ mavlink_message_t ack_message = {};
+ mavlink_msg_command_ack_encode(1, 1, &ack_message, &ack);
+
+ uint8_t acknewBuf[512];
+ uint16_t acknewBufLen = 0;
+ acknewBufLen = mavlink_msg_to_send_buffer(acknewBuf, &ack_message);
+ int writeRetval = writeResponse(&acknewBuf, acknewBufLen);
+
+ if (_debug) { PX4_INFO("Succesful write of ACK back over UART: %d at %llu", writeRetval, hrt_absolute_time()); }
+}
+
+int flow_debug_counter = 0;
+
+void
+handle_message_hil_optical_flow(mavlink_message_t *msg)
+{
+ mavlink_hil_optical_flow_t flow;
+ mavlink_msg_hil_optical_flow_decode(msg, &flow);
+
+ if ((_debug) && (!(flow_debug_counter % 10))) {
+ PX4_INFO("optflow: time: %llu, quality %d", flow.time_usec, (int) flow.quality);
+ PX4_INFO("optflow: x: %.2f y: %.2f", (double) flow.integrated_x, (double) flow.integrated_y);
+ }
+
+ flow_debug_counter++;
+
+ device::Device::DeviceId device_id;
+ device_id.devid_s.bus_type = device::Device::DeviceBusType::DeviceBusType_MAVLINK;
+ device_id.devid_s.bus = 1;
+ device_id.devid_s.address = msg->sysid;
+ device_id.devid_s.devtype = DRV_FLOW_DEVTYPE_SIM;
+
+ sensor_optical_flow_s sensor_optical_flow{};
+
+ sensor_optical_flow.timestamp_sample = hrt_absolute_time();
+ sensor_optical_flow.device_id = device_id.devid;
+
+ sensor_optical_flow.pixel_flow[0] = flow.integrated_x;
+ sensor_optical_flow.pixel_flow[1] = flow.integrated_y;
+
+ sensor_optical_flow.integration_timespan_us = flow.integration_time_us;
+ sensor_optical_flow.quality = flow.quality;
+
+ int index = (int) position_source::FLOW;
+
+ if (position_source_data[index].fail) {
+ uint32_t duration = position_source_data[index].failure_duration;
+ hrt_abstime start = position_source_data[index].failure_duration_start;
+
+ if (duration) {
+ if (hrt_elapsed_time(&start) > (duration * 1000000)) {
+ PX4_INFO("Optical flow failure ending");
+ position_source_data[index].fail = false;
+ position_source_data[index].failure_duration = 0;
+ position_source_data[index].failure_duration_start = 0;
+
+ } else {
+ sensor_optical_flow.quality = 0;
+ }
+
+ } else {
+ sensor_optical_flow.quality = 0;
+ }
+ }
+
+ const matrix::Vector3f integrated_gyro(flow.integrated_xgyro, flow.integrated_ygyro, flow.integrated_zgyro);
+
+ if (integrated_gyro.isAllFinite()) {
+ integrated_gyro.copyTo(sensor_optical_flow.delta_angle);
+ sensor_optical_flow.delta_angle_available = true;
+ }
+
+ sensor_optical_flow.max_flow_rate = NAN;
+ sensor_optical_flow.min_ground_distance = NAN;
+ sensor_optical_flow.max_ground_distance = NAN;
+
+ // Use distance value for distance sensor topic
+ // if (PX4_ISFINITE(flow.distance) && (flow.distance >= 0.f)) {
+ // // Positive value (including zero): distance known. Negative value: Unknown distance.
+ // sensor_optical_flow.distance_m = flow.distance;
+ // sensor_optical_flow.distance_available = true;
+ // }
+
+ // Emulate voxl-flow-server where distance comes in a separate
+ // distance sensor topic message
+ sensor_optical_flow.distance_m = 0.0f;
+ sensor_optical_flow.distance_available = false;
+
+ sensor_optical_flow.timestamp = hrt_absolute_time();
+
+ _sensor_optical_flow_pub.publish(sensor_optical_flow);
+
+ flow_sent_counter++;
+}
+
+int distance_debug_counter = 0;
+
+void handle_message_distance_sensor(mavlink_message_t *msg)
+{
+ mavlink_distance_sensor_t dist_sensor;
+ mavlink_msg_distance_sensor_decode(msg, &dist_sensor);
+
+ if ((_debug) && (!(distance_debug_counter % 10))) {
+ PX4_INFO("distance: time: %u, quality: %u, height: %u",
+ dist_sensor.time_boot_ms, dist_sensor.signal_quality,
+ dist_sensor.current_distance);
+ }
+
+ distance_debug_counter++;
+
+ distance_sensor_s ds{};
+
+ device::Device::DeviceId device_id;
+ device_id.devid_s.bus_type = device::Device::DeviceBusType::DeviceBusType_MAVLINK;
+ device_id.devid_s.bus = 1;
+ device_id.devid_s.address = msg->sysid;
+ device_id.devid_s.devtype = DRV_DIST_DEVTYPE_MAVLINK;
+
+ ds.timestamp = hrt_absolute_time(); /* Use system time for now, don't trust sender to attach correct timestamp */
+ ds.min_distance = static_cast(dist_sensor.min_distance) * 1e-2f; /* cm to m */
+ ds.max_distance = static_cast(dist_sensor.max_distance) * 1e-2f; /* cm to m */
+ ds.current_distance = static_cast(dist_sensor.current_distance) * 1e-2f; /* cm to m */
+ ds.variance = dist_sensor.covariance * 1e-4f; /* cm^2 to m^2 */
+ ds.h_fov = dist_sensor.horizontal_fov;
+ ds.v_fov = dist_sensor.vertical_fov;
+ ds.q[0] = dist_sensor.quaternion[0];
+ ds.q[1] = dist_sensor.quaternion[1];
+ ds.q[2] = dist_sensor.quaternion[2];
+ ds.q[3] = dist_sensor.quaternion[3];
+ ds.type = dist_sensor.type;
+ ds.device_id = device_id.devid;
+ ds.orientation = dist_sensor.orientation;
+
+ // MAVLink DISTANCE_SENSOR signal_quality value of 0 means unset/unknown
+ // quality value. Also it comes normalised between 1 and 100 while the uORB
+ // signal quality is normalised between 0 and 100.
+ ds.signal_quality = dist_sensor.signal_quality == 0 ? -1 : 100 * (dist_sensor.signal_quality - 1) / 99;
+
+ _distance_sensor_pub.publish(ds);
+
+ distance_sent_counter++;
+}
+
+void
+handle_message_odometry_dsp(mavlink_message_t *msg)
+{
+ mavlink_odometry_t odom_in;
+ mavlink_msg_odometry_decode(msg, &odom_in);
+
+ odometry_sent_counter++;
+
+ // fill vehicle_odometry from Mavlink ODOMETRY
+ vehicle_odometry_s odom{};
+ uint64_t timestamp = hrt_absolute_time();
+ odom.timestamp_sample = timestamp;
+
+ const matrix::Vector3f odom_in_p(odom_in.x, odom_in.y, odom_in.z);
+
+ // position x/y/z (m)
+ if (odom_in_p.isAllFinite()) {
+ // frame_id: Coordinate frame of reference for the pose data.
+ switch (odom_in.frame_id) {
+ case MAV_FRAME_LOCAL_NED:
+ // NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth.
+ odom.pose_frame = vehicle_odometry_s::POSE_FRAME_NED;
+ odom_in_p.copyTo(odom.position);
+ break;
+
+ case MAV_FRAME_LOCAL_ENU:
+ // ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth.
+ odom.pose_frame = vehicle_odometry_s::POSE_FRAME_NED;
+ odom.position[0] = odom_in.y; // y: North
+ odom.position[1] = odom_in.x; // x: East
+ odom.position[2] = -odom_in.z; // z: Up
+ break;
+
+ case MAV_FRAME_LOCAL_FRD:
+ // FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth.
+ odom.pose_frame = vehicle_odometry_s::POSE_FRAME_FRD;
+ odom_in_p.copyTo(odom.position);
+ break;
+
+ case MAV_FRAME_LOCAL_FLU:
+ // FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth.
+ odom.pose_frame = vehicle_odometry_s::POSE_FRAME_FRD;
+ odom.position[0] = odom_in.x; // x: Forward
+ odom.position[1] = -odom_in.y; // y: Left
+ odom.position[2] = -odom_in.z; // z: Up
+ break;
+
+ default:
+ break;
+ }
+
+ // pose_covariance
+ // Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw)
+ // first six entries are the first ROW, next five entries are the second ROW, etc.
+ if (odom_in.estimator_type != MAV_ESTIMATOR_TYPE_NAIVE) {
+ switch (odom_in.frame_id) {
+ case MAV_FRAME_LOCAL_NED:
+ case MAV_FRAME_LOCAL_FRD:
+ case MAV_FRAME_LOCAL_FLU:
+ // position variances copied directly
+ odom.position_variance[0] = odom_in.pose_covariance[0]; // X row 0, col 0
+ odom.position_variance[1] = odom_in.pose_covariance[6]; // Y row 1, col 1
+ odom.position_variance[2] = odom_in.pose_covariance[11]; // Z row 2, col 2
+ break;
+
+ case MAV_FRAME_LOCAL_ENU:
+ // ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth.
+ odom.position_variance[0] = odom_in.pose_covariance[6]; // Y row 1, col 1
+ odom.position_variance[1] = odom_in.pose_covariance[0]; // X row 0, col 0
+ odom.position_variance[2] = odom_in.pose_covariance[11]; // Z row 2, col 2
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ // q: the quaternion of the ODOMETRY msg represents a rotation from body frame to a local frame
+ if (matrix::Quatf(odom_in.q).isAllFinite()) {
+
+ odom.q[0] = odom_in.q[0];
+ odom.q[1] = odom_in.q[1];
+ odom.q[2] = odom_in.q[2];
+ odom.q[3] = odom_in.q[3];
+
+ // pose_covariance (roll, pitch, yaw)
+ // states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.
+ // TODO: fix pose_covariance for MAV_FRAME_LOCAL_ENU, MAV_FRAME_LOCAL_FLU
+ if (odom_in.estimator_type != MAV_ESTIMATOR_TYPE_NAIVE) {
+ odom.orientation_variance[0] = odom_in.pose_covariance[15]; // R row 3, col 3
+ odom.orientation_variance[1] = odom_in.pose_covariance[18]; // P row 4, col 4
+ odom.orientation_variance[2] = odom_in.pose_covariance[20]; // Y row 5, col 5
+ }
+ }
+
+ const matrix::Vector3f odom_in_v(odom_in.vx, odom_in.vy, odom_in.vz);
+
+ // velocity vx/vy/vz (m/s)
+ if (odom_in_v.isAllFinite()) {
+ // child_frame_id: Coordinate frame of reference for the velocity in free space (twist) data.
+ switch (odom_in.child_frame_id) {
+ case MAV_FRAME_LOCAL_NED:
+ // NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth.
+ odom.velocity_frame = vehicle_odometry_s::VELOCITY_FRAME_NED;
+ odom_in_v.copyTo(odom.velocity);
+ break;
+
+ case MAV_FRAME_LOCAL_ENU:
+ // ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth.
+ odom.velocity_frame = vehicle_odometry_s::VELOCITY_FRAME_NED;
+ odom.velocity[0] = odom_in.vy; // y: East
+ odom.velocity[1] = odom_in.vx; // x: North
+ odom.velocity[2] = -odom_in.vz; // z: Up
+ break;
+
+ case MAV_FRAME_LOCAL_FRD:
+ // FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth.
+ odom.velocity_frame = vehicle_odometry_s::VELOCITY_FRAME_FRD;
+ odom_in_v.copyTo(odom.velocity);
+ break;
+
+ case MAV_FRAME_LOCAL_FLU:
+ // FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth.
+ odom.velocity_frame = vehicle_odometry_s::VELOCITY_FRAME_FRD;
+ odom.velocity[0] = odom_in.vx; // x: Forward
+ odom.velocity[1] = -odom_in.vy; // y: Left
+ odom.velocity[2] = -odom_in.vz; // z: Up
+ break;
+
+ case MAV_FRAME_BODY_NED: // DEPRECATED: Replaced by MAV_FRAME_BODY_FRD (2019-08).
+ case MAV_FRAME_BODY_OFFSET_NED: // DEPRECATED: Replaced by MAV_FRAME_BODY_FRD (2019-08).
+ case MAV_FRAME_BODY_FRD:
+ // FRD local tangent frame (x: Forward, y: Right, z: Down) with origin that travels with vehicle.
+ odom.velocity_frame = vehicle_odometry_s::VELOCITY_FRAME_BODY_FRD;
+ odom.velocity[0] = odom_in.vx;
+ odom.velocity[1] = odom_in.vy;
+ odom.velocity[2] = odom_in.vz;
+ break;
+
+ default:
+ // unsupported child_frame_id
+ break;
+ }
+
+ // velocity_covariance (vx, vy, vz)
+ // states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.
+ // TODO: fix velocity_covariance for MAV_FRAME_LOCAL_ENU, MAV_FRAME_LOCAL_FLU, MAV_FRAME_LOCAL_FLU
+ if (odom_in.estimator_type != MAV_ESTIMATOR_TYPE_NAIVE) {
+ switch (odom_in.child_frame_id) {
+ case MAV_FRAME_LOCAL_NED:
+ case MAV_FRAME_LOCAL_FRD:
+ case MAV_FRAME_LOCAL_FLU:
+ case MAV_FRAME_BODY_NED: // DEPRECATED: Replaced by MAV_FRAME_BODY_FRD (2019-08).
+ case MAV_FRAME_BODY_OFFSET_NED: // DEPRECATED: Replaced by MAV_FRAME_BODY_FRD (2019-08).
+ case MAV_FRAME_BODY_FRD:
+ // velocity covariances copied directly
+ odom.velocity_variance[0] = odom_in.velocity_covariance[0]; // X row 0, col 0
+ odom.velocity_variance[1] = odom_in.velocity_covariance[6]; // Y row 1, col 1
+ odom.velocity_variance[2] = odom_in.velocity_covariance[11]; // Z row 2, col 2
+ break;
+
+ case MAV_FRAME_LOCAL_ENU:
+ // ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth.
+ odom.velocity_variance[0] = odom_in.velocity_covariance[6]; // Y row 1, col 1
+ odom.velocity_variance[1] = odom_in.velocity_covariance[0]; // X row 0, col 0
+ odom.velocity_variance[2] = odom_in.velocity_covariance[11]; // Z row 2, col 2
+ break;
+
+ default:
+ // unsupported child_frame_id
+ break;
+ }
+ }
+ }
+
+ // Roll/Pitch/Yaw angular speed (rad/s)
+ if (PX4_ISFINITE(odom_in.rollspeed)
+ && PX4_ISFINITE(odom_in.pitchspeed)
+ && PX4_ISFINITE(odom_in.yawspeed)) {
+
+ odom.angular_velocity[0] = odom_in.rollspeed;
+ odom.angular_velocity[1] = odom_in.pitchspeed;
+ odom.angular_velocity[2] = odom_in.yawspeed;
+ }
+
+ odom.reset_counter = odom_in.reset_counter;
+ odom.quality = odom_in.quality;
+
+ int index = (int) position_source::VIO;
+
+ if (position_source_data[index].fail) {
+ uint32_t duration = position_source_data[index].failure_duration;
+ hrt_abstime start = position_source_data[index].failure_duration_start;
+
+ if (duration) {
+ if (hrt_elapsed_time(&start) > (duration * 1000000)) {
+ PX4_INFO("VIO failure ending");
+ position_source_data[index].fail = false;
+ position_source_data[index].failure_duration = 0;
+ position_source_data[index].failure_duration_start = 0;
+
+ } else {
+ odom.quality = 0;
+ }
+
+ } else {
+ odom.quality = 0;
+ }
+ }
+
+ switch (odom_in.estimator_type) {
+ case MAV_ESTIMATOR_TYPE_UNKNOWN: // accept MAV_ESTIMATOR_TYPE_UNKNOWN for legacy support
+ case MAV_ESTIMATOR_TYPE_NAIVE:
+ case MAV_ESTIMATOR_TYPE_VISION:
+ case MAV_ESTIMATOR_TYPE_VIO:
+ odom.timestamp = hrt_absolute_time();
+ _visual_odometry_pub.publish(odom);
+ break;
+
+ case MAV_ESTIMATOR_TYPE_MOCAP:
+ odom.timestamp = hrt_absolute_time();
+ _mocap_odometry_pub.publish(odom);
+ break;
+
+ case MAV_ESTIMATOR_TYPE_GPS:
+ case MAV_ESTIMATOR_TYPE_GPS_INS:
+ case MAV_ESTIMATOR_TYPE_LIDAR:
+ case MAV_ESTIMATOR_TYPE_AUTOPILOT:
+ default:
+ //mavlink_log_critical(&_mavlink_log_pub, "ODOMETRY: estimator_type %" PRIu8 " unsupported\t",
+ // odom_in.estimator_type);
+ //events::send(events::ID("mavlink_rcv_odom_unsup_estimator_type"), events::Log::Error,
+ // "ODOMETRY: unsupported estimator_type {1}", odom_in.estimator_type);
+ return;
+ }
+}
+
+void actuator_controls_from_outputs_dsp(mavlink_hil_actuator_controls_t *msg)
+{
+ memset(msg, 0, sizeof(mavlink_hil_actuator_controls_t));
+
+ msg->time_usec = hrt_absolute_time();
+
+ bool armed = (_vehicle_status.arming_state == vehicle_status_s::ARMING_STATE_ARMED);
+
+ if (armed) {
+ for (unsigned i = 0; i < actuator_outputs_s::NUM_ACTUATOR_OUTPUTS; i++) {
+ msg->controls[i] = _actuator_outputs.output[i];
+ }
+
+ //PX4_INFO("Value of actuator data: %f, %f, %f, %f", (double)msg->controls[0], (double)msg->controls[1], (double)msg->controls[2], (double)msg->controls[3]);
+ }
+
+ msg->mode = mode_flag_custom;
+ msg->mode |= (armed) ? mode_flag_armed : 0;
+ msg->flags = 0;
+}
+
+int openPort(const char *dev, speed_t speed)
+{
+ if (_uart_fd >= 0) {
+ PX4_ERR("Port in use: %s (%i)", dev, errno);
+ return -1;
+ }
+
+ _uart_fd = qurt_uart_open(dev, speed);
+
+ if (_debug) { PX4_INFO("qurt_uart_opened"); }
+
+ if (_uart_fd < 0) {
+ PX4_ERR("Error opening port: %s (%i)", dev, errno);
+ return -1;
+ }
+
+ return 0;
+}
+
+int closePort()
+{
+ _uart_fd = -1;
+
+ return 0;
+}
+
+int readResponse(void *buf, size_t len)
+{
+ if (_uart_fd < 0 || buf == NULL) {
+ PX4_ERR("invalid state for reading or buffer");
+ return -1;
+ }
+
+ return qurt_uart_read(_uart_fd, (char *) buf, len, ASYNC_UART_READ_WAIT_US);
+}
+
+int writeResponse(void *buf, size_t len)
+{
+ if (_uart_fd < 0 || buf == NULL) {
+ PX4_ERR("invalid state for writing or buffer");
+ return -1;
+ }
+
+ return qurt_uart_write(_uart_fd, (const char *) buf, len);
+}
+
+int start(int argc, char *argv[])
+{
+ if (_is_running) {
+ PX4_WARN("already running");
+ return -1;
+ }
+
+ _task_should_exit = false;
+
+ _task_handle = px4_task_spawn_cmd("dsp_hitl__main",
+ SCHED_DEFAULT,
+ SCHED_PRIORITY_DEFAULT,
+ 2000,
+ (px4_main_t)&task_main,
+ (char *const *)argv);
+
+ if (_task_handle < 0) {
+ PX4_ERR("task start failed");
+ return -1;
+ }
+
+ return 0;
+}
+
+int stop()
+{
+ if (!_is_running) {
+ PX4_WARN("not running");
+ return -1;
+ }
+
+ _task_should_exit = true;
+
+ while (_is_running) {
+ usleep(200000);
+ PX4_INFO(".");
+ }
+
+ _task_handle = -1;
+ return 0;
+}
+
+void usage()
+{
+ PX4_INFO("Usage: dsp_hitl {start|status|clear|failure|stop}");
+ PX4_INFO(" failure