Compare commits

..

5 Commits

Author SHA1 Message Date
Jacob Dahl d4bf6216e3 fix(rc): warn and deny invalid Spektrum bind sub-type
Previously, an unrecognized param2 sub-type would silently leave
dsm_bind_pulses at 0 and return the generic UNSUPPORTED ACK. Add an
explicit else-branch that logs a PX4_WARN and returns DENIED so users
get clear feedback in QGC.
2026-03-19 16:56:36 -08:00
Jacob Dahl c47fcf7390 fix(rc): check write return value in BindCRSF, guard Spektrum bind against invalid sub-type 2026-03-17 20:06:53 -08:00
Jacob Dahl 3d92ca5edf style(crsf_rc): zero-init vcmd, remove noisy comments, drop unused enum value 2026-03-17 19:16:57 -08:00
Jacob Dahl 0478395ada style(crsf_rc): use C++ style comment 2026-03-17 19:15:02 -08:00
Jacob Dahl 2bf50badf4 feat(crsf_rc): add CRSF receiver bind command
Add ability to initiate CRSF receiver binding from QGroundControl or
the NSH console. When MAV_CMD_START_RX_PAIR is received with
RC_TYPE_CRSF, the driver sends the CRSF bind command frame over UART.

Binding is rejected when armed or on singlewire configurations.

Also adds RC_TYPE and RC_SUB_TYPE constants to VehicleCommand.msg and
replaces magic numbers in DsmRc and RCInput drivers.

Based on PX4/PX4-Autopilot#23294.
2026-03-17 19:11:33 -08:00
695 changed files with 26943 additions and 21190 deletions
-28
View File
@@ -1,28 +0,0 @@
---
name: commit
description: Create a conventional commit for PX4 changes
disable-model-invocation: true
argument-hint: "[optional: description of changes]"
allowed-tools: Bash, Read, Glob, Grep
---
# PX4 Conventional Commit
Create a git commit: `type(scope): description`
**NEVER add Co-Authored-By lines. No Claude attribution in commits.**
Follow [CONTRIBUTING.md](../../CONTRIBUTING.md) for full project conventions.
## Steps
1. **Read [CONTRIBUTING.md](../../CONTRIBUTING.md)** for commit message format, types, scopes, and conventions.
2. Check branch (`git branch --show-current`). If on `main`, create a feature branch. Use `<username>/<description>` format where `<username>` comes from `gh api user --jq .login`. If unavailable, just use `<description>`.
3. Run `git status` and `git diff --staged`. If nothing staged, ask what to stage.
4. Follow the commit message convention from CONTRIBUTING.md: pick the correct **type** and **scope**, write a concise imperative description.
5. Body (if needed): explain **why**, not what.
6. Run `make format` or `./Tools/astyle/fix_code_style.sh <file>` on changed C/C++ files before committing.
7. Check if GPG signing is available: `git config --get user.signingkey`. If set, use `git commit -S -s`. Otherwise, use `git commit -s`.
8. Stage and commit. No `Co-Authored-By`.
If the user provided arguments, use them as context: $ARGUMENTS
-24
View File
@@ -1,24 +0,0 @@
---
name: pr
description: Create a pull request with conventional commit title and description
disable-model-invocation: true
argument-hint: "[optional: target branch or description]"
allowed-tools: Bash, Read, Glob, Grep
---
# PX4 Pull Request
**No Claude attribution anywhere (no Co-Authored-By, no "Generated with Claude").**
Follow [CONTRIBUTING.md](../../CONTRIBUTING.md) for full project conventions.
## Steps
1. Check branch. If on `main`, create a feature branch. Use `<username>/<description>` format where `<username>` comes from `gh api user --jq .login`. If unavailable, just use `<description>`.
2. Gather context: `git status`, `git log --oneline main..HEAD`, `git diff main...HEAD --stat`, check if remote tracking branch exists.
3. PR **title**: `type(scope): description` — under 72 chars, describes the overall change across all commits. This becomes the squash-merge commit message.
4. PR **body**: brief summary + bullet points for key changes. No filler.
5. Push with `-u` if needed, then `gh pr create`. Default base is `main` unless user says otherwise.
6. Return the PR URL.
If the user provided arguments, use them as context: $ARGUMENTS
-73
View File
@@ -1,73 +0,0 @@
---
name: rebase-onto-main
description: Rebase a branch onto main, handling squash-merged parent branches cleanly
argument-hint: "[optional: branch name, defaults to current branch]"
allowed-tools: Bash, Read, Glob, Grep, Agent
---
# Rebase Branch onto Main
Rebase the current (or specified) branch onto `main`, correctly handling the case where the branch was built on top of another branch that has since been squash-merged into `main`.
## Background
When a parent branch is squash-merged, its individual commits become a single new commit on `main` with a different hash. A normal `git rebase main` will try to replay the parent's original commits, causing messy conflicts. The fix is to **cherry-pick only the commits unique to this branch** onto a fresh branch from `main`.
## Steps
1. **Identify the branch.** Use `$ARGUMENTS` if provided, otherwise use the current branch.
2. **Fetch and update main:**
```
git fetch origin main:main
```
3. **Find the merge base** between the branch and `main`:
```
git merge-base <branch> main
```
4. **List all commits** on the branch since the merge base:
```
git log --oneline <merge-base>..<branch>
```
5. **Identify which commits are unique to this branch** vs. inherited from a parent branch. Look for:
- Squash-merged commits on `main` that correspond to a group of commits at the bottom of the branch's history (check PR titles, commit message keywords).
- The boundary commit: the first commit that belongs to *this* branch's work, not the parent's.
- If ALL commits are unique (no parent branch), just do a normal `git rebase main` and skip the rest.
6. **Create a fresh branch from `main`:**
```
git checkout -b <branch>-rebase main
```
7. **Cherry-pick only the unique commits** (oldest first):
```
git cherry-pick <first-unique-commit>^..<branch>
```
The `A^..B` range means "from the parent of A through B inclusive."
8. **Handle conflicts** if any arise during cherry-pick. Resolve and `git cherry-pick --continue`.
9. **Replace the old branch:**
```
git branch -m <branch> <branch>-old
git branch -m <branch>-rebase <branch>
```
10. **Verify** the result:
```
git log --oneline main..<branch>
```
Confirm only the expected commits are present.
11. **Ask the user** before force-pushing. When approved:
```
git push origin <branch> --force-with-lease
```
12. **Clean up** the old branch:
```
git branch -D <branch>-old
```
+1 -3
View File
@@ -265,7 +265,5 @@ jobs:
with:
draft: true
prerelease: ${{ steps.upload-location.outputs.is_prerelease == 'true' }}
files: |
artifacts/*.px4
artifacts/*.deb
files: artifacts/*.px4
name: ${{ steps.upload-location.outputs.uploadlocation }}
+1 -9
View File
@@ -89,15 +89,7 @@ jobs:
. /opt/ros/galactic/setup.bash
mkdir -p /opt/px4_ws/src
cd /opt/px4_ws/src
BRANCH="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}"
REPO_URL="https://github.com/Auterion/px4-ros2-interface-lib.git"
if git ls-remote --heads "$REPO_URL" "$BRANCH" | grep -q "$BRANCH"; then
echo "Cloning px4-ros2-interface-lib with matching branch: $BRANCH"
git clone --recursive --branch "$BRANCH" "$REPO_URL"
else
echo "Branch '$BRANCH' not found in px4-ros2-interface-lib, using default (main)"
git clone --recursive "$REPO_URL"
fi
git clone --recursive https://github.com/Auterion/px4-ros2-interface-lib.git
# Ignore python packages due to compilation issue (can be enabled when updating ROS)
touch px4-ros2-interface-lib/px4_ros2_py/COLCON_IGNORE || true
touch px4-ros2-interface-lib/examples/python/COLCON_IGNORE || true
@@ -1,43 +0,0 @@
name: Sync release branch to px4-ros2-interface-lib
on:
create:
workflow_dispatch:
inputs:
branch:
description: 'Release branch name (e.g. release/1.18)'
required: true
type: string
permissions: {}
jobs:
notify-interface-lib:
if: >-
github.repository == 'PX4/PX4-Autopilot' &&
(
(github.event_name == 'create' && github.ref_type == 'branch' && startsWith(github.ref_name, 'release/')) ||
github.event_name == 'workflow_dispatch'
)
runs-on: ubuntu-latest
steps:
- name: Determine branch name
id: params
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
BRANCH="${{ inputs.branch }}"
else
BRANCH="${{ github.ref_name }}"
fi
echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
echo "Dispatching for branch: $BRANCH"
- name: Dispatch release branch creation
run: |
BRANCH="${{ steps.params.outputs.branch }}"
curl -s -f -X POST \
-H "Authorization: token ${{ secrets.PX4BUILTBOT_PERSONAL_ACCESS_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/Auterion/px4-ros2-interface-lib/dispatches \
-d "{\"event_type\":\"px4_release_branch\",\"client_payload\":{\"branch\":\"$BRANCH\"}}"
echo "Dispatched px4_release_branch event for $BRANCH"
+1 -15
View File
@@ -226,22 +226,9 @@ CONFIG_TARGETS_DEFAULT := $(patsubst %_default,%,$(filter %_default,$(ALL_CONFIG
$(CONFIG_TARGETS_DEFAULT):
@$(call cmake-build,$@_default$(BUILD_DIR_SUFFIX))
# Multi-processor boards: build all processor targets together
# VOXL2 apps processor (default) depends on SLPI DSP being built first
modalai_voxl2_default: modalai_voxl2_slpi
modalai_voxl2: modalai_voxl2_slpi
modalai_voxl2_deb: modalai_voxl2_slpi
all_config_targets: $(ALL_CONFIG_TARGETS)
all_default_targets: $(CONFIG_TARGETS_DEFAULT)
# DEB package targets: builds _default config, then runs cpack.
# Multi-processor boards (e.g. VOXL2) chain companion builds automatically
# via existing cmake prerequisites.
%_deb:
@$(call cmake-build,$(subst _deb,_default,$@)$(BUILD_DIR_SUFFIX))
@cd "$(SRC_DIR)/build/$(subst _deb,_default,$@)" && cpack -G DEB
updateconfig:
@./Tools/kconfig/updateconfig.py
@@ -548,8 +535,7 @@ validate_module_configs:
-not -path "$(SRC_DIR)/src/modules/zenoh/zenoh-pico/*" \
-not -path "$(SRC_DIR)/src/lib/events/libevents/*" \
-not -path "$(SRC_DIR)/src/lib/cdrstream/*" \
-not -path "$(SRC_DIR)/src/lib/crypto/libtommath/*" \
-not -path "$(SRC_DIR)/src/lib/tensorflow_lite_micro/*" -print0 | \
-not -path "$(SRC_DIR)/src/lib/crypto/libtommath/*" -print0 | \
xargs -0 "$(SRC_DIR)"/Tools/validate_yaml.py --schema-file "$(SRC_DIR)"/validation/module_schema.yaml
# Cleanup
+3 -3
View File
@@ -119,11 +119,11 @@ else
param set SYS_AUTOCONFIG 1
fi
# To trigger a parameter reset during boot SYS_AUTOCONFIG was set to 1 before
# To trigger a parameter reset during boot SYS_AUTCONFIG was set to 1 before
if param greater SYS_AUTOCONFIG 0
then
# Reset parameters except airframe, parameter version, sensor calibration, total flight time, flight UUID
param reset_all SYS_AUTOSTART SYS_PARAM_VER CAL_* LND_FLIGHT* TC_* COM_FLIGHT*
# Reset parameters except airframe, parameter version, RC calibration, sensor calibration, total flight time, flight UUID
param reset_all SYS_AUTOSTART SYS_PARAM_VER RC* CAL_* LND_FLIGHT* TC_* COM_FLIGHT*
set AUTOCNF yes
fi
+1 -1
View File
@@ -238,7 +238,7 @@ then
fi
# Start TMP102 temperature sensor
if param compare -s SENS_EN_TMP102 1
if param compare SENS_EN_TMP102 1
then
tmp102 start -X
fi
+7 -10
View File
@@ -188,11 +188,11 @@ else
netman update -i eth0
fi
# To trigger a parameter reset during boot SYS_AUTOCONFIG was set to 1 before
# To trigger a parameter reset during boot SYS_AUTCONFIG was set to 1 before
if param greater SYS_AUTOCONFIG 0
then
# Reset parameters except airframe, parameter version, sensor calibration, total flight time, flight UUID
param reset_all SYS_AUTOSTART SYS_PARAM_VER CAL_* LND_FLIGHT* TC_* COM_FLIGHT*
# Reset parameters except airframe, parameter version, RC calibration, sensor calibration, total flight time, flight UUID
param reset_all SYS_AUTOSTART SYS_PARAM_VER RC* CAL_* LND_FLIGHT* TC_* COM_FLIGHT*
fi
#
@@ -633,15 +633,12 @@ else
#
# Start the VTX services.
#
if ! param compare VTX_SER_CFG 0
set RC_VTXTABLE ${R}etc/init.d/rc.vtxtable
if [ -f ${RC_VTXTABLE} ]
then
set RC_VTXTABLE ${R}etc/init.d/rc.vtxtable
if [ -f ${RC_VTXTABLE} ]
then
. ${RC_VTXTABLE}
fi
unset RC_VTXTABLE
. ${RC_VTXTABLE}
fi
unset RC_VTXTABLE
#
# Set additional parameters and env variables for selected AUTOSTART.
-59
View File
@@ -189,65 +189,6 @@ for manufacturer in sorted(os.scandir(os.path.join(source_dir, '../boards')), ke
if target is not None:
build_configs.append(target)
# Remove companion targets from CI groups (parent target builds them via Make prerequisite)
for manufacturer in sorted(os.scandir(os.path.join(source_dir, '../boards')), key=lambda e: e.name):
if not manufacturer.is_dir():
continue
for board in sorted(os.scandir(manufacturer.path), key=lambda e: e.name):
if not board.is_dir():
continue
companion_file = os.path.join(board.path, 'companion_targets')
if os.path.exists(companion_file):
with open(companion_file) as f:
companions = {l.strip() for l in f if l.strip() and not l.startswith('#')}
for arch in grouped_targets:
for man in grouped_targets[arch]['manufacturers']:
grouped_targets[arch]['manufacturers'][man] = [
t for t in grouped_targets[arch]['manufacturers'][man]
if t not in companions
]
# Append _deb targets for boards that have cmake/package.cmake
for manufacturer in sorted(os.scandir(os.path.join(source_dir, '../boards')), key=lambda e: e.name):
if not manufacturer.is_dir():
continue
if manufacturer.name in excluded_manufacturers:
continue
for board in sorted(os.scandir(manufacturer.path), key=lambda e: e.name):
if not board.is_dir():
continue
board_name = manufacturer.name + '_' + board.name
if board_name in excluded_boards:
continue
package_cmake = os.path.join(board.path, 'cmake', 'package.cmake')
if os.path.exists(package_cmake):
deb_target = board_name + '_deb'
if target_filter and not any(deb_target.startswith(f) for f in target_filter):
continue
# Determine the container and group for this board
container = default_container
if board_name in board_container_overrides:
container = board_container_overrides[board_name]
target_entry = {'target': deb_target, 'container': container}
if args.group:
# Find the group where this board's _default target already lives
default_target = board_name + '_default'
group = None
for g in grouped_targets:
targets_in_group = grouped_targets[g].get('manufacturers', {}).get(manufacturer.name, [])
if default_target in targets_in_group:
group = g
break
if group is None:
group = 'base'
target_entry['arch'] = group
if group not in grouped_targets:
grouped_targets[group] = {'container': container, 'manufacturers': {}}
if manufacturer.name not in grouped_targets[group]['manufacturers']:
grouped_targets[group]['manufacturers'][manufacturer.name] = []
grouped_targets[group]['manufacturers'][manufacturer.name].append(deb_target)
build_configs.append(target_entry)
if(verbose):
import pprint
print("============================")
-1
View File
@@ -3,7 +3,6 @@
mkdir artifacts
cp **/**/*.px4 artifacts/ 2>/dev/null || true
cp **/**/*.elf artifacts/ 2>/dev/null || true
cp **/**/*.deb artifacts/ 2>/dev/null || true
for build_dir_path in build/*/ ; do
build_dir_path=${build_dir_path::${#build_dir_path}-1}
build_dir=${build_dir_path#*/}
+3 -13
View File
@@ -128,9 +128,6 @@ class SourceParser:
# start waiting for the next part - long comment.
if state == "wait-short-end":
state = "wait-long"
elif state == "wait-long-end":
# Preserve paragraph breaks in long description
long_desc += "\n"
else:
m = self.re_comment_tag.match(comment_content)
if m:
@@ -211,7 +208,8 @@ class SourceParser:
raise Exception('short description too long (150 max, is {:}, parameter: {:})'.format(len(short_desc), name))
param.fields["short_desc"] = self.re_remove_dots.sub('', short_desc)
if long_desc is not None:
param.fields["long_desc"] = long_desc.rstrip('\n')
long_desc = self.re_remove_carriage_return.sub(' ', long_desc)
param.fields["long_desc"] = long_desc
for tag in tags:
if tag == "group":
group = tags[tag]
@@ -409,15 +407,7 @@ def generate_yaml(filename: str, groups: list[ParameterGroup]) -> str:
g["definitions"][parameter.name] = p
data["parameters"].append(g)
# Use block scalar style for multi-line strings
class BlockStyleDumper(yaml.SafeDumper):
pass
def str_representer(dumper, data):
if '\n' in data:
return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|')
return dumper.represent_scalar('tag:yaml.org,2002:str', data)
BlockStyleDumper.add_representer(str, str_representer)
return yaml.dump(data, Dumper=BlockStyleDumper, sort_keys=False)
return yaml.dump(data, sort_keys=False)
def main():
+1 -4
View File
@@ -108,7 +108,7 @@ def parse_yaml_parameters_config(yaml_config, ethernet_supported):
tags = '@group {:}'.format(param_group)
if param['type'] == 'enum':
param_type = 'INT32'
for key in sorted(param['values'], key=float):
for key in param['values']:
tags += '\n * @value {:} {:}'.format(key, param['values'][key])
elif param['type'] == 'bitmask':
param_type = 'INT32'
@@ -124,9 +124,6 @@ def parse_yaml_parameters_config(yaml_config, ethernet_supported):
param_type = 'INT32'
elif param['type'] == 'float':
param_type = 'FLOAT'
if 'values' in param:
for key in sorted(param['values'], key=float):
tags += '\n * @value {:} {:}'.format(key, param['values'][key])
else:
raise Exception("unknown param type {:}".format(param['type']))
+1 -3
View File
@@ -316,9 +316,7 @@ Param | Units | Range/Enum | Description
if val.minValue or val.maxValue:
rangeVal = f"[{val.minValue if val.minValue else '-'} : {val.maxValue if val.maxValue else '-' }]"
units_str = ", ".join(val.units)
enums_str = ', '.join("[{}](#{})".format(e, e) for e in val.enums)
output+=f"{i} | {units_str}|{enums_str}{rangeVal} | {val.description}\n"
output+=f"{i} | {", ".join(val.units)}|{', '.join(f"[{e}](#{e})" for e in val.enums)}{rangeVal} | {val.description}\n"
else:
output+=f"{i} | | | ?\n"
@@ -42,8 +42,6 @@ px4_add_module(
syslink_bridge.cpp
syslink_memory.cpp
syslink.c
MODULE_CONFIG
syslink_params.yaml
DEPENDS
battery
)
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2026 PX4 Development Team. All rights reserved.
* Copyright (c) 2016 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
@@ -10,7 +10,8 @@
* 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 distribution.
* 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.
@@ -30,39 +31,42 @@
*
****************************************************************************/
#include "rallyPointCheck.hpp"
/**
* @file syslink_params.c
*
* Parameters defined by the syslink module and the exposed NRF51 radio
*
* @author Dennis Shtatnov <densht@gmail.com>
*/
RallyPointChecks::RallyPointChecks()
: _param_rtl_type_handle(param_find("RTL_TYPE"))
{
}
/**
* Operating channel of the NRF51
*
* @min 0
* @max 125
* @group Syslink
*/
PARAM_DEFINE_INT32(SLNK_RADIO_CHAN, 80);
void RallyPointChecks::checkAndReport(const Context &context, Report &reporter)
{
int32_t rtl_type = 0;
/**
* Operating datarate of the NRF51
*
* @min 0
* @max 2
* @group Syslink
*/
PARAM_DEFINE_INT32(SLNK_RADIO_RATE, 2);
if (param_get(_param_rtl_type_handle, &rtl_type) != 0 || rtl_type != 5) {
// Only enforce rally point requirement when RTL_TYPE == 5 (safe points only)
return;
}
/**
* Operating address of the NRF51 (most significant byte)
*
* @group Syslink
*/
PARAM_DEFINE_INT32(SLNK_RADIO_ADDR1, 231); // 0xE7
rtl_status_s rtl_status;
if (!_rtl_status_sub.copy(&rtl_status) || rtl_status.safe_point_index == UINT8_MAX) {
/* EVENT
* @description
* Upload at least one rally point before arming, or change <param>RTL_TYPE</param>.
*
* <profile name="dev">
* This check is active when RTL_TYPE is set to 5 (safe points only).
* </profile>
*/
reporter.armingCheckFailure(NavModes::All, health_component_t::system,
events::ID("check_rally_point_missing"),
events::Log::Error, "No rally point available");
if (reporter.mavlink_log_pub()) {
mavlink_log_critical(reporter.mavlink_log_pub(), "Preflight Fail: No rally point available\t");
}
}
}
/**
* Operating address of the NRF51 (least significant 4 bytes)
*
* @group Syslink
*/
PARAM_DEFINE_INT32(SLNK_RADIO_ADDR2, 3890735079); // 0xE7E7E7E7
@@ -1,28 +0,0 @@
module_name: syslink
parameters:
- group: Syslink
definitions:
SLNK_RADIO_CHAN:
description:
short: Operating channel of the NRF51
type: int32
default: 80
min: 0
max: 125
SLNK_RADIO_RATE:
description:
short: Operating datarate of the NRF51
type: int32
default: 2
min: 0
max: 2
SLNK_RADIO_ADDR1:
description:
short: Operating address of the NRF51 (most significant byte)
type: int32
default: 231
SLNK_RADIO_ADDR2:
description:
short: Operating address of the NRF51 (least significant 4 bytes)
type: int32
default: -404232217
Binary file not shown.
+1 -1
View File
@@ -104,7 +104,7 @@
#define OSC_FREQ 8
#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_BLUE // BLUE
#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_RED // RED
#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_GREEN // GREEN
#define BOARD_LED_ON 0
#define BOARD_LED_OFF 1
-1
View File
@@ -169,7 +169,6 @@ __EXPORT int board_app_initialize(uintptr_t arg)
drv_led_start();
led_off(LED_RED);
led_off(LED_BLUE);
led_off(LED_GREEN);
if (board_hardfault_init(2, true) != 0) {
led_on(LED_BLUE);
+3 -22
View File
@@ -63,23 +63,12 @@ extern void led_toggle(int led);
__END_DECLS
# define xlat(p) (p)
// index: 0=BLUE, 1=RED, 2=SAFETY, 3=GREEN
static uint32_t g_ledmap[] = {
GPIO_nLED_BLUE, // LED_BLUE (0)
GPIO_nLED_RED, // LED_RED (1)
0, // LED_SAFETY (2) - no independent safety LED, use 0 placeholder
GPIO_nLED_GREEN, // LED_GREEN (3)
GPIO_nLED_GREEN, // Indexed by BOARD_LED_GREEN
GPIO_nLED_BLUE, // Indexed by BOARD_LED_BLUE
GPIO_nLED_RED, // Indexed by BOARD_LED_RED
};
#ifndef arraySize
#define arraySize(a) (sizeof((a))/sizeof(((a)[0])))
#endif
static inline bool valid_led_index(int led)
{
return (led >= 0) && ((size_t)led < arraySize(g_ledmap));
}
__EXPORT void led_init(void)
{
/* Configure LED GPIOs for output */
@@ -92,10 +81,6 @@ __EXPORT void led_init(void)
static void phy_set_led(int led, bool state)
{
if (!valid_led_index(led)) {
return;
}
/* Drive Low to switch on */
if (g_ledmap[led] != 0) {
stm32_gpiowrite(g_ledmap[led], !state);
@@ -104,10 +89,6 @@ static void phy_set_led(int led, bool state)
static bool phy_get_led(int led)
{
if (!valid_led_index(led)) {
return false;
}
/* If Low it is on */
if (g_ledmap[led] != 0) {
return !stm32_gpioread(g_ledmap[led]);
@@ -37,8 +37,6 @@ px4_add_module(
SRCS
pwm_voltage.cpp
MODULE_CONFIG
parameters.yaml
DEPENDS
px4_work_queue
)
@@ -0,0 +1,44 @@
/****************************************************************************
*
* 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
* 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.
*
****************************************************************************/
/**
* Control PWM output voltage
*
* Enable: PWM output voltage 5V
* Disable: PWM output voltage 3.3V
*
* @boolean
* @reboot_required true
* @group PWM Outputs
*/
PARAM_DEFINE_INT32(PWM_LEVEL_CONT, 0);
@@ -1,13 +0,0 @@
module_name: pwm_voltage
parameters:
- group: PWM Outputs
definitions:
PWM_LEVEL_CONT:
description:
short: Control PWM output voltage
long: |-
Enable: PWM output voltage 5V
Disable: PWM output voltage 3.3V
type: boolean
default: 0
reboot_required: true
@@ -37,8 +37,6 @@ px4_add_module(
SRCS
pwm_voltage.cpp
MODULE_CONFIG
parameters.yaml
DEPENDS
px4_work_queue
)
@@ -0,0 +1,43 @@
/****************************************************************************
*
* Copyright (c) 2025 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.
*
****************************************************************************/
/**
* Control PWM output voltage
*
* @value 0 3.3V
* @value 1 5.0V
*
* @reboot_required true
* @group PWM Outputs
*/
PARAM_DEFINE_INT32(PWM_VOLT_SEL, 0);
@@ -1,13 +0,0 @@
module_name: pwm_voltage
parameters:
- group: PWM Outputs
definitions:
PWM_VOLT_SEL:
description:
short: Control PWM output voltage
type: enum
values:
0: 3.3V
1: 5.0V
default: 0
reboot_required: true
@@ -37,8 +37,6 @@ px4_add_module(
SRCS
pwm_voltage.cpp
MODULE_CONFIG
parameters.yaml
DEPENDS
px4_work_queue
)
@@ -0,0 +1,43 @@
/****************************************************************************
*
* Copyright (c) 2025 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.
*
****************************************************************************/
/**
* Control PWM output voltage
*
* @value 0 3.3V
* @value 1 5.0V
*
* @reboot_required true
* @group PWM Outputs
*/
PARAM_DEFINE_INT32(PWM_VOLT_SEL, 0);
@@ -1,13 +0,0 @@
module_name: pwm_voltage
parameters:
- group: PWM Outputs
definitions:
PWM_VOLT_SEL:
description:
short: Control PWM output voltage
type: enum
values:
0: 3.3V
1: 5.0V
default: 0
reboot_required: true
@@ -37,8 +37,6 @@ px4_add_module(
SRCS
pwm_voltage.cpp
MODULE_CONFIG
parameters.yaml
DEPENDS
px4_work_queue
)
@@ -10,7 +10,8 @@
* 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 distribution.
* 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.
@@ -30,24 +31,13 @@
*
****************************************************************************/
#pragma once
#include "../Common.hpp"
#include <uORB/Subscription.hpp>
#include <uORB/topics/rtl_status.h>
#include <parameters/param.h>
class RallyPointChecks : public HealthAndArmingCheckBase
{
public:
RallyPointChecks();
~RallyPointChecks() = default;
void checkAndReport(const Context &context, Report &reporter) override;
private:
uORB::Subscription _rtl_status_sub{ORB_ID(rtl_status)};
const param_t _param_rtl_type_handle;
};
/**
* Control PWM output voltage
*
* @value 0 3.3V
* @value 1 5.0V
*
* @reboot_required true
* @group PWM Outputs
*/
PARAM_DEFINE_INT32(PWM_VOLT_SEL, 0);
@@ -1,13 +0,0 @@
module_name: pwm_voltage
parameters:
- group: PWM Outputs
definitions:
PWM_VOLT_SEL:
description:
short: Control PWM output voltage
type: enum
values:
0: 3.3V
1: 5.0V
default: 0
reboot_required: true
@@ -1,23 +1,5 @@
CONFIG_PLATFORM_QURT=y
CONFIG_BOARD_TOOLCHAIN="qurt"
# Disable modules from default.px4board that are apps-only
CONFIG_BOARD_LINUX_TARGET=n
CONFIG_DRIVERS_OSD_MSP_OSD=n
CONFIG_DRIVERS_QSHELL_POSIX=n
CONFIG_DRIVERS_RC_INPUT=n
CONFIG_MODULES_DATAMAN=n
CONFIG_MODULES_LOGGER=n
CONFIG_MODULES_MAVLINK=n
CONFIG_MODULES_MUORB_APPS=n
CONFIG_MODULES_NAVIGATOR=n
CONFIG_MODULES_UXRCE_DDS_CLIENT=n
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=n
CONFIG_SYSTEMCMDS_BSONDUMP=n
CONFIG_SYSTEMCMDS_PERF=n
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=n
CONFIG_SYSTEMCMDS_VER=n
CONFIG_SYSTEMCMDS_REBOOT=n
CONFIG_PARAM_PRIMARY=n
CONFIG_DRIVERS_ACTUATORS_VOXL_ESC=y
CONFIG_DRIVERS_BAROMETER_INVENSENSE_ICP101XX=y
CONFIG_DRIVERS_BAROMETER_MS5611=y
@@ -37,8 +19,6 @@ CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y
CONFIG_DRIVERS_MAGNETOMETER_QMC5883L=y
CONFIG_DRIVERS_MAGNETOMETER_ST_IIS2MDC=y
CONFIG_DRIVERS_POWER_MONITOR_VOXLPM=y
CONFIG_DRIVERS_POWER_MONITOR_INA226=y
CONFIG_DRIVERS_POWER_MONITOR_INA228=y
CONFIG_DRIVERS_QSHELL_QURT=y
CONFIG_DRIVERS_RC_CRSF_RC=y
CONFIG_DRIVERS_VOXL2_IO=y
@@ -0,0 +1,84 @@
############################################################################
#
# Copyright (c) 2022 ModalAI, Inc. 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.
#
############################################################################
# Need to make sure that the DSP processor on VOXL2
# knows about all parameters since some modules need parameters
# from other modules that are not running on the DSP.
set(DISABLE_PARAMS_MODULE_SCOPING TRUE PARENT_SCOPE)
add_library(drivers_board
board_config.h
i2c.cpp
init.c
spi.cpp
)
# Generate MAVLink common headers for SLPI drivers (dsp_hitl, mavlink_rc_in)
# Replicates the generation from src/modules/mavlink/CMakeLists.txt so the
# SLPI build is self-contained and does not depend on voxl2-default.
set(MAVLINK_GIT_DIR "${PX4_SOURCE_DIR}/src/modules/mavlink/mavlink")
set(MAVLINK_LIBRARY_DIR "${CMAKE_BINARY_DIR}/mavlink")
px4_add_git_submodule(TARGET git_mavlink_v2 PATH "${MAVLINK_GIT_DIR}")
add_custom_command(
OUTPUT ${MAVLINK_LIBRARY_DIR}/common/common.h
COMMAND ${PYTHON_EXECUTABLE} ${MAVLINK_GIT_DIR}/pymavlink/tools/mavgen.py
--lang C --wire-protocol 2.0
--output ${MAVLINK_LIBRARY_DIR}
${MAVLINK_GIT_DIR}/message_definitions/v1.0/common.xml
> ${CMAKE_BINARY_DIR}/mavgen_common.log
DEPENDS
git_mavlink_v2
${MAVLINK_GIT_DIR}/pymavlink/tools/mavgen.py
${MAVLINK_GIT_DIR}/message_definitions/v1.0/common.xml
COMMENT "Generating MAVLink common headers for SLPI"
)
add_custom_target(mavlink_common_generate DEPENDS ${MAVLINK_LIBRARY_DIR}/common/common.h)
add_library(mavlink_common_headers INTERFACE)
add_dependencies(mavlink_common_headers mavlink_common_generate)
target_compile_options(mavlink_common_headers INTERFACE -Wno-address-of-packed-member -Wno-cast-align)
target_include_directories(mavlink_common_headers INTERFACE
${MAVLINK_LIBRARY_DIR}
${MAVLINK_LIBRARY_DIR}/common
)
# Add custom drivers for SLPI
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/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)
@@ -0,0 +1,82 @@
/****************************************************************************
*
* Copyright (c) 2022-2026 ModalAI, Inc. 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
*
* VOXL2 internal definitions
*/
#pragma once
#define CONFIG_BOARDCTL_RESET
#define BOARD_HAS_NO_BOOTLOADER
/*
* I2C buses
*/
#define CONFIG_I2C 1
#define PX4_NUMBER_I2C_BUSES 4
/*
* SPI buses
*/
#define CONFIG_SPI 1
#define BOARD_SPI_BUS_MAX_BUS_ITEMS 1
/*
* Include these last to make use of the definitions above
*/
#include <system_config.h>
#include <px4_platform_common/board_common.h>
/*
* Default port for the ESC
*/
#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
+35
View File
@@ -0,0 +1,35 @@
/****************************************************************************
*
* Copyright (C) 2022 ModalAI, Inc. 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 "board_config.h"
// Place holder for VOXL2-specific early startup code
+2 -10
View File
@@ -13,10 +13,6 @@ critical applications such as Mavlink, and logging are running on the
ARM CPU cluster (aka apps proc). The DSP and ARM CPU cluster communicate via a
Qualcomm proprietary shared memory interface.
Both processors are built from this single board directory:
- `default.px4board` - POSIX apps processor (ARM64)
- `slpi.px4board` - QURT DSP (Hexagon)
## Build environment
In order to build for this platform both the Qualcomm Hexagon (DSP) toolchain and the Linaro ARM64 toolchain need to be installed. The (nearly) complete setup including the ARM64 toolchain is provided in the base Docker image provided by ModalAI, but since ModalAI is not allowed to redistribute the Qualcomm Hexagon DSP SDK this must be added by the end user.
@@ -26,21 +22,17 @@ The full instructions are available here:
## Build overview
A single `make modalai_voxl2` command builds both the DSP and apps processor
firmware. The Makefile chains the SLPI build as a prerequisite of the default
(apps) build.
- Clone the repo (Don't forget to update and initialize all submodules)
- In the top level directory
```
px4$ boards/modalai/voxl2/scripts/run-docker.sh
root@9373fa1401b8:/usr/local/workspace# boards/modalai/voxl2/scripts/clean.sh
root@9373fa1401b8:/usr/local/workspace# boards/modalai/voxl2/scripts/build-deps.sh
root@9373fa1401b8:/usr/local/workspace# boards/modalai/voxl2/scripts/build-apps.sh
root@9373fa1401b8:/usr/local/workspace# boards/modalai/voxl2/scripts/build-slpi.sh
root@9373fa1401b8:/usr/local/workspace# exit
```
For DSP-only rebuilds: `make modalai_voxl2_slpi`
## Install and run on VOXL 2
Once the DSP and Linux images have been built they can be installed on a VOXL 2
-4
View File
@@ -31,10 +31,6 @@
#
############################################################################
if(NOT "${PX4_PLATFORM}" STREQUAL "posix")
return()
endif()
# Initialize libfc-sensor-api submodule (fetches from GitLab if not present)
execute_process(
COMMAND Tools/check_submodules.sh boards/modalai/voxl2/libfc-sensor-api
-84
View File
@@ -1,84 +0,0 @@
############################################################################
#
# 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
# 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.
#
############################################################################
# VOXL2 board-specific install rules for .deb packaging
# Included from platforms/posix/CMakeLists.txt where the px4 target exists
# SLPI companion build output directory
set(VOXL2_SLPI_BUILD_DIR "${PX4_SOURCE_DIR}/build/modalai_voxl2_slpi")
# Apps processor binary
install(TARGETS px4 RUNTIME DESTINATION bin)
# px4-alias.sh (generated during build into bin/ subdirectory)
install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/px4-alias.sh DESTINATION bin)
# Startup scripts from board target directory
install(PROGRAMS
${PX4_BOARD_DIR}/target/voxl-px4
${PX4_BOARD_DIR}/target/voxl-px4-start
${PX4_BOARD_DIR}/target/voxl-px4-hitl
${PX4_BOARD_DIR}/target/voxl-px4-hitl-start
${PX4_BOARD_DIR}/scripts/voxl-configure-px4
DESTINATION bin
)
# DSP firmware blob from companion SLPI build
install(FILES ${VOXL2_SLPI_BUILD_DIR}/platforms/qurt/libpx4.so
DESTINATION lib/rfsa/adsp
)
# Configuration files
install(FILES
${PX4_BOARD_DIR}/target/voxl-px4-fake-imu-calibration.config
${PX4_BOARD_DIR}/target/voxl-px4-hitl-set-default-parameters.config
DESTINATION ../etc/modalai
)
# Systemd service file
install(FILES ${PX4_BOARD_DIR}/debian/voxl-px4.service
DESTINATION ../etc/systemd/system
)
# Component metadata JSON files
install(FILES
${PX4_BINARY_DIR}/actuators.json.xz
${PX4_BINARY_DIR}/component_general.json.xz
${PX4_BINARY_DIR}/parameters.json.xz
DESTINATION ../data/px4/etc/extras
OPTIONAL
)
install(FILES ${PX4_BINARY_DIR}/events/all_events.json.xz
DESTINATION ../data/px4/etc/extras
OPTIONAL
)
@@ -1,6 +1,3 @@
if(NOT "${PX4_PLATFORM}" STREQUAL "posix")
return()
endif()
# Link against the public stub version of the proprietary fc sensor library
target_link_libraries(px4 PRIVATE
-63
View File
@@ -1,63 +0,0 @@
############################################################################
#
# 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
# 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.
#
############################################################################
# VOXL2 board-specific CPack overrides
# Loaded after cmake/package.cmake sets up CPack defaults
# Derive Debian-compatible version from git tag (e.g. v1.17.0-alpha1-42-gabcdef -> 1.17.0~alpha1.42.gabcdef)
string(REGEX REPLACE "^v" "" _deb_ver "${PX4_GIT_TAG}")
string(REGEX REPLACE "-" "~" _deb_ver "${_deb_ver}" )
string(REGEX REPLACE "~([0-9]+)~" ".\\1." _deb_ver "${_deb_ver}")
# VOXL2 is always aarch64 regardless of build host
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
set(CPACK_DEBIAN_PACKAGE_NAME "voxl-px4")
set(CPACK_DEBIAN_FILE_NAME "voxl-px4_${_deb_ver}_arm64.deb")
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
set(CPACK_INSTALL_PREFIX "/usr")
set(CPACK_SET_DESTDIR true)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libfc-sensor (>=1.0.10), voxl-px4-params (>=0.3.10), voxl3-system-image(>=0.0.2) | voxl2-system-image(>=1.5.4) | rb5-system-image(>=1.6.2), modalai-slpi(>=1.2.2) | modalai-adsp(>=1.0.5)")
set(CPACK_DEBIAN_PACKAGE_CONFLICTS "px4-rb5-flight")
set(CPACK_DEBIAN_PACKAGE_REPLACES "px4-rb5-flight")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "PX4 Autopilot for ModalAI VOXL2")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "ModalAI <support@modalai.com>")
# Disable shlibdeps for cross-compiled boards
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${PX4_BOARD_DIR}/debian/postinst;${PX4_BOARD_DIR}/debian/prerm")
# Install rules are in boards/modalai/voxl2/cmake/install.cmake,
# included from platforms/posix/CMakeLists.txt where the px4 target exists.
-3
View File
@@ -1,3 +0,0 @@
# Companion processor targets - built automatically by the parent (default) target
# These are excluded from CI target lists to avoid redundant builds
modalai_voxl2_slpi
-36
View File
@@ -1,36 +0,0 @@
#!/bin/bash
set -e
# Create px4-* symlinks from px4-alias.sh
# The alias format is: alias <module>='px4-<module> --instance $px4_instance'
# We extract the px4-<module> command name and symlink it to the px4 binary
if [ -f /usr/bin/px4-alias.sh ]; then
grep "^alias " /usr/bin/px4-alias.sh | \
sed -n "s/.*'\(px4-[a-zA-Z0-9_]*\).*/\1/p" | while read cmd; do
ln -sf px4 "/usr/bin/${cmd}"
done
fi
# Detect platform and generate DSP test signature if needed
if ! /bin/ls /usr/lib/rfsa/adsp/testsig-*.so &> /dev/null; then
echo "[INFO] Generating DSP test signature..."
if [ -f /share/modalai/qcs6490-slpi-test-sig/generate-test-sig.sh ]; then
/share/modalai/qcs6490-slpi-test-sig/generate-test-sig.sh || true
elif [ -f /share/modalai/qrb5165-slpi-test-sig/generate-test-sig.sh ]; then
/share/modalai/qrb5165-slpi-test-sig/generate-test-sig.sh || true
else
echo "[WARNING] Could not find DSP signature generation script"
fi
fi
# Create required data directories
mkdir -p /data/px4/param
mkdir -p /data/px4/etc/extras
chown -R root:root /data/px4
# Reload systemd if available
if command -v systemctl > /dev/null 2>&1; then
systemctl daemon-reload
fi
echo "voxl-px4 installed successfully"
-14
View File
@@ -1,14 +0,0 @@
#!/bin/bash
set -e
# Stop voxl-px4 service if running
if command -v systemctl > /dev/null 2>&1; then
systemctl stop voxl-px4 2>/dev/null || true
fi
# Remove px4-* symlinks
for f in /usr/bin/px4-*; do
if [ -L "$f" ] && [ "$(readlink "$f")" = "px4" ]; then
rm -f "$f"
fi
done
@@ -1,14 +0,0 @@
[Unit]
Description=PX4 Autopilot for VOXL2
After=sscrpcd.service
Requires=sscrpcd.service
[Service]
Type=simple
ExecStart=/usr/bin/voxl-px4
ExecStopPost=/usr/bin/voxl-reset-slpi
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
+2 -2
View File
@@ -1,6 +1,6 @@
#!/bin/bash
echo "*** Starting unified VOXL2 build (apps + SLPI) ***"
echo "*** Starting apps processor build ***"
source /home/build-env.sh
@@ -8,4 +8,4 @@ make modalai_voxl2
cat build/modalai_voxl2_default/src/lib/version/build_git_version.h
echo "*** End of unified VOXL2 build ***"
echo "*** End of apps processor build ***"
-11
View File
@@ -1,11 +0,0 @@
#!/bin/bash
echo "*** Starting unified VOXL2 build (apps + SLPI) ***"
source /home/build-env.sh
make modalai_voxl2_deb
cat build/modalai_voxl2_default/src/lib/version/build_git_version.h
echo "*** End of unified VOXL2 build ***"
+1 -1
View File
@@ -4,6 +4,6 @@ echo "*** Starting qurt slpi build ***"
source /home/build-env.sh
make modalai_voxl2_slpi
make modalai_voxl2-slpi
echo "*** End of qurt slpi build ***"
@@ -1,7 +1,7 @@
#!/bin/bash
# Push slpi image to voxl2
adb push build/modalai_voxl2_slpi/platforms/qurt/libpx4.so /usr/lib/rfsa/adsp
adb push build/modalai_voxl2-slpi_default/platforms/qurt/libpx4.so /usr/lib/rfsa/adsp
# Push apps processor image to voxl2
adb push build/modalai_voxl2_default/bin/px4 /usr/bin
+1 -1
View File
@@ -1,7 +1,7 @@
#!/bin/bash
# Push slpi image to voxl2
adb push build/modalai_voxl2_slpi/platforms/qurt/libpx4.so /usr/lib/rfsa/adsp
adb push build/modalai_voxl2-slpi_default/platforms/qurt/libpx4.so /usr/lib/rfsa/adsp
# Push apps processor image to voxl2
adb push build/modalai_voxl2_default/bin/px4 /usr/bin
@@ -1,270 +0,0 @@
#!/bin/bash
################################################################################
# Copyright 2023 ModalAI Inc.
#
# 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 of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# 4. The Software is used solely in conjunction with devices provided by
# ModalAI Inc.
#
# 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 HOLDER 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.
################################################################################
NAME="voxl-px4"
SERVICE_FILE="${NAME}.service"
CONFIG_FILE="/etc/modalai/${NAME}.conf"
USER=$(whoami)
print_usage () {
echo ""
echo "Config script for voxl-px4"
echo "wizard coming soon. For now, call with one of the following args:"
echo ""
echo ""
echo "voxl-configure-px4 disable"
echo "voxl-configure-px4 enable"
echo "voxl-configure-px4 factory_enable"
echo "voxl-configure-px4 d0005_v2"
echo "voxl-configure-px4 starling_v2"
echo "voxl-configure-px4 d0006_v1"
echo "voxl-configure-px4 sentinel_v1"
echo "voxl-configure-px4 d0008"
echo "voxl-configure-px4 fpv_revB"
echo "voxl-configure-px4 d0010"
echo "voxl-configure-px4 d0011"
echo "voxl-configure-px4 d0013"
echo "voxl-configure-px4 d0015"
echo "voxl-configure-px4 voxl2-mini"
echo ""
echo "show this help message:"
echo "voxl-configure-px4 help"
echo ""
echo "Use voxl-configure-px4 factory_enable to configure default values"
}
## set most parameters which don't have quotes in json
set_param () {
if [ "$#" != "2" ]; then
echo "set_param expected 2 args"
exit 1
fi
var=$1
val=$2
sed -i "/$var=/c $var=$val" ${CONFIG_FILE}
}
disable_service_and_exit () {
echo "disabling ${NAME} systemd service"
systemctl disable ${SERVICE_FILE}
echo "stopping ${NAME} systemd service"
systemctl stop ${SERVICE_FILE}
echo "Done configuring ${NAME}"
exit 0
}
enable_service_and_exit () {
echo "enabling ${NAME} systemd service"
systemctl enable ${SERVICE_FILE}
echo "Done configuring ${NAME}"
exit 0
}
reset_config_file_to_default () {
echo "wiping old config file"
rm -rf ${CONFIG_FILE}
# create config description section on top of file
echo -e "#!/bin/bash\n#\n# voxl-px4 Configuration File\
\n#\
\n# AIRFRAME:\
\n# Tell PX4 which AIRFRAME to use.\
\n# Options include: [MULTICOPTER, FIXED_WING]\
\n#\
\n# GPS:\
\n# Tell PX4 which GPS to use. If there is no GPS unit use NONE. Otherwise\
\n# choose AUTODETECT and the startup script will attempt to automatically\
\n# configure the GPS, magnetometer, and status LED\
\n# Options include: [NONE, AUTODETECT]\
\n#\
\n# RC:\
\n# Tell PX4 which RC transmitter to use. \
\n# Use EXTERNAL when getting RC control from external Mavlink messages (e.g Via QGC)\
\n# Options include: [SPEKTRUM, CRSF_MAV, CRSF_RAW, M0065_SBUS, EXTERNAL, FAKE_RC_INPUT]\
\n#\
\n# ESC:\
\n# Tell PX4 which type of ESC to use. \
\n# Options include: [VOXL_ESC, VOXL2_IO_PWM_ESC]\
\n#\
\n# POWER_MANAGER:\
\n# Tell PX4 which power manager to use. \
\n# Use NONE for ModalAI Mini-ESC since the ESC driver handles PM.\
\n# Use EXTERNAL when not using the ModalAI APM power manager to power the board\
\n# This also just disables the voxlpm driver, same as the NONE option\
\n# Options include: [VOXLPM, EXTERNAL, NONE]\
\n#\
\n# AIRSPEED_SENSOR:\
\n# Tell PX4 which airspeed sensor peripheral to use. \
\n# Note: The sensor will be started on external I2C port on voxl2\
\n# Options include: [NONE, MS4525DO]\
\n#\
\n# DISTANCE_SENSOR:\
\n# Tell PX4 which distance sensor peripheral to use. \
\n# Note: The sensor will be started on the RC port so it is only\
\n# really possible to use it when using external RC.\
\n# Options include: [NONE, LIGHTWARE_SF000]\
\n#\
\n# OSD:\
\n# Tell PX4 whether to enable OSD (on-screen display). \
\n# Options include: [ENABLE, DISABLE]\
\n#\
\n# DAEMON_MODE:\
\n# Tell PX4 whether to enable daemon mode. \
\n# Options include: [ENABLE, DISABLE]\
\n#\
\n# SENSOR_CAL:\
\n# Tell PX4 where to source sensor calibration information. \
\n# Options include: [ACTUAL, FAKE]\
\n#\
\n# ARTIFACT_MODE:\
\n# Do not allow artifacts to be saved to disk. Will not start the logging \
\n# module, will delete any current log files, and will delete the data manager file. \
\n# Options include: [ENABLE, DISABLE]\
\n#\
\n# EXTRA_STEPS:\
\n# Optional field that allows a user to define custom commands to be run by PX4 on boot. \
\n# Must be a valid bash array as seen below \
\n# Example: EXTRA_STEPS=( \"qshell gps start\" \"qshell commander mode manual\" ) \
\n#\
\n#" > $CONFIG_FILE
echo "AIRFRAME=MULTICOPTER" >> $CONFIG_FILE
echo "GPS=NONE" >> $CONFIG_FILE
echo "RC=SPEKTRUM" >> $CONFIG_FILE
echo "ESC=VOXL_ESC" >> $CONFIG_FILE
echo "POWER_MANAGER=VOXLPM" >> $CONFIG_FILE
echo "AIRSPEED_SENSOR=NONE" >> $CONFIG_FILE
echo "DISTANCE_SENSOR=NONE" >> $CONFIG_FILE
echo "OSD=DISABLE" >> $CONFIG_FILE
echo "DAEMON_MODE=ENABLE" >> $CONFIG_FILE
echo "SENSOR_CAL=ACTUAL" >> $CONFIG_FILE
echo "ARTIFACT_MODE=DISABLE" >> $CONFIG_FILE
echo "EXTRA_STEPS=()" >> $CONFIG_FILE
}
################################################################################
## actual start of execution, handle optional arguments first
################################################################################
## sanity checks
if [ "${USER}" != "root" ]; then
echo "Please run this script as root"
exit 1
fi
## convert argument to lower case for robustness
arg=$(echo "$1" | tr '[:upper:]' '[:lower:]')
## parse arguments
case ${arg} in
"")
echo "ERROR no argument given"
print_usage
exit 1
;;
"h"|"-h"|"help"|"--help")
print_usage
exit 0
;;
"disable")
disable_service_and_exit
;;
"enable")
enable_service_and_exit
;;
"factory_enable")
reset_config_file_to_default
enable_service_and_exit
;;
"crsf_gps_apm"|"d0005_v2"|"starling_v2"|"d0006_v2"|"sentinel_v2")
reset_config_file_to_default
set_param GPS AUTODETECT
set_param RC CRSF_RAW
enable_service_and_exit
;;
"spektrum_gps_apm"|"d0006_v1"|"sentinel_v1")
## First revision Sentinel with Holybro GPS and Spektrum Radio
reset_config_file_to_default
set_param GPS AUTODETECT
set_param RC SPEKTRUM
enable_service_and_exit
;;
"d0008"|"fpv_revb")
reset_config_file_to_default
set_param GPS NONE
set_param RC CRSF_RAW
set_param OSD ENABLE
enable_service_and_exit
;;
"crsf_nogps_apm"|"d0010")
## Starling 1 with no GPS
reset_config_file_to_default
set_param GPS NONE
set_param RC CRSF_RAW
enable_service_and_exit
;;
"crsf_gps_noapm"|"d0011"|"voxl2-mini")
reset_config_file_to_default
set_param GPS AUTODETECT
set_param RC CRSF_RAW
set_param POWER_MANAGER NONE
enable_service_and_exit
;;
"crsf_nogps_noapm"|"d0013")
reset_config_file_to_default
set_param GPS NONE
set_param RC CRSF_RAW
set_param POWER_MANAGER NONE
enable_service_and_exit
;;
"d0015")
reset_config_file_to_default
set_param GPS AUTODETECT
set_param ESC VOXL2_IO_PWM_ESC
set_param RC CRSF_RAW
set_param AIRFRAME FIXED_WING
set_param AIRSPEED_SENSOR MS4525DO
set_param DISTANCE_SENSOR LIGHTWARE_SF000
enable_service_and_exit
;;
*)
echo "invalid option: $arg"
exit 1
esac
## should never get here
exit 1
+18 -71
View File
@@ -31,81 +31,28 @@
#
############################################################################
# Both processors need to know about all parameters since modules are
# split across processors and may reference parameters from the other side.
# Need to make sure that the Linux processor on VOXL2
# knows about all parameters since it is acting as the
# parameter server for other processors that may define
# parameters that it doesn't normally know about.
set(DISABLE_PARAMS_MODULE_SCOPING TRUE PARENT_SCOPE)
set(SRCS
add_library(drivers_board
board_config.h
i2c.cpp
init.c
)
boardctl.c
spi.cpp
)
if("${PX4_PLATFORM}" STREQUAL "qurt")
list(APPEND SRCS
i2c_qurt.cpp
spi_qurt.cpp
)
elseif("${PX4_PLATFORM}" STREQUAL "posix")
list(APPEND SRCS
boardctl.c
i2c_posix.cpp
spi_posix.cpp
)
endif()
# Add custom drivers
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/apps_sbus)
add_library(drivers_board ${SRCS})
# Add custom libraries
add_subdirectory(${PX4_BOARD_DIR}/src/lib/mpa)
if("${PX4_PLATFORM}" STREQUAL "qurt")
# Generate MAVLink common headers for SLPI drivers (dsp_hitl, mavlink_rc_in)
# Replicates the generation from src/modules/mavlink/CMakeLists.txt so the
# SLPI build is self-contained and does not depend on voxl2-default.
set(MAVLINK_GIT_DIR "${PX4_SOURCE_DIR}/src/modules/mavlink/mavlink")
set(MAVLINK_LIBRARY_DIR "${CMAKE_BINARY_DIR}/mavlink")
px4_add_git_submodule(TARGET git_mavlink_v2_slpi PATH "${MAVLINK_GIT_DIR}")
add_custom_command(
OUTPUT ${MAVLINK_LIBRARY_DIR}/common/common.h
COMMAND ${PYTHON_EXECUTABLE} ${MAVLINK_GIT_DIR}/pymavlink/tools/mavgen.py
--lang C --wire-protocol 2.0
--output ${MAVLINK_LIBRARY_DIR}
${MAVLINK_GIT_DIR}/message_definitions/v1.0/common.xml
> ${CMAKE_BINARY_DIR}/mavgen_common.log
DEPENDS
git_mavlink_v2_slpi
${MAVLINK_GIT_DIR}/pymavlink/tools/mavgen.py
${MAVLINK_GIT_DIR}/message_definitions/v1.0/common.xml
COMMENT "Generating MAVLink common headers for SLPI"
)
add_custom_target(mavlink_common_generate DEPENDS ${MAVLINK_LIBRARY_DIR}/common/common.h)
add_library(mavlink_common_headers INTERFACE)
add_dependencies(mavlink_common_headers mavlink_common_generate)
target_compile_options(mavlink_common_headers INTERFACE -Wno-address-of-packed-member -Wno-cast-align)
target_include_directories(mavlink_common_headers INTERFACE
${MAVLINK_LIBRARY_DIR}
${MAVLINK_LIBRARY_DIR}/common
)
# Add custom drivers for SLPI
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/qurt/rc_controller rc_controller)
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/qurt/mavlink_rc_in mavlink_rc_in)
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/qurt/spektrum_rc spektrum_rc)
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/qurt/ghst_rc ghst_rc)
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/qurt/dsp_hitl dsp_hitl)
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/qurt/dsp_sbus dsp_sbus)
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/qurt/elrs_led elrs_led)
elseif("${PX4_PLATFORM}" STREQUAL "posix")
# Add custom drivers
add_subdirectory(${PX4_BOARD_DIR}/src/drivers/posix/apps_sbus apps_sbus)
# Add custom libraries
add_subdirectory(${PX4_BOARD_DIR}/src/lib/mpa mpa)
# Add custom modules
add_subdirectory(${PX4_BOARD_DIR}/src/modules/voxl_save_cal_params voxl_save_cal_params)
add_subdirectory(${PX4_BOARD_DIR}/src/modules/vehicle_air_data_bridge vehicle_air_data_bridge)
add_subdirectory(${PX4_BOARD_DIR}/src/modules/sensor_baro_bridge sensor_baro_bridge)
add_subdirectory(${PX4_BOARD_DIR}/src/modules/vehicle_local_position_bridge vehicle_local_position_bridge)
endif()
# Add custom modules
add_subdirectory(${PX4_BOARD_DIR}/src/modules/voxl_save_cal_params)
add_subdirectory(${PX4_BOARD_DIR}/src/modules/vehicle_air_data_bridge)
add_subdirectory(${PX4_BOARD_DIR}/src/modules/sensor_baro_bridge)
add_subdirectory(${PX4_BOARD_DIR}/src/modules/vehicle_local_position_bridge)
+10 -35
View File
@@ -42,44 +42,21 @@
#define CONFIG_BOARDCTL_RESET
#define BOARD_HAS_NO_BOOTLOADER
// Define this as empty since i2c clock init isn't required
#define BOARD_I2C_BUS_CLOCK_INIT
/*
* SPI buses (shared)
* I2C buses
*/
#define CONFIG_I2C 1
#define PX4_NUMBER_I2C_BUSES 1
/*
* SPI buses
*/
#define CONFIG_SPI 1
#define BOARD_SPI_BUS_MAX_BUS_ITEMS 1
#ifdef __PX4_QURT
/*
* QURT (DSP) specific defines
*/
#define CONFIG_I2C 1
#define PX4_NUMBER_I2C_BUSES 4
#include <system_config.h>
#include <px4_platform_common/board_common.h>
#define VOXL_ESC_DEFAULT_PORT "2"
#define GHST_RC_DEFAULT_PORT "7"
#define VOXL2_IO_DEFAULT_PORT "2"
/* M0065 PWM */
#define DIRECT_PWM_OUTPUT_CHANNELS 4
#define MAX_IO_TIMERS 3
#endif /* __PX4_QURT */
#if defined(__PX4_POSIX) && !defined(__PX4_QURT)
/*
* POSIX (apps processor) specific defines
*/
/* I2C clock init not required on Linux */
#define BOARD_I2C_BUS_CLOCK_INIT
#define CONFIG_I2C 1
#define PX4_NUMBER_I2C_BUSES 1
#include <system_config.h>
#include <px4_platform_common/board_common.h>
@@ -88,5 +65,3 @@
#define VOXL_ESC_DEFAULT_PORT "2"
#define VOXL2_IO_DEFAULT_PORT "2"
#endif /* __PX4_POSIX && !__PX4_QURT */
@@ -215,12 +215,6 @@ fi
if [ "$POWER_MANAGER" == "VOXLPM" ]; then
# APM power monitor
qshell voxlpm start -X -b 2
elif [ "$POWER_MANAGER" == "INA226" ]; then
/bin/echo "Starting INA226 power monitor"
qshell ina226 start -X -b 2
elif [ "$POWER_MANAGER" == "INA228" ]; then
/bin/echo "Starting INA228 power monitor"
qshell ina228 start -X -b 2
fi
if [ "$AIRSPEED_SENSOR" == "MS4525DO" ]; then
@@ -37,8 +37,6 @@ px4_add_module(
SRCS
pwm_voltage.cpp
MODULE_CONFIG
parameters.yaml
DEPENDS
px4_work_queue
)
@@ -0,0 +1,43 @@
/****************************************************************************
*
* Copyright (c) 2025 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.
*
****************************************************************************/
/**
* Control PWM output voltage
*
* @value 0 3.3V
* @value 1 5.0V
*
* @reboot_required true
* @group PWM Outputs
*/
PARAM_DEFINE_INT32(PWM_VOLT_SEL, 0);
@@ -1,13 +0,0 @@
module_name: pwm_voltage
parameters:
- group: PWM Outputs
definitions:
PWM_VOLT_SEL:
description:
short: Control PWM output voltage
type: enum
values:
0: 3.3V
1: 5.0V
default: 0
reboot_required: true
@@ -37,8 +37,6 @@ px4_add_module(
SRCS
pwm_voltage.cpp
MODULE_CONFIG
parameters.yaml
DEPENDS
px4_work_queue
)
@@ -0,0 +1,43 @@
/****************************************************************************
*
* Copyright (c) 2025 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.
*
****************************************************************************/
/**
* Control PWM output voltage
*
* @value 0 3.3V
* @value 1 5.0V
*
* @reboot_required true
* @group PWM Outputs
*/
PARAM_DEFINE_INT32(PWM_VOLT_SEL, 0);
@@ -1,13 +0,0 @@
module_name: pwm_voltage
parameters:
- group: PWM Outputs
definitions:
PWM_VOLT_SEL:
description:
short: Control PWM output voltage
type: enum
values:
0: 3.3V
1: 5.0V
default: 0
reboot_required: true
@@ -37,8 +37,6 @@ px4_add_module(
SRCS
pwm_voltage.cpp
MODULE_CONFIG
parameters.yaml
DEPENDS
px4_work_queue
)
@@ -0,0 +1,43 @@
/****************************************************************************
*
* Copyright (c) 2025 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.
*
****************************************************************************/
/**
* Control PWM output voltage
*
* @value 0 3.3V
* @value 1 5.0V
*
* @reboot_required true
* @group PWM Outputs
*/
PARAM_DEFINE_INT32(PWM_VOLT_SEL, 0);
@@ -1,13 +0,0 @@
module_name: pwm_voltage
parameters:
- group: PWM Outputs
definitions:
PWM_VOLT_SEL:
description:
short: Control PWM output voltage
type: enum
values:
0: 3.3V
1: 5.0V
default: 0
reboot_required: true
+1 -6
View File
@@ -86,7 +86,7 @@ if("${CMAKE_SYSTEM}" MATCHES "Linux")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "PX4 autopilot")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_SECTION "misc")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
# autogenerate dependency information
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
@@ -97,9 +97,4 @@ else()
set(CPACK_GENERATOR "ZIP")
endif()
# Board-specific overrides (loaded after defaults are set)
if(EXISTS "${PX4_BOARD_DIR}/cmake/package.cmake")
include(${PX4_BOARD_DIR}/cmake/package.cmake)
endif()
include(CPack)
@@ -304,6 +304,7 @@
1 1 COM_FLT_TIME_MAX -1 6
1 1 COM_FORCE_SAFETY 0 6
1 1 COM_HLDL_LOSS_T 120 6
1 1 COM_HLDL_REG_T 0 6
1 1 COM_HOME_EN 1 6
1 1 COM_HOME_IN_AIR 0 6
1 1 COM_IMB_PROP_ACT 0 6
Binary file not shown.

Before

Width:  |  Height:  |  Size: 508 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

-3
View File
@@ -164,7 +164,6 @@
- [ARK Electronics ARKV6X](flight_controller/ark_v6x.md)
- [ARK FPV Flight Controller](flight_controller/ark_fpv.md)
- [ARK Pi6X Flow Flight Controller](flight_controller/ark_pi6x.md)
- [CORVON 743v1](flight_controller/corvon_743v1.md)
- [CUAV Nora](flight_controller/cuav_nora.md)
- [CUAV V5+ (FMUv5)](flight_controller/cuav_v5_plus.md)
- [Wiring Quickstart](assembly/quick_start_cuav_v5_plus.md)
@@ -477,7 +476,6 @@
- [Flight Controller Porting Guide](hardware/porting_guide.md)
- [PX4 Board Configuration (kconfig)](hardware/porting_guide_config.md)
- [NuttX Board Porting Guide](hardware/porting_guide_nuttx.md)
- [Board Firmware Packaging (.deb)](hardware/board_packaging.md)
- [Serial Port Mapping](hardware/serial_port_mapping.md)
- [Airframes](dev_airframes/index.md)
- [Adding a New Airframe](dev_airframes/adding_a_new_frame.md)
@@ -758,7 +756,6 @@
- [MAVLink Messaging](mavlink/index.md)
- [Adding Messages](mavlink/adding_messages.md)
- [Streaming Messages](mavlink/streaming_messages.md)
- [MAVLink Profiles](mavlink/mavlink_profiles.md)
- [Receiving Messages](mavlink/receiving_messages.md)
- [Custom MAVLink Messages](mavlink/custom_messages.md)
- [Message Signing](mavlink/message_signing.md)
+1 -12
View File
@@ -57,17 +57,6 @@ param set PWM_MAIN_FUNC10 2064
param set PPS_CAP_ENABLE 1
```
#### Multi-GPS Setups
If you have multiple GPS receivers, set `PPS_CAP_GPS_ID` to the device ID of the GPS receiver that emits the PPS signal.
When set to `0` (default), the driver uses the first available GPS instance.
You can find the device ID by running:
```sh
listener sensor_gps
```
### Wiring
The wiring configuration depends on your specific flight controller.
@@ -140,5 +129,5 @@ See also:
The PPS signal provides much higher temporal precision than the transmitted time data, which has latency and jitter from serial communication.
::: warning
If the PPS driver does not send any data for 5 seconds (despite having `PPS_CAP_ENABLE` set to 1), the corresponding `SENS_GPS*_DELAY` parameter will be used instead for estimating the latency.
If the PPS driver does not sending any data for 5 seconds (despite having `PPS_CAP_ENABLE` set to 1), the `SENS_GPS0_DELAY` will be used instead for estimating the latency.
:::

Some files were not shown because too many files have changed in this diff Show More