Compare commits

...

198 Commits

Author SHA1 Message Date
JaeyoungLim 38c63c9c52 Limit TECS integrators 2026-02-12 14:53:31 -08:00
PX4BuildBot f518f87d0f docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-12 22:05:22 +00:00
Aaron1356 6a123298e5 [Documentation] Small Doc Update to params for GRF lidars (#26445)
* small Doc Update to params for GRF lidars
2026-02-13 08:57:48 +11:00
Ramon Roche a38b10c9d0 docs: modernize README (#26458)
* docs: modernize README with hero logo, vehicle icons, and fixed links

Add PX4 and Dronecode SVG logos to the repo, replace broken external
Dronecode logo URL, fix SITL badge branch from master to main, and
restructure the README with centered branding, airframe icon row,
quick-start section, and consolidated documentation links.
2026-02-13 08:55:29 +11:00
Ramon Roche d641cc3986 ci: init libfc-sensor-api submodule before building stub
The libfc-sensor-api submodule was not being initialized in CI,
causing the stub library build to fail silently. Use the existing
check_submodules.sh mechanism to ensure the submodule is fetched
before attempting to build, and add RESULT_VARIABLE checks so
cmake configuration and build failures are caught early.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 12:00:25 -08:00
Ramon Roche 731d754a15 ci: enable VOXL2 CI builds with private Docker container
Remove modalai_voxl2 and qurt from CI exclusion lists and add
container overrides to use the private ghcr.io/px4/px4-dev-voxl2
image which contains the Qualcomm Hexagon SDK.

- Add voxl2 build group with x64 runner for cross-compilation
- Add GHCR credentials to workflow for private container pull
- Add packages:read permission to workflow
- Auto-build libfc_sensor.so stub during cmake configure
- Handle missing .px4/.elf gracefully in artifact packaging

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-12 12:00:25 -08:00
alexcekay 7edf21414e manifest: reserve ID for Skynode-N 2026-02-12 18:28:41 +01:00
PX4BuildBot ec278758ed docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-12 05:57:26 +00:00
Hamish Willee 53a14d10cd docs: Rover flashing update (#26409) 2026-02-12 16:39:11 +11:00
PX4BuildBot d6c4dd22da docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-12 05:32:38 +00:00
fakerror 4117912506 docs: clarify rover MAVLink offboard support (#26411)
* docs: clarify rover MAVLink offboard support

* Apply suggestion from @hamishwillee

---------

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-02-12 16:25:12 +11:00
Julian Oes e239c017d1 Revert "CI: add ccache to macOS"
This reverts commit f751974b41.
2026-02-11 19:14:07 -08:00
PX4BuildBot 5f0e3f600f docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-12 02:06:31 +00:00
Ramon Roche 61da2505fe docs: address review feedback on release process
- Add step to replace "main (planned for:" badges with release version
  when preparing release notes (hamishwillee suggestion)
- Define explicit exit criteria for alpha phase: test cards pass,
  regressions fixed/triaged, documentation complete
- Differentiate beta testing from alpha: beta is community-driven
  validation on extended hardware, not a repeat of alpha test cards
- Define explicit exit criteria for beta->RC transition
- Fix index.md formatting

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 17:53:56 -08:00
Ramon Roche 27d831fbcd docs: add companion repo branching to release process
Include px4_msgs and px4-ros2-interface-lib in the release branch
creation steps.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 17:53:56 -08:00
Ramon Roche 71fbc63d67 docs: clarify release cycle, documentation workflow, and gate criteria
- Add approximate 6-month release cycle target
- Move release notes preparation before branching, based on main.md
- Add success criteria for alpha and beta phase transitions

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 17:53:56 -08:00
Ramon Roche a6d50d02bc docs: address review feedback on release process documentation
- Move maintainer link to end of index.md in an info block
- Fix link path to use relative ../releases/ prefix
- Clarify tag stages apply to release branches
- Improve Dronecode Test Team formatting with proper link

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 17:53:56 -08:00
Ramon Roche c56bc4208d docs: document release process
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 17:53:56 -08:00
Hamish Willee 741892c30f do make format 2026-02-12 14:53:26 +13:00
Julian Oes ad6ee2aadf Apply suggestions from code review
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-02-12 14:53:26 +13:00
Hamish Willee b3c05bf4da Update docs for changes to tune format 2026-02-12 14:53:26 +13:00
Hamish Willee 0134d7dd3b Add R (rest) as alias for Pause (p) 2026-02-12 14:53:26 +13:00
Hamish Willee 07d9167d66 Tunes library MML compatibility[A 2026-02-12 14:53:26 +13:00
PX4BuildBot e945c91f88 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-11 23:08:10 +00:00
Ramon Roche 8bb1e44c10 ci: fix deploy-aws skipped due to upstream always() propagation
When build-site uses always() in its if condition, the skipped status
from its upstream dependencies propagates to deploy-aws which lacks
always(). Add always() with explicit success checks to ensure deploy
runs when both metadata-regen and build-site succeed.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 15:00:16 -08:00
PX4BuildBot 36b5e1e1bb docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-02-11 22:43:01 +00:00
Ramon Roche 01b348c86b ci: install Node.js and Yarn inside container for metadata-regen
The metadata-regen job runs inside the px4io/px4-dev container which
has no Node.js. The actions/setup-node action only installs on the
host runner, not inside the container, causing yarn: not found errors.

Replace actions/setup-node with direct Node.js installation via
NodeSource and enable corepack for Yarn support.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 14:35:27 -08:00
Ramon Roche 907823f9c5 ci: skip build-site on PRs without docs/source changes
Add a docs filter to detect-changes and gate build-site so it is
skipped when a PR only touches the workflow YAML file.  Push and
dispatch triggers are unaffected.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 13:46:44 -08:00
Ramon Roche d886db8aab ci: trigger docs orchestrator on workflow file push to main
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 13:46:44 -08:00
Ramon Roche 1c929da8ba ci: fall back to main version for PR site builds
The version guard rejects non-main/release branches, but build-site
also runs on PRs where the branch name is arbitrary. Default to "main"
for PR builds since deploy-aws is skipped anyway.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 13:46:44 -08:00
Ramon Roche 6362a44cc4 docs: update CI docs to reflect orchestrator fixes
Update workflow_dispatch support, fork PR comment guard,
and branch validation in the docs-orchestrator documentation.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 13:46:44 -08:00
Ramon Roche 42b0061217 ci: comprehensive docs-orchestrator audit and fixes
- Add safe.directory + fetch-depth: 0 for container jobs
- Support workflow_dispatch in metadata-regen and deploy-aws
- Guard PR comments against fork PRs
- Add ccache save to pr-metadata-regen
- Use metadata_sync.sh --generate --sync instead of manual steps
- Fix msg_docs source path in metadata_sync.sh
- Guard set-version against non-release branches
- Clean up build-site needs list

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-11 13:46:44 -08:00
Julian Oes caf9feba73 CI: fix set-output deprecation warning 2026-02-12 09:17:33 +13:00
Julian Oes f751974b41 CI: add ccache to macOS 2026-02-12 09:17:33 +13:00
Yannick Poffet 3e1b7d4d0a clean-up(SIH): remove confusing runtime uorb sub change 2026-02-11 12:14:54 +01:00
Julian Oes 6ef0e57eeb boards: remove unused IMU sensors from 6X
It turns out ICM20602 and ICM20948 are not actually started/probed on
the px4/v6x platform. We should be able to remove them without
repercussions and save some flash.
2026-02-11 08:31:55 +01:00
Ramon Roche 4c866fc9b2 ci: fix docs orchestrator docker image
The docs-orchestrator workflow referenced px4io/px4-dev-nuttx-focal:2024-11-07
which does not exist on Docker Hub, causing the T2: Metadata Sync job
to fail on push to main.

Use px4io/px4-dev:v1.17.0-beta1 which has all required toolchains.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:54:41 -08:00
Ramon Roche 93fd9d4bae ci: fix empty file error in docs link check PR comment
The sticky-pull-request-comment action requires a non-empty file
when using the path input. When the filtered link checker finds no
broken links in changed files, it produces an empty file causing
the action to fail with "Either message or path input is required".

Ensure the results file always has content by writing a fallback
message when the file is missing or empty.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Hamish Willee 2ec9937369 Remove pregenerated files - that should all be tidied up next time this runs 2026-02-10 22:09:19 -08:00
Hamish Willee 3c80be8e48 Prettier 2026-02-10 22:09:19 -08:00
Ramon Roche 89b5a61f79 docs: update CI docs to match current orchestrator
- Update tier numbering to match T1-T4 job names
- Fix PR flow diagram to show T2 jobs running in parallel
- Add [skip ci] note to push flow
- Separate push vs PR path trigger tables
- Add workflow file to PR path triggers
- Remove Crowdin from orchestrator deploy tier (separate workflow)
- Update infrastructure table with correct job names

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 06bb7a6e1b ci: rename orchestrator jobs with tier prefixes
Prefix job names with T1-T4 to make the execution order and dependency
chain visible at a glance in the GitHub Actions UI.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche d63f47b5b3 ci: add orchestrator workflow file to PR path triggers
After a force push, GitHub evaluates path filters against only the
pushed commits, not the full PR diff. Changes to the orchestrator
workflow file itself were not matching the docs/** path filter,
preventing the orchestrator from running on the PR.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 61a67b3a09 ci: harden docs orchestrator before merge
- Add [skip ci] to auto-commit message to prevent infinite workflow loop
- Add source paths (src/, msg/, ROMFS/, Tools/module_config/) to push
  triggers so metadata regenerates on source-only changes
- Move permissions from workflow-level to job-level (least privilege)

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 0966e92e36 docs: fix flaw checker paths
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 273d3cedac ci: fix jq parse error in changed files list step
Pass the changed files JSON through an environment variable instead
of direct interpolation to avoid shell quoting issues.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 2290096e25 docs: consolidate docs ci
adds docs

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 0efded2fa7 ci: fix check_flaws shallow clone missing merge base
Add fetch-depth: 0 to the checkout step in docs_flaw_checker.yml.
Without a full clone, tj-actions/changed-files cannot find the merge
base between main and the PR branch, causing the job to fail with
"no merge base".

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 1c13f28121 docs: fix yarn.lock and gitignore for CI
Regenerate yarn.lock to include prettier dependency that was added to
package.json but missing from the lockfile, causing CI to fail with
--frozen-lockfile. Also add package-lock.json to .gitignore since the
project uses yarn.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Hamish Willee 94514bd811 REmove package-lock.json - no longer required 2026-02-10 22:09:19 -08:00
Ramon Roche 85aa863c56 ci: add docs workflow with PR metadata generation
Add conditional metadata generation for PRs that modify both docs and
source files. This fixes broken link checker reports when a PR adds a
new module and documents it simultaneously - previously the link checker
would fail because metadata files are only generated on push to main.

Changes:
- Add docs-orchestrator.yml workflow with:
  - detect-changes job to check if PR touches source paths
  - pr-metadata-regen job that generates metadata and uploads as artifact
  - link-check job that downloads metadata artifact when available
  - build-site job for VitePress site generation
  - deploy-aws and crowdin-upload jobs for push events
  - Prettier formatting step before auto-commit on push

- Add Prettier for markdown formatting:
  - Add prettier ^3.2.0 as devDependency in docs/package.json
  - Add docs/.prettierrc with prose-preserving config

- Remove normalize_whitespace from metadata_sync.sh (Prettier handles
  whitespace normalization now)

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 380ae3047d tools: merge all scripts into a single one
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche ba72434fe4 tools: metadata modules check with diff
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 60df456168 ci: debug with tmate
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche f11ea548da tools: remove trailing whitespace
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 3fdd3e3e43 docs: update module reference metadata 2026-02-10 22:09:19 -08:00
Ramon Roche f50d8b258c docs: update parameter reference metadata 2026-02-10 22:09:19 -08:00
Ramon Roche dfcde09899 tools: strip trailing whitespace from markdown
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche b3c27bc91b docs: update uORB message reference docs 2026-02-10 22:09:19 -08:00
Ramon Roche c66584879c docs: metadata: update uORB graph JSONs 2026-02-10 22:09:19 -08:00
Ramon Roche 7aca05a531 ci: disable the metadata failsafe web check
test is broken

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche c032138a34 docs: metadata: update uORB graph JSONs 2026-02-10 22:09:19 -08:00
Ramon Roche bc75b5cc0d docs: update parameter reference metadata 2026-02-10 22:09:19 -08:00
Ramon Roche b70da3968c docs: update module reference metadata 2026-02-10 22:09:19 -08:00
Ramon Roche 853fa088de ci: bump px4-dev container
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche e80abe4e29 tools: metadata script leftover 2026-02-10 22:09:19 -08:00
Ramon Roche 593192df54 toos: remove unnecessary file
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 166e7a2fd7 ci: consolidate into a matrix loop
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 57843adb48 ci: checks for updates to the px4 modules metadata
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 7be82b08c4 tools: generates and checks px4 module metadata
metadata_modules.sh — generate and sync PX4 module reference documentation

Usage:
  Tools/ci/metadata_modules.sh [--test-only] [--debug]

Options:
  --test-only   Run make target and comparison; exit 1 if diffs found, without copying files
  --debug       Show full make output and debug info for file comparisons

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche d530bd5a7f ci: checks for airframe metadata changes
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche b6ace98962 tools: create and test for airframe metadata
metadata_airframe.sh — generate and sync PX4 airframe reference documentation

Usage:
  Tools/ci/metadata_airframe.sh [--test-only] [--debug]

Options:
  --test-only   Run make target and comparison; exit 1 if diffs found, without copying file
  --debug       Show full make output and debug info for comparison

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 75e2a38a05 ci: adds a check for parameter metadata
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche f73ac7a257 toos: create and check for param metadata in docs
metadata_parameters.sh — generate and sync PX4 parameter reference documentation

Usage:
  Tools/ci/metadata_parameters.sh [--test-only] [--debug]

Options:
  --test-only   Run make target and comparison; exit 1 if diffs found, without copying file
  --debug       Show full make output and debug info for comparison

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 1a46de3a25 ci: docs metadata check for uorb message updates
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 239a7bc4f1 tools: build target for uorb message ref docs
metadata_msg_docs.sh — generate and sync uORB message reference documentation

Usage:
  Tools/ci/metadata_msg_docs.sh [--test-only] [--debug]

Options:
  --test-only   Run make target and comparison; exit 1 if diffs found, without copying files
  --debug       Show full make output and debug info for file comparisons

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche c5c66ee261 ci: checks for failsafe web metadata updates
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 87f1eb69b1 tools: generate & check failsafe web metadata
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 86c38ae384 ci: fix git ownership issues
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche b43a842bc8 ci: enable uorb graphs debug
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche d227cfc174 tools: update uorb graphs script
more debug tools

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche 24ac02fbac ci: metadata checks for docs
check if metadata needs to be rebuilt!

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
Ramon Roche bc6cc5f82a tools: generate uorb graph metadata
context: our docs need this metadata, this script generates the metadata then
moves the files to the required destination.

docs:
update_uorb_graphs.sh — generate, compare, and sync uORB graph JSONs

Usage:
      ./scripts/update_uorb_graphs.sh [--test-only] [--debug]

Options:
      --test-only	Run generation and comparison only; exit 1 if diffs found, without copying files
      --debug		Echo debug info for missing or differing files

Examples:
      # CI mode: fail if docs need updates
      ./scripts/update_uorb_graphs.sh --test-only

      # Developer mode: regenerate and sync JSONs
      ./scripts/update_uorb_graphs.sh

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-02-10 22:09:19 -08:00
PX4 Build Bot 90169b932b New Crowdin translations - ko (#26396)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-02-11 15:22:48 +11:00
Evanns Morales 7f010c1430 docs: fix incorrect C++ file casing in diagram to match source (#26417) 2026-02-11 15:16:35 +11:00
PX4 Build Bot d018551047 New Crowdin translations - zh-CN (#26433)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-02-11 15:11:43 +11:00
Hamish Willee 509b4ba96d MC_RAPTOR_INTREF module.yaml rendering fix 2026-02-11 13:16:02 +13:00
Eric Katzfey 64e3cb16fa Removed VOXL2_IO: tag from all voxl2_io debug messages as they are redundant 2026-02-10 15:45:40 -07:00
Eric Katzfey 77d8e4f213 VOXLPM: Updated driver to publish battery status at 20ms intervals. Changed printf to PX4_INFO. 2026-02-10 11:46:44 -07:00
Balduin ecf8191aad Battery: Declare fault on overtemperature
If the measured temperature exceeds the fixed threshold of 100 degC, a
fault is declared, causing batteryCheck to show a failsafe warning to
the user.
2026-02-10 13:44:46 +01:00
Jacob Dahl 3fb1459c33 ManualControl: fix payload power switch state when mapped with RC (RC_MAP_PAY_SW) (#26357)
* ManualControl: Payload Power Switch: default PAYLOAD_POWER_EN false if RC_MAP_PAY_SW is configured. Apply initial switch state for Payload Power

* make format

* ManualControl: init power_en in init()

* ManualControl: Apply payload power state on first switch receipt if not armed

* simplfy

* fix idefs

* simplify
2026-02-09 21:36:35 -09:00
Jacob Dahl ee196fadb8 gps: ubx: add output rate parameter (#26388)
* gps: ubx: add parameter to configure module measurement rate (GPS_UBX_RATE)

* gps: update submodule

* submodule
2026-02-09 22:49:40 -07:00
Julian Oes fd9abf76fd Fixup docs 2026-02-10 15:47:31 +13:00
Julian Oes a98d68f919 AirBrainH743: use /fs/flash instead of /fs/microsd 2026-02-10 15:47:31 +13:00
Julian Oes 7d2d85e6ac AirBrainH743: reformat littlefs if required 2026-02-10 15:47:31 +13:00
Julian Oes 34845a62b0 AirBrainH743: add external I2C
This is for future/later board revisions.
2026-02-10 15:47:31 +13:00
Julian Oes 7715a4ab4c AirBrainH743: configure for active buzzer
We can't use passive buzzers because the timer to drive the PWM would
conflict with the motor outputs M7 and M8.
2026-02-10 15:47:31 +13:00
Julian Oes ea2ca45cf9 boards: add support for Gear Up AirBrainH743 2026-02-10 15:47:31 +13:00
Jacob Dahl 14864814ef gps: ubx: added jamming sensitivity parameter (#26386)
* gps: ubx: added jamming sensitivity parameter GPS_UBX_JAM_DET

* submodule

* gps: submodule to main
2026-02-09 17:43:39 -09:00
Julian Oes 3a6a57bd45 kakuteh7v2: use /fs/flash instead of /fs/microsd 2026-02-10 15:23:51 +13:00
Julian Oes e0af9f4ef4 boards: add NAND flash logging support to KakuteH7v2
- Initialize W25N01GV NAND flash on SPI1 with littlefs.
- Enable BOARD_SMALL_FLASH_LOGGING for small flash handling.
- Increase logger buffer size for flash write performance.
2026-02-10 15:23:51 +13:00
Julian Oes 0294d4a794 dataman: increase stack size for littlefs
Increase stack size when using littlefs filesystem, which requires
more stack space than traditional filesystems.
2026-02-10 15:23:51 +13:00
Julian Oes d411e1c40d logger: increase stack size for littlefs 2026-02-10 15:23:51 +13:00
Julian Oes 833e4536b7 nuttx: add support for NAND flash
This cherry-picks upstream commits adding NAND flash support for the
Winbond W25N specifically W25N01GV chip.

NAND flash is used together with littlefs, hence I updated that to 2.5.1
to match upstream NuttX.
2026-02-10 15:23:51 +13:00
Eric Katzfey 1b7e12cf90 VOXL_ESC: bringing the driver up to date with ModalAI latest. Includes new open loop "PWM" command handling. 2026-02-09 16:38:53 -07:00
Eric Katzfey aacb7e35dd For VOXL flight controllers, Use DSP clock directly on Posix for CLOCK_MONOTONIC 2026-02-09 15:22:36 -07:00
Eric Katzfey 1dbee4100a uORB: Added a new uorb_shutdown function that is called during normal shutdown procedures. It will only
call into a new UORB COMMUNICATOR ICHANNEL shutdown interface if it has been configured, otherwise it
does nothing. This allows ICHANNEL implementations to pass on a shutdown indication to a remote processor.
Implemented the shutdown interface in the muorb module for VOXL flight controllers.
2026-02-09 15:21:41 -07:00
Nick dbb00d500f Update src/modules/commander/failure_detector/FailureDetector.cpp
Prevent Buffer overflow
2026-02-09 18:08:26 +01:00
Matthias Grob 61a8ae80a6 FailureDetector: implement upper and lower current limit with offset 2026-02-09 18:08:26 +01:00
Matthias Grob f8329ff80d FailureDetector: rework motor status check 2026-02-09 18:08:26 +01:00
Matthias Grob b4b1b44c6a FailureDetector: consistent timestamp naming 2026-02-09 18:08:26 +01:00
Matthias Grob f5a56ae42f escCheck: rework online check to properly report offline ESCs
previous to this
09d79b221f
set `esc_online_flags` e.g. for UAVCAN ESCs which specific one is online and that then got compared to a mask where the first `esc_count` bits were set.

So if only ESC 5 is mapped and online you get the message "ESC 156 offline" because `esc_online_flags = 0b1000` gets compared to `online_bitmask = 0b1` based on `esc_count = 1` and the motor index is `esc[0].actuator_function = 0` wrapped using `0 - actuator_motors_s::ACTUATOR_FUNCTION_MOTOR1 + 1 = 156`.
2026-02-09 18:08:26 +01:00
Marco Hauswirth c4535683a7 ekf2 unit-tests: adapt to strict GNSS checks on ground 2026-02-09 10:59:58 +01:00
Matthias Grob f9cdd095b8 gnss_checks: always run strict checks on ground
With the goal to never take off if the GNSS solution is not fullfilling the configured requirements still not stopping to use it in case it degrades mid air.
2026-02-09 10:59:58 +01:00
Matthias Grob 61c990c5ee estimator_interface: remove unused getter 2026-02-09 10:59:58 +01:00
Beat Küng 8115cf2597 docs: update link for px4 ros2 interface lib python api docs 2026-02-09 10:03:55 +01:00
Eric Katzfey eb43d21730 voxl2_io: Added UART passthru 2026-02-08 20:51:31 -07:00
Eric Katzfey 5e54d727fc voxl_esc: Limit frequency of UART passthru writes to 20Hz 2026-02-08 20:51:31 -07:00
Andrew Brahim ecb222c7e7 uavcannode: implement hardpoint commands (#26334)
* implement cannode hardpoint commands

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

* Update src/drivers/uavcannode/Subscribers/HardpointCommand.hpp

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* Update src/drivers/uavcannode/Subscribers/HardpointCommand.hpp

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* add hardpoint sub to ark cannode, simplify handling of hardpoint broadcast

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>

---------

Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2026-02-08 18:36:11 -09:00
Aaron1356 a5a7dd802c [Feature] Adding I2C driver for the GRF250 and GRF500 models (#26425)
* Adding the GRF I2C driver

* I2C Driver Working

* Removing a lot of unnecessary code

* fixing names

* Changing the i2c Driver to be in the lightware laser

* remove the old driver

* formatting fix

* Adding Ligthware GRF to documentation
2026-02-06 15:26:13 -05:00
Silvan 7b72335876 UI: remove isAdvanced=false for Altitude Cruise
Signed-off-by: Silvan <silvan@auterion.com>
2026-02-06 18:13:36 +01:00
Beat Küng 446895fdc0 Revert "failsafe: prevent Hold when no action is taken (#26383)"
This reverts commit 40dc011d82.

Not needed anymore
2026-02-06 13:00:08 +01:00
Beat Küng 3eb0255922 fix commander: do not trigger Hold (delay) when failsafe action is Warn
The new unit test failed before and passes with the fix.
2026-02-06 13:00:08 +01:00
Hamish Willee 271d3f01a3 Update mavlink/mavlink to latest[A (#26410) 2026-02-06 08:17:44 +13:00
Hamish Willee e8fca6e991 uORB docs parser (#24977) 2026-02-05 17:58:45 +11:00
Beniamino Pozzan de1314f995 docs: fix badge for UXRCE_DDS_FLCTRL (#26375)
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-02-04 09:40:32 +11:00
Julian Oes 1bfc0da258 [Sponsored by CubePilot] Get CI to pass all boards (#26402)
* kakutef7: try to save more flash
2026-02-03 16:46:36 -05:00
ch3at 41966774c2 docs: fix incorrect links in config/safety.md (#26355)
Fixed incorrect links to Acro mode
2026-02-03 20:38:43 +00:00
Jacob Dahl 82e3322e0c vtxtable: fix KConfig type from string to bool (#26359) 2026-02-03 13:14:47 +13:00
PX4 Build Bot e2e89def7e New Crowdin translations - zh-CN (#26398)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-02-02 08:19:45 +11:00
PX4 Build Bot d5c4ace615 New Crowdin translations - uk (#26397)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-02-02 08:19:19 +11:00
Levi Todes 390c9d6ccf SHT3X driver: change state timer variable from uint32 to uint64. (#24264)
Prevents current behaviour of repeated entry into 'init' state
and associated log spamming after +-72 minutes.

Signed-off-by: LeTo37 <levitodes2019@u.northwestern.edu>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
2026-01-31 17:57:39 -09:00
Jacob Dahl 63c4f4ac3e uavcannode: publisher: Fix2: fix eph/epv off by sqrt bug (#26389) 2026-01-30 10:31:38 -07:00
Nick 40dc011d82 failsafe: prevent Hold when no action is taken (#26383) 2026-01-30 14:09:56 +01:00
Pernilla 8d97013822 Mavlink: increase stream rate of GIMBAL_DEVICE_ATTITUDE_STATUS 2026-01-30 13:06:58 +01:00
mahima-yoga 4e59a060a8 HomePosition: only set home position using GNSS if bit 0 in EKF2_GPS_CTRL is active
If the vehicle position is not set by GNSS, then the home position should not be either.
2026-01-30 11:20:34 +01:00
tompsontan f8c1e8b81f Improve QMC5883P magnetometer stability by optimizing OSR and ODR settings. (#26350) 2026-01-29 19:38:20 -09:00
Nick 6be1a14e06 docs: COM_FLTT_LOW_ACT default fixed (#26374) 2026-01-29 15:21:45 -09:00
Julian Oes 3075724f9e jmavsim: update submodule (#26369)
This contains:
https://github.com/PX4/jMAVSim/pull/140

which updates dependencies and adds macOS arm64 support.
2026-01-30 10:19:38 +13:00
Eric Katzfey e37a216393 QURT/SERIAL: Undo the breaking changes from commit 17f3db9231. (#26382)
A check was added for a non-existant parameter. This commit removes those.
2026-01-29 12:03:18 -09:00
Eric Katzfey 90fec17427 CRSF_RC: Replace strlcpy with strncpy and null termination. strlcpy is a BSD extension and is not part of standard C/C++. (#26381)
It's typically not available in glibc's <string.h>.
2026-01-29 12:02:36 -09:00
ttechnick 03264ce1a7 failsafe: prevent switch offboard -->pos without RC 2026-01-29 18:21:00 +01:00
Daniel Honies ac4f419b50 Update 4004_gz_standard_vtol
VT_F_TRANS_THR at 0.3 always triggers front transition timeout as the vehicle does not accaelerate quickly enough. With the param set to 1.0 it works.
2026-01-29 18:07:32 +01:00
Phil-Engljaehringer 193a4478ed fix: adjusted probe function to new revision of TLA2528 (and add status function) 2026-01-29 18:04:25 +01:00
Phil-Engljaehringer 744548e9f2 fix: use correct address passed with -a flag 2026-01-29 18:03:04 +01:00
Beat Küng b9bd820186 docs: mention python bindings in ros lib 2026-01-29 08:20:03 +01:00
Beat Küng e0f1022681 ci: ignore python packages in px4-ros2-interface-lib
Due to build issues with very old ROS version
2026-01-29 08:20:03 +01:00
Hamish Willee 4c184f309c docs: Max code line length 140 chars (#26368) 2026-01-29 13:43:22 +11:00
Sindre Meyer Hegre adf1bab518 docs: add link to masther thesis for mc_nn_control (#26279) 2026-01-29 13:10:21 +11:00
Claudio Chies f5c5f2ed8c Update FLARM link to the correct product page (#26361)
* Update FLARM link to the correct product page

* Update docs/en/peripherals/adsb_flarm.md

---------

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-01-29 12:48:30 +11:00
Julian Oes 09d3f05bcd gazebo-classic: update for CI test fixes (#26335)
The fix:
https://github.com/PX4/PX4-SITL_gazebo-classic/pull/1084
seems to help with test failures locally.
2026-01-29 06:05:55 +13:00
Loic Fernau b7d9876cd9 Added missing Defaults to VEHICLE_CMD_DO_SET_MODE (#26291)
* Added missing Defaults to VEHICLE_CMD_DO_SET_MODE

* Made Format
2026-01-29 05:36:21 +13:00
Julian Oes bd6b0699cc Fetch metadata files from master not main
For flash constrained builds, the component metadata files are
downloaded directly from s3. For the main branch, these files are
currently still uploaded to master. Therefore, we also need to reference
master and not main.

This fixes the actuators tab in QQC for KakuteH743-Wing which is one of
the boards that did not exist in source when we briefly uploaded to main
before reverting back to master, presumably for QGC compatibility.
2026-01-28 09:43:28 +01:00
Jonas Eschmann 684ba28fbf Update iframe source to fix mixed content warning (#26309) 2026-01-28 17:54:35 +11:00
Hamish Willee 1797ce4e88 Fix round trip hello_sky translation (#26360) 2026-01-28 16:59:40 +11:00
PX4 Build Bot 05517935dc New Crowdin translations - ko (#26246)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-01-28 16:43:34 +11:00
PX4 Build Bot 4af33cef43 New Crowdin translations - uk (#26247)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-01-28 16:43:23 +11:00
PX4 Build Bot c90095e8b4 New Crowdin translations - zh-CN (#26248)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2026-01-28 16:43:18 +11:00
Jacob Dahl 65cedc8bf8 px_uploader: add ARK PID/VIDs (#26358) 2026-01-27 15:38:30 -09:00
Matthias Grob 9be7585add SagetechMXS: remove two unused subscriptions (#26356)
Randomly saw that there's a publication and subscription for the same topic and
it is in this case indeed useless.
2026-01-27 11:48:23 -09:00
tompsontan 2282330102 board:fixed ap-h743r1 bmi270 rotation; update internal mag rotation. (#26341) 2026-01-27 10:30:06 -09:00
Balduin 0676647d8a ControlAllocator: Periodically spin MC motors to shed ice (#26322)
This feature periodically spins the unused motors on VTOL airframes, to
break off ice that has built up in the motor while it is still feasible
to do so. Each ice shedding event sends a motor ouput of 0.01 to the
unused motors for 2 seconds.

Configured by `CA_ICE_PERIOD`, the duration of the entire cycle. Set to
0 to disable.
2026-01-27 11:15:24 +01:00
Balduin 50bb31491b AirspeedModule: Change to throttle without battery scaling (#26347)
rather than the vehicle_thrust_setpoint used previously, which includes
battery scaling which we don't want, neither for synthetic airspeed nor
for the airspeed validator.
2026-01-27 11:03:44 +01:00
Matthias Grob cac3c3c133 boot script: start uavcan and zenoh before logger
because they publish optional topics which need to be advertised before logger starts otherwise they do not get logged!
2026-01-27 10:06:22 +01:00
Nick c2490e01a5 tiny uavcan optimizations (#26344)
Reduce number of hrt_absolute_time() calls and node_id.get()
2026-01-27 09:06:18 +01:00
Marin D 01d8113f8b modify: remove xtensa-tarfile after installation (#26326)
Signed-off-by: Marin Doetterer <marin@auterion.com>
2026-01-26 11:33:27 -09:00
Niklas Hauser 091ac918b1 [vtx] Remove unused uORB messages (#26345) 2026-01-26 11:31:55 -09:00
Niklas Hauser c0c265cd1f [vtx] Add VTX driver with Tramp and SmartAudio support 2026-01-26 11:05:22 +01:00
Julian Oes fad4450d7d Jenkins: pin emscripten version (#26339)
This would match GitHub action and hopefully fix CI.
2026-01-25 12:56:17 -08:00
David Meng 1cfab8feb2 mavlink: odometry: Initialize the covariance matrix to 0 to prevent the entire matrix from becoming invalid after mavros performs coordinate transformation. (#26321) 2026-01-24 12:52:13 -09:00
Tarmo Tänav e2864e521f Fill TC_M0_ID in offboard thermal calibration script (#26290) 2026-01-23 15:47:27 -09:00
Julian Oes 9460625c99 Tools: rewrite uploader script (#26310)
* Tools: rewrite uploader script

This adds a script called px4_uploader.py which is a complete rewrite
using Claude Code of px_uploader.py.

The main improvements over the previous px_uploader.py script are:
- Separate smaller classes instead of one big uploader class.
- Easier debugging with --verbose or --debug flags.
- Nicer progress animation.
- No more hard to debug Exception swallowing over multiple levels.
- Auto-detection and looping of devices, removing the functionality from
  cmake.
- Auto-detection of PX4 devices by USB VID/PID.
- Add noninteractive mode
- Add JSON output mode
2026-01-24 11:09:17 +13:00
Silvan Fuhrer 32fc5cb5b9 RTL: only run initRtlMissionType() when new type is of any mission type
Otherwise it kills the mission when the type jumps from mission to Home.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2026-01-23 17:16:42 +01:00
Matthias Grob 7a6506f2dd rtl: redability suggestions from review, remove unused subscription 2026-01-23 17:16:42 +01:00
Silvan a416437561 rtl: guard access of dynamically created _rtl_mission_type_handle behind if()
To avoid hard faults from NULL access.

Signed-off-by: Silvan <silvan@auterion.com>
2026-01-23 17:16:42 +01:00
Silvan 554b52c6a1 RTL: fix RTL_TYPE=2 with RTL_LAND_DELAY set to indefinitely wait
Signed-off-by: Silvan <silvan@auterion.com>
2026-01-23 17:16:42 +01:00
Silvan fc992385a9 RTL: fix RTL_TYPE=2 stuck without valid mission
Signed-off-by: Silvan <silvan@auterion.com>
2026-01-23 17:16:42 +01:00
Silvan 0577a40440 RTL Direct: remove unnecessary sanitization
Signed-off-by: Silvan <silvan@auterion.com>
2026-01-23 17:16:42 +01:00
Matthias Grob 2239c10192 rtl: restructure findRtlDestination() to one flow 2026-01-23 17:16:42 +01:00
Matthias Grob 8117fce790 rtl: never set arbitrary yaw, initialize _destination and _last_position_before_link_loss with NAN 2026-01-23 17:16:42 +01:00
Matthias Grob 18c3d889fe rtl: keep rtl_status struct on stack 2026-01-23 17:16:42 +01:00
Matthias Grob 31c7d70342 rtl refactor: name destination "destination" 2026-01-23 17:16:42 +01:00
Matthias Grob 6386f10ba2 rtl: unify finding closest safe point and move finding the destination into the dedicated function returning the destination 2026-01-23 17:16:42 +01:00
Matthias Grob deb9a1ad4e rtl: remove duplication for safe landing only in setRtlTypeAndDestination() 2026-01-23 17:16:42 +01:00
Matthias Grob f685df32bc rtl refactor: make dependency of rtl_type in status clear 2026-01-23 17:16:42 +01:00
Matthias Grob 432b0e8c58 rtl: adhere to parameter member naming convention 2026-01-23 17:16:42 +01:00
Silvan 024b3d27ac RTL: add new RTL_TYPE to only allow returns to safe points or last link position
Do not allow RTL to Home or mission landings.

Signed-off-by: Silvan <silvan@auterion.com>
2026-01-23 17:16:42 +01:00
bresch 5d5e1db97f ekf2: update change indicator 2026-01-23 14:46:08 +01:00
bresch d3da4fe608 ekf2 mag: clear mag_fault when healthy again 2026-01-23 14:46:08 +01:00
Jacob Dahl 76b58b6f0b remove unused CTestConfig.cmake (#26333) 2026-01-22 15:07:38 -09:00
Atsunori Saito 75d7395daa v6xrt: correct LED state read logic (#26316)
Move negation to return value instead of GPIO map argument for proper active-low handling.
2026-01-22 14:11:37 -09:00
David Meng 11f4d5c4e7 control_allocator: improve status output formatting (#26277) 2026-01-22 14:09:56 -09:00
Pernilla 522c15284f Gimbal: (#26331)
* passing const reference instead to avoid the copy
* remove unused using declaration
2026-01-22 14:02:03 -09:00
Dmitry Ponomarev 93ab802202 add ability to control uavcan hardpoint by MAV_CMD_DO_GRIPPER (#19124)
* update uavcan hardpoint: add ability to use it via mavlink cmd and during mission and removed send_command() dedicated for usage via mavlink console

* uavcan hardpoint: allow gripper ID 0

---------

Co-authored-by: Andrew Brahim <35986980+dirksavage88@users.noreply.github.com>
2026-01-22 16:43:18 -05:00
Jacob Dahl 3381b270ea uavcannode: add CANNODE_PUB_BAR and CANNODE_PUB_MAG parameters to optionally disable baro and mag data publication (#26324) 2026-01-22 09:59:59 -08:00
Julian Oes aed8a78c1d mavlink: accept broadcast commands (#26311)
I think - per MAVLink spec - PX4 ought to accept broadcast commands
which are aimed at system ID 0, so anyone/all.
2026-01-23 06:55:34 +13:00
Niklas Hauser 9cf07c2452 [logger] Ensure msg buffer is large enough for all uORB message headers 2026-01-22 17:58:04 +01:00
bresch 230276540f estimator_status_flags: remove useless logged flags
Those flags are not so useful for log analysis and can be found in the
aid_src topics
2026-01-22 17:58:04 +01:00
722 changed files with 30183 additions and 8700 deletions
+4
View File
@@ -29,6 +29,7 @@ concurrency:
permissions:
contents: write
actions: read
packages: read
jobs:
group_targets:
@@ -94,6 +95,9 @@ jobs:
fail-fast: false
container:
image: ${{ matrix.container }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: runs-on/action@v2
- uses: actions/checkout@v4
+1 -1
View File
@@ -42,7 +42,7 @@ jobs:
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}\n")
- name: ccache cache files
uses: actions/cache@v4
with:
+416
View File
@@ -0,0 +1,416 @@
# Docs - Orchestrator
#
# Trigger paths:
# push (main, release/**) → metadata-regen → build-site → deploy-aws
# pull_request → detect-changes → pr-metadata-regen → link-check → build-site (if docs/source changed)
# workflow_dispatch → metadata-regen → build-site → deploy-aws
#
# Container jobs (pr-metadata-regen, metadata-regen) run in px4-dev image and
# require safe.directory + fetch-depth: 0 for git operations.
name: Docs - Orchestrator
on:
push:
branches:
- "main"
- "release/**"
paths:
- "docs/**"
- "src/**"
- "msg/**"
- "ROMFS/**"
- "Tools/module_config/**"
- ".github/workflows/docs-orchestrator.yml"
pull_request:
paths:
- "docs/**"
- ".github/workflows/docs-orchestrator.yml"
workflow_dispatch:
concurrency:
group: docs-orchestrator-${{ github.ref }}
cancel-in-progress: true
jobs:
# =============================================================================
# Detect Changes (PR only)
# =============================================================================
detect-changes:
name: "T1: Detect Changes"
if: github.event_name == 'pull_request'
permissions:
contents: read
runs-on: ubuntu-latest
outputs:
source_changed: ${{ steps.changes.outputs.source }}
docs_changed: ${{ steps.changes.outputs.docs }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
source:
- 'src/**'
- 'msg/**'
- 'ROMFS/**'
- 'Tools/module_config/**'
docs:
- 'docs/**'
# =============================================================================
# PR Metadata Regen (conditional - only when PR touches source files)
# =============================================================================
pr-metadata-regen:
name: "T2: PR Metadata"
needs: [detect-changes]
if: github.event_name == 'pull_request' && needs.detect-changes.outputs.source_changed == 'true'
permissions:
contents: read
runs-on: [runs-on,runner=4cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
container:
image: px4io/px4-dev:v1.17.0-beta1
steps:
- uses: runs-on/action@v1
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Git ownership workaround
run: git config --system --add safe.directory '*'
- name: Cache Restore - ccache
id: cache-ccache
uses: actions/cache/restore@v4
with:
path: ~/.ccache
key: ccache-docs-metadata-${{ github.sha }}
restore-keys: |
ccache-docs-metadata-
- name: Setup ccache
run: |
mkdir -p ~/.ccache
echo "max_size = 1G" > ~/.ccache/ccache.conf
- name: Build px4_sitl_default
run: |
make px4_sitl_default
env:
CCACHE_DIR: ~/.ccache
- name: Cache Save - ccache
uses: actions/cache/save@v4
if: always()
with:
path: ~/.ccache
key: ccache-docs-metadata-${{ github.sha }}
- name: Generate and sync metadata
run: Tools/ci/metadata_sync.sh --generate --sync parameters airframes modules msg_docs failsafe_web
env:
CCACHE_DIR: ~/.ccache
- name: Upload metadata artifact
uses: actions/upload-artifact@v4
with:
name: pr-metadata
path: docs/
retention-days: 1
# =============================================================================
# Push Metadata Regen (main/release branches)
# =============================================================================
metadata-regen:
name: "T2: Metadata Sync"
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
permissions:
contents: write
runs-on: [runs-on,runner=4cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
container:
image: px4io/px4-dev:v1.17.0-beta1
steps:
- uses: runs-on/action@v1
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.PX4BUILTBOT_PERSONAL_ACCESS_TOKEN }}
- name: Git ownership workaround
run: git config --system --add safe.directory '*'
- name: Cache Restore - ccache
id: cache-ccache
uses: actions/cache/restore@v4
with:
path: ~/.ccache
key: ccache-docs-metadata-${{ github.sha }}
restore-keys: |
ccache-docs-metadata-
- name: Setup ccache
run: |
mkdir -p ~/.ccache
echo "max_size = 1G" > ~/.ccache/ccache.conf
- name: Build px4_sitl_default
run: |
make px4_sitl_default
env:
CCACHE_DIR: ~/.ccache
- name: Cache Save - ccache
uses: actions/cache/save@v4
if: always()
with:
path: ~/.ccache
key: ccache-docs-metadata-${{ github.sha }}
- name: Generate and sync metadata
run: Tools/ci/metadata_sync.sh --generate --sync parameters airframes modules msg_docs failsafe_web
env:
CCACHE_DIR: ~/.ccache
- name: Install Node.js and Yarn
run: |
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
corepack enable
- name: Format markdown with Prettier
run: |
cd docs
yarn install --frozen-lockfile
yarn prettier --write "en/**/*.md"
- name: Commit and push changes
run: |
git config --global user.name "${{ secrets.PX4BUILDBOT_USER }}"
git config --global user.email "${{ secrets.PX4BUILDBOT_EMAIL }}"
git add docs/
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <${{ secrets.PX4BUILDBOT_EMAIL }}>"
git push
fi
# =============================================================================
# Link Check
# =============================================================================
link-check:
name: "T2: Link Check"
needs: [detect-changes, pr-metadata-regen]
if: always() && (github.event_name == 'pull_request')
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Download metadata artifact
if: needs.pr-metadata-regen.result == 'success'
uses: actions/download-artifact@v4
with:
name: pr-metadata
path: docs/
- name: Get changed doc files
id: changed-files
uses: tj-actions/changed-files@v46.0.5
with:
json: true
write_output_files: true
output_dir: ./logs
base_sha: ${{ github.event.pull_request.base.sha }}
sha: ${{ github.event.pull_request.head.sha }}
files: |
docs/en/**/*.md
- name: Save changed files list
run: |
mv ./logs/all_changed_files.json ./logs/prFiles.json
echo "Changed files:"
cat ./logs/prFiles.json
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Run filtered link checker (changed files)
run: |
npm -g install markdown_link_checker_sc@0.0.138
if [ "$(jq length ./logs/prFiles.json)" -gt 0 ]; then
markdown_link_checker_sc \
-r "$GITHUB_WORKSPACE" \
-d docs \
-e en \
-f ./logs/prFiles.json \
-i assets \
-u docs.px4.io/main/ \
> ./logs/filtered-link-check-results.md || true
fi
if [ ! -s ./logs/filtered-link-check-results.md ]; then
echo "No broken links found in changed files." > ./logs/filtered-link-check-results.md
fi
cat ./logs/filtered-link-check-results.md
- name: Run full link checker
run: |
markdown_link_checker_sc \
-r "$GITHUB_WORKSPACE" \
-d docs \
-e en \
-i assets \
-u docs.px4.io/main/ \
> ./logs/link-check-results.md || true
cat ./logs/link-check-results.md
- name: Post PR comment with link check results
if: github.event.pull_request.head.repo.full_name == github.repository
uses: marocchino/sticky-pull-request-comment@v2
with:
header: flaws
path: ./logs/filtered-link-check-results.md
- name: Upload link check results
uses: actions/upload-artifact@v4
with:
name: link-check-results
path: logs/
retention-days: 7
# =============================================================================
# Build Site
# =============================================================================
build-site:
name: "T3: Build Site"
needs: [detect-changes, pr-metadata-regen, metadata-regen, link-check]
if: >-
always() &&
(needs.metadata-regen.result == 'success' || needs.metadata-regen.result == 'skipped') &&
(needs.link-check.result == 'success' || needs.link-check.result == 'skipped') &&
(github.event_name != 'pull_request' || needs.detect-changes.outputs.docs_changed == 'true' || needs.detect-changes.outputs.source_changed == 'true')
permissions:
contents: read
runs-on: [runs-on,runner=4cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
outputs:
branchname: ${{ steps.set-branch.outputs.branchname }}
releaseversion: ${{ steps.set-version.outputs.releaseversion }}
steps:
- uses: runs-on/action@v1
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
- name: Download metadata artifact (PR)
if: github.event_name == 'pull_request' && needs.pr-metadata-regen.result == 'success'
uses: actions/download-artifact@v4
with:
name: pr-metadata
path: docs/
- id: set-branch
run: echo "branchname=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- id: set-version
run: |
branch="${{ steps.set-branch.outputs.branchname }}"
if [[ "$branch" == "main" ]]; then
version="main"
elif [[ "$branch" =~ ^release/ ]]; then
version="v${branch#release/}"
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
version="main"
else
echo "::error::Unsupported branch for docs deploy: $branch (expected main or release/*)"
exit 1
fi
echo "releaseversion=$version" >> $GITHUB_OUTPUT
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: ./docs/yarn.lock
- name: Install dependencies
run: yarn install --frozen-lockfile --cwd ./docs
- name: Build with VitePress
working-directory: ./docs
env:
BRANCH_NAME: ${{ steps.set-version.outputs.releaseversion }}
run: |
npm run docs:build_ubuntu
touch .vitepress/dist/.nojekyll
npm run docs:sitemap
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: px4_docs_build
path: docs/.vitepress/dist/
retention-days: 1
# =============================================================================
# Deploy to AWS (push + workflow_dispatch)
# =============================================================================
deploy-aws:
name: "T4: Deploy"
needs: [metadata-regen, build-site]
if: >-
always() &&
needs.metadata-regen.result == 'success' &&
needs.build-site.result == 'success' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch')
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: px4_docs_build
path: ~/_book
- name: Configure AWS from OIDC
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-west-2
- name: Sanity check AWS credentials
run: aws sts get-caller-identity
- name: Upload HTML with short cache
run: |
aws s3 sync ~/_book/ s3://px4-docs/${{ needs.build-site.outputs.releaseversion }}/ \
--delete \
--exclude "*" --include "*.html" \
--cache-control "public, max-age=60"
- name: Upload assets with long cache
run: |
aws s3 sync ~/_book/ s3://px4-docs/${{ needs.build-site.outputs.releaseversion }}/ \
--delete \
--exclude "*.html" \
--cache-control "public, max-age=86400, immutable"
-116
View File
@@ -1,116 +0,0 @@
name: Docs - Deploy PX4 User Guide to AWS
on:
push:
branches:
- "main"
- "release/**"
paths:
- "docs/en/**"
- "docs/zh/**"
- "docs/uk/**"
- "docs/ko/**"
pull_request:
paths:
- "docs/en/**"
- "docs/zh/**"
- "docs/uk/**"
- "docs/ko/**"
workflow_dispatch:
permissions:
contents: read
actions: read
id-token: write # for AWS OIDC
concurrency:
group: docs-deploy
cancel-in-progress: false
jobs:
build:
runs-on: [runs-on,runner=4cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
outputs:
branchname: ${{ steps.set-branch.outputs.branchname }}
releaseversion: ${{ steps.set-version.outputs.releaseversion }}
steps:
- uses: runs-on/action@v1
- name: Checkout
uses: actions/checkout@v4
- id: set-branch
run: echo "branchname=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- id: set-version
run: |
branch="${{ steps.set-branch.outputs.branchname }}"
if [[ "$branch" == "main" ]]; then
version="main"
else
version="v${branch#release/}"
fi
echo "releaseversion=$version" >> $GITHUB_OUTPUT
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: ./docs/yarn.lock
- name: Install dependencies
run: yarn install --frozen-lockfile --cwd ./docs
- name: Build with VitePress
working-directory: ./docs
env:
BRANCH_NAME: ${{ steps.set-version.outputs.releaseversion }}
run: |
npm run docs:build_ubuntu
touch .vitepress/dist/.nojekyll
npm run docs:sitemap
- name: Upload artifact
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged) || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v4
with:
name: px4_docs_build
path: docs/.vitepress/dist/
retention-days: 1
deploy:
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged) || github.event_name == 'workflow_dispatch' }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: px4_docs_build
path: ~/_book
- name: Configure AWS from OIDC
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-west-2
- name: Sanity check AWS credentials
run: aws sts get-caller-identity
- name: Upload HTML with short cache
run: |
aws s3 sync ~/_book/ s3://px4-docs/${{ needs.build.outputs.releaseversion }}/ \
--delete \
--exclude "*" --include "*.html" \
--cache-control "public, max-age=60"
- name: Upload assets with long cache
run: |
aws s3 sync ~/_book/ s3://px4-docs/${{ needs.build.outputs.releaseversion }}/ \
--delete \
--exclude "*.html" \
--cache-control "public, max-age=86400, immutable"
-85
View File
@@ -1,85 +0,0 @@
name: Docs - Check for flaws in PX4 Guide Source
# So far:
# Modifications of translations files
# Broken internal links
on:
pull_request_target:
types: [opened, edited, synchronize]
paths:
- 'docs/en/**'
jobs:
check_flaws:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Create logs directory
run: |
mkdir logs
- name: Get changed english doc files
id: get_changed_markdown_english
uses: tj-actions/changed-files@v46.0.5
with:
json: true
base_sha: "${{ github.event.pull_request.base.sha }}"
sha: "${{ github.event.pull_request.head.sha }}"
# Below are used to output files to a directory. May use in flaw checker.
# write_output_files: true
# output_dir: "./logs"
files: |
docs/en/**/*.md
- name: Save JSON file containing files to link check
run: |
echo "$ALL_CHANGED_FILES"
# echo "$ALL_CHANGED_FILES" > ./logs/prFiles.json
echo "$ALL_CHANGED_FILES" | sed 's/\\//g' | jq '.' > ./logs/prFiles.json
env:
ALL_CHANGED_FILES: ${{ steps.get_changed_markdown_english.outputs.all_changed_files }}
- name: Run link checker
id: link-check
run: |
npm -g install markdown_link_checker_sc@0.0.138
markdown_link_checker_sc \
-r "$GITHUB_WORKSPACE" \
-d docs \
-e en \
-f ./logs/prFiles.json \
-i assets \
-u docs.px4.io/main/ \
> ./logs/errorsFilteredByPrPages.md
mkdir -p ./pr
cp ./logs/errorsFilteredByPrPages.md ./pr/errorsFilteredByPrPages.md
- name: Read errorsFilteredByPrPages.md file
id: read-errors-by-page
uses: juliangruber/read-file-action@v1
with:
path: ./logs/errorsFilteredByPrPages.md
- name: Echo Errors by Page
run: echo "$ERRORS"
env:
ERRORS: ${{ steps.read-errors-by-page.outputs.content }}
- name: Save PR number
run: echo "$PR_NUMBER" > ./pr/pr_number
env:
PR_NUMBER: ${{ github.event.number }}
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr/
-111
View File
@@ -1,111 +0,0 @@
name: Docs - Comment Workflow
on:
workflow_run:
workflows: ["Docs - Check for flaws in PX4 Guide Source"]
types:
- completed
jobs:
comment:
permissions:
pull-requests: write # for marocchino/sticky-pull-request-comment
name: Comments
runs-on: ubuntu-latest
steps:
- name: 'Download PR artifact'
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr_number"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_number.zip`, Buffer.from(download.data));
- name: 'Unzip artifact'
run: unzip pr_number.zip
# Doesn't work across workflows
#- name: Get artifacts from flaw checker workflow
# uses: actions/download-artifact@v3
# with:
# name: logs_and_errors
# #path: ./logs
- name: Read errorsFilteredByPrPages.md file
id: read-errors-by-page
uses: juliangruber/read-file-action@v1
with:
path: ./errorsFilteredByPrPages.md
- name: Read PR number
id: read-error-pr-number
uses: juliangruber/read-file-action@v1
with:
path: ./pr_number
- name: File detail info
run: |
echo "$ERRORS"
echo "$PRNUM"
env:
ERRORS: ${{ steps.read-errors-by-page.outputs.content }}
PRNUM: ${{ steps.read-error-pr-number.outputs.content }}
- name: Create or update comment
id: comment_to_pr
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
recreate: true
number: ${{ steps.read-error-pr-number.outputs.content }}
header: flaws
message: ${{ steps.read-errors-by-page.outputs.content || 'No flaws found' }}
#- name: Dump GitHub context
# env:
# GITHUB_CONTEXT: ${{ toJSON(github) }}
# run: echo "$GITHUB_CONTEXT"
# Would like to do this, but it doesn't work (for me).
# Moving to time-based, or triggering on workflow
#- name: Wait for artifacts upload to succeed
# uses: lewagon/wait-on-check-action@v1.3.1
# with:
# ref: ${{ github.ref }}
# check-name: 'Archive production artifacts'
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# wait-interval: 80
# Not needed for now - trying to trigger off the workflow
#- name: Sleep for 80 seconds
# run: sleep 80s
# shell: bash
#- name: Find Comment
# uses: peter-evans/find-comment@v2
# id: fc
# with:
# issue-number: ${{ steps.read-error-pr-number.outputs.content }}
# comment-author: 'github-actions[bot]'
# body-includes: Flaws (may be none)
#- name: Create or update comment
# uses: peter-evans/create-or-update-comment@v3
# with:
# comment-id: ${{ steps.fc.outputs.comment-id }}
# issue-number: ${{ steps.read-error-pr-number.outputs.content }}
# body: |
# Flaws (may be none)
# ${{ steps.read-errors-by-page.outputs.content }}
# edit-mode: replace
@@ -90,6 +90,9 @@ jobs:
mkdir -p /opt/px4_ws/src
cd /opt/px4_ws/src
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
cd ..
# Copy messages to ROS workspace
"${PX4_DIR}/Tools/copy_to_ros_ws.sh" "$(pwd)"
+3
View File
@@ -109,3 +109,6 @@ src/systemcmds/topic_listener/listener_generated.cpp
# colcon
log/
keys/
# metadata
_emscripten_sdk/
-15
View File
@@ -1,15 +0,0 @@
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
##
## # The following are required to submit to the CDash dashboard:
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "PX4 Firmware")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PX4+Firmware")
set(CTEST_DROP_SITE_CDASH TRUE)
Vendored
+1
View File
@@ -101,6 +101,7 @@ pipeline {
echo $0;
git clone https://github.com/emscripten-core/emsdk.git _emscripten_sdk;
cd _emscripten_sdk;
git checkout 4.0.15;
./emsdk install latest;
./emsdk activate latest;
cd ..;
+7
View File
@@ -598,3 +598,10 @@ failsafe_web:
run_failsafe_web_server: failsafe_web
@cd build/px4_sitl_default_failsafe_web && \
python3 -m http.server
# Generate reference documentation for uORB messages
.PHONY: msg_docs
msg_docs:
$(call colorecho,'Generating uORB message reference docs')
@mkdir -p build/msg_docs
@./Tools/msg/generate_msg_docs.py -d build/msg_docs
+84 -37
View File
@@ -1,62 +1,109 @@
# PX4 Drone Autopilot
<p align="center">
<a href="https://px4.io">
<img src="docs/assets/site/px4_logo.svg" alt="PX4 Autopilot" width="240">
</a>
</p>
[![Releases](https://img.shields.io/github/release/PX4/PX4-Autopilot.svg)](https://github.com/PX4/PX4-Autopilot/releases) [![DOI](https://zenodo.org/badge/22634/PX4/PX4-Autopilot.svg)](https://zenodo.org/badge/latestdoi/22634/PX4/PX4-Autopilot)
<p align="center">
<em>The autopilot stack the industry builds on.</em>
</p>
[![Build Targets](https://github.com/PX4/PX4-Autopilot/actions/workflows/build_all_targets.yml/badge.svg?branch=main)](https://github.com/PX4/PX4-Autopilot/actions/workflows/build_all_targets.yml) [![SITL Tests](https://github.com/PX4/PX4-Autopilot/workflows/SITL%20Tests/badge.svg?branch=master)](https://github.com/PX4/PX4-Autopilot/actions?query=workflow%3A%22SITL+Tests%22)
<p align="center">
<a href="https://github.com/PX4/PX4-Autopilot/releases"><img src="https://img.shields.io/github/release/PX4/PX4-Autopilot.svg" alt="Releases"></a>
<a href="https://zenodo.org/badge/latestdoi/22634/PX4/PX4-Autopilot"><img src="https://zenodo.org/badge/22634/PX4/PX4-Autopilot.svg" alt="DOI"></a>
<a href="https://github.com/PX4/PX4-Autopilot/actions/workflows/build_all_targets.yml"><img src="https://github.com/PX4/PX4-Autopilot/actions/workflows/build_all_targets.yml/badge.svg?branch=main" alt="Build Targets"></a>
<a href="https://discord.gg/dronecode"><img src="https://discordapp.com/api/guilds/1022170275984457759/widget.png?style=shield" alt="Discord"></a>
</p>
[![Discord Shield](https://discordapp.com/api/guilds/1022170275984457759/widget.png?style=shield)](https://discord.gg/dronecode)
---
This repository holds the [PX4](http://px4.io) flight control solution for drones, with the main applications located in the [src/modules](https://github.com/PX4/PX4-Autopilot/tree/main/src/modules) directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.
## About
PX4 is highly portable, OS-independent and supports Linux, NuttX and MacOS out of the box.
PX4 is an open-source autopilot stack for drones and unmanned vehicles. It supports multirotors, fixed-wing, VTOL, rovers, and many more experimental platforms from racing quads to industrial survey aircraft. It runs on [NuttX](https://nuttx.apache.org/), Linux, and macOS. Licensed under [BSD 3-Clause](LICENSE).
* Official Website: http://px4.io (License: BSD 3-clause, [LICENSE](https://github.com/PX4/PX4-Autopilot/blob/main/LICENSE))
* [Supported airframes](https://docs.px4.io/main/en/airframes/airframe_reference.html) ([portfolio](https://px4.io/ecosystem/commercial-systems/)):
* [Multicopters](https://docs.px4.io/main/en/frames_multicopter/)
* [Fixed wing](https://docs.px4.io/main/en/frames_plane/)
* [VTOL](https://docs.px4.io/main/en/frames_vtol/)
* [Autogyro](https://docs.px4.io/main/en/frames_autogyro/)
* [Rover](https://docs.px4.io/main/en/frames_rover/)
* many more experimental types (Blimps, Boats, Submarines, High Altitude Balloons, Spacecraft, etc)
* Releases: [Downloads](https://github.com/PX4/PX4-Autopilot/releases)
## Why PX4
## Releases
**Modular architecture.** PX4 is built around [uORB](https://docs.px4.io/main/en/middleware/uorb.html), a [DDS](https://docs.px4.io/main/en/middleware/uxrce_dds.html)-compatible publish/subscribe middleware. Modules are fully parallelized and thread safe. You can build custom configurations and trim what you don't need.
Release notes and supporting information for PX4 releases can be found on the [Developer Guide](https://docs.px4.io/main/en/releases/).
**Wide hardware support.** PX4 runs on a wide range of [autopilot boards](https://docs.px4.io/main/en/flight_controller/) and supports an extensive set of sensors, telemetry radios, and actuators through the [Pixhawk](https://pixhawk.org/) ecosystem.
## Building a PX4 based drone, rover, boat or robot
**Developer friendly.** First-class support for [MAVLink](https://mavlink.io/) and [DDS / ROS 2](https://docs.px4.io/main/en/ros2/) integration. Comprehensive [SITL simulation](https://docs.px4.io/main/en/simulation/), hardware-in-the-loop testing, and [log analysis](https://docs.px4.io/main/en/log/flight_log_analysis.html) tools. An active developer community on [Discord](https://discord.gg/dronecode) and the [weekly dev call](https://docs.px4.io/main/en/contribute/).
The [PX4 User Guide](https://docs.px4.io/main/en/) explains how to assemble [supported vehicles](https://docs.px4.io/main/en/airframes/airframe_reference.html) and fly drones with PX4. See the [forum and chat](https://docs.px4.io/main/en/#getting-help) if you need help!
**Vendor neutral governance.** PX4 is hosted under the [Dronecode Foundation](https://www.dronecode.org/), part of the Linux Foundation. Business-friendly BSD-3 license. No single vendor controls the roadmap.
## Supported Vehicles
## Changing Code and Contributing
<table>
<tr>
<td align="center">
<a href="https://docs.px4.io/main/en/frames_multicopter/">
<img src="docs/assets/airframes/types/QuadRotorX.svg" width="50" alt="Multicopter"><br>
<sub>Multicopter</sub>
</a>
</td>
<td align="center">
<a href="https://docs.px4.io/main/en/frames_plane/">
<img src="docs/assets/airframes/types/Plane.svg" width="50" alt="Fixed Wing"><br>
<sub>Fixed Wing</sub>
</a>
</td>
<td align="center">
<a href="https://docs.px4.io/main/en/frames_vtol/">
<img src="docs/assets/airframes/types/VTOLPlane.svg" width="50" alt="VTOL"><br>
<sub>VTOL</sub>
</a>
</td>
<td align="center">
<a href="https://docs.px4.io/main/en/frames_rover/">
<img src="docs/assets/airframes/types/Rover.svg" width="50" alt="Rover"><br>
<sub>Rover</sub>
</a>
</td>
</tr>
</table>
This [Developer Guide](https://docs.px4.io/main/en/development/development.html) is for software developers who want to modify the flight stack and middleware (e.g. to add new flight modes), hardware integrators who want to support new flight controller boards and peripherals, and anyone who wants to get PX4 working on a new (unsupported) airframe/vehicle.
<sub>…and many more: helicopters, autogyros, airships, submarines, boats, and other experimental platforms. These frames have basic support but are not part of the regular flight-test program. See the <a href="https://docs.px4.io/main/en/airframes/airframe_reference.html">full airframe reference</a>.</sub>
Developers should read the [Guide for Contributions](https://docs.px4.io/main/en/contribute/).
See the [forum and chat](https://docs.px4.io/main/en/#getting-help) if you need help!
## Quick Start
```bash
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
cd PX4-Autopilot
make px4_sitl
```
## Weekly Dev Call
> [!NOTE]
> See the [Development Guide](https://docs.px4.io/main/en/development/development.html) for toolchain setup and build options.
The PX4 Dev Team syncs up on a [weekly dev call](https://docs.px4.io/main/en/contribute/).
## Documentation & Resources
> **Note** The dev call is open to all interested developers (not just the core dev team). This is a great opportunity to meet the team and contribute to the ongoing development of the platform. It includes a QA session for newcomers. All regular calls are listed in the [Dronecode calendar](https://www.dronecode.org/calendar/).
| Resource | Description |
| --- | --- |
| [User Guide](https://docs.px4.io/main/en/) | Build, configure, and fly with PX4 |
| [Developer Guide](https://docs.px4.io/main/en/development/development.html) | Modify the flight stack, add peripherals, port to new hardware |
| [Airframe Reference](https://docs.px4.io/main/en/airframes/airframe_reference.html) | Full list of supported frames |
| [Autopilot Hardware](https://docs.px4.io/main/en/flight_controller/) | Compatible flight controllers |
| [Release Notes](https://docs.px4.io/main/en/releases/) | What's new in each release |
| [Contribution Guide](https://docs.px4.io/main/en/contribute/) | How to contribute to PX4 |
## Community
## Maintenance Team
- **Weekly Dev Call** — open to all developers ([Dronecode calendar](https://www.dronecode.org/calendar/))
- **Discord** — [Join the Dronecode server](https://discord.gg/dronecode)
- **Discussion Forum** — [PX4 Discuss](https://discuss.px4.io/)
- **Maintainers** — see [`MAINTAINERS.md`](MAINTAINERS.md)
- **Contributor Stats** — [LFX Insights](https://insights.lfx.linuxfoundation.org/foundation/dronecode)
See the latest list of maintainers on [MAINTAINERS](MAINTAINERS.md) file at the root of the project.
## Contributing
For the latest stats on contributors please see the latest stats for the Dronecode ecosystem in our project dashboard under [LFX Insights](https://insights.lfx.linuxfoundation.org/foundation/dronecode). For information on how to update your profile and affiliations please see the following support link on how to [Complete Your LFX Profile](https://docs.linuxfoundation.org/lfx/my-profile/complete-your-lfx-profile). Dronecode publishes a yearly snapshot of contributions and achievements on its [website under the Reports section](https://dronecode.org).
We welcome contributions of all kinds — bug reports, documentation, new features, and code reviews. Please read the [Contribution Guide](https://docs.px4.io/main/en/contribute/) to get started.
## Supported Hardware
## Governance
For the most up to date information, please visit [PX4 User Guide > Autopilot Hardware](https://docs.px4.io/main/en/flight_controller/).
The PX4 Autopilot project is hosted by the [Dronecode Foundation](https://www.dronecode.org/), a [Linux Foundation](https://www.linuxfoundation.org/) Collaborative Project. Dronecode holds all PX4 trademarks and serves as the project's legal guardian, ensuring vendor-neutral stewardship — no single company owns the name or controls the roadmap. The source code is licensed under the [BSD 3-Clause](LICENSE) license, so you are free to use, modify, and distribute it in your own projects.
## Project Governance
The PX4 Autopilot project including all of its trademarks is hosted under [Dronecode](https://www.dronecode.org/), part of the Linux Foundation.
<a href="https://www.dronecode.org/" style="padding:20px" ><img src="https://dronecode.org/wp-content/uploads/sites/24/2020/08/dronecode_logo_default-1.png" alt="Dronecode Logo" width="110px"/></a>
<div style="padding:10px">&nbsp;</div>
<p align="center">
<a href="https://www.dronecode.org/">
<img src="docs/assets/site/dronecode_logo.svg" alt="Dronecode Logo" width="180">
</a>
</p>
@@ -101,6 +101,6 @@ param set-default NAV_ACC_RAD 5
param set-default NAV_DLL_ACT 2
param set-default VT_FWD_THRUST_EN 4
param set-default VT_F_TRANS_THR 0.3
param set-default VT_F_TRANS_THR 1
param set-default VT_TYPE 2
param set-default FD_ESCS_EN 0
@@ -123,3 +123,9 @@ if(CONFIG_MODULES_TEMPERATURE_COMPENSATION)
rc.thermal_cal
)
endif()
if(CONFIG_DRIVERS_VTXTABLE)
px4_add_romfs_files(
rc.vtxtable
)
endif()
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
#
# VTX table loading script.
#
# NOTE: Script variables are declared/initialized/unset in the rcS script.
#
vtxtable load
+28 -21
View File
@@ -479,6 +479,19 @@ else
pwm_out start
fi
#
# Optional UAVCAN/DroneCAN or Cyphal
#
if param greater -s UAVCAN_ENABLE 0
then
uavcan start
else
if param greater -s CYPHAL_ENABLE 0
then
cyphal start
fi
fi
#
# Configure vehicle type specific parameters.
# Note: rc.vehicle_setup is the entry point for all vehicle type specific setup.
@@ -507,6 +520,11 @@ else
#
. ${R}etc/init.d/rc.serial
if param greater -s ZENOH_ENABLE 0
then
zenoh start
fi
# Must be started after the serial config is read
rc_input start $RC_INPUT_ARGS
@@ -612,6 +630,16 @@ else
fi
unset RC_LOGGING
#
# Start the VTX services.
#
set RC_VTXTABLE ${R}etc/init.d/rc.vtxtable
if [ -f ${RC_VTXTABLE} ]
then
. ${RC_VTXTABLE}
fi
unset RC_VTXTABLE
#
# Set additional parameters and env variables for selected AUTOSTART.
#
@@ -628,27 +656,6 @@ else
fi
unset BOARD_BOOTLOADER_UPGRADE
#
# Check if UAVCAN is enabled, default to it for ESCs.
#
if param greater -s UAVCAN_ENABLE 0
then
# Start core UAVCAN module.
if ! uavcan start
then
tune_control play error
fi
else
if param greater -s CYPHAL_ENABLE 0
then
cyphal start
fi
fi
if param greater -s ZENOH_ENABLE 0
then
zenoh start
fi
#
# End of autostart.
#
+26 -4
View File
@@ -36,11 +36,20 @@ if args.filter:
target_filter.append(target)
default_container = 'ghcr.io/px4/px4-dev:v1.16.0-rc1-258-g0369abd556'
voxl2_container = 'ghcr.io/px4/px4-dev-voxl2:v1.5'
build_configs = []
grouped_targets = {}
excluded_boards = ['modalai_voxl2', 'px4_ros2', 'espressif_esp32'] # TODO: fix and enable
excluded_boards = ['px4_ros2', 'espressif_esp32'] # TODO: fix and enable
excluded_manufacturers = ['atlflight']
excluded_platforms = ['qurt']
excluded_platforms = []
# Container overrides for platforms/boards that need a non-default container
platform_container_overrides = {
'qurt': voxl2_container,
}
board_container_overrides = {
'modalai_voxl2': voxl2_container,
}
excluded_labels = [
'stackcheck',
'nolockstep', 'replay', 'test',
@@ -88,7 +97,20 @@ def process_target(px4board_file, target_name):
if platform not in excluded_platforms:
container = default_container
if platform == 'posix':
# Extract board name (manufacturer_board) from target name
board_name = '_'.join(target_name.split('_')[:2])
# Apply container overrides for specific platforms or boards
if platform in platform_container_overrides:
container = platform_container_overrides[platform]
if board_name in board_container_overrides:
container = board_container_overrides[board_name]
# Boards with container overrides get their own group
if board_name in board_container_overrides or platform in platform_container_overrides:
group = 'voxl2'
elif platform == 'posix':
group = 'base'
if toolchain:
if toolchain.startswith('aarch64'):
@@ -203,7 +225,7 @@ if (args.group):
if(verbose):
print(f'=:Architectures: [{grouped_targets.keys()}]')
for arch in grouped_targets:
runner = 'x64' if arch == 'nuttx' else 'arm64'
runner = 'x64' if arch in ('nuttx', 'voxl2') else 'arm64'
if(verbose):
print(f'=:Processing: [{arch}]')
temp_group = []
+431
View File
@@ -0,0 +1,431 @@
#!/usr/bin/env bash
#
# metadata_sync.sh - Unified metadata generation and synchronization for PX4 docs
#
# Usage:
# Tools/ci/metadata_sync.sh [OPTIONS] [TYPES...]
#
# Types:
# parameters - Parameter reference (docs/en/advanced_config/parameter_reference.md)
# airframes - Airframe reference (docs/en/airframes/airframe_reference.md)
# modules - Module documentation (docs/en/modules/*.md)
# msg_docs - uORB message docs (docs/en/msg_docs/*.md + docs/en/middleware/dds_topics.md)
# uorb_graphs - uORB graph JSONs (docs/public/middleware/*.json)
# failsafe_web - Failsafe simulator (docs/public/config/failsafe/*.{js,wasm,json})
# all - All of the above (default)
#
# Options:
# --generate Build the make targets to generate fresh metadata
# --sync Copy generated files to docs/
# --verbose Show detailed output
# --help Show this help
#
# Exit codes:
# 0 - Success (files synced or already up-to-date)
# 1 - Error (build failed, missing files, etc.)
#
# Examples:
# # Full regeneration and sync (orchestrator use case)
# Tools/ci/metadata_sync.sh --generate --sync all
#
# # Just sync specific type (assumes already built)
# Tools/ci/metadata_sync.sh --sync parameters
#
# # Generate only, don't copy
# Tools/ci/metadata_sync.sh --generate uorb_graphs
#
set -euo pipefail
shopt -s nullglob
# ═══════════════════════════════════════════════════════════════════════════════
# Configuration
# ═══════════════════════════════════════════════════════════════════════════════
EMSCRIPTEN_VERSION="3.1.64"
EMSDK_DIR="${EMSDK_DIR:-_emscripten_sdk}"
# All available metadata types
ALL_TYPES=(parameters airframes modules msg_docs uorb_graphs failsafe_web)
# ═══════════════════════════════════════════════════════════════════════════════
# Logging
# ═══════════════════════════════════════════════════════════════════════════════
VERBOSE=false
log() {
echo "[metadata_sync] $*"
}
log_verbose() {
if [[ "$VERBOSE" == "true" ]]; then
echo "[metadata_sync] $*"
fi
}
die() {
echo "[metadata_sync] ERROR: $*" >&2
exit 1
}
# ═══════════════════════════════════════════════════════════════════════════════
# Help
# ═══════════════════════════════════════════════════════════════════════════════
show_help() {
head -n 35 "$0" | tail -n +2 | sed 's/^# \?//'
exit 0
}
# ═══════════════════════════════════════════════════════════════════════════════
# Emscripten Setup
# ═══════════════════════════════════════════════════════════════════════════════
ensure_emscripten() {
if command -v emcc >/dev/null 2>&1; then
log_verbose "Emscripten already available: $(emcc --version | head -1)"
return 0
fi
log "Setting up Emscripten ${EMSCRIPTEN_VERSION}..."
if [[ ! -d "$EMSDK_DIR" ]]; then
log_verbose "Cloning emsdk to $EMSDK_DIR"
if [[ "$VERBOSE" == "true" ]]; then
git clone https://github.com/emscripten-core/emsdk.git "$EMSDK_DIR"
else
git clone https://github.com/emscripten-core/emsdk.git "$EMSDK_DIR" >/dev/null 2>&1
fi
fi
pushd "$EMSDK_DIR" >/dev/null
if [[ "$VERBOSE" == "true" ]]; then
./emsdk install "$EMSCRIPTEN_VERSION"
./emsdk activate "$EMSCRIPTEN_VERSION"
else
./emsdk install "$EMSCRIPTEN_VERSION" >/dev/null 2>&1
./emsdk activate "$EMSCRIPTEN_VERSION" >/dev/null 2>&1
fi
popd >/dev/null
# shellcheck source=/dev/null
source "${EMSDK_DIR}/emsdk_env.sh" >/dev/null 2>&1
log_verbose "Emscripten ready: $(emcc --version | head -1)"
}
# ═══════════════════════════════════════════════════════════════════════════════
# Generation Functions
# ═══════════════════════════════════════════════════════════════════════════════
generate_parameters() {
log "Generating parameters metadata..."
if [[ "$VERBOSE" == "true" ]]; then
make parameters_metadata
else
make parameters_metadata >/dev/null 2>&1
fi
}
generate_airframes() {
log "Generating airframes metadata..."
if [[ "$VERBOSE" == "true" ]]; then
make airframe_metadata
else
make airframe_metadata >/dev/null 2>&1
fi
}
generate_modules() {
log "Generating modules documentation..."
if [[ "$VERBOSE" == "true" ]]; then
make module_documentation
else
make module_documentation >/dev/null 2>&1
fi
}
generate_msg_docs() {
log "Generating message documentation..."
if [[ "$VERBOSE" == "true" ]]; then
make msg_docs
else
make msg_docs >/dev/null 2>&1
fi
}
generate_uorb_graphs() {
log "Generating uORB graphs..."
if [[ "$VERBOSE" == "true" ]]; then
make uorb_graphs
else
make uorb_graphs >/dev/null 2>&1
fi
}
generate_failsafe_web() {
ensure_emscripten
log "Generating failsafe web..."
if [[ "$VERBOSE" == "true" ]]; then
make failsafe_web
else
make failsafe_web >/dev/null 2>&1
fi
}
# ═══════════════════════════════════════════════════════════════════════════════
# Sync Functions
# ═══════════════════════════════════════════════════════════════════════════════
sync_parameters() {
local src="build/px4_sitl_default/docs/parameters.md"
local dest="docs/en/advanced_config/parameter_reference.md"
log "Syncing parameters..."
if [[ ! -f "$src" ]]; then
die "Source file not found: $src (did you run --generate?)"
fi
mkdir -p "$(dirname "$dest")"
cp "$src" "$dest"
log_verbose " $src -> $dest"
}
sync_airframes() {
local src="build/px4_sitl_default/docs/airframes.md"
local dest="docs/en/airframes/airframe_reference.md"
log "Syncing airframes..."
if [[ ! -f "$src" ]]; then
die "Source file not found: $src (did you run --generate?)"
fi
mkdir -p "$(dirname "$dest")"
cp "$src" "$dest"
log_verbose " $src -> $dest"
}
sync_modules() {
local src_dir="build/px4_sitl_default/docs/modules"
local dest_dir="docs/en/modules"
log "Syncing modules..."
if [[ ! -d "$src_dir" ]]; then
die "Source directory not found: $src_dir (did you run --generate?)"
fi
local src_files=("$src_dir"/*.md)
if [[ ${#src_files[@]} -eq 0 ]]; then
die "No .md files found in $src_dir"
fi
mkdir -p "$dest_dir"
for src in "${src_files[@]}"; do
local name
name=$(basename "$src")
cp "$src" "$dest_dir/$name"
log_verbose " $src -> $dest_dir/$name"
done
}
sync_msg_docs() {
local src_dir="build/msg_docs"
local dest_dir="docs/en/msg_docs"
local middleware_dir="docs/en/middleware"
log "Syncing message docs..."
if [[ ! -d "$src_dir" ]]; then
die "Source directory not found: $src_dir (did you run --generate?)"
fi
local src_files=("$src_dir"/*.md)
if [[ ${#src_files[@]} -eq 0 ]]; then
die "No .md files found in $src_dir"
fi
mkdir -p "$dest_dir"
mkdir -p "$middleware_dir"
for src in "${src_files[@]}"; do
local name
name=$(basename "$src")
# dds_topics.md goes to middleware dir
if [[ "$name" == "dds_topics.md" ]]; then
cp "$src" "$middleware_dir/$name"
log_verbose " $src -> $middleware_dir/$name"
else
cp "$src" "$dest_dir/$name"
log_verbose " $src -> $dest_dir/$name"
fi
done
}
sync_uorb_graphs() {
local src_dir="Tools/uorb_graph"
local dest_dir="docs/public/middleware"
log "Syncing uORB graphs..."
local src_files=("$src_dir"/*.json)
if [[ ${#src_files[@]} -eq 0 ]]; then
die "No .json files found in $src_dir (did you run --generate?)"
fi
mkdir -p "$dest_dir"
for src in "${src_files[@]}"; do
local name
name=$(basename "$src")
cp "$src" "$dest_dir/$name"
log_verbose " $src -> $dest_dir/$name"
done
}
sync_failsafe_web() {
local src_dir="build/px4_sitl_default_failsafe_web"
local dest_dir="docs/public/config/failsafe"
log "Syncing failsafe web..."
if [[ ! -d "$src_dir" ]]; then
die "Source directory not found: $src_dir (did you run --generate?)"
fi
# Gather js, wasm, json files
local src_files=()
for ext in js wasm json; do
src_files+=("$src_dir"/*."$ext")
done
if [[ ${#src_files[@]} -eq 0 ]]; then
die "No .js/.wasm/.json files found in $src_dir"
fi
mkdir -p "$dest_dir"
for src in "${src_files[@]}"; do
local name
name=$(basename "$src")
cp "$src" "$dest_dir/$name"
log_verbose " $src -> $dest_dir/$name"
done
}
# ═══════════════════════════════════════════════════════════════════════════════
# Main Logic
# ═══════════════════════════════════════════════════════════════════════════════
DO_GENERATE=false
DO_SYNC=false
SELECTED_TYPES=()
parse_args() {
while [[ $# -gt 0 ]]; do
case "$1" in
--generate)
DO_GENERATE=true
shift
;;
--sync)
DO_SYNC=true
shift
;;
--verbose)
VERBOSE=true
shift
;;
--help|-h)
show_help
;;
-*)
die "Unknown option: $1"
;;
*)
# It's a type
SELECTED_TYPES+=("$1")
shift
;;
esac
done
# Default to all types if none specified
if [[ ${#SELECTED_TYPES[@]} -eq 0 ]]; then
SELECTED_TYPES=("all")
fi
# Expand "all" to all types
local expanded_types=()
for t in "${SELECTED_TYPES[@]}"; do
if [[ "$t" == "all" ]]; then
expanded_types+=("${ALL_TYPES[@]}")
else
expanded_types+=("$t")
fi
done
SELECTED_TYPES=("${expanded_types[@]}")
# Validate types
for t in "${SELECTED_TYPES[@]}"; do
local valid=false
for valid_type in "${ALL_TYPES[@]}"; do
if [[ "$t" == "$valid_type" ]]; then
valid=true
break
fi
done
if [[ "$valid" == "false" ]]; then
die "Unknown type: $t (valid: ${ALL_TYPES[*]})"
fi
done
# Must specify at least one action
if [[ "$DO_GENERATE" == "false" && "$DO_SYNC" == "false" ]]; then
die "Must specify at least one of: --generate, --sync"
fi
}
main() {
parse_args "$@"
log "Selected types: ${SELECTED_TYPES[*]}"
[[ "$DO_GENERATE" == "true" ]] && log "Actions: generate"
[[ "$DO_SYNC" == "true" ]] && log "Actions: sync"
# Remove duplicates from SELECTED_TYPES
local -A seen
local unique_types=()
for t in "${SELECTED_TYPES[@]}"; do
if [[ -z "${seen[$t]:-}" ]]; then
seen[$t]=1
unique_types+=("$t")
fi
done
SELECTED_TYPES=("${unique_types[@]}")
# Generate phase
if [[ "$DO_GENERATE" == "true" ]]; then
log "=== Generation Phase ==="
for t in "${SELECTED_TYPES[@]}"; do
"generate_$t"
done
fi
# Sync phase
if [[ "$DO_SYNC" == "true" ]]; then
log "=== Sync Phase ==="
for t in "${SELECTED_TYPES[@]}"; do
"sync_$t"
done
fi
log "Done."
exit 0
}
main "$@"
+2 -2
View File
@@ -1,8 +1,8 @@
#!/bin/bash
mkdir artifacts
cp **/**/*.px4 artifacts/
cp **/**/*.elf artifacts/
cp **/**/*.px4 artifacts/ 2>/dev/null || true
cp **/**/*.elf 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#*/}
+163
View File
@@ -0,0 +1,163 @@
#!/usr/bin/env bash
#
# test_metadata_sync.sh - Test metadata_sync.sh locally using Docker
#
# Usage:
# Tools/ci/test_metadata_sync.sh [OPTIONS] [TYPES...]
#
# Options:
# --shell Drop into interactive shell instead of running sync
# --verbose Pass --verbose to metadata_sync.sh
# --skip-build Skip SITL build (use existing build artifacts)
# --help Show this help
#
# Types:
# Same as metadata_sync.sh: parameters, airframes, modules, msg_docs, uorb_graphs, failsafe_web, all
#
# Examples:
# # Test full regeneration
# Tools/ci/test_metadata_sync.sh all
#
# # Test just parameters (faster)
# Tools/ci/test_metadata_sync.sh parameters
#
# # Drop into shell for debugging
# Tools/ci/test_metadata_sync.sh --shell
#
# # Skip build if you already have artifacts
# Tools/ci/test_metadata_sync.sh --skip-build --verbose all
#
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
DOCKER_IMAGE="px4io/px4-dev:v1.17.0-alpha1"
CONTAINER_NAME="px4-metadata-test-$$"
SHELL_MODE=false
VERBOSE=""
SKIP_BUILD=false
TYPES=()
show_help() {
head -n 28 "$0" | tail -n +2 | sed 's/^# \?//'
exit 0
}
cleanup() {
echo "[test] Cleaning up container..."
docker rm -f "$CONTAINER_NAME" 2>/dev/null || true
}
parse_args() {
while [[ $# -gt 0 ]]; do
case "$1" in
--shell)
SHELL_MODE=true
shift
;;
--verbose)
VERBOSE="--verbose"
shift
;;
--skip-build)
SKIP_BUILD=true
shift
;;
--help|-h)
show_help
;;
-*)
echo "Unknown option: $1" >&2
exit 1
;;
*)
TYPES+=("$1")
shift
;;
esac
done
# Default to all types
if [[ ${#TYPES[@]} -eq 0 ]]; then
TYPES=("all")
fi
}
main() {
parse_args "$@"
cd "$REPO_ROOT"
echo "[test] Using Docker image: $DOCKER_IMAGE"
echo "[test] Repository root: $REPO_ROOT"
# Pull image if not present
if ! docker image inspect "$DOCKER_IMAGE" >/dev/null 2>&1; then
echo "[test] Pulling Docker image..."
docker pull "$DOCKER_IMAGE"
fi
trap cleanup EXIT
# Handle git worktrees: the .git file points to the main repo's .git directory
# We need to mount that directory too so git works inside the container
local git_mounts=()
if [[ -f "$REPO_ROOT/.git" ]]; then
# It's a worktree - read the gitdir path and mount it
local gitdir
gitdir=$(grep '^gitdir:' "$REPO_ROOT/.git" | cut -d' ' -f2)
if [[ -n "$gitdir" ]]; then
# Mount the gitdir at the same path so the .git file reference works
git_mounts+=("-v" "$gitdir:$gitdir:ro")
# Also need the main .git directory (parent of worktrees/)
local main_git_dir
main_git_dir=$(dirname "$(dirname "$gitdir")")
git_mounts+=("-v" "$main_git_dir:$main_git_dir:ro")
echo "[test] Detected git worktree, mounting git directories"
fi
fi
if [[ "$SHELL_MODE" == "true" ]]; then
echo "[test] Starting interactive shell..."
echo "[test] Run: Tools/ci/metadata_sync.sh --generate --sync all"
docker run -it --rm \
--name "$CONTAINER_NAME" \
-v "$REPO_ROOT:/src" \
"${git_mounts[@]}" \
-w /src \
"$DOCKER_IMAGE" \
/bin/bash
else
echo "[test] Running metadata sync for: ${TYPES[*]}"
# Build the command
local cmd=""
if [[ "$SKIP_BUILD" == "false" ]]; then
cmd="Tools/ci/metadata_sync.sh --generate --sync $VERBOSE ${TYPES[*]}"
else
cmd="Tools/ci/metadata_sync.sh --sync $VERBOSE ${TYPES[*]}"
fi
echo "[test] Command: $cmd"
docker run --rm \
--name "$CONTAINER_NAME" \
-v "$REPO_ROOT:/src" \
"${git_mounts[@]}" \
-w /src \
"$DOCKER_IMAGE" \
/bin/bash -c "$cmd"
echo ""
echo "[test] Done! Check git status for changes:"
echo " git status -s docs/"
echo ""
echo "[test] To see what changed:"
echo " git diff docs/"
fi
}
main "$@"
+822 -58
View File
@@ -8,6 +8,803 @@ Also generates docs/en/middleware/dds_topics.md from dds_topics.yaml
import os
import argparse
import sys
import re
VALID_FIELDS = { #Note, also have to add the message types as those can be fields
'uint64',
'uint16',
'uint8',
'uint32'
}
ALLOWED_UNITS = set(["m", "m/s", "m/s^2", "(m/s)^2", "deg", "deg/s", "rad", "rad/s", "rad^2", "rpm" ,"V", "A", "mA", "mAh", "W", "dBm", "h", "s", "ms", "us", "Ohm", "MB", "Kb/s", "degC","Pa","%","-"])
invalid_units = set()
ALLOWED_FRAMES = set(["NED","Body"])
ALLOWED_INVALID_VALUES = set(["NaN", "0"])
ALLOWED_CONSTANTS_NOT_IN_ENUM = set(["ORB_QUEUE_LENGTH","MESSAGE_VERSION"])
class Error:
def __init__(self, type, message, linenumber=None, issueString = None, field = None):
self.type = type
self.message = message
self.linenumber = linenumber
self.issueString = issueString
self.field = field
def display_error(self):
#print(f"Debug: Error: display_error")
if 'trailing_whitespace' == self.type:
if self.issueString.strip():
print(f"NOTE: Line has trailing whitespace ({self.message}: {self.linenumber}): {self.issueString}")
else:
print(f"NOTE: Line has trailing whitespace ({self.message}: {self.linenumber})")
elif 'leading_whitespace_field_or_constant' == self.type:
print(f"NOTE: Whitespace before field or constant ({self.message}: {self.linenumber}): {self.issueString}")
elif 'field_or_constant_has_multiple_whitepsace' == self.type:
print(f"NOTE: Field/constant has more than one sequential whitespace character ({self.message}: {self.linenumber}): {self.issueString}")
elif 'empty_start_line' == self.type:
print(f"NOTE: Empty line at start of file ({self.message}: {self.linenumber})")
elif 'internal_comment' == self.type:
print(f"NOTE: Internal Comment ({self.message}: {self.linenumber})\n {self.issueString}")
elif 'internal_comment_empty' == self.type:
print(f"NOTE: Empty Internal Comment ({self.message}: {self.linenumber})")
elif 'summary_missing' == self.type:
print(f"WARNING: No message description ({self.message})")
elif 'topic_error' == self.type:
print(f"NOTE: TOPIC ISSUE: {self.issueString}")
elif 'unknown_unit' == self.type:
print(f"WARNING: Unknown Unit: [{self.issueString}] on `{self.field}` ({self.message}: {self.linenumber})")
elif 'constant_not_in_assigned_enum' == self.type:
print(f"WARNING: `{self.issueString}` constant: Prefix not in `@enum` field metadata ({self.message}: {self.linenumber})")
elif 'unknown_invalid_value' == self.type:
print(f"WARNING: Unknown @invalid value: [{self.issueString}] on `{self.field}` ({self.message}: {self.linenumber})")
elif 'unknown_frame' == self.type:
print(f"WARNING: Unknown @frame: [{self.issueString}] on `{self.field}` ({self.message}: {self.linenumber})")
elif 'command_no_params_pipes' == self.type:
print(f"WARNING: `{self.field}` command has no parameters (pipes): [{self.issueString}] ({self.message}: {self.linenumber})")
elif 'command_missing_params' == self.type:
print(f"WARNING: `{self.field}` command missing params - should be 7 params surrounded by 8 pipes: [{self.issueString}] ({self.message}: {self.linenumber})")
elif 'command_too_many_params' == self.type:
print(f"WARNING: `{self.field}` command too many params (should be 7). Extras: [{self.issueString}] ({self.message}: {self.linenumber})")
else:
self.display_info()
def display_info(self):
"""
Display info about an error.
Used as a fallback if error does not have specific printout in display_error()
"""
#print(f"Debug: Error: display_info")
print(f" type: {self.type}, message: {self.message}, linenumber: {self.linenumber}, issueString: {self.issueString}, field: {self.field}")
class Enum:
def __init__(self, name, parentMessage):
self.name = name
self.parent = parentMessage
self.enumValues = dict()
def display_info(self):
"""
Display info about an enum
"""
print(f"Debug: Enum: display_info")
print(f" name: {self.name}")
for key, value in self.enumValues.items():
value.display_info()
class ConstantValue:
def __init__(self, name, type, value, comment, line_number):
self.name = name.strip()
self.type = type.strip()
self.value = value.strip()
self.comment = comment
self.line_number = line_number
if not self.value:
print(f"Debug WARNING: NO VALUE in ConstantValue: {self.name}") ## TODO make into ERROR
exit()
# TODO if value or name are empty, error
def display_info(self):
print(f"Debug: ConstantValue: display_info")
print(f" name: {self.name}, type: {self.type}, value: {self.value}, comment: {self.comment}, line: {self.line_number}")
class CommandParam:
"""
Represents an individual param in a command constant
Encapsulates parsing of the param to extract units etc.
"""
def __init__(self, num, paramText, line_number, parentCommand):
self.paramNum = num
self.paramText = paramText.strip()
self.enum = None
self.range = None
#self.type = type
self.units = []
self.enums = []
self.minValue = None
self.maxValue = None
self.invalidValue = None
self.frameValue = None
self.lineNumber = line_number
self.parent = parentCommand
self.parentMessage = self.parent.parent
match = None
if self.paramText:
match = re.match(r'^((?:\[[^\]]*\]\s*)+)(.*)$', paramText)
self.description = paramText
bracketed_part = None
if match:
bracketed_part = match.group(1).strip() # .strip() removes trailing whitespace from the bracketed part
self.description = match.group(2).strip()
if bracketed_part:
# get units
bracket_content_matches = re.findall(r'\[(.*?)\]', bracketed_part)
#print(f"DEBUG: bracket_content_matches: {bracket_content_matches}")
for item in bracket_content_matches:
item = item.strip()
if item.startswith('@'): # Not a unit:
if item.startswith('@enum'):
item = item.split(" ")
enum = item[1].strip()
if enum and enum not in self.enums:
self.enums.append(enum)
# Create parent enum objects for any enums created in this step
for enumName in self.enums:
if not enumName in self.parentMessage.enums:
self.parentMessage.enums[enumName]=Enum(enumName,self.parentMessage)
elif item.startswith('@range'):
item = item[6:].strip().split(",")
self.range = item
self.minValue = item[0].strip()
self.maxValue = item[1].strip()
elif item.startswith('@invalid'):
self.invalidValue = item[8:].strip()
#TODO: Do we require a description? (not currently)
if self.invalidValue.split(" ")[0] not in ALLOWED_INVALID_VALUES:
print(f"TODO: Command param do not support @invalid: {self.invalidValue}")
"""
error = Error("unknown_invalid_value", self.parent.filename, self.lineNumber, self.invalidValue, self.name)
#error.display_error()
if not "unknown_invalid_value" in self.parent.errors:
self.parent.errors["unknown_invalid_value"] = []
self.parent.errors["unknown_invalid_value"].append(error)
"""
elif item.startswith('@frame'):
self.frameValue = item[6:].strip()
print(f"TODO: Command param do not support @frame: {self.frameValue}")
"""
if self.frameValue not in ALLOWED_FRAMES:
error = Error("unknown_frame", self.parent.filename, self.lineNumber, self.frameValue, self.name)
#error.display_error()
if not "unknown_frame" in self.parent.errors:
self.parent.errors["unknown_frame"] = []
self.parent.errors["unknown_frame"].append(error)
"""
else:
print(f"WARNING: Unhandled metadata in message comment: {item}")
# TODO - report errors for different kinds of metadata
exit()
else: # bracket is a unit
unit = item.strip()
if item == "-":
unit = ""
if unit and unit not in self.units:
self.units.append(unit)
if unit not in ALLOWED_UNITS:
invalid_units.add(unit)
error = Error("unknown_unit", self.parentMessage.filename, self.lineNumber, unit, self.parent.name)
#error.display_error()
if not "unknown_unit" in self.parentMessage.errors:
self.parentMessage.errors["unknown_unit"] = []
self.parentMessage.errors["unknown_unit"].append(error)
def display_info(self):
print(f"Debug: CommandParam: display_info")
print(f" id: {self.paramNum}")
print(f" paramText: {self.paramText}\n unit: {self.units}\n enums: {self.enums}\n lineNumber: {self.lineNumber}\n range: {self.range}\n minValue: {self.minValue}\n maxValue: {self.maxValue}\n invalidValue: {self.invalidValue}\n frameValue: {self.frameValue}\n parent: {self.parent}\n ")
class CommandConstant:
"""
Represents a constant that is a command definition.
Encapsulates parsing of the command format.
The individual params are further parsed in CommandParam
"""
def __init__(self, name, type, value, comment, line_number, parentMessage):
self.name = name.strip()
self.type = type.strip()
self.value = value.strip()
self.comment = comment
self.line_number = line_number
self.parent = parentMessage
self.description = self.comment
self.param1 = None
self.param2 = None
self.param3 = None
self.param4 = None
self.param5 = None
self.param6 = None
self.param7 = None
if not self.value:
print(f"Debug WARNING: NO VALUE in CommandConstant: {self.name}") ## TODO make into ERROR
exit()
if not self.comment: # This is an bug for a command
#print(f"Debug WARNING: NO COMMENT in CommandConstant: {self.name}") ## TODO make into ERROR
return
# Parse command comment to get the description and parameters.
# print(f"Debug CommandConstant: {self.comment}")
if not "|" in self.comment:
# This is an error for a command constant
error = Error("command_no_params_pipes", self.parent.filename, self.line_number, self.comment, self.name)
#error.display_error()
if not "command_no_params_pipes" in self.parent.errors:
self.parent.errors["command_no_params_pipes"] = []
self.parent.errors["command_no_params_pipes"].append(error)
return
# Split on pipes
commandSplit = self.comment.split("|")
if len(commandSplit) < 9:
# Should 7 pipes, so each command is fully surrounded
error = Error("command_missing_params", self.parent.filename, self.line_number, self.comment, self.name)
#error.display_error()
if not "command_missing_params" in self.parent.errors:
self.parent.errors["command_missing_params"] = []
self.parent.errors["command_missing_params"].append(error)
self.description = commandSplit[0].strip()
self.description = self.description if self.description else None
params_to_update = commandSplit[1:8]
for i, value in enumerate(params_to_update, start=1):
if value.strip():
# parse the param
param = CommandParam(i, value, self.line_number, self)
#param.display_info() # DEBUG CODE XXX
setattr(self, f"param{i}", param)
# parse the param
if len(commandSplit) > 8:
extras = commandSplit[8:]
error = Error("command_too_many_params", self.parent.filename, self.line_number, extras, self.name)
if not "command_too_many_params" in self.parent.errors:
self.parent.errors["command_too_many_params"] = []
self.parent.errors["command_too_many_params"].append(error)
# TODO if value or name are empty, error
def markdown_out(self):
#print("DEBUG: CommandConstant.markdown_out")
output = f"""### {self.name} ({self.value})
{self.description}
Param | Units | Range/Enum | Description
--- | --- | --- | ---
"""
for i in range(1, 8):
attr_name = f"param{i}"
# getattr returns None if the attribute doesn't exist
val = getattr(self, attr_name, None)
if val is not None:
rangeVal = ""
if val.minValue or val.maxValue:
rangeVal = f"[{val.minValue if val.minValue else '-'} : {val.maxValue if val.maxValue else '-' }]"
output+=f"{i} | {", ".join(val.units)}|{', '.join(f"[{e}](#{e})" for e in val.enums)}{rangeVal} | {val.description}\n"
else:
output+=f"{i} | | | ?\n"
output+=f"\n"
return output
def display_info(self):
print(f"Debug: CommandConstant: display_info")
print(f" name: {self.name}, type: {self.type}, value: {self.value}, comment: {self.comment}, line: {self.line_number}")
print(f" description: {self.description}\n param1: {self.param1}\n param2: {self.param2}\n param3: {self.param3}\n param4: {self.param4}\n param5: {self.param5}\n param6: {self.param6}\n param7: {self.param7}")
class MessageField:
"""
Represents a field.
Encapsulates parsing of the field information.
"""
def __init__(self, name, type, comment, line_number, parentMessage):
self.name = name
self.type = type
self.comment = comment
self.unit = None
self.enums = None
self.minValue = None
self.maxValue = None
self.invalidValue = None
self.frameValue = None
self.lineNumber = line_number
self.parent = parentMessage
#print(f"MessageComment: {comment}")
match = None
if self.comment:
match = re.match(r'^((?:\[[^\]]*\]\s*)+)(.*)$', comment)
self.description = comment
bracketed_part = None
if match:
bracketed_part = match.group(1).strip() # .strip() removes trailing whitespace from the bracketed part
self.description = match.group(2).strip()
if bracketed_part:
# get units
bracket_content_matches = re.findall(r'\[(.*?)\]', bracketed_part)
#print(f"bracket_content_matches: {bracket_content_matches}")
for item in bracket_content_matches:
item = item.strip()
if item.startswith('@'): # Not a unit:
if item.startswith('@enum'):
item = item.split(" ")
self.enums = item[1:]
# Create parent enum objects
for enumName in self.enums:
if not enumName in parentMessage.enums:
parentMessage.enums[enumName]=Enum(enumName,parentMessage)
elif item.startswith('@range'):
item = item[6:].strip().split(",")
self.minValue = item[0].strip()
self.maxValue = item[1].strip()
elif item.startswith('@invalid'):
self.invalidValue = item[8:].strip()
#TODO: Do we require a description? (not currently)
if self.invalidValue.split(" ")[0] not in ALLOWED_INVALID_VALUES:
error = Error("unknown_invalid_value", self.parent.filename, self.lineNumber, self.invalidValue, self.name)
#error.display_error()
if not "unknown_invalid_value" in self.parent.errors:
self.parent.errors["unknown_invalid_value"] = []
self.parent.errors["unknown_invalid_value"].append(error)
elif item.startswith('@frame'):
self.frameValue = item[6:].strip()
if self.frameValue not in ALLOWED_FRAMES:
error = Error("unknown_frame", self.parent.filename, self.lineNumber, self.frameValue, self.name)
#error.display_error()
if not "unknown_frame" in self.parent.errors:
self.parent.errors["unknown_frame"] = []
self.parent.errors["unknown_frame"].append(error)
else:
print(f"WARNING: Unhandled metadata in message comment: {item}")
# TODO - report errors for different kinds of metadata
exit()
else: # bracket is a unit
self.unit = item
if self.unit not in ALLOWED_UNITS:
invalid_units.add(self.unit)
error = Error("unknown_unit", self.parent.filename, self.lineNumber, self.unit, self.name)
#error.display_error()
if not "unknown_unit" in self.parent.errors:
self.parent.errors["unknown_unit"] = []
self.parent.errors["unknown_unit"].append(error)
if item == "-":
self.unit = ""
def display_info(self):
print(f"Debug: MessageField: display_info")
print(f" name: {self.name}, type: {self.type}, description: {self.description}, enums: {self.enums}, minValue: {self.minValue}, maxValue: {self.maxValue}, invalidValue: {self.invalidValue}, frameValue: {self.frameValue}")
class UORBMessage:
"""
Represents a whole message, including fields, enums, commands, constants.
The parser function delegates the parsing of each part of the message to
more appropriate classes, once the specific type of line has been identified.
"""
def __init__(self, filename):
self.filename = filename
msg_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../../msg")
self.msg_filename = os.path.join(msg_path, self.filename)
self.name = os.path.splitext(os.path.basename(msg_file))[0]
self.shortDescription = ""
self.longDescription = ""
self.fields = []
self.constantFields = dict()
self.commandConstants = dict()
self.enums = dict()
self.output_file = os.path.join(output_dir, f"{self.name}.md")
self.topics = []
self.errors = dict()
self.parseFile()
if args.errors:
#print(f"DEBUG: args.errors: {args.errors}")
if args.error_messages:
messages = args.error_messages.split(" ")
#print(f"DEBUG: args.errors: {messages},self.name: {self.name}")
if self.name in messages:
self.reportErrors()
#print(f"Debug: {self.name} in {messages}")
else:
self.reportErrors()
def reportErrors(self):
#print(f"Debug: UORBMessage: reportErrors()")
for errorType, errors in self.errors.items():
for error in errors:
error.display_error()
def markdown_out(self):
#print(f"Debug: UORBMessage: markdown_out()")
# Add page header (forces wide pages)
markdown = f"""---
pageClass: is-wide-page
---
# {self.name} (UORB message)
"""
## Append description info if present
markdown += f"{self.shortDescription}\n\n" if self.shortDescription else ""
markdown += f"{self.longDescription}\n\n" if self.longDescription else ""
topicList = " ".join(self.topics)
markdown += f"**TOPICS:** {topicList}\n\n"
# Generate field docs
markdown += f"## Fields\n\n"
markdown += "Name | Type | Unit [Frame] | Range/Enum | Description\n"
markdown += "--- | --- | --- | --- | ---\n"
for field in self.fields:
unit = f"{field.unit}" if field.unit else ""
frame = f"[{field.frameValue}]" if field.frameValue else ""
unit = f"{unit} {frame}"
unit.strip()
unit = f" {unit}"
value = " "
if field.enums:
value = ""
for enum in field.enums:
value += f"[{enum}](#{enum})"
value = value.strip()
value = f"{value}"
elif field.minValue or field.maxValue:
value = f"[{field.minValue if field.minValue else '-'} : {field.maxValue if field.maxValue else '-' }]"
description = f" {field.description}" if field.description else ""
invalid = f" (Invalid: {field.invalidValue}) " if field.invalidValue else ""
markdown += f"{field.name} | `{field.type}` |{unit}|{value}|{description}{invalid}\n"
# Generate table for command docs
if len(self.commandConstants) > 0:
#print("DEBUGCOMMAND")
markdown += f"\n## Commands\n\n"
"""
markdown += "Name | Type | Value | Description\n"
markdown += "--- | --- | --- |---\n"
for name, command in self.commandConstants.items():
description = f" {command.comment} " if enum.comment else " "
markdown += f'<a href="#{name}"></a> {name} | `{command.type}` | {command.value} |{description}\n'
"""
for commandConstant in self.commandConstants.values():
#print(commandConstant)
markdown += commandConstant.markdown_out()
# Generate enum docs
if len(self.enums) > 0:
markdown += f"\n## Enums\n"
for name, enum in self.enums.items():
markdown += f"\n### {name} {{#{name}}}\n\n"
markdown += "Name | Type | Value | Description\n"
markdown += "--- | --- | --- | ---\n"
for enumValueName, enumValue in enum.enumValues.items():
description = f" {enumValue.comment} " if enumValue.comment else " "
markdown += f'<a href="#{enumValueName}"></a> {enumValueName} | `{enumValue.type}` | {enumValue.value} |{description}\n'
# Generate table for constants docs
if len(self.constantFields) > 0:
markdown += f"\n## Constants\n\n"
markdown += "Name | Type | Value | Description\n"
markdown += "--- | --- | --- |---\n"
for name, enum in self.constantFields.items():
description = f" {enum.comment} " if enum.comment else " "
markdown += f'<a href="#{name}"></a> {name} | `{enum.type}` | {enum.value} |{description}\n'
# Append msg contents to the end
with open(self.msg_filename, 'r') as source_file:
msg_contents = source_file.read()
msg_contents = msg_contents.strip()
#Format markdown using msg name, comment, url, contents.
markdown += f"""
## Source Message
[Source file (GitHub)](https://github.com/PX4/PX4-Autopilot/blob/main/msg/{self.filename})
::: details Click here to see original file
```c
{msg_contents}
```
:::
"""
with open(self.output_file, 'w') as content_file:
content_file.write(markdown)
#exit()
def display_info(self):
print(f"UORBMessage: display_info")
print(f" name: {self.name}")
print(f" filename: {self.filename}, ")
print(f" msg_filename: {self.msg_filename}, ")
print(f"self.shortDescription: {self.shortDescription}")
print(f"self.longDescription: {self.longDescription}")
print(f"self.enums: {self.enums}")
for enum, enumObject in self.enums.items():
enumObject.display_info()
# Output our data so far
for field in self.fields:
field.display_info()
for enumvalue in self.constantFields:
print(enumvalue)
self.constantFields[enumvalue].display_info()
def handleField(self, line, line_number, parentMessage):
#print(f"debug: handleField: (line): \n {line}")
# Note, here we know we don't have a comment or a topic.
# We expect it to be a field.
# Check field doesn't have leading whitespace (trailing spaces already checked)
if line[:1].isspace(): # Returns True for ' ', '\t', '\n', '\r', etc.
#print("First character is whitespace")
error = Error("leading_whitespace_field_or_constant", self.filename, line_number, line)
if not "leading_whitespace_field_or_constant" in self.errors:
self.errors["leading_whitespace_field_or_constant"] = []
self.errors["leading_whitespace_field_or_constant"].append(error)
# Now we can parse the stripped line
fieldOrConstant = line.strip()
# Check that the field or constant has only single whitespace separators
stripped_fieldOrConstant = re.sub(r'\s+', ' ', fieldOrConstant) # Collapse all spaces to a single space (LHS already stripped).
if stripped_fieldOrConstant != fieldOrConstant:
#print("Field/Constant has multiple whitespace characters") # Since the collapsed version shows them.
error = Error("field_or_constant_has_multiple_whitepsace", self.filename, line_number, line)
if not "field_or_constant_has_multiple_whitepsace" in self.errors:
self.errors["field_or_constant_has_multiple_whitepsace"] = []
self.errors["field_or_constant_has_multiple_whitepsace"].append(error)
fieldOrConstant = stripped_fieldOrConstant
comment = None
if "#" in line:
commentExtract = line.split("#", 1) # Split once on left-most '#'
fieldOrConstant = commentExtract[0].strip()
comment = commentExtract[-1].strip()
if "=" not in fieldOrConstant:
# Is a field:
field = fieldOrConstant.split(" ")
type = field[0].strip()
name = field[1].strip()
field = MessageField(name, type, comment, line_number, parentMessage)
self.fields.append(field)
else:
temp = fieldOrConstant.split("=")
value = temp[-1]
typeAndName = temp[0].split(" ")
type = typeAndName[0]
name = typeAndName[1]
if name.startswith("VEHICLE_CMD_") and parentMessage.name == 'VehicleCommand': #it's a command.
#print(f"DEBUG: startswith VEHICLE_CMD_ {name}")
commandConstant = CommandConstant(name, type, value, comment, line_number, parentMessage)
#commandConstant.display_info()
self.commandConstants[name]=commandConstant
else: #it's a constant (or part of an enum)
constantField = ConstantValue(name, type, value, comment, line_number)
self.constantFields[name]=constantField
def parseFile(self):
initial_block_lines = []
#stopping_token = None
found_first_relevant_content = False
gettingInitialComments = False
gettingFields = False
with open(self.msg_filename, 'r', encoding='utf-8') as uorbfile:
lines = uorbfile.read().splitlines()
for line_number, line in enumerate(lines, 1):
if line != line.rstrip():
#print(f"[{self.filename}] Trailing whitespace on line {line_number}: XX{line}YY")
error = Error("trailing_whitespace", self.filename, line_number, line)
if not "trailing_whitespace" in self.errors:
self.errors["trailing_whitespace"] = []
self.errors["trailing_whitespace"].append(error)
#print(f"line: {line}")
stripped_line = re.sub(r'\s+', ' ', line).strip() # Collapse all spaces to a single space and strip stuff off end.
#print(f"stripped_line: {stripped_line}")
# TODO? Perhaps report whitespace if the size of those two is different and it is empty
# Or perhaps we just fix it on request
isEmptyLine = False if line.strip() else True
if not found_first_relevant_content and isEmptyLine: #Empty line
#print(f"{self.filename}: Empty line at start of file: [{line_number}]\n {line}")
error = Error("empty_start_line", self.filename, line_number, line)
if not "empty_start_line" in self.errors:
self.errors["empty_start_line"] = []
self.errors["empty_start_line"].append(error)
#error.display_error()
continue
if not found_first_relevant_content and not isEmptyLine:
found_first_relevant_content = True
if stripped_line.startswith("#"):
gettingInitialComments = True
else:
gettingInitialComments = False
gettingFields = True
if gettingInitialComments and stripped_line.startswith("#"):
stripped_line=stripped_line[1:].strip()
#print(f"DEBUG: gettingInitialComments: comment line: {stripped_line}")
initial_block_lines.append(stripped_line)
else:
gettingInitialComments = False
gettingFields = True #Getting fields and constants
if gettingFields:
if isEmptyLine:
continue # empty line
if stripped_line.startswith("# TOPICS "):
stripped_line = stripped_line[9:]
stripped_line = stripped_line.split(" ")
self.topics+= stripped_line
# Note, default topic and topic errors handled after all lines parsed
continue
if stripped_line.startswith("#"):
# Its an internal comment
stripped_line=stripped_line[1:].strip()
if stripped_line:
#print(f"{self.filename}: Internal comment: [{line_number}]\n {line}")
error = Error("internal_comment", self.filename, line_number, line)
if not "internal_comment" in self.errors:
self.errors["internal_comment"] = []
self.errors["internal_comment"].append(error)
else:
#print(f"{self.filename}: Empty internal comment: [{line_number}]\n {line}")
error = Error("internal_comment_empty", self.filename, line_number, line)
if not "internal_comment_empty" in self.errors:
self.errors["internal_comment_empty"] = []
self.errors["internal_comment_empty"].append(error)
#pass # Empty comment
continue
# Must be a field or a comment.
self.handleField(line, line_number, parentMessage=self)
# Fix up topics if the topic is empty
def camel_to_snake(name):
# Match upper case not at start of string
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
# Handle cases with multiple capital first letter
return re.sub('([A-Z]+)([A-Z][a-z]*)', r'\1_\2', s1).lower()
defaultTopic = camel_to_snake(self.name)
if len(self.topics) == 0:
# We have no topic declared, so set the default topic
self.topics.append(defaultTopic)
elif len(self.topics) == 1:
# We have 1 topic declared - either it is default or there is some issue.
if defaultTopic in self.topics:
# Declared topic is default topic
error = Error("topic_error", self.filename, "", f"WARNING: TOPIC {defaultTopic} unnecessarily declared for {self.name}")
else:
# Declared topic is not default topic
error = Error("topic_error", self.filename, "", f"NOTE: TOPIC {self.topics[1]}: Only Declared topic is not default topic {defaultTopic} for {self.name}")
if not "topic_error" in self.errors:
self.errors["topic_error"] = []
self.errors["topic_error"].append(error)
elif len(self.topics) > 1:
if defaultTopic not in self.topics:
error = Error("topic_error", self.filename, "", f"NOTE: TOPIC - Default topic {defaultTopic} for {self.name} not in {self.topics}")
# Parse our short and long description
#print(f"DEBUG: initial_block_lines: {initial_block_lines}")
doingLongDescription = False
for summaryline in initial_block_lines:
if not self.shortDescription and summaryline.strip() == '':
continue
if not doingLongDescription and not summaryline.strip() == '':
self.shortDescription += f" {summaryline}"
self.shortDescription = self.shortDescription.strip()
if not self.shortDescription[-1:] == ".": # Add terminating fullstop if not present.
self.shortDescription += "."
if not doingLongDescription and summaryline.strip() == '':
doingLongDescription = True
continue
if doingLongDescription:
self.longDescription += f"{summaryline}\n"
if self.longDescription:
self.longDescription.strip()
if not self.shortDescription:
# Summary has not been defined
error = Error("summary_missing", self.filename)
if not "summary_missing" in self.errors:
self.errors["summary_missing"] = []
self.errors["summary_missing"].append(error)
# TODO Parse our constantValues into enums, leaving only constants
constantValuesToRemove = []
#print(f"DEBUG: Self.enums: {self.enums}")
for enumName, enumObject in self.enums.items():
for enumValueName, enumValueObject in self.constantFields.items():
if enumValueName.startswith(enumName):
# Copy this value into the object (cant be duplicate because parent is dict)
enumObject.enumValues[enumValueName]=enumValueObject
constantValuesToRemove.append(enumValueName)
# Now delete the original enumvalues
for enumValName in constantValuesToRemove:
del self.constantFields[enumValName]
constantsNotAssignedToEnums = len(self.constantFields)
if constantsNotAssignedToEnums > 0:
#print(f"Debug: WARNING constantsNotAssignedToEnums: {constantsNotAssignedToEnums}")
for enumValueName, enumValue in self.constantFields.items():
if enumValueName in ALLOWED_CONSTANTS_NOT_IN_ENUM: # Ignore constants
pass
else:
error = Error("constant_not_in_assigned_enum", self.filename, enumValue.line_number, enumValueName)
if not "constant_not_in_assigned_enum" in self.errors:
self.errors["constant_not_in_assigned_enum"] = []
self.errors["constant_not_in_assigned_enum"].append(error)
# TODO Maybe present as list of possible enums.
import yaml
@@ -127,83 +924,50 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Generate docs from .msg files')
parser.add_argument('-d', dest='dir', help='output directory', required=True)
parser.add_argument('-e', dest='errors', action='store_true', help='Report errors')
parser.add_argument('-m', dest='error_messages', help='Message to report errors against (by default all)')
args = parser.parse_args()
output_dir = args.dir
if not os.path.isdir(output_dir):
print(f"making output_dir {output_dir}")
os.mkdir(output_dir)
msg_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../../msg")
msg_files = get_msgs_list(msg_path)
msg_files.sort()
versioned_msgs_list = ''
unversioned_msgs_list = ''
msgTypes = set()
for msg_file in msg_files:
# Add messages to set of allowed types (compound types)
#msg_type = msg_file.rsplit('/')[-1]
#msg_type = msg_type.rsplit('\\')[-1]
#msg_type = msg_type.rsplit('.')[0]
msg_name = os.path.splitext(os.path.basename(msg_file))[0]
output_file = os.path.join(output_dir, msg_name+'.md')
msg_filename = os.path.join(msg_path, msg_file)
print("{:} -> {:}".format(msg_filename, output_file))
msgTypes.add(msg_name)
#Format msg url
msg_url="[source file](https://github.com/PX4/PX4-Autopilot/blob/main/msg/%s)" % msg_file
msg_description = ""
summary_description = ""
#Get msg description (first non-empty comment line from top of msg)
with open(msg_filename, 'r') as lineparser:
line = lineparser.readline()
while line.startswith('#') or (line.strip() == ''):
print('DEBUG: line: %s' % line)
line=line[1:].strip()+'\n'
stripped_line=line.strip()
if msg_description and not summary_description and stripped_line=='':
summary_description = msg_description.strip()
msg_description+=line
line = lineparser.readline()
msg_description=msg_description.strip()
if not summary_description and msg_description:
summary_description = msg_description
print('msg_description: Z%sZ' % msg_description)
print('summary_description: Z%sZ' % summary_description)
summary_description
msg_contents = ""
#Get msg contents (read the file)
with open(msg_filename, 'r') as source_file:
msg_contents = source_file.read()
#Format markdown using msg name, comment, url, contents.
markdown_output="""# %s (UORB message)
%s
%s
```c
%s
```
""" % (msg_name, msg_description, msg_url, msg_contents)
with open(output_file, 'w') as content_file:
content_file.write(markdown_output)
for msg_file in msg_files:
message = UORBMessage(msg_file)
# Any additional tests that can't be in UORBMessage parser go here.
message.markdown_out()
# Categorize as versioned or unversioned
if "versioned" in msg_file:
versioned_msgs_list += '- [%s](%s.md)' % (msg_name, msg_name)
if summary_description:
versioned_msgs_list += "%s" % summary_description
versioned_msgs_list += f"- [{message.name}]({message.name}.md)"
if message.shortDescription:
versioned_msgs_list += f"{message.shortDescription}"
versioned_msgs_list += "\n"
else:
unversioned_msgs_list += '- [%s](%s.md)' % (msg_name, msg_name)
if summary_description:
unversioned_msgs_list += "%s" % summary_description
unversioned_msgs_list += f"- [{message.name}]({message.name}.md)"
if message.shortDescription:
unversioned_msgs_list += f"{message.shortDescription}"
unversioned_msgs_list += "\n"
# Write out the index.md file
index_text="""# uORB Message Reference
index_text=f"""# uORB Message Reference
::: info
This list is [auto-generated](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/msg/generate_msg_docs.py) from the source code.
@@ -218,14 +982,14 @@ Graphs showing how these are used [can be found here](../middleware/uorb_graph.m
## Versioned Messages
%s
{versioned_msgs_list}
## Unversioned Messages
%s
""" % (versioned_msgs_list, unversioned_msgs_list)
{unversioned_msgs_list}
"""
index_file = os.path.join(output_dir, 'index.md')
with open(index_file, 'w') as content_file:
with open(index_file, 'w', encoding='utf-8') as content_file:
content_file.write(index_text)
generate_dds_yaml_doc(msg_files)
+2
View File
@@ -1138,6 +1138,8 @@ if num_mags >= 1:
if not math.isnan(sensor_mag_0['temperature'][0]):
mag_0_params['TC_M0_ID'] = int(np.median(sensor_mag_0['device_id']))
# find the min, max and reference temperature
mag_0_params['TC_M0_TMIN'] = np.amin(sensor_mag_0['temperature'])
mag_0_params['TC_M0_TMAX'] = np.amax(sensor_mag_0['temperature'])
+2113
View File
File diff suppressed because it is too large Load Diff
-947
View File
@@ -1,947 +0,0 @@
#!/usr/bin/env python3
############################################################################
#
# Copyright (c) 2012-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.
#
############################################################################
#
# Serial firmware uploader for the PX4FMU bootloader
#
# The PX4 firmware file is a JSON-encoded Python object, containing
# metadata fields and a zlib-compressed base64-encoded firmware image.
#
# The uploader uses the following fields from the firmware file:
#
# image
# The firmware that will be uploaded.
# image_size
# The size of the firmware in bytes.
# board_id
# The board for which the firmware is intended.
# board_revision
# Currently only used for informational purposes.
#
import sys
import argparse
import binascii
import socket
import struct
import json
import zlib
import base64
import time
import array
import os
from sys import platform as _platform
try:
import serial
except ImportError as e:
print(f"Failed to import serial: {e}")
print("")
print("You may need to install it using:")
print(" python -m pip install pyserial")
print("")
sys.exit(1)
# Detect python version
if sys.version_info[0] < 3:
raise RuntimeError("Python 2 is not supported. Please try again using Python 3.")
sys.exit(1)
# Use monotonic time where available
def _time():
try:
return time.monotonic()
except Exception:
return time.time()
class FirmwareNotSuitableException(Exception):
def __init__(self, message):
super(FirmwareNotSuitableException, self).__init__(message)
class firmware(object):
'''Loads a firmware file'''
desc = {}
image = bytes()
def __init__(self, path):
# read the file
f = open(path, "r")
self.desc = json.load(f)
f.close()
self.image = bytearray(zlib.decompress(base64.b64decode(self.desc['image'])))
# pad image to 4-byte length
while ((len(self.image) % 4) != 0):
self.image.extend(b'\xff')
def property(self, propname):
return self.desc[propname]
def crc(self, padlen):
state = 0xFFFFFFFF
state = zlib.crc32(self.image, state)
padding_length = padlen - len(self.image)
if padding_length > 0:
padding = b'\xff' * padding_length
state = zlib.crc32(padding, state)
return (state ^ 0xFFFFFFFF) & 0xFFFFFFFF
class uploader:
'''Uploads a firmware file to the PX4 bootloader'''
# protocol bytes
INSYNC = b'\x12'
EOC = b'\x20'
# reply bytes
OK = b'\x10'
FAILED = b'\x11'
INVALID = b'\x13' # rev3+
BAD_SILICON_REV = b'\x14' # rev5+
# command bytes
NOP = b'\x00' # guaranteed to be discarded by the bootloader
GET_SYNC = b'\x21'
GET_DEVICE = b'\x22'
CHIP_ERASE = b'\x23'
CHIP_VERIFY = b'\x24' # rev2 only
PROG_MULTI = b'\x27'
READ_MULTI = b'\x28' # rev2 only
GET_CRC = b'\x29' # rev3+
GET_OTP = b'\x2a' # rev4+ , get a word from OTP area
GET_SN = b'\x2b' # rev4+ , get a word from SN area
GET_CHIP = b'\x2c' # rev5+ , get chip version
SET_BOOT_DELAY = b'\x2d' # rev5+ , set boot delay
GET_CHIP_DES = b'\x2e' # rev5+ , get chip description in ASCII
GET_VERSION = b'\x2f' # rev5+ , get bootloader version in ASCII
CHIP_FULL_ERASE = b'\x40' # full erase of flash, rev6+
MAX_DES_LENGTH = 20
REBOOT = b'\x30'
INFO_BL_REV = b'\x01' # bootloader protocol revision
BL_REV_MIN = 2 # minimum supported bootloader protocol
BL_REV_MAX = 5 # maximum supported bootloader protocol
INFO_BOARD_ID = b'\x02' # board type
INFO_BOARD_REV = b'\x03' # board revision
INFO_FLASH_SIZE = b'\x04' # max firmware size in bytes
PROG_MULTI_MAX = 252 # protocol max is 255, must be multiple of 4
READ_MULTI_MAX = 252 # protocol max is 255
NSH_INIT = bytearray(b'\x0d\x0d\x0d')
NSH_REBOOT_BL = b"reboot -b\n"
NSH_REBOOT = b"reboot\n"
MAVLINK_REBOOT_ID1 = bytearray(b'\xfe\x21\x72\xff\x00\x4c\x00\x00\x40\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x00\x01\x00\x00\x53\x6b')
MAVLINK_REBOOT_ID0 = bytearray(b'\xfe\x21\x45\xff\x00\x4c\x00\x00\x40\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x00\x00\x00\x00\xcc\x37')
MAX_FLASH_PRGRAM_TIME = 0.001 # Time on an F7 to send SYNC, RESULT from last data in multi RXed
def __init__(self, portname, baudrate_bootloader, baudrate_flightstack):
# Open the port, keep the default timeout short so we can poll quickly.
# On some systems writes can suddenly get stuck without having a
# write_timeout > 0 set.
# chartime 8n1 * bit rate is us
self.chartime = 10 * (1.0 / baudrate_bootloader)
# we use a window approche to SYNC,<result> gathring
self.window = 0
self.window_max = 256
self.window_per = 2 # Sync,<result>
self.ackWindowedMode = False # Assume Non Widowed mode for all USB CDC
self.port = serial.Serial(portname, baudrate_bootloader, timeout=0.5, write_timeout=0)
self.otp = b''
self.sn = b''
self.baudrate_bootloader = baudrate_bootloader
self.baudrate_flightstack = baudrate_flightstack
self.baudrate_flightstack_idx = -1
self.force_erase = False
def close(self):
if self.port is not None:
self.port.close()
def open(self):
# upload timeout
timeout = _time() + 0.2
# attempt to open the port while it exists and until timeout occurs
while self.port is not None:
portopen = True
try:
portopen = self.port.is_open
except AttributeError:
portopen = self.port.isOpen()
if not portopen and _time() < timeout:
try:
self.port.open()
except OSError:
# wait for the port to be ready
time.sleep(0.04)
except serial.SerialException:
# if open fails, try again later
time.sleep(0.04)
else:
break
# debugging code
def __probe(self, state):
# self.port.setRTS(state)
return
def __send(self, c):
# print("send " + binascii.hexlify(c))
self.port.write(c)
def __recv(self, count=1):
c = self.port.read(count)
if len(c) < 1:
raise RuntimeError("timeout waiting for data (%u bytes)" % count)
# print("recv " + binascii.hexlify(c))
return c
def __recv_int(self):
raw = self.__recv(4)
val = struct.unpack("<I", raw)
return val[0]
def __getSync(self, doFlush=True):
if (doFlush):
self.port.flush()
c = bytes(self.__recv())
if c != self.INSYNC:
raise RuntimeError("unexpected %s instead of INSYNC" % c)
c = self.__recv()
if c == self.INVALID:
raise RuntimeError("bootloader reports INVALID OPERATION")
if c == self.FAILED:
raise RuntimeError("bootloader reports OPERATION FAILED")
if c != self.OK:
raise RuntimeError("unexpected response 0x%x instead of OK" % ord(c))
# The control flow for receiving Sync is on the order of 16 Ms per Sync
# This will validate all the SYNC,<results> for a window of programing
# in about 13.81 Ms for 256 blocks written
def __ackSyncWindow(self, count):
if (count > 0):
data = bytearray(bytes(self.__recv(count)))
if (len(data) != count):
raise RuntimeError("Ack Window %i not %i " % (len(data), count))
for i in range(0, len(data), 2):
if bytes([data[i]]) != self.INSYNC:
raise RuntimeError("unexpected %s instead of INSYNC" % data[i])
if bytes([data[i+1]]) == self.INVALID:
raise RuntimeError("bootloader reports INVALID OPERATION")
if bytes([data[i+1]]) == self.FAILED:
raise RuntimeError("bootloader reports OPERATION FAILED")
if bytes([data[i+1]]) != self.OK:
raise RuntimeError("unexpected response 0x%x instead of OK" % ord(data[i+1]))
# attempt to get back into sync with the bootloader
def __sync(self):
# send a stream of ignored bytes longer than the longest possible conversation
# that we might still have in progress
# self.__send(uploader.NOP * (uploader.PROG_MULTI_MAX + 2))
self.port.flushInput()
self.__send(uploader.GET_SYNC +
uploader.EOC)
self.__getSync()
def __trySync(self):
try:
self.port.flush()
if (self.__recv() != self.INSYNC):
# print("unexpected 0x%x instead of INSYNC" % ord(c))
return False
c = self.__recv()
if (c == self.BAD_SILICON_REV):
raise NotImplementedError()
if (c != self.OK):
# print("unexpected 0x%x instead of OK" % ord(c))
return False
return True
except NotImplementedError:
raise RuntimeError("Programing not supported for this version of silicon!\n"
"See https://docs.px4.io/main/en/flight_controller/silicon_errata.html")
except RuntimeError:
# timeout, no response yet
return False
# attempt to determins if the device is CDCACM or A FTDI
def __determineInterface(self):
self.port.flushInput()
# Set a baudrate that can not work on a real serial port
# in that it is 233% off.
try:
self.port.baudrate = self.baudrate_bootloader * 2.33
except NotImplementedError as e:
# This error can occur because pySerial on Windows does not support odd baudrates
print(f"{e} -> could not check for FTDI device, assuming USB connection")
return
self.__send(uploader.GET_SYNC +
uploader.EOC)
try:
self.__getSync(False)
except RuntimeError:
# if it fails we are on a real serial port - only leave this enabled on Windows
if sys.platform.startswith('win'):
self.ackWindowedMode = True
finally:
try:
self.port.baudrate = self.baudrate_bootloader
except Exception:
pass
# send the GET_DEVICE command and wait for an info parameter
def __getInfo(self, param):
self.__send(uploader.GET_DEVICE + param + uploader.EOC)
value = self.__recv_int()
self.__getSync()
return value
# send the GET_OTP command and wait for an info parameter
def __getOTP(self, param):
t = struct.pack("I", param) # int param as 32bit ( 4 byte ) char array.
self.__send(uploader.GET_OTP + t + uploader.EOC)
value = self.__recv(4)
self.__getSync()
return value
# send the GET_SN command and wait for an info parameter
def __getSN(self, param):
t = struct.pack("I", param) # int param as 32bit ( 4 byte ) char array.
self.__send(uploader.GET_SN + t + uploader.EOC)
value = self.__recv(4)
self.__getSync()
return value
# send the GET_CHIP command
def __getCHIP(self):
self.__send(uploader.GET_CHIP + uploader.EOC)
value = self.__recv_int()
self.__getSync()
return value
# send the GET_CHIP command
def __getCHIPDes(self):
self.__send(uploader.GET_CHIP_DES + uploader.EOC)
length = self.__recv_int()
value = self.__recv(length)
self.__getSync()
pieces = value.split(b",")
return pieces
def __getVersion(self):
self.__send(uploader.GET_VERSION + uploader.EOC)
try:
length = self.__recv_int()
value = self.__recv(length)
self.__getSync()
except RuntimeError:
# Bootloader doesn't support version call
return "unknown"
return value.decode()
def __drawProgressBar(self, label, progress, maxVal):
if maxVal < progress:
progress = maxVal
percent = (float(progress) / float(maxVal)) * 100.0
redraw = "\r" if sys.stdout.isatty() else "\n"
sys.stdout.write("%s%s: [%-20s] %.1f%%" % (redraw, label, '='*int(percent/5.0), percent))
sys.stdout.flush()
# send the CHIP_ERASE command and wait for the bootloader to become ready
def __erase(self, label):
print(f"Windowed mode: {self.ackWindowedMode}")
print("\n", end='')
if self.force_erase:
print("Trying force erase of full chip...\n")
self.__send(uploader.CHIP_FULL_ERASE +
uploader.EOC)
else:
self.__send(uploader.CHIP_ERASE +
uploader.EOC)
# erase is very slow, give it 30s
deadline = _time() + 30.0
while _time() < deadline:
usualEraseDuration = 15.0
estimatedTimeRemaining = deadline-_time()
if estimatedTimeRemaining >= usualEraseDuration:
self.__drawProgressBar(label, 30.0-estimatedTimeRemaining, usualEraseDuration)
else:
self.__drawProgressBar(label, 10.0, 10.0)
sys.stdout.write(" (timeout: %d seconds) " % int(deadline-_time()))
sys.stdout.flush()
if self.__trySync():
self.__drawProgressBar(label, 10.0, 10.0)
if self.force_erase:
print("\nForce erase done.\n")
return
if self.force_erase:
raise RuntimeError("timed out waiting for erase, force erase is likely not supported by bootloader!")
else:
raise RuntimeError("timed out waiting for erase")
# send a PROG_MULTI command to write a collection of bytes
def __program_multi(self, data, windowMode):
length = len(data).to_bytes(1, byteorder='big')
self.__send(uploader.PROG_MULTI)
self.__send(length)
self.__send(data)
self.__send(uploader.EOC)
if (not windowMode):
self.__getSync(False)
else:
# The following is done to have minimum delay on the transmission
# of the ne fw. The per block cost of __getSync was about 16 mS per.
# Passively wait on Sync and Result using board rates and
# N.B. attempts to activly wait on InWating still carried 8 mS of overhead
self.__probe(False)
self.__probe(True)
time.sleep((ord(length) * self.chartime) + uploader.MAX_FLASH_PRGRAM_TIME)
self.__probe(False)
# verify multiple bytes in flash
def __verify_multi(self, data):
length = len(data).to_bytes(1, byteorder='big')
self.__send(uploader.READ_MULTI)
self.__send(length)
self.__send(uploader.EOC)
self.port.flush()
programmed = self.__recv(len(data))
if programmed != data:
print("got " + binascii.hexlify(programmed))
print("expect " + binascii.hexlify(data))
return False
self.__getSync()
return True
# send the reboot command
def __reboot(self):
self.__send(uploader.REBOOT +
uploader.EOC)
self.port.flush()
# v3+ can report failure if the first word flash fails
if self.bl_rev >= 3:
self.__getSync()
# split a sequence into a list of size-constrained pieces
def __split_len(self, seq, length):
return [seq[i:i+length] for i in range(0, len(seq), length)]
# upload code
def __program(self, label, fw):
self.__probe(False)
print("\n", end='')
code = fw.image
groups = self.__split_len(code, uploader.PROG_MULTI_MAX)
# Give imedate feedback
self.__drawProgressBar(label, 0, len(groups))
uploadProgress = 0
for bytes in groups:
self.__program_multi(bytes, self.ackWindowedMode)
# If in Window mode, extend the window size for the __ackSyncWindow
if self.ackWindowedMode:
self.window += self.window_per
# Print upload progress (throttled, so it does not delay upload progress)
uploadProgress += 1
if uploadProgress % 256 == 0:
self.__probe(True)
self.__probe(False)
self.__probe(True)
self.__ackSyncWindow(self.window)
self.__probe(False)
self.window = 0
self.__drawProgressBar(label, uploadProgress, len(groups))
# Do any remaining fragment
self.__ackSyncWindow(self.window)
self.window = 0
self.__drawProgressBar(label, 100, 100)
# verify code
def __verify_v2(self, label, fw):
print("\n", end='')
self.__send(uploader.CHIP_VERIFY +
uploader.EOC)
self.__getSync()
code = fw.image
groups = self.__split_len(code, uploader.READ_MULTI_MAX)
verifyProgress = 0
for bytes in groups:
verifyProgress += 1
if verifyProgress % 256 == 0:
self.__drawProgressBar(label, verifyProgress, len(groups))
if (not self.__verify_multi(bytes)):
raise RuntimeError("Verification failed")
self.__drawProgressBar(label, 100, 100)
def __verify_v3(self, label, fw):
print("\n", end='')
self.__drawProgressBar(label, 1, 100)
expect_crc = fw.crc(self.fw_maxsize)
self.__send(uploader.GET_CRC + uploader.EOC)
time.sleep(0.5)
report_crc = self.__recv_int()
self.__getSync()
if report_crc != expect_crc:
print("Expected 0x%x" % expect_crc)
print("Got 0x%x" % report_crc)
raise RuntimeError("Program CRC failed")
self.__drawProgressBar(label, 100, 100)
def __set_boot_delay(self, boot_delay):
self.__send(uploader.SET_BOOT_DELAY +
struct.pack("b", boot_delay) +
uploader.EOC)
self.__getSync()
# get basic data about the board
def identify(self):
self.__determineInterface()
# make sure we are in sync before starting
self.__sync()
# get the bootloader protocol ID first
self.bl_rev = self.__getInfo(uploader.INFO_BL_REV)
if (self.bl_rev < uploader.BL_REV_MIN) or (self.bl_rev > uploader.BL_REV_MAX):
print("Unsupported bootloader protocol %d" % uploader.INFO_BL_REV)
raise RuntimeError("Bootloader protocol mismatch")
self.board_type = self.__getInfo(uploader.INFO_BOARD_ID)
self.board_rev = self.__getInfo(uploader.INFO_BOARD_REV)
self.fw_maxsize = self.__getInfo(uploader.INFO_FLASH_SIZE)
self.version = self.__getVersion()
# upload the firmware
def upload(self, fw_list, force=False, boot_delay=None, boot_check=False, force_erase=False):
self.force_erase = force_erase
# select correct binary
found_suitable_firmware = False
for file in fw_list:
fw = firmware(file)
if self.board_type == fw.property('board_id'):
if len(fw_list) > 1: print("using firmware binary {}".format(file))
found_suitable_firmware = True
break
if not found_suitable_firmware:
msg = "Firmware not suitable for this board (Firmware board_type=%u board_id=%u)" % (
self.board_type, fw.property('board_id'))
print("WARNING: %s" % msg)
if force:
if len(fw_list) > 1:
raise FirmwareNotSuitableException("force flashing failed, more than one file provided, none suitable")
print("FORCED WRITE, FLASHING ANYWAY!")
else:
raise FirmwareNotSuitableException(msg)
percent = fw.property('image_size') / fw.property('image_maxsize')
binary_size = float(fw.property('image_size'))
binary_max_size = float(fw.property('image_maxsize'))
percent = (binary_size / binary_max_size) * 100
print("Loaded firmware for board id: %s,%s size: %d bytes (%.2f%%) " % (fw.property('board_id'), fw.property('board_revision'), fw.property('image_size'), percent))
print()
print(f"Bootloader version: {self.version}")
# Make sure we are doing the right thing
start = _time()
if self.board_type != fw.property('board_id'):
msg = "Firmware not suitable for this board (Firmware board_type=%u board_id=%u)" % (
self.board_type, fw.property('board_id'))
print("WARNING: %s" % msg)
if force:
print("FORCED WRITE, FLASHING ANYWAY!")
else:
raise FirmwareNotSuitableException(msg)
# Prevent uploads where the image would overflow the flash
if self.fw_maxsize < fw.property('image_size'):
raise RuntimeError("Firmware image is too large for this board")
# OTP added in v4:
if self.bl_rev >= 4:
for byte in range(0, 32*6, 4):
x = self.__getOTP(byte)
self.otp = self.otp + x
# print(binascii.hexlify(x).decode('Latin-1') + ' ', end='')
# see src/modules/systemlib/otp.h in px4 code:
self.otp_id = self.otp[0:4]
self.otp_idtype = self.otp[4:5]
self.otp_vid = self.otp[8:4:-1]
self.otp_pid = self.otp[12:8:-1]
self.otp_coa = self.otp[32:160]
# show user:
try:
print("Sn: ", end='')
for byte in range(0, 12, 4):
x = self.__getSN(byte)
x = x[::-1] # reverse the bytes
self.sn = self.sn + x
print(binascii.hexlify(x).decode('Latin-1'), end='') # show user
print('')
print("Chip: %08x" % self.__getCHIP())
otp_id = self.otp_id.decode('Latin-1')
if ("PX4" in otp_id):
print("OTP id: " + otp_id)
print("OTP idtype: " + binascii.b2a_qp(self.otp_idtype).decode('Latin-1'))
print("OTP vid: " + binascii.hexlify(self.otp_vid).decode('Latin-1'))
print("OTP pid: " + binascii.hexlify(self.otp_pid).decode('Latin-1'))
print("OTP coa: " + binascii.b2a_base64(self.otp_coa).decode('Latin-1'))
except Exception as e:
# ignore bad character encodings
print(f"Exception ignored: {e}")
pass
# Silicon errata check was added in v5
if (self.bl_rev >= 5):
des = self.__getCHIPDes()
if (len(des) == 2):
family, revision = des
print(f"Family: {family.decode()}")
print(f"Revision: {revision.decode()}")
print(f"Flash: {self.fw_maxsize} bytes")
# Prevent uploads where the maximum image size of the board config is smaller than the flash
# of the board. This is a hint the user chose the wrong config and will lack features
# for this particular board.
# This check should also check if the revision is an unaffected revision
# and thus can support the full flash, see
# https://github.com/PX4/Firmware/blob/master/src/drivers/boards/common/stm32/board_mcu_version.c#L125-L144
if self.fw_maxsize > fw.property('image_maxsize') and not force:
print(f"WARNING: Board can accept larger flash images ({self.fw_maxsize} bytes) than board config ({fw.property('image_maxsize')} bytes)")
else:
# If we're still on bootloader v4 on a Pixhawk, we don't know if we
# have the silicon errata and therefore need to flash px4_fmu-v2
# with 1MB flash or if it supports px4_fmu-v3 with 2MB flash.
if fw.property('board_id') == 9 \
and fw.property('image_size') > 1032192 \
and not force:
raise RuntimeError("\nThe Board uses bootloader revision 4 and can therefore not determine\n"
"if flashing more than 1 MB (px4_fmu-v3_default) is safe, chances are\n"
"high that it is not safe! If unsure, use px4_fmu-v2_default.\n"
"\n"
"If you know you that the board does not have the silicon errata, use\n"
"this script with --force, or update the bootloader. If you are invoking\n"
"upload using make, you can use force-upload target to force the upload.\n")
self.__erase("Erase ")
self.__program("Program", fw)
if self.bl_rev == 2:
self.__verify_v2("Verify ", fw)
else:
self.__verify_v3("Verify ", fw)
if boot_delay is not None:
self.__set_boot_delay(boot_delay)
print("\nRebooting.", end='')
self.__reboot()
self.port.close()
print(" Elapsed Time %3.3f\n" % (_time() - start))
def __next_baud_flightstack(self):
if self.baudrate_flightstack_idx + 1 >= len(self.baudrate_flightstack):
return False
try:
self.port.baudrate = self.baudrate_flightstack[self.baudrate_flightstack_idx + 1]
self.baudrate_flightstack_idx = self.baudrate_flightstack_idx + 1
except serial.SerialException:
# Sometimes _configure_port fails
time.sleep(0.04)
return True
def send_protocol_splitter_format(self, data):
# Header Structure:
# bits: 1 2 3 4 5 6 7 8
# header[0] - | Magic | (='S')
# header[1] - |T| LenH | (T - 0: mavlink; 1: rtps)
# header[2] - | LenL |
# header[3] - | Checksum |
MAGIC = 83
len_bytes = len(data).to_bytes(2, "big")
LEN_H = len_bytes[0] & 127
LEN_L = len_bytes[1] & 255
CHECKSUM = MAGIC ^ LEN_H ^ LEN_L
header_ints = [MAGIC, LEN_H, LEN_L, CHECKSUM]
header_bytes = struct.pack("{}B".format(len(header_ints)), *header_ints)
self.__send(header_bytes)
self.__send(data)
def send_reboot(self, use_protocol_splitter_format=False):
if (not self.__next_baud_flightstack()):
return False
print("Attempting reboot on %s with baudrate=%d..." % (self.port.port, self.port.baudrate), file=sys.stderr)
if "ttyS" in self.port.port:
print("If the board does not respond, check the connection to the Flight Controller")
else:
print("If the board does not respond, unplug and re-plug the USB connector.", file=sys.stderr)
try:
send_fct = self.__send
if use_protocol_splitter_format:
send_fct = self.send_protocol_splitter_format
# try MAVLINK command first
self.port.flush()
send_fct(uploader.MAVLINK_REBOOT_ID1)
send_fct(uploader.MAVLINK_REBOOT_ID0)
# then try reboot via NSH
send_fct(uploader.NSH_INIT)
send_fct(uploader.NSH_REBOOT_BL)
send_fct(uploader.NSH_INIT)
send_fct(uploader.NSH_REBOOT)
self.port.flush()
self.port.baudrate = self.baudrate_bootloader
except Exception:
try:
self.port.flush()
self.port.baudrate = self.baudrate_bootloader
except Exception:
pass
return True
def main():
# Parse commandline arguments
parser = argparse.ArgumentParser(description="Firmware uploader for the PX autopilot system.")
parser.add_argument('--port', action="store", required=True, help="Comma-separated list of serial port(s) to which the FMU may be attached")
parser.add_argument('--baud-bootloader', action="store", type=int, default=115200, help="Baud rate of the serial port (default is 115200) when communicating with bootloader, only required for true serial ports.")
parser.add_argument('--baud-flightstack', action="store", default="57600", help="Comma-separated list of baud rate of the serial port (default is 57600) when communicating with flight stack (Mavlink or NSH), only required for true serial ports.")
parser.add_argument('--force', action='store_true', default=False, help='Override board type check, or silicon errata checks and continue loading')
parser.add_argument('--force-erase', action="store_true", help="Do not perform the blank check, always erase every sector of the application space")
parser.add_argument('--boot-delay', type=int, default=None, help='minimum boot delay to store in flash')
parser.add_argument('--use-protocol-splitter-format', action='store_true', help='use protocol splitter format for reboot')
parser.add_argument('firmware', action="store", nargs='+', help="Firmware file(s)")
args = parser.parse_args()
if args.use_protocol_splitter_format:
print("Using protocol splitter format to reboot pixhawk!")
# warn people about ModemManager which interferes badly with Pixhawk
if os.path.exists("/usr/sbin/ModemManager"):
print("==========================================================================================================")
print("WARNING: You should uninstall ModemManager as it conflicts with any non-modem serial device (like Pixhawk)")
print("==========================================================================================================")
print("Waiting for bootloader...")
# tell any GCS that might be connected to the autopilot to give up
# control of the serial port
# send to localhost and default GCS port
ipaddr = '127.0.0.1'
portnum = 14550
# COMMAND_LONG in MAVLink 1
heartbeatpacket = bytearray.fromhex('fe097001010000000100020c5103033c8a')
commandpacket = bytearray.fromhex('fe210101014c00000000000000000000000000000000000000000000803f00000000f6000000008459')
# initialize an UDP socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# send heartbeat to initialize connection and command to free the link
s.sendto(heartbeatpacket, (ipaddr, portnum))
s.sendto(commandpacket, (ipaddr, portnum))
# close the socket
s.close()
# Spin waiting for a device to show up
try:
while True:
portlist = []
patterns = args.port.split(",")
# on unix-like platforms use glob to support wildcard ports. This allows
# the use of /dev/serial/by-id/usb-3D_Robotics on Linux, which prevents the upload from
# causing modem hangups etc
if "linux" in _platform or "darwin" in _platform or "cygwin" in _platform:
import glob
for pattern in patterns:
portlist += glob.glob(pattern)
else:
portlist = patterns
baud_flightstack = [int(x) for x in args.baud_flightstack.split(',')]
successful = False
unsuitable_board = False
for port in portlist:
# print("Trying %s" % port)
# create an uploader attached to the port
try:
if "linux" in _platform:
# Linux, don't open Mac OS and Win ports
if "COM" not in port and "tty.usb" not in port:
up = uploader(port, args.baud_bootloader, baud_flightstack)
elif "darwin" in _platform:
# OS X, don't open Windows and Linux ports
if "COM" not in port and "ACM" not in port:
up = uploader(port, args.baud_bootloader, baud_flightstack)
elif "cygwin" in _platform:
# Cygwin, don't open native Windows COM and Linux ports
if "COM" not in port and "ACM" not in port:
up = uploader(port, args.baud_bootloader, baud_flightstack)
elif "win" in _platform:
# Windows, don't open POSIX ports
if "/" not in port:
up = uploader(port, args.baud_bootloader, baud_flightstack)
except Exception as e:
# open failed, rate-limit our attempts
time.sleep(0.05)
print(f"Exception ignored: {e}")
# and loop to the next port
continue
found_bootloader = False
while True:
up.open()
# port is open, try talking to it
try:
# identify the bootloader
up.identify()
found_bootloader = True
print()
print(f"Found board id: {up.board_type},{up.board_rev} bootloader protocol revision {up.bl_rev} on {port}")
break
except (RuntimeError, serial.SerialException):
if not up.send_reboot(args.use_protocol_splitter_format):
break
# wait for the reboot, without we might run into Serial I/O Error 5
time.sleep(0.25)
# always close the port
up.close()
# wait for the close, without we might run into Serial I/O Error 6
time.sleep(0.3)
if not found_bootloader:
# Go to the next port
continue
try:
# ok, we have a bootloader, try flashing it
up.upload(args.firmware, force=args.force, boot_delay=args.boot_delay, force_erase=args.force_erase)
# if we made this far without raising exceptions, the upload was successful
successful = True
except RuntimeError as e:
# print the error
print(f"\n\nError: {e}")
except FirmwareNotSuitableException:
unsuitable_board = True
up.close()
continue
except IOError:
up.close()
continue
finally:
# always close the port
up.close()
# we could loop here if we wanted to wait for more boards...
if successful:
sys.exit(0)
else:
sys.exit(1)
if unsuitable_board:
# If we land here, we went through all ports, did not flash any
# board and found at least one unsuitable board.
# Exit with 2, so a caller can distinguish from other errors
sys.exit(2)
# Delay retries to < 20 Hz to prevent spin-lock from hogging the CPU
time.sleep(0.05)
# CTRL+C aborts the upload/spin-lock by interrupt mechanics
except KeyboardInterrupt:
print("\n Upload aborted by user.")
sys.exit(0)
if __name__ == '__main__':
main()
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
+4 -2
View File
@@ -176,8 +176,10 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
echo
echo "Fetching Xtensa compilers"
wget -q -P $DIR https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.xz
sudo tar -xf $DIR/xtensa-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.xz -C /opt
XTENSA_FILE_NAME=xtensa-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.xz
wget -q -P $DIR https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/$XTENSA_FILE_NAME
sudo tar -xf $DIR/$XTENSA_FILE_NAME -C /opt
rm $DIR/$XTENSA_FILE_NAME
echo 'export PATH=$PATH:/opt/xtensa-esp-elf/bin/' >> /home/$USER/.bashrc
fi
+1
View File
@@ -31,6 +31,7 @@ CONFIG_UAVCANNODE_ESC_RAW_COMMAND=y
CONFIG_UAVCANNODE_ESC_STATUS=y
CONFIG_UAVCANNODE_FLOW_MEASUREMENT=y
CONFIG_UAVCANNODE_GNSS_FIX=y
CONFIG_UAVCANNODE_HARDPOINT_COMMAND=y
CONFIG_UAVCANNODE_HYGROMETER_MEASUREMENT=y
CONFIG_UAVCANNODE_LIGHTS_COMMAND=y
CONFIG_UAVCANNODE_MAGNETIC_FIELD_STRENGTH=y
+3
View File
@@ -15,6 +15,8 @@ CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_PPS_CAPTURE=y
CONFIG_DRIVERS_VTX=y
CONFIG_VTX_CRSF_MSP_SUPPORT=y
CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
CONFIG_BMI088_ACCELEROMETER_INT2=y
CONFIG_COMMON_LIGHT=y
@@ -92,3 +94,4 @@ CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
CONFIG_SYSTEMCMDS_UORB=y
CONFIG_SYSTEMCMDS_VER=y
CONFIG_SYSTEMCMDS_WORK_QUEUE=y
CONFIG_WQ_TTY_STACKSIZE=2500
@@ -160,7 +160,7 @@ CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_CMDPARMS=y
CONFIG_NSH_CROMFSETC=y
CONFIG_NSH_LINELEN=128
CONFIG_NSH_MAXARGUMENTS=15
CONFIG_NSH_MAXARGUMENTS=24
CONFIG_NSH_NESTDEPTH=8
CONFIG_NSH_QUOTE=y
CONFIG_NSH_ROMFSETC=y
+2
View File
@@ -1,4 +1,6 @@
# CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE is not set
CONFIG_DRIVERS_UAVCAN=n
CONFIG_MODULES_UXRCE_DDS_CLIENT=n
CONFIG_SYSTEMCMDS_SD_BENCH=n
CONFIG_SYSTEMCMDS_I2CDETECT=n
CONFIG_MODULES_ZENOH=y
@@ -0,0 +1,3 @@
CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
CONFIG_BOARD_ARCHITECTURE="cortex-m7"
CONFIG_BOARD_ROMFSROOT=""
@@ -0,0 +1,86 @@
CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
CONFIG_BOARD_ARCHITECTURE="cortex-m7"
CONFIG_BOARD_ROOT_PATH="/fs/flash"
CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS6"
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS3"
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS4"
CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS5"
CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS2"
CONFIG_BOARD_SERIAL_RC="/dev/ttyS1"
CONFIG_DRIVERS_ADC_BOARD_ADC=y
CONFIG_DRIVERS_BAROMETER_DPS310=y
CONFIG_DRIVERS_CDCACM_AUTOSTART=y
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
CONFIG_COMMON_LIGHT=y
CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y
CONFIG_DRIVERS_MAGNETOMETER_LIS3MDL=y
CONFIG_DRIVERS_MAGNETOMETER_QMC5883L=y
CONFIG_DRIVERS_MAGNETOMETER_ST_IIS2MDC=y
CONFIG_DRIVERS_OSD_MSP_OSD=y
CONFIG_COMMON_OPTICAL_FLOW=y
CONFIG_DRIVERS_PWM_OUT=y
CONFIG_DRIVERS_RC_INPUT=y
CONFIG_COMMON_TELEMETRY=y
CONFIG_DRIVERS_TONE_ALARM=y
CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y
CONFIG_MODULES_BATTERY_STATUS=y
CONFIG_MODULES_COMMANDER=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
CONFIG_MODULES_DATAMAN=y
CONFIG_MODULES_EKF2=y
# CONFIG_EKF2_AUX_GLOBAL_POSITION is not set
# CONFIG_EKF2_AUXVEL is not set
# CONFIG_EKF2_BARO_COMPENSATION is not set
# CONFIG_EKF2_DRAG_FUSION is not set
# CONFIG_EKF2_GNSS_YAW is not set
# CONFIG_EKF2_SIDESLIP is not set
CONFIG_MODULES_EVENTS=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_MODE_MANAGER=y
CONFIG_MODULES_FW_LATERAL_LONGITUDINAL_CONTROL=y
CONFIG_MODULES_FW_RATE_CONTROL=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
CONFIG_MODULES_LAND_DETECTOR=y
CONFIG_MODULES_LANDING_TARGET_ESTIMATOR=y
CONFIG_MODULES_LOAD_MON=y
CONFIG_MODULES_LOGGER=y
CONFIG_MODULES_MAG_BIAS_ESTIMATOR=y
CONFIG_MODULES_MANUAL_CONTROL=y
CONFIG_MODULES_MAVLINK=y
CONFIG_MODULES_MC_ATT_CONTROL=y
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
CONFIG_MODULES_MC_POS_CONTROL=y
CONFIG_MODULES_MC_RATE_CONTROL=y
CONFIG_MODULES_NAVIGATOR=y
CONFIG_MODULES_RC_UPDATE=y
CONFIG_MODULES_SENSORS=y
CONFIG_MODULES_UXRCE_DDS_CLIENT=y
CONFIG_MODULES_VTOL_ATT_CONTROL=y
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y
CONFIG_SYSTEMCMDS_BSONDUMP=y
CONFIG_SYSTEMCMDS_DMESG=y
CONFIG_SYSTEMCMDS_GPIO=y
CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y
CONFIG_SYSTEMCMDS_I2CDETECT=y
CONFIG_SYSTEMCMDS_LED_CONTROL=y
CONFIG_SYSTEMCMDS_MFT=y
CONFIG_SYSTEMCMDS_MTD=y
CONFIG_SYSTEMCMDS_NSHTERM=y
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_TUNE_CONTROL=y
CONFIG_SYSTEMCMDS_UORB=y
CONFIG_SYSTEMCMDS_USB_CONNECTED=y
CONFIG_SYSTEMCMDS_VER=y
CONFIG_SYSTEMCMDS_WORK_QUEUE=y
Binary file not shown.
@@ -0,0 +1,13 @@
{
"board_id": 1209,
"magic": "PX4FWv1",
"description": "Firmware for the AirBrainH743 by Gear Up",
"image": "",
"build_time": 0,
"summary": "AirBrainH743",
"version": "0.1",
"image_size": 0,
"image_maxsize": 1966080,
"git_identity": "",
"board_revision": 0
}
@@ -0,0 +1,17 @@
#!/bin/sh
#
# AirBrainH743 board specific defaults
#------------------------------------------------------------------------------
# Battery voltage divider and current scale
param set-default BAT1_V_DIV 15.0
param set-default BAT1_A_PER_V 101.0
# system_power unavailable
param set-default CBRK_SUPPLY_CHK 894281
param set-default IMU_GYRO_RATEMAX 2000
# W25N NAND flash with littlefs (128 MB): larger buffer, auto-rotate
set LOGGER_BUF 32
param set-default SDLOG_DIRS_MAX 3
@@ -0,0 +1,6 @@
#!/bin/sh
#
# AirBrainH743 specific board extras init
#------------------------------------------------------------------------------
# No extras configured by default
@@ -0,0 +1,16 @@
#!/bin/sh
#
# AirBrainH743 specific board sensors init
#------------------------------------------------------------------------------
board_adc start
# Internal SPI bus IMU - ICM42688P (Invensensev3)
icm42688p -R 2 -b 1 -s start
# Internal I2C bus barometer - DPS310 @ 0x76 (118 decimal)
dps310 -I -a 118 start
# Internal I2C bus magnetometer - LIS2MDL @ 0x1E (30 decimal)
# Using iis2mdc driver (functionally equivalent to LIS2MDL)
iis2mdc -I -R 2 -a 30 start
@@ -0,0 +1,3 @@
#
# Board-specific Kconfig for AirBrainH743
#
@@ -0,0 +1,89 @@
#
# 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_CONSOLE is not set
# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set
# CONFIG_SPI_EXCHANGE is not set
# CONFIG_STM32H7_SYSCFG is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD_CUSTOM=y
CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/gearup/airbrainh743/nuttx-config"
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32H743VI=y
CONFIG_ARCH_CHIP_STM32H7=y
CONFIG_ARCH_INTERRUPTSTACK=768
CONFIG_ARMV7M_BASEPRI_WAR=y
CONFIG_ARMV7M_ICACHE=y
CONFIG_ARMV7M_MEMCPY=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_BOARDCTL=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_ASSERT_RESET_VALUE=0
CONFIG_BOARD_INITTHREAD_PRIORITY=254
CONFIG_BOARD_LATE_INITIALIZE=y
CONFIG_BOARD_LOOPSPERMSEC=22114
CONFIG_BOARD_RESET_ON_ASSERT=2
CONFIG_CDCACM=y
CONFIG_CDCACM_PRODUCTID=0x004b
CONFIG_CDCACM_PRODUCTSTR="AirBrainH743 BL"
CONFIG_CDCACM_RXBUFSIZE=600
CONFIG_CDCACM_TXBUFSIZE=12000
CONFIG_CDCACM_VENDORID=0x3162
CONFIG_CDCACM_VENDORSTR="Gear Up"
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEBUG_TCBINFO=y
CONFIG_DEFAULT_SMALL=y
CONFIG_EXPERIMENTAL=y
CONFIG_FDCLONE_DISABLE=y
CONFIG_FDCLONE_STDIO=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_IDLETHREAD_STACKSIZE=750
CONFIG_INIT_ENTRYPOINT="bootloader_main"
CONFIG_INIT_STACKSIZE=3194
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_LIBC_LONG_LONG=y
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_PREALLOC_TIMERS=50
CONFIG_PTHREAD_STACK_MIN=512
CONFIG_RAM_SIZE=245760
CONFIG_RAM_START=0x20010000
CONFIG_RAW_BINARY=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_SPI=y
CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=30
CONFIG_START_MONTH=11
CONFIG_STDIO_BUFFER_SIZE=32
CONFIG_STM32H7_BKPSRAM=y
CONFIG_STM32H7_DMA1=y
CONFIG_STM32H7_OTGFS=y
CONFIG_STM32H7_PROGMEM=y
CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y
CONFIG_STM32H7_TIM1=y
CONFIG_STM32H7_USART1=y
CONFIG_SYSTEMTICK_HOOK=y
CONFIG_SYSTEM_CDCACM=y
CONFIG_TASK_NAME_SIZE=24
CONFIG_TTY_SIGINT=y
CONFIG_TTY_SIGINT_CHAR=0x03
CONFIG_TTY_SIGTSTP=y
CONFIG_USART1_RXBUFSIZE=600
CONFIG_USART1_TXBUFSIZE=300
CONFIG_USBDEV=y
CONFIG_USBDEV_BUSPOWERED=y
CONFIG_USBDEV_MAXPOWER=500
CONFIG_USEC_PER_TICK=1000
@@ -0,0 +1,346 @@
/************************************************************************************
* nuttx-config/include/board.h
*
* Copyright (C) 2026 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 __NUTTX_CONFIG_AIRBRAINH743_INCLUDE_BOARD_H
#define __NUTTX_CONFIG_AIRBRAINH743_INCLUDE_BOARD_H
/************************************************************************************
* Included Files
************************************************************************************/
#include "board_dma_map.h"
#include <nuttx/config.h>
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
#include "stm32_rcc.h"
#include "stm32_sdmmc.h"
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* Clocking *************************************************************************/
/* The AirBrainH743 board provides the following clock sources:
*
* X1: 8 MHz crystal for HSE
*/
#define STM32_BOARD_XTAL 8000000ul
#define STM32_HSI_FREQUENCY 16000000ul
#define STM32_LSI_FREQUENCY 32000
#define STM32_HSE_FREQUENCY STM32_BOARD_XTAL
#define STM32_LSE_FREQUENCY 32768
/* Main PLL Configuration.
*
* PLL source is HSE = 8,000,000
*
* PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN
*
* SYSCLK = PLL_VCO / PLLP
* CPUCLK = SYSCLK / D1CPRE
*/
#define STM32_BOARD_USEHSE
#define STM32_PLLCFG_PLLSRC RCC_PLLCKSELR_PLLSRC_HSE
/* PLL1, wide 4 - 8 MHz input, enable DIVP, DIVQ, DIVR
*
* PLL1_VCO = (8,000,000 / 1) * 120 = 960 MHz
*
* PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz
* PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz
* PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz
*/
#define STM32_PLLCFG_PLL1CFG (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \
RCC_PLLCFGR_PLL1RGE_4_8_MHZ | \
RCC_PLLCFGR_DIVP1EN | \
RCC_PLLCFGR_DIVQ1EN | \
RCC_PLLCFGR_DIVR1EN)
#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1)
#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(120)
#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2)
#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(5)
#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8)
#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 120)
#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2)
#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 5)
#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8)
/* PLL2 */
#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \
RCC_PLLCFGR_PLL2RGE_4_8_MHZ | \
RCC_PLLCFGR_DIVP2EN | \
RCC_PLLCFGR_DIVQ2EN | \
RCC_PLLCFGR_DIVR2EN)
#define STM32_PLLCFG_PLL2M RCC_PLLCKSELR_DIVM2(2)
#define STM32_PLLCFG_PLL2N RCC_PLL2DIVR_N2(48)
#define STM32_PLLCFG_PLL2P RCC_PLL2DIVR_P2(2)
#define STM32_PLLCFG_PLL2Q RCC_PLL2DIVR_Q2(2)
#define STM32_PLLCFG_PLL2R RCC_PLL2DIVR_R2(2)
#define STM32_VCO2_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48)
#define STM32_PLL2P_FREQUENCY (STM32_VCO2_FREQUENCY / 2)
#define STM32_PLL2Q_FREQUENCY (STM32_VCO2_FREQUENCY / 2)
#define STM32_PLL2R_FREQUENCY (STM32_VCO2_FREQUENCY / 2)
/* PLL3 */
#define STM32_PLLCFG_PLL3CFG (RCC_PLLCFGR_PLL3VCOSEL_WIDE | \
RCC_PLLCFGR_PLL3RGE_4_8_MHZ | \
RCC_PLLCFGR_DIVQ3EN)
#define STM32_PLLCFG_PLL3M RCC_PLLCKSELR_DIVM3(2)
#define STM32_PLLCFG_PLL3N RCC_PLL3DIVR_N3(48)
#define STM32_PLLCFG_PLL3P RCC_PLL3DIVR_P3(2)
#define STM32_PLLCFG_PLL3Q RCC_PLL3DIVR_Q3(4)
#define STM32_PLLCFG_PLL3R RCC_PLL3DIVR_R3(2)
#define STM32_VCO3_FREQUENCY ((STM32_HSE_FREQUENCY / 2) * 48)
#define STM32_PLL3P_FREQUENCY (STM32_VCO3_FREQUENCY / 2)
#define STM32_PLL3Q_FREQUENCY (STM32_VCO3_FREQUENCY / 4)
#define STM32_PLL3R_FREQUENCY (STM32_VCO3_FREQUENCY / 2)
/* SYSCLK = PLL1P = 480MHz
* CPUCLK = SYSCLK / 1 = 480 MHz
*/
#define STM32_RCC_D1CFGR_D1CPRE (RCC_D1CFGR_D1CPRE_SYSCLK)
#define STM32_SYSCLK_FREQUENCY (STM32_PLL1P_FREQUENCY)
#define STM32_CPUCLK_FREQUENCY (STM32_SYSCLK_FREQUENCY / 1)
/* Configure Clock Assignments */
/* AHB clock (HCLK) is SYSCLK/2 (240 MHz max)
* HCLK1 = HCLK2 = HCLK3 = HCLK4 = 240
*/
#define STM32_RCC_D1CFGR_HPRE RCC_D1CFGR_HPRE_SYSCLKd2 /* HCLK = SYSCLK / 2 */
#define STM32_ACLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* ACLK in D1, HCLK3 in D1 */
#define STM32_HCLK_FREQUENCY (STM32_CPUCLK_FREQUENCY / 2) /* HCLK in D2, HCLK4 in D3 */
#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */
/* APB1 clock (PCLK1) is HCLK/2 (120 MHz) */
#define STM32_RCC_D2CFGR_D2PPRE1 RCC_D2CFGR_D2PPRE1_HCLKd2 /* PCLK1 = HCLK / 2 */
#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2)
/* APB2 clock (PCLK2) is HCLK/2 (120 MHz) */
#define STM32_RCC_D2CFGR_D2PPRE2 RCC_D2CFGR_D2PPRE2_HCLKd2 /* PCLK2 = HCLK / 2 */
#define STM32_PCLK2_FREQUENCY (STM32_HCLK_FREQUENCY/2)
/* APB3 clock (PCLK3) is HCLK/2 (120 MHz) */
#define STM32_RCC_D1CFGR_D1PPRE RCC_D1CFGR_D1PPRE_HCLKd2 /* PCLK3 = HCLK / 2 */
#define STM32_PCLK3_FREQUENCY (STM32_HCLK_FREQUENCY/2)
/* APB4 clock (PCLK4) is HCLK/2 (120 MHz) */
#define STM32_RCC_D3CFGR_D3PPRE RCC_D3CFGR_D3PPRE_HCLKd2 /* PCLK4 = HCLK / 2 */
#define STM32_PCLK4_FREQUENCY (STM32_HCLK_FREQUENCY/2)
/* Timer clock frequencies */
/* Timers driven from APB1 will be twice PCLK1 */
#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_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY)
#define STM32_APB1_TIM7_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)
/* Timers driven from APB2 will be twice PCLK2 */
#define STM32_APB2_TIM1_CLKIN (2*STM32_PCLK2_FREQUENCY)
#define STM32_APB2_TIM8_CLKIN (2*STM32_PCLK2_FREQUENCY)
#define STM32_APB2_TIM15_CLKIN (2*STM32_PCLK2_FREQUENCY)
#define STM32_APB2_TIM16_CLKIN (2*STM32_PCLK2_FREQUENCY)
#define STM32_APB2_TIM17_CLKIN (2*STM32_PCLK2_FREQUENCY)
/* Kernel Clock Configuration */
/* I2C123 clock source */
#define STM32_RCC_D2CCIP2R_I2C123SRC RCC_D2CCIP2R_I2C123SEL_HSI
/* I2C4 clock source */
#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI
/* SPI123 clock source */
#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2
/* SPI45 clock source */
#define STM32_RCC_D2CCIP1R_SPI45SRC RCC_D2CCIP1R_SPI45SEL_PLL2
/* SPI6 clock source */
#define STM32_RCC_D3CCIPR_SPI6SRC RCC_D3CCIPR_SPI6SEL_PLL2
/* USB 1 and 2 clock source */
#define STM32_RCC_D2CCIP2R_USBSRC RCC_D2CCIP2R_USBSEL_PLL3
/* ADC 1 2 3 clock source */
#define STM32_RCC_D3CCIPR_ADCSRC RCC_D3CCIPR_ADCSEL_PLL2
/* FDCAN 1 clock source */
#define STM32_RCC_D2CCIP1R_FDCANSEL RCC_D2CCIP1R_FDCANSEL_HSE
#define STM32_FDCANCLK STM32_HSE_FREQUENCY
/* FLASH wait states */
#define BOARD_FLASH_WAITSTATES 2
/* LED definitions ******************************************************************/
#define BOARD_LED1 0
#define BOARD_LED2 1
#define BOARD_LED3 2
#define BOARD_NLEDS 3
#define BOARD_LED_RED BOARD_LED1
#define BOARD_LED_GREEN BOARD_LED2
#define BOARD_LED_BLUE BOARD_LED3
/* LED bits for use with board_userled_all() */
#define BOARD_LED1_BIT (1 << BOARD_LED1)
#define BOARD_LED2_BIT (1 << BOARD_LED2)
#define BOARD_LED3_BIT (1 << BOARD_LED3)
#define LED_STARTED 0 /* NuttX has been started OFF OFF OFF */
#define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF OFF ON */
#define LED_IRQSENABLED 2 /* Interrupts enabled OFF ON OFF */
#define LED_STACKCREATED 3 /* Idle stack created OFF ON ON */
#define LED_INIRQ 4 /* In an interrupt N/C N/C GLOW */
#define LED_SIGNAL 5 /* In a signal handler N/C GLOW N/C */
#define LED_ASSERTION 6 /* An assertion failed GLOW N/C GLOW */
#define LED_PANIC 7 /* The system has crashed Blink OFF N/C */
#define LED_IDLE 8 /* MCU is is sleep mode ON OFF OFF */
/* Alternate function pin selections ************************************************/
/* USART1 - Debug (PA9 TX, PA10 RX) */
#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PA10 */
#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PA9 */
/* USART2 - RC input (PD5 TX, PD6 RX) */
#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */
#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */
/* USART3 - DJI/MSP (PD8 TX, PD9 RX) */
#define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */
#define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */
/* UART4 - General (PB9 TX, PB8 RX) */
#define GPIO_UART4_RX GPIO_UART4_RX_3 /* PB8 */
#define GPIO_UART4_TX GPIO_UART4_TX_3 /* PB9 */
/* UART5 - Companion (PB13 TX, PB12 RX) */
#define GPIO_UART5_RX GPIO_UART5_RX_1 /* PB12 */
#define GPIO_UART5_TX GPIO_UART5_TX_1 /* PB13 */
/* UART7 - ESC telemetry (PE8 TX, PE7 RX) */
#define GPIO_UART7_RX GPIO_UART7_RX_3 /* PE7 */
#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */
/* UART8 - GPS (PE1 TX, PE0 RX) */
#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */
#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */
/* SPI
*
* SPI1: IMU (PA5 SCK, PA6 MISO, PA7 MOSI)
* SPI2: W25N Flash (PD3 SCK, PB14 MISO, PC3 MOSI)
* SPI4: External (PE12 SCK, PE5 MISO, PE6 MOSI)
*/
#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */
#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */
#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */
#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */
#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_3 /* PC3 */
#define GPIO_SPI2_SCK GPIO_SPI2_SCK_5 /* PD3 */
#define GPIO_SPI4_MISO GPIO_SPI4_MISO_2 /* PE5 */
#define GPIO_SPI4_MOSI GPIO_SPI4_MOSI_2 /* PE6 */
#define GPIO_SPI4_SCK GPIO_SPI4_SCK_1 /* PE12 */
/* I2C
*
* I2C1: Internal (PB6 SCL, PB7 SDA)
* I2C4: External (PD12 SCL, PD13 SDA)
*/
#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 /* PB6 */
#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */
#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_I2C4_SCL GPIO_I2C4_SCL_1 /* PD12 */
#define GPIO_I2C4_SDA GPIO_I2C4_SDA_1 /* PD13 */
#define GPIO_I2C4_SCL_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTD | GPIO_PIN12)
#define GPIO_I2C4_SDA_GPIO (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | GPIO_PORTD | GPIO_PIN13)
/* USB
*
* OTG_FS_DM PA11
* OTG_FS_DP PA12
* VBUS PD0
*/
#endif /*__NUTTX_CONFIG_AIRBRAINH743_INCLUDE_BOARD_H */
@@ -0,0 +1,42 @@
/****************************************************************************
*
* Copyright (c) 2026 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
/* DMA mapping for SPI1 (IMU) */
#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1:37 */
#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1:38 */
/* DMA mapping for SPI2 (W25N Flash) */
#define DMAMAP_SPI2_RX DMAMAP_DMA12_SPI2RX_0 /* DMA1:39 */
#define DMAMAP_SPI2_TX DMAMAP_DMA12_SPI2TX_0 /* DMA1:40 */
@@ -0,0 +1,258 @@
#
# 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_MMCSD_HAVE_CARDDETECT is not set
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
# CONFIG_MMCSD_MMCSUPPORT 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_EXIT 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_MKFATFS is not set
# CONFIG_NSH_DISABLE_MOUNT is not set
# CONFIG_NSH_DISABLE_MV is not set
# CONFIG_NSH_DISABLE_PRINTF 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_SPI_CALLBACK is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD_CUSTOM=y
CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/gearup/airbrainh743/nuttx-config"
CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH=y
CONFIG_ARCH_BOARD_CUSTOM_NAME="px4"
CONFIG_ARCH_CHIP="stm32h7"
CONFIG_ARCH_CHIP_STM32H743VI=y
CONFIG_ARCH_CHIP_STM32H7=y
CONFIG_ARCH_INTERRUPTSTACK=512
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARMV7M_BASEPRI_WAR=y
CONFIG_ARMV7M_DCACHE=y
CONFIG_ARMV7M_DTCM=y
CONFIG_ARMV7M_ICACHE=y
CONFIG_ARMV7M_MEMCPY=y
CONFIG_ARMV7M_USEBASEPRI=y
CONFIG_ARM_MPU_EARLY_RESET=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_ASSERT_RESET_VALUE=0
CONFIG_BOARD_CRASHDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=95150
CONFIG_BOARD_RESET_ON_ASSERT=2
CONFIG_BUILTIN=y
CONFIG_CDCACM=y
CONFIG_CDCACM_IFLOWCONTROL=y
CONFIG_CDCACM_PRODUCTID=0x0050
CONFIG_CDCACM_PRODUCTSTR="AirBrainH743"
CONFIG_CDCACM_RXBUFSIZE=600
CONFIG_CDCACM_TXBUFSIZE=12000
CONFIG_CDCACM_VENDORID=0x3162
CONFIG_CDCACM_VENDORSTR="Gear Up"
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_HARDFAULT_ALERT=y
CONFIG_DEBUG_MEMFAULT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEFAULT_SMALL=y
CONFIG_DEV_FIFO_SIZE=0
CONFIG_DEV_PIPE_MAXSIZE=1024
CONFIG_DEV_PIPE_SIZE=70
CONFIG_EXPERIMENTAL=y
CONFIG_FAT_DMAMEMORY=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FAT_LFN_ALIAS_HASH=y
CONFIG_FDCLONE_STDIO=y
CONFIG_FS_BINFS=y
CONFIG_FS_CROMFS=y
CONFIG_FS_FAT=y
CONFIG_FS_FATTIME=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y
CONFIG_FS_PROCFS_MAX_TASKS=64
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_ROMFS=y
CONFIG_FS_LITTLEFS=y
CONFIG_FS_LITTLEFS_PROGRAM_SIZE_FACTOR=1
CONFIG_FS_LITTLEFS_READ_SIZE_FACTOR=1
CONFIG_FS_LITTLEFS_CACHE_SIZE_FACTOR=1
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=3194
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_LIBC_LONG_LONG=y
CONFIG_LIBC_MAX_EXITFUNS=1
CONFIG_LIBC_STRERROR=y
CONFIG_MEMSET_64BIT=y
CONFIG_MEMSET_OPTSPEED=y
CONFIG_MM_REGIONS=4
CONFIG_MTD=y
CONFIG_MTD_BYTE_WRITE=y
CONFIG_MTD_PARTITION=y
CONFIG_MTD_PROGMEM=y
CONFIG_MTD_W25N=y
CONFIG_W25N_SPIFREQUENCY=104000000
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_STRERROR=y
CONFIG_NSH_VARS=y
CONFIG_OTG_ID_GPIO_DISABLE=y
CONFIG_PIPES=y
CONFIG_PREALLOC_TIMERS=50
CONFIG_PRIORITY_INHERITANCE=y
CONFIG_PTHREAD_MUTEX_ROBUST=y
CONFIG_PTHREAD_STACK_MIN=512
CONFIG_RAM_SIZE=245760
CONFIG_RAM_START=0x20010000
CONFIG_RAW_BINARY=y
CONFIG_READLINE_CMD_HISTORY=y
CONFIG_READLINE_TABCOMPLETION=y
CONFIG_RTC_DATETIME=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_LPWORK=y
CONFIG_SCHED_LPWORKPRIORITY=50
CONFIG_SCHED_LPWORKSTACKSIZE=1632
CONFIG_SCHED_WAITPID=y
CONFIG_SEM_PREALLOCHOLDERS=32
CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=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=256
CONFIG_STM32H7_ADC1=y
CONFIG_STM32H7_ADC3=y
CONFIG_STM32H7_BBSRAM=y
CONFIG_STM32H7_BBSRAM_FILES=5
CONFIG_STM32H7_BDMA=y
CONFIG_STM32H7_BKPSRAM=y
CONFIG_STM32H7_DMA1=y
CONFIG_STM32H7_DMA2=y
CONFIG_STM32H7_DMACAPABLE=y
CONFIG_STM32H7_DMAMUX1=y
CONFIG_STM32H7_FLOWCONTROL_BROKEN=y
CONFIG_STM32H7_I2C1=y
CONFIG_STM32H7_I2C4=y
CONFIG_STM32H7_I2C_DYNTIMEO=y
CONFIG_STM32H7_I2C_DYNTIMEO_STARTSTOP=10
CONFIG_STM32H7_OTGFS=y
CONFIG_STM32H7_PROGMEM=y
CONFIG_STM32H7_RTC=y
CONFIG_STM32H7_RTC_HSECLOCK=y
CONFIG_STM32H7_RTC_MAGIC_REG=1
CONFIG_STM32H7_SAVE_CRASHDUMP=y
CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y
CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y
CONFIG_STM32H7_SPI1=y
CONFIG_STM32H7_SPI1_DMA=y
CONFIG_STM32H7_SPI1_DMA_BUFFER=4096
CONFIG_STM32H7_SPI2=y
CONFIG_STM32H7_SPI2_DMA=y
CONFIG_STM32H7_SPI2_DMA_BUFFER=4096
CONFIG_STM32H7_SPI4=y
CONFIG_STM32H7_TIM1=y
CONFIG_STM32H7_TIM2=y
CONFIG_STM32H7_TIM3=y
CONFIG_STM32H7_TIM5=y
CONFIG_STM32H7_TIM8=y
CONFIG_STM32H7_UART4=y
CONFIG_STM32H7_UART5=y
CONFIG_STM32H7_UART7=y
CONFIG_STM32H7_UART8=y
CONFIG_STM32H7_USART1=y
CONFIG_STM32H7_USART2=y
CONFIG_STM32H7_USART3=y
CONFIG_STM32H7_USART_BREAKS=y
CONFIG_STM32H7_USART_INVERT=y
CONFIG_STM32H7_USART_SINGLEWIRE=y
CONFIG_STM32H7_USART_SWAP=y
CONFIG_SYSTEM_CDCACM=y
CONFIG_SYSTEM_NSH=y
CONFIG_TASK_NAME_SIZE=24
CONFIG_TTY_SIGINT=y
CONFIG_TTY_SIGTSTP=y
CONFIG_UART4_BAUD=57600
CONFIG_UART4_RXBUFSIZE=600
CONFIG_UART4_TXBUFSIZE=1500
CONFIG_UART5_BAUD=57600
CONFIG_UART5_RXBUFSIZE=600
CONFIG_UART5_TXBUFSIZE=1500
CONFIG_UART7_BAUD=57600
CONFIG_UART7_RXBUFSIZE=600
CONFIG_UART7_TXBUFSIZE=1500
CONFIG_UART8_BAUD=57600
CONFIG_UART8_RXBUFSIZE=600
CONFIG_UART8_TXBUFSIZE=1500
CONFIG_USART1_BAUD=57600
CONFIG_USART1_RXBUFSIZE=600
CONFIG_USART1_SERIAL_CONSOLE=y
CONFIG_USART1_TXBUFSIZE=1500
CONFIG_USART2_BAUD=57600
CONFIG_USART2_RXBUFSIZE=600
CONFIG_USART2_TXBUFSIZE=1500
CONFIG_USART3_BAUD=57600
CONFIG_USART3_RXBUFSIZE=600
CONFIG_USART3_TXBUFSIZE=1500
CONFIG_USBDEV=y
CONFIG_USBDEV_BUSPOWERED=y
CONFIG_USBDEV_MAXPOWER=500
CONFIG_USEC_PER_TICK=1000
CONFIG_WATCHDOG=y
@@ -0,0 +1,213 @@
/****************************************************************************
* scripts/script.ld
*
* Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
*
* 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 Durandal-v1 uses an STM32H743II has 2048Kb of main FLASH memory.
* The flash memory is partitioned into a User Flash memory and a System
* Flash memory. Each of these memories has two banks:
*
* 1) User Flash memory:
*
* Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each
* Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each
*
* 2) System Flash memory:
*
* Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector
* Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector
*
* 3) User option bytes for user configuration, only in Bank 1.
*
* In the STM32H743II, two different boot spaces can be selected through
* the BOOT pin and the boot base address programmed in the BOOT_ADD0 and
* BOOT_ADD1 option bytes:
*
* 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0].
* ST programmed value: Flash memory at 0x0800:0000
* 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0].
* ST programmed value: System bootloader at 0x1FF0:0000
*
* The Durandal has a Switch on board, the BOOT0 pin is at ground so by default,
* the STM32 will boot to address 0x0800:0000 in FLASH unless the swiutch is
* drepresed, then the boot will be from 0x1FF0:0000
*
* The STM32H743ZI also has 1024Kb of data SRAM.
* SRAM is split up into several blocks and into three power domains:
*
* 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with
* 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus
*
* 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000
*
* The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit
* DTCM ports. The DTCM-RAM could be used for critical real-time
* data, such as interrupt service routines or stack / heap memory.
* Both DTCM-RAMs can be used in parallel (for load/store operations)
* thanks to the Cortex-M7 dual issue capability.
*
* 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000
*
* This RAM is connected to ITCM 64-bit interface designed for
* execution of critical real-times routines by the CPU.
*
* 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA
* through D1 domain AXI bus matrix
*
* 2.1) 512Kb of SRAM beginning at address 0x2400:0000
*
* 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA
* through D2 domain AHB bus matrix
*
* 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000
* 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000
* 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000
*
* SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000
*
* 4) AHB SRAM (D3 domain) accessible by most of system masters
* through D3 domain AHB bus matrix
*
* 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000
* 4.1) 4Kb of backup RAM beginning at address 0x3880: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
{
itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
flash (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
dtcm1 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
dtcm2 (rwx) : ORIGIN = 0x20010000, LENGTH = 64K
sram (rwx) : ORIGIN = 0x24000000, LENGTH = 512K
sram1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K
sram2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K
sram3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K
sram4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K
bbram (rwx) : ORIGIN = 0x38800000, LENGTH = 4K
}
OUTPUT_ARCH(arm)
EXTERN(_vectors)
ENTRY(_stext)
/*
* 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(32);
/*
This signature provides the bootloader with a way to delay booting
*/
_bootdelay_signature = ABSOLUTE(.);
FILL(0xffecc2925d7d05c5)
. += 8;
*(.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(.);
.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) }
}
@@ -0,0 +1,228 @@
/****************************************************************************
* scripts/script.ld
*
* Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
*
* 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 board uses an STM32H743II and has 2048Kb of main FLASH memory.
* The flash memory is partitioned into a User Flash memory and a System
* Flash memory. Each of these memories has two banks:
*
* 1) User Flash memory:
*
* Bank 1: Start address 0x0800:0000 to 0x080F:FFFF with 8 sectors, 128Kb each
* Bank 2: Start address 0x0810:0000 to 0x081F:FFFF with 8 sectors, 128Kb each
*
* 2) System Flash memory:
*
* Bank 1: Start address 0x1FF0:0000 to 0x1FF1:FFFF with 1 x 128Kb sector
* Bank 1: Start address 0x1FF4:0000 to 0x1FF5:FFFF with 1 x 128Kb sector
*
* 3) User option bytes for user configuration, only in Bank 1.
*
* In the STM32H743II, two different boot spaces can be selected through
* the BOOT pin and the boot base address programmed in the BOOT_ADD0 and
* BOOT_ADD1 option bytes:
*
* 1) BOOT=0: Boot address defined by user option byte BOOT_ADD0[15:0].
* ST programmed value: Flash memory at 0x0800:0000
* 2) BOOT=1: Boot address defined by user option byte BOOT_ADD1[15:0].
* ST programmed value: System bootloader at 0x1FF0:0000
*
* There's a switch on board, the BOOT0 pin is at ground so by default,
* the STM32 will boot to address 0x0800:0000 in FLASH unless the switch is
* drepresed, then the boot will be from 0x1FF0:0000
*
* The STM32H743ZI also has 1024Kb of data SRAM.
* SRAM is split up into several blocks and into three power domains:
*
* 1) TCM SRAMs are dedicated to the Cortex-M7 and are accessible with
* 0 wait states by the Cortex-M7 and by MDMA through AHBS slave bus
*
* 1.1) 128Kb of DTCM-RAM beginning at address 0x2000:0000
*
* The DTCM-RAM is organized as 2 x 64Kb DTCM-RAMs on 2 x 32 bit
* DTCM ports. The DTCM-RAM could be used for critical real-time
* data, such as interrupt service routines or stack / heap memory.
* Both DTCM-RAMs can be used in parallel (for load/store operations)
* thanks to the Cortex-M7 dual issue capability.
*
* 1.2) 64Kb of ITCM-RAM beginning at address 0x0000:0000
*
* This RAM is connected to ITCM 64-bit interface designed for
* execution of critical real-times routines by the CPU.
*
* 2) AXI SRAM (D1 domain) accessible by all system masters except BDMA
* through D1 domain AXI bus matrix
*
* 2.1) 512Kb of SRAM beginning at address 0x2400:0000
*
* 3) AHB SRAM (D2 domain) accessible by all system masters except BDMA
* through D2 domain AHB bus matrix
*
* 3.1) 128Kb of SRAM1 beginning at address 0x3000:0000
* 3.2) 128Kb of SRAM2 beginning at address 0x3002:0000
* 3.3) 32Kb of SRAM3 beginning at address 0x3004:0000
*
* SRAM1 - SRAM3 are one contiguous block: 288Kb at address 0x3000:0000
*
* 4) AHB SRAM (D3 domain) accessible by most of system masters
* through D3 domain AHB bus matrix
*
* 4.1) 64Kb of SRAM4 beginning at address 0x3800:0000
* 4.1) 4Kb of backup RAM beginning at address 0x3880: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
{
ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1792K /* params in last sector */
DTCM1_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
DTCM2_RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 64K
AXI_SRAM (rwx) : ORIGIN = 0x24000000, LENGTH = 512K /* D1 domain AXI bus */
SRAM1 (rwx) : ORIGIN = 0x30000000, LENGTH = 128K /* D2 domain AHB bus */
SRAM2 (rwx) : ORIGIN = 0x30020000, LENGTH = 128K /* D2 domain AHB bus */
SRAM3 (rwx) : ORIGIN = 0x30040000, LENGTH = 32K /* D2 domain AHB bus */
SRAM4 (rwx) : ORIGIN = 0x38000000, LENGTH = 64K /* D3 domain */
BKPRAM (rwx) : ORIGIN = 0x38800000, LENGTH = 4K
}
OUTPUT_ARCH(arm)
EXTERN(_vectors)
ENTRY(_stext)
/*
* 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(32);
/*
This signature provides the bootloader with a way to delay booting
*/
_bootdelay_signature = ABSOLUTE(.);
FILL(0xffecc2925d7d05c5)
. += 8;
*(.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(.);
.data : {
_sdata = ABSOLUTE(.);
*(.data .data.*)
*(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
/* Pad out last section as the STM32H7 Flash write size is 256 bits. 32 bytes */
. = ALIGN(16);
FILL(0xffff)
. += 16;
} > AXI_SRAM AT > FLASH = 0xffff
.bss : {
_sbss = ABSOLUTE(.);
*(.bss .bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
. = ALIGN(4);
_ebss = ABSOLUTE(.);
} > AXI_SRAM
/* Emit the the D3 power domain section for locating BDMA data */
.sram4_reserve (NOLOAD) :
{
*(.sram4)
. = ALIGN(4);
_sram4_heap_start = ABSOLUTE(.);
} > SRAM4
/* 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) }
}
@@ -0,0 +1,67 @@
############################################################################
#
# Copyright (c) 2026 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 "bootloader")
add_library(drivers_board
bootloader_main.c
usb.c
)
target_link_libraries(drivers_board
PRIVATE
nuttx_arch
nuttx_drivers
bootloader
)
target_include_directories(drivers_board PRIVATE ${PX4_SOURCE_DIR}/platforms/nuttx/src/bootloader/common)
else()
add_library(drivers_board
i2c.cpp
init.c
led.c
spi.cpp
timer_config.cpp
usb.c
)
add_dependencies(drivers_board arch_board_hw_info)
target_link_libraries(drivers_board
PRIVATE
arch_io_pins
arch_spi
arch_board_hw_info
drivers__led
nuttx_arch
nuttx_drivers
px4_layer
)
endif()
@@ -0,0 +1,223 @@
/****************************************************************************
*
* Copyright (c) 2026 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
*
* AirBrainH743 (Gear Up) internal definitions
*/
#pragma once
/****************************************************************************************************
* Included Files
****************************************************************************************************/
#include <px4_platform_common/px4_config.h>
#include <nuttx/compiler.h>
#include <stdint.h>
#include <stm32_gpio.h>
/****************************************************************************************************
* Definitions
****************************************************************************************************/
/* Enable small flash logging support (for W25N NAND flash) */
#ifdef CONFIG_MTD_W25N
# define BOARD_SMALL_FLASH_LOGGING 1
#endif
/* LEDs are active low
* STAT RGB LED:
* PB15 = Blue
* PD11 = Green
* PD15 = Red
* BAT LED (orange): hardwired to power input
*/
#define GPIO_nLED_BLUE /* PB15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN15)
#define GPIO_nLED_GREEN /* PD11 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN11)
#define GPIO_nLED_RED /* PD15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN15)
#define BOARD_HAS_CONTROL_STATUS_LEDS 1
#define BOARD_OVERLOAD_LED LED_RED
#define BOARD_ARMED_STATE_LED LED_GREEN
/*
* ADC channels
*
* These are the channel numbers of the ADCs of the microcontroller that
* can be used by the Px4 Firmware in the adc driver
*/
/* ADC defines to be used in sensors.cpp to read from a particular channel */
#define ADC1_CH(n) (n)
/* Define GPIO pins used as ADC N.B. Channel numbers must match below */
#define PX4_ADC_GPIO \
/* PC4 */ GPIO_ADC12_INP4, \
/* PC5 */ GPIO_ADC12_INP8
/* Define Channel numbers must match above GPIO pin IN(n)*/
#define ADC_BATTERY_VOLTAGE_CHANNEL /* PC4 */ ADC1_CH(4)
#define ADC_BATTERY_CURRENT_CHANNEL /* PC5 */ ADC1_CH(8)
#define ADC_CHANNELS \
((1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \
(1 << ADC_BATTERY_CURRENT_CHANNEL))
/* Define Battery Voltage Divider and A per V
*/
#define BOARD_BATTERY1_V_DIV (15.0f)
#define BOARD_BATTERY1_A_PER_V (101.0f)
/* PWM
* 8 PWM outputs for motors + 1 for LED strip
*/
#define DIRECT_PWM_OUTPUT_CHANNELS 9
#define DIRECT_INPUT_TIMER_CHANNELS 9
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
/* Tone alarm output (directly connected to transistor switch of external buzzer)
*
* GPIO mode only (active buzzer) - passive buzzer with different tones is not
* supported because PA15 can only use TIM2, which is also used for motor outputs
* M7 (PB10, TIM2_CH3) and M8 (PB11, TIM2_CH4). The PWM tone alarm driver changes
* the timer's prescaler and auto-reload registers (shared across all channels),
* which would affect M7/M8 PWM frequency during tone playback.
*/
#define GPIO_TONE_ALARM_IDLE /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15)
#define GPIO_TONE_ALARM_GPIO /* PA15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN15)
/* ICM42688P FSYNC - directly connected to IMU via GPIO (no timer).
* The driver clears TMST_FSYNC_EN and FIFO_TMST_FSYNC_EN, so FSYNC is unused.
* This GPIO is kept low to prevent spurious triggers.
*/
#define GPIO_42688P_FSYNC /* PC7 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN7)
/* USB OTG FS
*
* PD0 VBUS sensing (active high input)
*/
#define GPIO_OTGFS_VBUS /* PD0 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTD|GPIO_PIN0)
/* High-resolution timer */
#define HRT_TIMER 8 /* use timer8 for the HRT */
#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */
/*
* Serial Port Mapping:
*
* UART Device Pins Function
* ---- ------ ---- --------
* USART1 /dev/ttyS0 PA9/PA10 Console/Debug
* USART2 /dev/ttyS1 PD5/PD6 RC Input
* USART3 /dev/ttyS2 PD8/PD9 TEL4 (DJI/MSP)
* UART4 /dev/ttyS3 PA0/PA1 TEL1
* UART5 /dev/ttyS4 PB13/PB12 TEL2
* UART7 /dev/ttyS5 PE8/PE7 TEL3 (ESC Telemetry)
* UART8 /dev/ttyS6 PE1/PE0 GPS1
*/
/* RC Serial port - USART2 (PD5/PD6) */
#define RC_SERIAL_PORT "/dev/ttyS1"
#define BOARD_SUPPORTS_RC_SERIAL_PORT_OUTPUT
/* This board provides a DMA pool and APIs */
#define BOARD_DMA_ALLOC_POOL_SIZE 5120
/* This board provides the board_on_reset interface */
#define BOARD_HAS_ON_RESET 1
#define PX4_GPIO_INIT_LIST { \
PX4_ADC_GPIO, \
GPIO_nLED_RED, \
GPIO_nLED_GREEN, \
GPIO_nLED_BLUE, \
GPIO_TONE_ALARM_IDLE, \
GPIO_42688P_FSYNC, \
}
#define BOARD_ENABLE_CONSOLE_BUFFER
#define BOARD_NUM_IO_TIMERS 4
__BEGIN_DECLS
/****************************************************************************************************
* Public Types
****************************************************************************************************/
/****************************************************************************************************
* Public data
****************************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************************
* Public Functions
****************************************************************************************************/
/****************************************************************************
* Name: stm32_spiinitialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the board.
*
****************************************************************************/
extern void stm32_spiinitialize(void);
extern void stm32_usbinitialize(void);
extern void board_peripheral_reset(int ms);
/* Parameters stored in internal flash */
#define FLASH_BASED_PARAMS
#include <px4_platform_common/board_common.h>
#endif /* __ASSEMBLY__ */
__END_DECLS
@@ -0,0 +1,75 @@
/****************************************************************************
*
* Copyright (c) 2026 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 bootloader_main.c
*
* AirBrainH743-specific early startup code for bootloader
*/
#include "board_config.h"
#include "bl.h"
#include <nuttx/config.h>
#include <nuttx/board.h>
#include <chip.h>
#include <stm32_uart.h>
#include <arch/board/board.h>
#include "arm_internal.h"
#include <px4_platform_common/init.h>
extern int sercon_main(int c, char **argv);
__EXPORT void board_on_reset(int status) {}
__EXPORT void stm32_boardinitialize(void)
{
/* configure USB interfaces */
stm32_usbinitialize();
}
__EXPORT int board_app_initialize(uintptr_t arg)
{
return 0;
}
void board_late_initialize(void)
{
sercon_main(0, NULL);
}
extern void sys_tick_handler(void);
void board_timerhook(void)
{
sys_tick_handler();
}
@@ -0,0 +1,85 @@
/****************************************************************************
*
* Copyright (C) 2026 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
#define APP_LOAD_ADDRESS 0x08020000
#define BOOTLOADER_DELAY 5000
#define INTERFACE_USB 1
#define INTERFACE_USB_CONFIG "/dev/ttyACM0"
#define BOARD_VBUS MK_GPIO_INPUT(GPIO_OTGFS_VBUS)
#define INTERFACE_USART 1
#define INTERFACE_USART_CONFIG "/dev/ttyS0,57600"
#define BOOT_DELAY_ADDRESS 0x000001a0
#define BOARD_TYPE 1209
#define _FLASH_KBYTES (*(uint32_t *)0x1FF1E880)
#define BOARD_FLASH_SECTORS (14)
#define BOARD_FLASH_SIZE (_FLASH_KBYTES * 1024)
#define OSC_FREQ 8
#define BOARD_PIN_LED_ACTIVITY GPIO_nLED_BLUE
#define BOARD_PIN_LED_BOOTLOADER GPIO_nLED_GREEN
#define BOARD_LED_ON 0
#define BOARD_LED_OFF 1
#define SERIAL_BREAK_DETECT_DISABLED 1
#if !defined(ARCH_SN_MAX_LENGTH)
# define ARCH_SN_MAX_LENGTH 12
#endif
/* Reserve 128KB (1 sector) at end of flash for parameters */
#define APP_RESERVATION_SIZE (1 * 128 * 1024)
#if !defined(BOARD_FIRST_FLASH_SECTOR_TO_ERASE)
# define BOARD_FIRST_FLASH_SECTOR_TO_ERASE 1
#endif
#if !defined(USB_DATA_ALIGN)
# define USB_DATA_ALIGN
#endif
#ifndef BOOT_DEVICES_SELECTION
# define BOOT_DEVICES_SELECTION USB0_DEV|SERIAL0_DEV|SERIAL1_DEV
#endif
#ifndef BOOT_DEVICES_FILTER_ONUSB
# define BOOT_DEVICES_FILTER_ONUSB USB0_DEV|SERIAL0_DEV|SERIAL1_DEV
#endif
/* Boot device selection list*/
#define USB0_DEV 0x01
#define SERIAL0_DEV 0x02
#define SERIAL1_DEV 0x04
+47
View File
@@ -0,0 +1,47 @@
/****************************************************************************
*
* Copyright (C) 2026 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 <px4_arch/i2c_hw_description.h>
/*
* I2C bus configuration for AirBrainH743
*
* I2C1: Internal bus - PB6 (SCL), PB7 (SDA)
* Devices: DPS310 baro @ 0x76, LIS2MDL compass @ 0x1E
* I2C4: External bus - PD12 (SCL), PD13 (SDA)
*/
constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = {
initI2CBusInternal(1),
initI2CBusExternal(4),
};
+249
View File
@@ -0,0 +1,249 @@
/****************************************************************************
*
* Copyright (c) 2026 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
*
* AirBrainH743-specific early startup code.
*/
#include "board_config.h"
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <debug.h>
#include <errno.h>
#include <syslog.h>
#include <fcntl.h>
#include <unistd.h>
#include <nuttx/config.h>
#include <nuttx/board.h>
#include <nuttx/spi/spi.h>
#include <nuttx/mtd/mtd.h>
#include <nuttx/fs/fs.h>
#include <arch/board/board.h>
#include "arm_internal.h"
#include <drivers/drv_hrt.h>
#include <drivers/drv_board_led.h>
#include <systemlib/px4_macros.h>
#include <px4_arch/io_timer.h>
#include <px4_platform_common/init.h>
#include <px4_platform/gpio.h>
#include <px4_platform/board_dma_alloc.h>
#if defined(FLASH_BASED_PARAMS)
#include <parameters/flashparams/flashfs.h>
#endif
#ifdef CONFIG_MTD_W25N
extern FAR struct mtd_dev_s *w25n_initialize(FAR struct spi_dev_s *dev, uint32_t spi_devid);
#endif
__BEGIN_DECLS
extern void led_init(void);
extern void led_on(int led);
extern void led_off(int led);
__END_DECLS
/************************************************************************************
* Name: board_peripheral_reset
*
* Description:
*
************************************************************************************/
__EXPORT void board_peripheral_reset(int ms)
{
UNUSED(ms);
}
/************************************************************************************
* Name: board_on_reset
*
* Description:
* Optionally provided function called on entry to board_system_reset
* It should perform any house keeping prior to the rest.
*
* status - 1 if resetting to boot loader
* 0 if just resetting
*
************************************************************************************/
__EXPORT void board_on_reset(int status)
{
for (int i = 0; i < DIRECT_PWM_OUTPUT_CHANNELS; ++i) {
px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i)));
}
if (status >= 0) {
up_mdelay(100);
}
}
/************************************************************************************
* Name: stm32_boardinitialize
*
* Description:
* All STM32 architectures must provide the following entry point.
*
************************************************************************************/
__EXPORT void stm32_boardinitialize(void)
{
/* Reset PWM first thing */
board_on_reset(-1);
/* configure LEDs */
board_autoled_initialize();
/* configure pins */
const uint32_t gpio[] = PX4_GPIO_INIT_LIST;
px4_gpio_init(gpio, arraySize(gpio));
/* configure USB interfaces */
stm32_usbinitialize();
}
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization.
*
****************************************************************************/
__EXPORT int board_app_initialize(uintptr_t arg)
{
/* Need hrt running before using the ADC */
px4_platform_init();
/* configure SPI interfaces */
stm32_spiinitialize();
/* configure the DMA allocator */
if (board_dma_alloc_init() < 0) {
syslog(LOG_ERR, "[boot] DMA alloc FAILED\n");
}
/* initial LED state */
drv_led_start();
led_off(LED_RED);
led_off(LED_GREEN);
led_off(LED_BLUE);
if (board_hardfault_init(2, true) != 0) {
led_on(LED_RED);
}
#ifdef CONFIG_MTD_W25N
/* Initialize W25N01GV NAND Flash on SPI2 */
struct spi_dev_s *spi2 = stm32_spibus_initialize(2);
if (!spi2) {
syslog(LOG_ERR, "[boot] FAILED to initialize SPI2 for W25N\n");
led_on(LED_RED);
} else {
struct mtd_dev_s *mtd = w25n_initialize(spi2, 0);
if (!mtd) {
syslog(LOG_ERR, "[boot] FAILED to initialize W25N MTD driver\n");
led_on(LED_RED);
} else {
int ret = register_mtddriver("/dev/mtd0", mtd, 0755, NULL);
if (ret < 0) {
syslog(LOG_ERR, "[boot] FAILED to register MTD driver: %d\n", ret);
led_on(LED_RED);
} else {
syslog(LOG_INFO, "[boot] W25N MTD registered at /dev/mtd0\n");
#ifdef CONFIG_FS_LITTLEFS
ret = nx_mount("/dev/mtd0", CONFIG_BOARD_ROOT_PATH, "littlefs", 0, NULL);
if (ret == 0) {
/* Verify the filesystem is usable by creating a test file */
int fd = open(CONFIG_BOARD_ROOT_PATH "/.mount_test", O_CREAT | O_WRONLY | O_TRUNC);
if (fd >= 0) {
close(fd);
unlink(CONFIG_BOARD_ROOT_PATH "/.mount_test");
} else {
syslog(LOG_WARNING, "[boot] littlefs mounted but not usable, reformatting\n");
nx_umount2(CONFIG_BOARD_ROOT_PATH, 0);
ret = -1;
}
}
if (ret < 0) {
ret = nx_mount("/dev/mtd0", CONFIG_BOARD_ROOT_PATH, "littlefs", 0, "forceformat");
}
if (ret < 0) {
syslog(LOG_ERR, "[boot] FAILED to mount littlefs: %d\n", ret);
led_on(LED_RED);
} else {
syslog(LOG_INFO, "[boot] LittleFS mounted at %s\n", CONFIG_BOARD_ROOT_PATH);
}
#endif
}
}
}
#endif
#if defined(FLASH_BASED_PARAMS)
/* Initialize parameters in internal flash (sector 15, 128KB at 0x081E0000) */
static sector_descriptor_t params_sector_map[] = {
{15, 128 * 1024, 0x081E0000},
{0, 0, 0},
};
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);
led_on(LED_RED);
}
#endif
/* Configure the HW based on the manifest */
px4_platform_configure();
return OK;
}
+205
View File
@@ -0,0 +1,205 @@
/****************************************************************************
*
* Copyright (c) 2026 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 <px4_platform_common/px4_config.h>
#include <stdbool.h>
#include "chip.h"
#include "stm32_gpio.h"
#include "board_config.h"
#include <nuttx/board.h>
#include <arch/board/board.h>
__BEGIN_DECLS
extern void led_init(void);
extern void led_on(int led);
extern void led_off(int led);
extern void led_toggle(int led);
__END_DECLS
#ifdef CONFIG_ARCH_LEDS
static bool nuttx_owns_leds = true;
static const uint8_t xlatpx4[] = {1, 2, 4, 0};
# define xlat(p) xlatpx4[(p)]
static uint32_t g_ledmap[] = {
GPIO_nLED_RED, // Indexed by BOARD_LED_RED
GPIO_nLED_GREEN, // Indexed by BOARD_LED_GREEN
GPIO_nLED_BLUE, // Indexed by BOARD_LED_BLUE
};
#else
# define xlat(p) (p)
static uint32_t g_ledmap[] = {
GPIO_nLED_RED, // LED_RED
GPIO_nLED_GREEN, // LED_GREEN
GPIO_nLED_BLUE, // LED_BLUE
};
#endif
__EXPORT void led_init(void)
{
for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) {
if (g_ledmap[l] != 0) {
stm32_configgpio(g_ledmap[l]);
}
}
}
static void phy_set_led(int led, bool state)
{
/* Drive Low to switch on (active low LEDs) */
if (led < (int)(sizeof(g_ledmap) / sizeof(g_ledmap[0])) && g_ledmap[led] != 0) {
stm32_gpiowrite(g_ledmap[led], !state);
}
}
static bool phy_get_led(int led)
{
/* If Low it is on */
if (led < (int)(sizeof(g_ledmap) / sizeof(g_ledmap[0])) && g_ledmap[led] != 0) {
return !stm32_gpioread(g_ledmap[led]);
}
return false;
}
__EXPORT void led_on(int led)
{
phy_set_led(xlat(led), true);
}
__EXPORT void led_off(int led)
{
phy_set_led(xlat(led), false);
}
__EXPORT void led_toggle(int led)
{
phy_set_led(xlat(led), !phy_get_led(xlat(led)));
}
#ifdef CONFIG_ARCH_LEDS
/****************************************************************************
* Public Functions
****************************************************************************/
void board_autoled_initialize(void)
{
led_init();
}
void board_autoled_on(int led)
{
if (!nuttx_owns_leds) {
return;
}
switch (led) {
default:
break;
case LED_HEAPALLOCATE:
phy_set_led(BOARD_LED_BLUE, true);
break;
case LED_IRQSENABLED:
phy_set_led(BOARD_LED_BLUE, false);
phy_set_led(BOARD_LED_GREEN, true);
break;
case LED_STACKCREATED:
phy_set_led(BOARD_LED_GREEN, true);
phy_set_led(BOARD_LED_BLUE, true);
break;
case LED_INIRQ:
phy_set_led(BOARD_LED_BLUE, true);
break;
case LED_SIGNAL:
phy_set_led(BOARD_LED_GREEN, true);
break;
case LED_ASSERTION:
phy_set_led(BOARD_LED_RED, true);
phy_set_led(BOARD_LED_BLUE, true);
break;
case LED_PANIC:
phy_set_led(BOARD_LED_RED, true);
break;
case LED_IDLE:
phy_set_led(BOARD_LED_RED, true);
break;
}
}
void board_autoled_off(int led)
{
if (!nuttx_owns_leds) {
return;
}
switch (led) {
default:
break;
case LED_SIGNAL:
phy_set_led(BOARD_LED_GREEN, false);
break;
case LED_INIRQ:
phy_set_led(BOARD_LED_BLUE, false);
break;
case LED_ASSERTION:
phy_set_led(BOARD_LED_RED, false);
phy_set_led(BOARD_LED_BLUE, false);
break;
case LED_PANIC:
phy_set_led(BOARD_LED_RED, false);
break;
case LED_IDLE:
phy_set_led(BOARD_LED_RED, false);
break;
}
}
#endif /* CONFIG_ARCH_LEDS */
+58
View File
@@ -0,0 +1,58 @@
/****************************************************************************
*
* Copyright (C) 2026 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 <px4_arch/spi_hw_description.h>
#include <drivers/drv_sensor.h>
#include <nuttx/spi/spi.h>
/*
* SPI bus configuration for AirBrainH743
*
* SPI1: IMU (Invensensev3/ICM42688P) - PA5 SCK, PA6 MISO, PA7 MOSI, PA3 CS
* SPI2: W25N Flash - PD3 SCK, PB14 MISO, PC3 MOSI, PD4 CS
* SPI4: External/AUX - PE12 SCK, PE5 MISO, PE6 MOSI
*/
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::PortA, GPIO::Pin3}),
}),
initSPIBus(SPI::Bus::SPI2, {
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortD, GPIO::Pin4}), // W25N Flash
}),
initSPIBusExternal(SPI::Bus::SPI4, {
initSPIConfigExternal(SPI::CS{GPIO::PortB, GPIO::Pin3}), // User 1 GPIO as chip select
}),
};
static constexpr bool unused = validateSPIConfig(px4_spi_buses);
@@ -0,0 +1,74 @@
/****************************************************************************
*
* Copyright (C) 2026 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 <px4_arch/io_timer_hw_description.h>
/*
* PWM output configuration for AirBrainH743
*
* M1: PE14 (TIM1_CH4)
* M2: PE13 (TIM1_CH3)
* M3: PE11 (TIM1_CH2)
* M4: PE9 (TIM1_CH1)
* M5: PB0 (TIM3_CH3)
* M6: PB1 (TIM3_CH4)
* M7: PB10 (TIM2_CH3)
* M8: PB11 (TIM2_CH4)
* M9: PA2 (TIM5_CH3) - LED strip
*
* Note: TIM2 is shared with buzzer pin PA15 (TIM2_CH1). The buzzer is disabled
* by default because the tone alarm driver would change the timer prescaler/ARR
* which affects M7/M8 PWM frequency. See board_config.h for details.
*/
constexpr io_timers_t io_timers[MAX_IO_TIMERS] = {
initIOTimer(Timer::Timer1, DMA{DMA::Index1, DMA::Stream0, DMA::Channel6}),
initIOTimer(Timer::Timer3, DMA{DMA::Index1, DMA::Stream2, DMA::Channel5}),
initIOTimer(Timer::Timer2, DMA{DMA::Index1, DMA::Stream6, DMA::Channel3}),
initIOTimer(Timer::Timer5),
};
constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel4}, {GPIO::PortE, GPIO::Pin14}), // M1
initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel3}, {GPIO::PortE, GPIO::Pin13}), // M2
initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel2}, {GPIO::PortE, GPIO::Pin11}), // M3
initIOTimerChannel(io_timers, {Timer::Timer1, Timer::Channel1}, {GPIO::PortE, GPIO::Pin9}), // M4
initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}), // M5
initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortB, GPIO::Pin1}), // M6
initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel3}, {GPIO::PortB, GPIO::Pin10}), // M7
initIOTimerChannel(io_timers, {Timer::Timer2, Timer::Channel4}, {GPIO::PortB, GPIO::Pin11}), // M8
initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel3}, {GPIO::PortA, GPIO::Pin2}), // M9 (LED)
};
constexpr io_timers_channel_mapping_t io_timers_channel_mapping =
initIOTimerChannelMapping(io_timers, timer_io_channels);
+75
View File
@@ -0,0 +1,75 @@
/****************************************************************************
*
* Copyright (C) 2026 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 usb.c
*
* Board-specific USB functions.
*/
#include "board_config.h"
#include <nuttx/usb/usbdev.h>
#include <nuttx/usb/usbdev_trace.h>
#include <stm32_otg.h>
#include <debug.h>
/************************************************************************************
* Name: stm32_usbinitialize
*
* Description:
* Called to setup USB-related GPIO pins for the board.
*
************************************************************************************/
__EXPORT void stm32_usbinitialize(void)
{
/* The OTG FS has an internal soft pull-up */
/* Configure the OTG FS VBUS sensing GPIO */
#ifdef CONFIG_STM32H7_OTGFS
stm32_configgpio(GPIO_OTGFS_VBUS);
#endif
}
/************************************************************************************
* Name: stm32_usbsuspend
*
* Description:
* Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is
* used. This function is called whenever the USB enters or leaves suspend mode.
*
************************************************************************************/
__EXPORT void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume)
{
uinfo("resume: %d\n", resume);
}
@@ -16,36 +16,36 @@
# 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_DATE=y
CONFIG_NSH_DISABLE_DF=y
# CONFIG_NSH_DISABLE_ECHO is not set
# CONFIG_NSH_DISABLE_ENV is not set
# CONFIG_NSH_DISABLE_EXEC is not set
# CONFIG_NSH_DISABLE_EXIT 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_EXPORT=y
CONFIG_NSH_DISABLE_FREE=y
CONFIG_NSH_DISABLE_GET=y
# 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_MKDIR=y
# CONFIG_NSH_DISABLE_MKFATFS is not set
# CONFIG_NSH_DISABLE_MOUNT is not set
# CONFIG_NSH_DISABLE_MV is not set
# CONFIG_NSH_DISABLE_PRINTF 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_PRINTF=y
CONFIG_NSH_DISABLE_PS=y
CONFIG_NSH_DISABLE_PSSTACKUSAGE=y
CONFIG_NSH_DISABLE_PWD=y
# CONFIG_NSH_DISABLE_RM is not set
# CONFIG_NSH_DISABLE_RMDIR is not set
CONFIG_NSH_DISABLE_RMDIR=y
# 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_TIME=y
# CONFIG_NSH_DISABLE_UMOUNT is not set
# CONFIG_NSH_DISABLE_UNSET is not set
# CONFIG_NSH_DISABLE_USLEEP is not set
@@ -1,5 +1,6 @@
CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
CONFIG_BOARD_ARCHITECTURE="cortex-m7"
CONFIG_BOARD_ROOT_PATH="/fs/flash"
CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3"
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS0"
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS1"
@@ -38,5 +38,6 @@ param set-default SYS_DM_BACKEND 1
# Ignore that there is no SD card
param set-default COM_ARM_SDCARD 0
# Disable logging
param set-default SDLOG_BACKEND 0
# W25N NAND flash with littlefs (128 MB): larger buffer, auto-rotate
set LOGGER_BUF 32
param set-default SDLOG_DIRS_MAX 3
@@ -99,7 +99,7 @@
* PLL1_VCO = (8,000,000 / 1) * 120 = 960 MHz
*
* PLL1P = PLL1_VCO/2 = 960 MHz / 2 = 480 MHz
* PLL1Q = PLL1_VCO/4 = 960 MHz / 4 = 240 MHz
* PLL1Q = PLL1_VCO/5 = 960 MHz / 5 = 192 MHz (SPI123 clock, max 200 MHz)
* PLL1R = PLL1_VCO/8 = 960 MHz / 8 = 120 MHz
*/
@@ -111,12 +111,12 @@
#define STM32_PLLCFG_PLL1M RCC_PLLCKSELR_DIVM1(1)
#define STM32_PLLCFG_PLL1N RCC_PLL1DIVR_N1(120)
#define STM32_PLLCFG_PLL1P RCC_PLL1DIVR_P1(2)
#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(4)
#define STM32_PLLCFG_PLL1Q RCC_PLL1DIVR_Q1(5)
#define STM32_PLLCFG_PLL1R RCC_PLL1DIVR_R1(8)
#define STM32_VCO1_FREQUENCY ((STM32_HSE_FREQUENCY / 1) * 120)
#define STM32_PLL1P_FREQUENCY (STM32_VCO1_FREQUENCY / 2)
#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 4)
#define STM32_PLL1Q_FREQUENCY (STM32_VCO1_FREQUENCY / 5)
#define STM32_PLL1R_FREQUENCY (STM32_VCO1_FREQUENCY / 8)
/* PLL2 */
@@ -227,9 +227,9 @@
#define STM32_RCC_D3CCIPR_I2C4SRC RCC_D3CCIPR_I2C4SEL_HSI
/* SPI123 clock source */
/* SPI123 clock source - PLL1Q = 192 MHz for W25N NAND flash (max 104 MHz) */
#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL2
#define STM32_RCC_D2CCIP1R_SPI123SRC RCC_D2CCIP1R_SPI123SEL_PLL1
/* SPI45 clock source */
@@ -281,17 +281,17 @@
#define STM32_SDMMC_INIT_CLKDIV (300 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
/* 25 MHz Max for now, 25 mHZ = PLL1Q/(2*div), div = PLL1Q/(2*freq)
* div = 4.8 = 240 / 50, So round up to 5 for default speed 24 MB/s
/* 25 MHz Max for now, 25 mHz = PLL1Q/(2*div), div = PLL1Q/(2*freq)
* PLL1Q = 192 MHz, div = 192 / 50 = 3.84, round up to 4 for 24 MHz
*/
#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA)
# define STM32_SDMMC_MMCXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
# define STM32_SDMMC_MMCXFR_CLKDIV (4 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
#else
# define STM32_SDMMC_MMCXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
#endif
#if defined(CONFIG_STM32H7_SDMMC_XDMA) || defined(CONFIG_STM32H7_SDMMC_IDMA)
# define STM32_SDMMC_SDXFR_CLKDIV (5 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
# define STM32_SDMMC_SDXFR_CLKDIV (4 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
#else
# define STM32_SDMMC_SDXFR_CLKDIV (100 << STM32_SDMMC_CLKCR_CLKDIV_SHIFT)
#endif
@@ -33,6 +33,10 @@
#pragma once
/* SPI1 DMA for W25N NAND Flash */
#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* DMA1 */
#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* DMA1 */
#define DMAMAP_SPI4_RX DMAMAP_DMA12_SPI4RX_1 /* DMA2 */
#define DMAMAP_SPI4_TX DMAMAP_DMA12_SPI4TX_1 /* DMA2 */
@@ -104,6 +104,10 @@ CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y
CONFIG_FS_PROCFS_MAX_TASKS=64
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_ROMFS=y
CONFIG_FS_LITTLEFS=y
CONFIG_FS_LITTLEFS_PROGRAM_SIZE_FACTOR=1
CONFIG_FS_LITTLEFS_READ_SIZE_FACTOR=1
CONFIG_FS_LITTLEFS_CACHE_SIZE_FACTOR=1
CONFIG_GRAN=y
CONFIG_GRAN_INTR=y
CONFIG_HAVE_CXX=y
@@ -126,7 +130,9 @@ CONFIG_MTD=y
CONFIG_MTD_BYTE_WRITE=y
CONFIG_MTD_PARTITION=y
CONFIG_MTD_PROGMEM=y
CONFIG_MTD_RAMTRON=y
# CONFIG_MTD_RAMTRON is not set
CONFIG_MTD_W25N=y
CONFIG_W25N_SPIFREQUENCY=104000000
CONFIG_NAME_MAX=40
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_ARGCAT=y
@@ -135,7 +141,7 @@ CONFIG_NSH_CMDPARMS=y
CONFIG_NSH_CROMFSETC=y
CONFIG_NSH_LINELEN=128
CONFIG_NSH_MAXARGUMENTS=15
CONFIG_NSH_MMCSDSPIPORTNO=1
# CONFIG_NSH_MMCSDSPIPORTNO is not set
CONFIG_NSH_NESTDEPTH=8
CONFIG_NSH_QUOTE=y
CONFIG_NSH_ROMFSETC=y
@@ -148,9 +154,6 @@ CONFIG_PREALLOC_TIMERS=50
CONFIG_PRIORITY_INHERITANCE=y
CONFIG_PTHREAD_MUTEX_ROBUST=y
CONFIG_PTHREAD_STACK_MIN=512
CONFIG_RAMTRON_EMULATE_PAGE_SHIFT=5
CONFIG_RAMTRON_EMULATE_SECTOR_SHIFT=5
CONFIG_RAMTRON_SETSPEED=y
CONFIG_RAM_SIZE=245760
CONFIG_RAM_START=0x20010000
CONFIG_RAW_BINARY=y
@@ -188,6 +191,7 @@ CONFIG_STM32H7_BKPSRAM=y
CONFIG_STM32H7_DMA1=y
CONFIG_STM32H7_DMA2=y
CONFIG_STM32H7_DMACAPABLE=y
CONFIG_STM32H7_DMAMUX1=y
CONFIG_STM32H7_FLOWCONTROL_BROKEN=y
CONFIG_STM32H7_I2C1=y
CONFIG_STM32H7_I2C_DYNTIMEO=y
@@ -202,6 +206,8 @@ CONFIG_STM32H7_SDMMC1=y
CONFIG_STM32H7_SERIALBRK_BSDCOMPAT=y
CONFIG_STM32H7_SERIAL_DISABLE_REORDERING=y
CONFIG_STM32H7_SPI1=y
CONFIG_STM32H7_SPI1_DMA=y
CONFIG_STM32H7_SPI1_DMA_BUFFER=4096
CONFIG_STM32H7_SPI2=y
CONFIG_STM32H7_SPI4=y
CONFIG_STM32H7_SPI4_DMA=y
@@ -59,6 +59,11 @@
# define BOARD_HAS_NBAT_V 1
# define BOARD_HAS_NBAT_I 1
/* Enable small flash logging support (for W25N NAND flash) */
#ifdef CONFIG_MTD_W25N
# define BOARD_SMALL_FLASH_LOGGING 1
#endif
/* Holybro KakuteH7 GPIOs ************************************************************************/
/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */
+46 -5
View File
@@ -59,6 +59,8 @@
#include <nuttx/spi/spi.h>
#include <nuttx/analog/adc.h>
#include <nuttx/mm/gran.h>
#include <nuttx/mtd/mtd.h>
#include <nuttx/fs/fs.h>
#include <chip.h>
#include <stm32_uart.h>
#include <arch/board/board.h>
@@ -79,6 +81,10 @@
# include <parameters/flashparams/flashfs.h>
#endif
#ifdef CONFIG_MTD_W25N
extern FAR struct mtd_dev_s *w25n_initialize(FAR struct spi_dev_s *dev, uint32_t spi_devid);
#endif
/****************************************************************************
* Pre-Processor Definitions
@@ -231,14 +237,49 @@ __EXPORT int board_app_initialize(uintptr_t arg)
led_on(LED_RED);
}
/* Get the SPI port for the microSD slot */
struct spi_dev_s *spi_dev = stm32_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO);
#ifdef CONFIG_MTD_W25N
/* Initialize W25N01GV NAND Flash on SPI1 */
struct spi_dev_s *spi1 = stm32_spibus_initialize(1);
if (!spi_dev) {
syslog(LOG_ERR, "[boot] FAILED to initialize SPI port %d\n", CONFIG_NSH_MMCSDSPIPORTNO);
led_on(LED_BLUE);
if (!spi1) {
syslog(LOG_ERR, "[boot] FAILED to initialize SPI1 for W25N\n");
led_on(LED_RED);
} else {
struct mtd_dev_s *mtd = w25n_initialize(spi1, 0);
if (!mtd) {
syslog(LOG_ERR, "[boot] FAILED to initialize W25N MTD driver\n");
led_on(LED_RED);
} else {
int ret = register_mtddriver("/dev/mtd0", mtd, 0755, NULL);
if (ret < 0) {
syslog(LOG_ERR, "[boot] FAILED to register MTD driver: %d\n", ret);
led_on(LED_RED);
} else {
syslog(LOG_INFO, "[boot] W25N MTD registered at /dev/mtd0\n");
#ifdef CONFIG_FS_LITTLEFS
ret = nx_mount("/dev/mtd0", CONFIG_BOARD_ROOT_PATH, "littlefs", 0, "autoformat");
if (ret < 0) {
syslog(LOG_ERR, "[boot] FAILED to mount littlefs: %d\n", ret);
led_on(LED_RED);
} else {
syslog(LOG_INFO, "[boot] LittleFS mounted at %s\n", CONFIG_BOARD_ROOT_PATH);
}
#endif
}
}
}
#endif
up_udelay(20);
+1 -1
View File
@@ -37,7 +37,7 @@
constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
initSPIBus(SPI::Bus::SPI1, {
initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::PortA, GPIO::Pin4})
initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortA, GPIO::Pin4}) // W25N01GV NAND Flash
}),
initSPIBus(SPI::Bus::SPI2, {
initSPIDevice(DRV_OSD_DEVTYPE_ATXXXX, SPI::CS{GPIO::PortB, GPIO::Pin12}),
+30
View File
@@ -31,4 +31,34 @@
#
############################################################################
# Initialize libfc-sensor-api submodule (fetches from GitLab if not present)
execute_process(
COMMAND Tools/check_submodules.sh boards/modalai/voxl2/libfc-sensor-api
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
)
include_directories(${PX4_BOARD_DIR}/libfc-sensor-api/inc)
# Build libfc_sensor.so stub library automatically if not already built
set(FC_SENSOR_LIB ${PX4_BOARD_DIR}/libfc-sensor-api/build/libfc_sensor.so)
if(NOT EXISTS ${FC_SENSOR_LIB})
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${PX4_BOARD_DIR}/libfc-sensor-api/build
)
execute_process(
COMMAND ${CMAKE_COMMAND} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} ..
WORKING_DIRECTORY ${PX4_BOARD_DIR}/libfc-sensor-api/build
RESULT_VARIABLE FC_SENSOR_CMAKE_RESULT
)
if(NOT FC_SENSOR_CMAKE_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to configure libfc_sensor stub library")
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${PX4_BOARD_DIR}/libfc-sensor-api/build
RESULT_VARIABLE FC_SENSOR_BUILD_RESULT
)
if(NOT FC_SENSOR_BUILD_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to build libfc_sensor stub library")
endif()
endif()
-2
View File
@@ -23,9 +23,7 @@ CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_HEATER=y
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16470=y
CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42670P=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM45686=y
-1
View File
@@ -180,7 +180,6 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION
initSPIFmumID(V6X_16, {
initSPIBus(SPI::Bus::SPI1, {
initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, 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}),
+1 -1
View File
@@ -92,7 +92,7 @@ static bool phy_get_led(int led)
{
if (g_ledmap[led] != 0) {
return imxrt_gpio_read(!g_ledmap[led]);
return !imxrt_gpio_read(g_ledmap[led]);
}
return false;
+3 -3
View File
@@ -8,12 +8,12 @@ board_adc start
# IMU
if ! icm42688p -s -b 1 -R 4 start
then
bmi270 -s -b 1 -R 4 start
bmi270 -s -b 1 -R 2 start
fi
if ! icm42688p -s -b 4 -R 4 start
then
bmi270 -s -b 4 -R 4 start
bmi270 -s -b 4 -R 2 start
fi
# baro
@@ -23,4 +23,4 @@ then
fi
# internal mag
qmc5883p -I -R 2 start
qmc5883p -I -R 4 start
+3
View File
@@ -16,6 +16,9 @@ logs
#Yarn log
yarn-error.log
# npm lockfile (project uses yarn)
package-lock.json
# Generated alternative _summary.md
# **/*/_summary.md
+8
View File
@@ -0,0 +1,8 @@
{
"proseWrap": "preserve",
"tabWidth": 2,
"useTabs": false,
"printWidth": 9999,
"endOfLine": "lf",
"embeddedLanguageFormatting": "off"
}
+65 -1
View File
@@ -254,7 +254,63 @@ export default defineConfig({
head.push(["link", { rel: "canonical", href: canonicalUrlToAdd }]);
}
// Add any other custom head tags you might want later
// Build version-aware site URL for OG tags
const branch = process.env.BRANCH_NAME || "main";
const siteUrl = `https://docs.px4.io/${branch}`;
// OG image — same image for all pages, but URL includes version base
const ogImage =
pageData.frontmatter.ogImage || `${siteUrl}/og-image.png`;
// Build the actual page URL (version-aware, includes locale prefix)
let ogPath = pageData.relativePath.replace(/\.md$/, "");
if (ogPath === "index") ogPath = "";
else if (ogPath.endsWith("/index"))
ogPath = ogPath.slice(0, -"/index".length);
const ogUrl = `${siteUrl}/${ogPath}`;
// Open Graph
head.push(
[
"meta",
{
property: "og:title",
content: pageData.title || "PX4 Autopilot",
},
],
[
"meta",
{
property: "og:description",
content:
pageData.description ||
"Open-source flight stack for drones and autonomous vehicles.",
},
],
["meta", { property: "og:url", content: ogUrl }],
["meta", { property: "og:image", content: ogImage }],
);
// Twitter Card
head.push(
[
"meta",
{
name: "twitter:title",
content: pageData.title || "PX4 Autopilot",
},
],
[
"meta",
{
name: "twitter:description",
content:
pageData.description ||
"Open-source flight stack for drones and autonomous vehicles.",
},
],
["meta", { name: "twitter:image", content: ogImage }],
);
// Return head that will be merged.
return head;
@@ -276,6 +332,14 @@ export default defineConfig({
gtag('js', new Date());
gtag('config', 'G-91EWVWRQ93');`,
],
// Open Graph
["meta", { property: "og:site_name", content: "PX4 Autopilot" }],
["meta", { property: "og:type", content: "website" }],
["meta", { property: "og:image:width", content: "1200" }],
["meta", { property: "og:image:height", content: "630" }],
["meta", { property: "og:image:type", content: "image/png" }],
// Twitter Card
["meta", { name: "twitter:card", content: "summary_large_image" }],
],
vue: {
+41
View File
@@ -160,3 +160,44 @@
.vp-doc img {
display: inline; /* block by default set by vitepress */
}
/**
* Custom styles for wide pages
* -------------------------------------------------------------------------- */
.is-wide-page .content-container {
max-width: 100% !important;
}
@media (min-width: 1280px) {
.is-wide-page .content {
min-width: 940px !important;
}
}
/* Make page width larger */
@media (min-width: 1440px) {
.is-wide-page .VPSidebar {
padding-left: 32px !important;
width: var(--vp-sidebar-width) !important;
}
.is-wide-page .VPContent.has-sidebar {
padding-left: var(--vp-sidebar-width) !important;
padding-right: 0 !important;
}
.is-wide-page .VPNavBar.has-sidebar .title {
padding-left: 32px !important;
}
.is-wide-page .VPNavBar.has-sidebar .content {
padding-left: var(--vp-sidebar-width) !important;
padding-right: 32px !important;
}
/* Very hacky */
.is-wide-page .VPNavBar.has-sidebar #local-search {
z-index: 10;
}
}
+1 -1
View File
@@ -653,7 +653,7 @@
id="tspan2761"
x="-83.335098"
y="147.11555"
style="font-size:3.88056px;writing-mode:lr-tb;stroke-width:0.264583px">simulator_mavlink.cpp</tspan></text>
style="font-size:3.88056px;writing-mode:lr-tb;stroke-width:0.264583px">SimulatorMavlink.cpp</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.79375;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.5875, 0.79375;stroke-dashoffset:2.46063;stroke-opacity:1;marker-start:url(#marker3113)"
d="m -42.713286,146.11223 h 8.466662"

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

+86
View File
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 612 335.8" style="enable-background:new 0 0 612 335.8;" xml:space="preserve">
<style type="text/css">
.st0{fill:#4D4E4E;}
.st1{fill:#27B373;}
.st2{fill:#5DC4CD;}
.st3{fill:#1E8756;}
</style>
<g>
<g>
<path class="st0" d="M66.1,232.6l-0.4-95.9h24c16.3,0,25.6,6.5,28,19.4c0.6,3,0.9,12.3,1,27.9c0.1,16.7-0.3,27-1.4,30.7
c-1.8,6.3-4.8,10.8-9.1,13.6c-4.2,2.8-10.2,4.2-18.1,4.2H66.1z M72.5,226h17.7c6.8,0,11.8-1.1,15-3.3c2.7-1.9,4.6-5.1,5.9-9.8
c0.9-2.9,1.3-12.2,1.3-27.9c0-15.1-0.3-24.4-1-27.7c-0.9-5-3.1-8.6-6.5-10.8c-3.4-2.2-8.5-3.3-15.2-3.3H72.2L72.5,226z"/>
<path class="st0" d="M129.1,232.6v-63.2h6.5v1c0,0.7,0.2,1.3,0.7,1.8c0.4,0.4,0.9,0.7,1.5,0.7c0.5,0,1-0.1,1.5-0.4
c3.9-1.9,7.2-3.1,9.9-3.7c1.4-0.3,2.7-0.4,4.1-0.4c4.9,0,9.3,2.2,13.4,6.6l-4.9,4.2c-2.7-2.9-5.5-4.3-8.5-4.3
c-0.8,0-1.6,0.1-2.6,0.3c-4,0.9-8.8,3.1-14.5,6.5l-0.7,0.4v50.6H129.1z"/>
<path class="st0" d="M176.4,229.2c-4.2-3.2-7.1-7.5-8.6-13c-2.3-8.2-2.4-17.9-0.4-29c1.2-6.3,3.7-11.1,7.7-14.4
c3.9-3.3,9-5,15.3-5c6,0,11.2,1.8,15.6,5.4c4.4,3.6,7.1,8.3,8.2,14.1c2.1,11.1,2,20.7-0.4,29c-1.6,5.6-4.4,9.9-8.5,13.1
c-4,3.1-8.8,4.7-14.4,4.7C185.4,234.1,180.5,232.5,176.4,229.2z M173.7,188.5c-1.9,10.1-1.8,18.7,0.3,25.9
c1.1,4.1,3.2,7.3,6.2,9.6c3,2.3,6.6,3.5,10.6,3.5c8.6,0,14.1-4.4,16.6-13.1c2.1-7.2,2.2-15.8,0.3-25.9c-0.8-4.3-2.8-7.7-5.9-10.3
c-3.1-2.5-7-3.8-11.5-3.8C181,174.5,175.5,179.1,173.7,188.5z"/>
<path class="st0" d="M262.2,232.6V189c0-5.9-1.2-9.9-3.5-12.1c-1.7-1.6-4.3-2.5-7.7-2.5c-0.4,0-0.9,0-1.4,0.1
c-6.1,0.3-12,2.3-17.8,6l-0.7,0.4v51.7h-6.5v-63.2h6.7c0.1,0.5,0.4,0.9,0.7,1.3c0.5,0.6,1.2,0.9,2.1,0.9c0.4,0,0.9-0.1,1.5-0.3
c5.6-1.9,10.2-3,13.6-3.2c0.6,0,1.2-0.1,1.8-0.1c5.2,0,9.2,1.4,12.2,4.2c3.6,3.5,5.5,9.1,5.5,16.8v43.5H262.2z"/>
<path class="st0" d="M289.4,229.2c-4.1-3.2-6.9-7.6-8.2-13c-2.6-10.4-2.7-19.8-0.3-28.1c1.8-6.5,4.9-11.5,9.1-15
c4.3-3.6,9.4-5.4,15.3-5.4c5.5,0,10,1.7,13.6,5c3.6,3.3,5.9,7.9,6.9,13.8c0.6,3.5,0.7,6.4,0.4,8.7l-0.3,2.3l-40,7.5l0.1,1.3
c0.2,2.8,0.7,5.6,1.4,8.3c1,4,2.9,7.2,5.9,9.5c2.9,2.3,6.5,3.5,10.6,3.5c5.9,0,10.7-1.9,14.5-5.6l4.9,4.2
c-5,5.3-11.5,7.9-19.4,7.9C298.4,234.1,293.5,232.4,289.4,229.2z M287.1,189.8c-0.5,2-0.9,4.2-1.1,6.7l-0.1,1.9l34.1-6.4l-0.1-1.3
c-0.1-1-0.2-2.1-0.4-3.2c-1.5-8.9-6.2-13.4-14.2-13.4C296.2,174.1,290.1,179.3,287.1,189.8z"/>
<path class="st0" d="M345.2,229.2c-4.2-3.2-7.1-7.5-8.6-13c-2.3-8.2-2.4-17.9-0.4-29c1.2-6.3,3.7-11.1,7.7-14.4
c3.9-3.3,9-5,15.3-5c8.4,0,14.9,3.2,19.5,9.5l-5.5,3.6c-3.3-4.3-8-6.5-14.1-6.5c-9.3,0-14.8,4.7-16.6,14.1
c-1.9,10.1-1.8,18.7,0.3,25.9c1.1,4.1,3.2,7.3,6.2,9.6c3,2.3,6.6,3.5,10.6,3.5c5.7,0,10.1-2.1,13.3-6.3l5.5,3.6
c-4.5,6.2-10.7,9.2-18.7,9.2C354.1,234.1,349.3,232.5,345.2,229.2z"/>
<path class="st0" d="M394.9,229.2c-4.2-3.2-7.1-7.5-8.6-13c-2.3-8.2-2.4-17.9-0.4-29c1.2-6.3,3.7-11.1,7.7-14.4
c3.9-3.3,9-5,15.3-5c6,0,11.2,1.8,15.6,5.4c4.4,3.6,7.1,8.3,8.2,14.1c2.1,11.1,2,20.7-0.4,29c-1.6,5.6-4.4,9.9-8.5,13.1
c-4,3.1-8.8,4.7-14.4,4.7C403.9,234.1,399.1,232.5,394.9,229.2z M392.3,188.5c-1.9,10.1-1.8,18.7,0.3,25.9
c1.1,4.1,3.2,7.3,6.2,9.6c3,2.3,6.6,3.5,10.6,3.5c8.6,0,14.1-4.4,16.6-13.1c2.1-7.2,2.2-15.8,0.3-25.9c-0.8-4.3-2.8-7.7-5.9-10.3
c-3.1-2.5-7-3.8-11.5-3.8C399.6,174.5,394,179.1,392.3,188.5z"/>
<path class="st0" d="M452.2,228.6c-3.9-3.7-6.5-8.6-7.6-14.6c-2.1-10.9-1.8-20.7,0.7-29.5c2.9-10.1,10.1-15.6,21.5-16.5
c0.8,0,1.7-0.1,2.6-0.1c4.3,0,8.3,0.8,12.1,2.4l1.9,0.8v-39h6.5v100.4h-6.7c-0.4-0.9-1.2-1.4-2.3-1.4c-0.4,0-0.9,0.1-1.3,0.2
c-4.6,1.9-9.1,2.8-13.5,2.8C460.7,234.1,456.1,232.2,452.2,228.6z M467.3,174.5c-8.5,0.6-13.7,4.6-15.8,11.8
c-2.3,7.8-2.5,16.7-0.6,26.6c0.8,4.5,2.6,8,5.4,10.7c2.8,2.7,6,4,9.7,4c5.9,0,11.5-1.8,16.7-5.4l0.6-0.4v-42.9l-0.6-0.4
c-3.9-2.6-8.4-3.9-13.4-3.9C468.6,174.4,468,174.4,467.3,174.5z"/>
<path class="st0" d="M508.6,229.2c-4.1-3.2-6.9-7.6-8.2-13c-2.6-10.4-2.7-19.8-0.3-28.1c1.8-6.5,4.9-11.5,9.1-15
c4.3-3.6,9.4-5.4,15.3-5.4c5.5,0,10,1.7,13.6,5c3.6,3.3,5.9,7.9,6.9,13.8c0.6,3.5,0.7,6.4,0.4,8.7l-0.3,2.3l-40,7.5l0.1,1.3
c0.2,2.8,0.7,5.6,1.4,8.3c1,4,2.9,7.2,5.9,9.5c2.9,2.3,6.5,3.5,10.6,3.5c5.9,0,10.7-1.9,14.5-5.6l4.9,4.2
c-5,5.3-11.5,7.9-19.4,7.9C517.6,234.1,512.7,232.4,508.6,229.2z M506.3,189.8c-0.5,2-0.9,4.2-1.1,6.7l-0.1,1.9l34.1-6.4l-0.1-1.3
c-0.1-1-0.2-2.1-0.4-3.2c-1.5-8.9-6.2-13.4-14.2-13.4C515.3,174.1,509.2,179.3,506.3,189.8z"/>
</g>
<g>
<path class="st1" d="M387.5,38.8c-1.5-2.3-6.1-3.2-10.6-1.4c0,0-58.1,21.9-58.3,22c-1.2,0.3-1.6,1.4-1.6,1.4l-13.8,28.2
c0,0-0.1,0.3-0.3,0.3c-0.2,0-0.3-0.3-0.3-0.3l-14-28.5c0,0-0.3-0.9-1.5-1.2c-0.3-0.1-58.3-22-58.3-22c-4.5-1.8-9.1-0.9-10.6,1.4
c-2.8,4.4,1.9,9,2.4,9.6l70.7,77.2c0,0,0,0.1,0.1,0.1l0,0c0,0,4.5,6.3,11.5,6.2c7,0.1,11.5-6.2,11.5-6.2l70.7-77.2
C385.5,47.7,390.3,43.2,387.5,38.8z"/>
<path class="st2" d="M287.5,121.3c0,0,1.6,2,3.8,4.2c1.8,2.6,5.9,6.2,11.5,6.3c7,0.1,11.5-6.2,11.5-6.2L385,48.4
c0.5-0.7,5.2-5.3,2.4-9.6c-1.5-2.3-6.1-3.2-10.6-1.4c0,0-58.1,21.9-58.3,22c-1.2,0.3-1.6,1.4-1.6,1.4L303.2,89
c0,0-0.1,0.3-0.4,0.3"/>
<path class="st3" d="M302.6,88.9c0,0,0.1,0.3,0.2,0.3s-15.3,32.1-15.3,32.1l-19.8-21.6l20.7-39.6L302.6,88.9z"/>
</g>
<g>
<path class="st3" d="M75.5,299h-6.8v-42.1h23.8v5.8H75.5v13.2h15.9v5.8H75.5V299z"/>
<path class="st3" d="M148,277.8c0,6.9-1.7,12.2-5.1,16c-3.4,3.8-8.3,5.7-14.6,5.7c-6.4,0-11.2-1.9-14.6-5.7
c-3.4-3.8-5.1-9.1-5.1-16.1s1.7-12.3,5.1-16c3.4-3.7,8.3-5.6,14.7-5.6c6.3,0,11.1,1.9,14.5,5.7C146.3,265.6,148,271,148,277.8z
M115.8,277.8c0,5.2,1,9.1,3.1,11.8c2.1,2.7,5.2,4,9.3,4c4.1,0,7.2-1.3,9.3-4s3.1-6.6,3.1-11.8c0-5.2-1-9.1-3.1-11.8s-5.1-4-9.2-4
c-4.1,0-7.2,1.3-9.3,4C116.9,268.8,115.8,272.7,115.8,277.8z"/>
<path class="st3" d="M200.5,256.8v27.3c0,3.1-0.7,5.8-2,8.2c-1.3,2.3-3.3,4.1-5.8,5.4s-5.5,1.9-9.1,1.9c-5.2,0-9.3-1.4-12.2-4.1
c-2.9-2.8-4.4-6.6-4.4-11.4v-27.1h6.9v26.6c0,3.5,0.8,6,2.4,7.7c1.6,1.7,4.1,2.5,7.4,2.5c6.5,0,9.7-3.4,9.7-10.2v-26.6H200.5z"/>
<path class="st3" d="M256.9,299h-8.4l-20.7-33.6h-0.2l0.1,1.9c0.3,3.6,0.4,6.8,0.4,9.8V299h-6.3v-42.1h8.4l20.7,33.4h0.2
c0-0.4-0.1-2-0.2-4.8c-0.1-2.8-0.2-4.9-0.2-6.5v-22.1h6.3V299z"/>
<path class="st3" d="M312.8,277.5c0,7-1.9,12.3-5.8,15.9c-3.9,3.7-9.4,5.5-16.7,5.5h-11.8v-42.1h13c6.7,0,11.9,1.8,15.6,5.4
C310.9,265.9,312.8,271,312.8,277.5z M305.5,277.7c0-10.1-4.7-15.1-14.1-15.1h-6v30.6h4.9C300.4,293.2,305.5,288,305.5,277.7z"/>
<path class="st3" d="M358.5,299l-4.2-11.7h-16.1L334,299h-7.3l15.8-42.3h7.5l15.8,42.3H358.5z M352.4,281.3l-3.9-11.5
c-0.3-0.8-0.7-2-1.2-3.6c-0.5-1.7-0.9-2.9-1.1-3.6c-0.5,2.4-1.3,4.9-2.3,7.8l-3.8,11H352.4z"/>
<path class="st3" d="M396.4,299h-6.9v-36.2h-12.4v-5.9h31.7v5.9h-12.4V299z"/>
<path class="st3" d="M425.7,299v-42.1h6.9V299H425.7z"/>
<path class="st3" d="M491.6,277.8c0,6.9-1.7,12.2-5.1,16c-3.4,3.8-8.3,5.7-14.6,5.7c-6.4,0-11.2-1.9-14.6-5.7
c-3.4-3.8-5.1-9.1-5.1-16.1s1.7-12.3,5.1-16c3.4-3.7,8.3-5.6,14.7-5.6c6.3,0,11.1,1.9,14.5,5.7C489.9,265.6,491.6,271,491.6,277.8
z M459.5,277.8c0,5.2,1,9.1,3.1,11.8c2.1,2.7,5.2,4,9.3,4c4.1,0,7.2-1.3,9.3-4c2.1-2.7,3.1-6.6,3.1-11.8c0-5.2-1-9.1-3.1-11.8
s-5.1-4-9.2-4c-4.1,0-7.2,1.3-9.3,4C460.5,268.8,459.5,272.7,459.5,277.8z"/>
<path class="st3" d="M546.3,299h-8.4l-20.7-33.6h-0.2l0.1,1.9c0.3,3.6,0.4,6.8,0.4,9.8V299h-6.3v-42.1h8.4l20.7,33.4h0.2
c0-0.4-0.1-2-0.2-4.8c-0.1-2.8-0.2-4.9-0.2-6.5v-22.1h6.3V299z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.4 KiB

+163
View File
@@ -0,0 +1,163 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 650 500" style="enable-background:new 0 0 650 500;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<g>
<path class="st0" d="M294.82,401.96c79.74,0,159.48,0.01,239.23-0.02c6.4,0,12.77-0.41,19.02-1.96
c11.51-2.86,21.12-8.67,28.49-18.07c6.12-7.8,10.16-16.62,12.59-26.13c4.11-16.08,7.95-32.24,11.87-48.37
c6.04-24.86,12.03-49.73,18.07-74.59c5.79-23.87,11.56-47.75,17.43-71.6c2.28-9.24,3.48-18.47,1.43-27.91
c-2.17-9.98-6.96-18.42-14.89-24.93c-8.8-7.22-19.09-10.24-30.31-10.24C436.83,98.12,275.92,98.12,115,98.13
c-5.72,0-11.38,0.69-16.93,2.1c-9.92,2.52-18.51,7.36-25.46,14.93c-6.72,7.32-11.33,15.91-14.11,25.36
c-2.76,9.38-5.02,18.91-7.39,28.4c-7.21,28.91-14.37,57.83-21.54,86.75c-6.83,27.54-13.6,55.09-20.52,82.61
c-2.3,9.16-3.73,18.31-1.82,27.71c2.34,11.58,8.11,20.96,17.84,27.77c8.69,6.08,18.54,8.21,28.97,8.21
C134.31,401.96,214.56,401.96,294.82,401.96z"/>
<path d="M294.82,401.96c-80.26,0-160.52,0-240.77,0c-10.43,0-20.28-2.14-28.97-8.21c-9.73-6.8-15.5-16.19-17.84-27.77
c-1.91-9.41-0.48-18.55,1.82-27.71c6.92-27.52,13.69-55.07,20.52-82.61c7.17-28.92,14.33-57.84,21.54-86.75
c2.37-9.49,4.63-19.02,7.39-28.4c2.79-9.45,7.39-18.04,14.11-25.36c6.95-7.57,15.54-12.41,25.46-14.93
c5.55-1.41,11.21-2.1,16.93-2.1c160.92-0.01,321.83-0.02,482.75,0.01c11.22,0,21.51,3.02,30.31,10.24
c7.93,6.51,12.72,14.95,14.89,24.93c2.05,9.43,0.84,18.67-1.43,27.91c-5.88,23.85-11.64,47.73-17.43,71.6
c-6.03,24.86-12.03,49.73-18.07,74.59c-3.92,16.13-7.75,32.29-11.87,48.37c-2.43,9.51-6.47,18.33-12.59,26.13
c-7.37,9.4-16.98,15.21-28.49,18.07c-6.25,1.55-12.63,1.96-19.02,1.96C454.31,401.97,374.56,401.96,294.82,401.96z M347.77,220.94
c0.2-0.26,0.25-0.37,0.33-0.44c21.16-16.45,42.32-32.89,63.48-49.34c1.51-1.17,2.99-2.45,2.37-4.68c-0.67-2.39-2.7-2.47-4.68-2.56
c-0.11,0-0.23-0.01-0.34-0.01c-6.75,0-13.51-0.14-20.26,0.09c-1.88,0.06-4.05,0.75-5.53,1.89c-12.16,9.41-24.18,18.99-36.25,28.52
c-3.71,2.93-7.42,5.85-11.18,8.81c-0.33-0.44-0.58-0.74-0.8-1.07c-7.85-11.51-15.75-22.98-23.48-34.56
c-1.81-2.71-4.04-3.73-7.14-3.7c-8.64,0.06-17.29,0.02-25.93,0.03c-1.03,0-2.07,0.01-3.09,0.13c-4.3,0.51-5.95,4.08-3.52,7.56
c8.94,12.84,17.89,25.67,26.84,38.51c3.42,4.91,6.83,9.83,10.3,14.82c-0.51,0.43-0.93,0.82-1.38,1.16
c-15.71,12-31.42,24-47.17,35.95c-0.75,0.57-1.84,0.96-2.77,0.97c-7.9,0.08-15.8,0.05-23.7,0.04c-0.47,0-0.95-0.07-1.31-0.1
c1.17-3.58,2.5-6.98,3.38-10.49c4.3-17.27,8.52-34.56,12.69-51.87c1.41-5.86,3.06-11.67,3.26-17.78
c0.28-8.53-3.37-14.09-11.46-16.73c-6.09-1.99-12.43-2.36-18.77-2.37c-34.34-0.04-68.69-0.03-103.03-0.03
c-0.52,0-1.03-0.02-1.54,0.02c-2.8,0.2-5.09,2.01-5.74,4.6c-0.73,2.92-1.44,5.85-2.09,8.8c-0.61,2.76,0.6,4.42,3.42,4.77
c0.62,0.08,1.26,0.03,1.89,0.03c32.97,0,65.94,0,98.91,0c0.92,0,1.84-0.04,2.75,0.03c2.51,0.19,3.34,1.1,3.22,3.62
c-0.05,1.01-0.26,2.03-0.5,3.03c-4.87,20.06-9.74,40.12-14.65,60.17c-0.84,3.42-1.74,6.83-2.72,10.21
c-0.64,2.21-2.08,3.64-4.54,3.74c-0.91,0.04-1.82,0.21-2.73,0.21c-6.3,0.02-12.59,0.01-18.89,0.01c-11.28,0-22.55-0.01-33.83,0.01
c-3.53,0.01-5.66,1.69-6.51,5.1c-0.71,2.87-1.39,5.75-2.06,8.63c-0.47,2.05,0.45,3.63,2.51,4.15c0.87,0.22,1.8,0.32,2.71,0.32
c18.15,0.02,36.29,0.08,54.44-0.03c4.56-0.03,9.13-0.42,13.66-0.98c3.45-0.43,6.84-1.38,10.27-2.11c0.63,2.3,1.8,3.2,4.43,3.2
c15.68-0.01,31.37,0.01,47.05-0.14c1.7-0.02,3.68-0.68,5.05-1.69c13.71-10.09,27.33-20.31,40.97-30.49
c3.09-2.31,6.18-4.6,9.32-6.94c0.34,0.49,0.58,0.81,0.79,1.14c7.53,11.71,15.09,23.4,22.54,35.17c1.34,2.11,3.02,2.9,5.38,2.89
c8.76-0.03,17.52,0,26.27-0.03c1.08,0,2.18-0.1,3.22-0.36c3.8-0.93,4.96-4.06,2.75-7.25c-6.1-8.77-12.21-17.52-18.31-26.28
C359.98,238.49,353.89,229.73,347.77,220.94z M489.13,228.49c-0.09,0.67-0.1,1.12-0.21,1.55c-3.7,15.25-7.4,30.5-11.1,45.75
c-0.84,3.47,0.48,5.31,4.08,5.35c7.38,0.07,14.77,0.07,22.15,0c3.47-0.03,5.87-2.13,6.68-5.49c3.63-15.03,7.31-30.05,10.85-45.11
c0.41-1.76,1.13-2.08,2.73-2.08c16.2,0.05,32.4,0.03,48.59,0.02c1.03,0,2.06-0.04,3.08-0.19c2.4-0.34,4.29-2.22,4.87-4.58
c0.73-2.98,1.67-5.91,2.25-8.91c0.19-0.96-0.15-2.5-0.82-3.03c-1.02-0.8-2.56-1.3-3.88-1.3c-16.6-0.08-33.2-0.05-49.8-0.05
c-0.68,0-1.36,0-2.11,0c0.05-0.55,0.05-0.95,0.14-1.33c3.21-13.09,6.42-26.18,9.65-39.26c0.9-3.67-0.67-5.86-4.43-5.89
c-7.1-0.06-14.2-0.05-21.29,0c-3.76,0.03-6.17,2.09-7.06,5.74c-3.2,13.15-6.43,26.29-9.64,39.44c-0.18,0.74-0.33,1.33-1.39,1.33
c-12.99-0.04-25.99-0.02-38.98-0.05c-2.14,0-3.59-1.27-3.84-3.4c-0.14-1.17-0.13-2.43,0.14-3.57c2.68-11.29,5.42-22.56,8.15-33.83
c0.84-3.47-0.73-5.64-4.29-5.67c-7.1-0.06-14.2-0.05-21.29,0c-3.65,0.02-5.98,1.87-6.87,5.46c-2.88,11.59-5.78,23.17-8.51,34.8
c-0.93,3.97-1.82,8.03-1.99,12.08c-0.26,6.08,3.83,10.83,9.68,11.89c1.95,0.35,3.99,0.31,5.99,0.32
c18.72,0.02,37.43,0.01,56.15,0.01C487.55,228.49,488.27,228.49,489.13,228.49z M89.55,322.76c3.72,0,7.44,0.02,11.16-0.01
c2.91-0.02,5.42-2.04,6.1-4.81c8.58-35.29,17.16-70.58,25.74-105.88c0.93-3.81-0.89-6.08-4.85-6.09c-6.52-0.01-13.04-0.01-19.57,0
c-4.38,0-6.83,2.01-7.87,6.29c-5.09,20.99-10.21,41.97-15.32,62.96c-3.46,14.19-6.92,28.38-10.36,42.58
c-0.77,3.18,0.65,4.93,3.98,4.95C82.23,322.78,85.89,322.76,89.55,322.76z M345.36,342.26c0.77,0,1.45,0,2.13,0
c9.78,0,19.57,0.02,29.35-0.01c4.94-0.01,8.85-3.05,9.86-7.62c1.73-7.83,3.44-15.66,5.13-23.5c1.01-4.66-1.4-7.83-6.17-7.86
c-11.38-0.07-22.77-0.08-34.15,0c-4.84,0.04-8.44,3.17-9.46,7.83c-1.91,8.72-3.84,17.44-5.74,26.16
c-1.05,4.82-2.06,9.65-3.08,14.48C339.59,352.7,343.88,349.37,345.36,342.26z M178.96,303.44c-0.38-0.09-0.54-0.17-0.7-0.17
c-13.84-0.01-27.68-0.09-41.52,0.03c-4.83,0.04-8.29,3.27-9.31,8.02c-1.65,7.67-3.3,15.34-4.99,23c-1.03,4.66,1.32,7.89,6.07,7.92
c13.56,0.07,27.11,0.01,40.67,0.05c1.08,0,1.42-0.36,1.64-1.42c0.98-4.85,2.1-9.66,3.16-14.49
C175.63,318.77,177.28,311.17,178.96,303.44z M308.09,303.25c-5.55,0-11.1,0-16.65,0c-0.06,0-0.11,0-0.17,0
c-5.2,0.07-8.89,3.09-9.96,8.13c-1.63,7.68-3.28,15.35-4.95,23.02c-1,4.58,1.32,7.8,5.98,7.83c11.45,0.08,22.89,0.07,34.34,0
c4.63-0.03,8.34-3.13,9.33-7.57c1.8-8.05,3.58-16.1,5.3-24.16c0.21-0.96,0.16-2.07-0.1-3.03c-0.74-2.8-2.94-4.2-6.46-4.21
C319.19,303.23,313.64,303.25,308.09,303.25z M473.33,342.26c5.55,0,11.1,0.02,16.65-0.01c5.04-0.02,8.77-2.91,9.87-7.79
c1.75-7.77,3.42-15.55,5.09-23.34c1.02-4.76-1.27-7.82-6.09-7.85c-11.39-0.08-22.78-0.08-34.17,0c-4.85,0.03-8.45,3.06-9.51,7.8
c-1.55,6.94-3.03,13.89-4.54,20.84c-0.17,0.78-0.29,1.57-0.46,2.34c-1.09,4.82,1.36,7.95,6.33,7.99
C462.11,342.29,467.72,342.26,473.33,342.26z M192.74,332.26c0-0.42-0.06-0.77,0.01-1.1c1.31-5.94,2.64-11.87,3.97-17.81
c0.12-0.55,0.24-1.11,0.37-1.67c1.23-5.49-1.4-8.62-7.03-8.45c-0.95,0.03-1.35,0.27-1.57,1.3c-2.12,10.01-4.34,20-6.48,30.01
c-0.98,4.58,1.42,7.66,6.12,7.69c11.38,0.07,22.77,0.07,34.15,0c4.81-0.03,8.56-3.33,9.56-7.99c1.65-7.73,3.37-15.44,5.04-23.16
c0.55-2.53,1.06-5.07,1.59-7.62c-5.73-0.93-10.51,2.17-11.71,7.47c-0.88,3.88-1.66,7.78-2.51,11.67c-0.71,3.25-1.45,6.49-2.15,9.65
C212.16,332.26,202.45,332.26,192.74,332.26z M525.75,303.27c0.14-1.77,0.54-3.38,0.33-4.91c-0.43-3.22-3.32-4.94-7.39-4.81
c-0.92,0.03-1.28,0.33-1.47,1.23c-2.88,13.45-5.79,26.9-8.69,40.34c-0.73,3.4,1.19,6.56,4.64,6.84c4.08,0.33,8.24,0.44,12.31,0.05
c4.97-0.47,8.23-4.55,8.31-9.7c-4.79,0-9.58,0-14.41,0c-0.02-0.35-0.08-0.58-0.03-0.79c1.26-5.83,2.5-11.67,3.84-17.49
c0.09-0.38,0.86-0.84,1.33-0.87c2.05-0.1,4.12-0.03,6.18-0.04c5.14-0.03,9.45-4.43,9.48-9.87
C535.34,303.27,530.51,303.27,525.75,303.27z M255.24,313.14c2.68,0,5.19,0.03,7.71-0.01c4.88-0.07,9.22-4.75,9.02-9.91
c-4.76,0-9.54,0-14.47,0c0.15-0.83,0.26-1.44,0.38-2.04c0.64-3.29-0.58-6.14-3.37-7.03c-1.52-0.49-3.3-0.64-4.83-0.3
c-0.55,0.12-0.7,2.09-1.02,3.22c-0.05,0.16-0.06,0.34-0.09,0.5c-2.69,12.28-5.4,24.55-8.07,36.83c-0.93,4.31,1.01,7.39,5.2,7.72
c3.81,0.3,7.68,0.33,11.48-0.04c5.08-0.5,8.69-4.86,8.49-9.78c-4.82,0-9.66,0-14.61,0C252.47,325.81,253.85,319.5,255.24,313.14z
M425.9,332.34c1.58-7.21,3.12-14.26,4.67-21.3c0.72-3.28-0.39-6.1-3.13-7.16c-1.24-0.48-2.67-0.42-4.02-0.64
c-1.06-0.17-1.41,0.44-1.6,1.31c-2.18,10.05-4.42,20.1-6.54,30.17c-0.88,4.17,1.23,7.15,5.38,7.44c3.64,0.25,7.33,0.29,10.97,0
c5.27-0.42,8.89-4.55,8.91-9.81C435.7,332.34,430.86,332.34,425.9,332.34z M401.48,317.9c-2.43-0.01-2.46-0.02-2.96,2.31
c-0.99,4.6-1.94,9.22-2.93,13.82c-1.13,5.22,1.23,8.17,6.53,8.27c1.35,0.03,1.89-0.41,2.16-1.7c1.03-5.06,2.12-10.11,3.24-15.15
C408.48,321.04,406,317.91,401.48,317.9z M400.15,312.96c0.26,0.08,0.37,0.15,0.48,0.15c1.94,0.01,3.89,0.03,5.83,0.03
c3.78,0,3.8,0.01,4.59-3.66c0.43-2.01,0.79-4.04,1.21-6.15c-3.51,0-6.69,0-9.99,0C401.56,306.55,400.87,309.7,400.15,312.96z"/>
<path class="st0" d="M347.77,220.94c6.11,8.79,12.21,17.55,18.31,26.31c6.1,8.76,12.21,17.52,18.31,26.28
c2.22,3.19,1.05,6.31-2.75,7.25c-1.04,0.26-2.15,0.35-3.22,0.36c-8.76,0.03-17.52,0-26.27,0.03c-2.36,0.01-4.04-0.78-5.38-2.89
c-7.45-11.77-15.01-23.46-22.54-35.17c-0.21-0.33-0.45-0.65-0.79-1.14c-3.14,2.34-6.24,4.63-9.32,6.94
c-13.64,10.18-27.26,20.4-40.97,30.49c-1.37,1.01-3.35,1.67-5.05,1.69c-15.68,0.15-31.37,0.13-47.05,0.14
c-2.63,0-3.79-0.9-4.43-3.2c-3.43,0.72-6.82,1.68-10.27,2.11c-4.53,0.56-9.1,0.96-13.66,0.98c-18.14,0.11-36.29,0.05-54.44,0.03
c-0.9,0-1.83-0.09-2.71-0.32c-2.05-0.52-2.98-2.1-2.51-4.15c0.67-2.88,1.34-5.76,2.06-8.63c0.84-3.4,2.98-5.09,6.51-5.1
c11.28-0.02,22.55-0.01,33.83-0.01c6.3,0,12.59,0.01,18.89-0.01c0.91,0,1.82-0.17,2.73-0.21c2.47-0.1,3.9-1.52,4.54-3.74
c0.98-3.38,1.89-6.79,2.72-10.21c4.9-20.05,9.78-40.11,14.65-60.17c0.24-0.99,0.45-2.01,0.5-3.03c0.12-2.52-0.71-3.43-3.22-3.62
c-0.91-0.07-1.83-0.03-2.75-0.03c-32.97,0-65.94,0-98.91,0c-0.63,0-1.27,0.04-1.89-0.03c-2.82-0.34-4.03-2-3.42-4.77
c0.65-2.94,1.36-5.87,2.09-8.8c0.65-2.59,2.93-4.39,5.74-4.6c0.51-0.04,1.03-0.02,1.54-0.02c34.34,0,68.69-0.01,103.03,0.03
c6.34,0.01,12.68,0.38,18.77,2.37c8.09,2.65,11.74,8.2,11.46,16.73c-0.2,6.11-1.85,11.92-3.26,17.78
c-4.17,17.3-8.39,34.6-12.69,51.87c-0.88,3.51-2.21,6.91-3.38,10.49c0.36,0.03,0.84,0.1,1.31,0.1c7.9,0.01,15.8,0.04,23.7-0.04
c0.94-0.01,2.02-0.4,2.77-0.97c15.75-11.95,31.46-23.95,47.17-35.95c0.45-0.34,0.86-0.72,1.38-1.16
c-3.47-4.99-6.88-9.91-10.3-14.82c-8.94-12.84-17.89-25.67-26.84-38.51c-2.43-3.48-0.77-7.05,3.52-7.56
c1.02-0.12,2.06-0.13,3.09-0.13c8.64-0.01,17.29,0.04,25.93-0.03c3.1-0.02,5.33,0.99,7.14,3.7c7.73,11.59,15.64,23.05,23.48,34.56
c0.22,0.33,0.47,0.63,0.8,1.07c3.76-2.96,7.47-5.88,11.18-8.81c12.07-9.53,24.09-19.11,36.25-28.52c1.47-1.14,3.65-1.83,5.53-1.89
c6.75-0.22,13.51-0.09,20.26-0.09c0.11,0,0.23,0,0.34,0.01c1.98,0.08,4.01,0.17,4.68,2.56c0.62,2.22-0.86,3.5-2.37,4.68
c-21.16,16.45-42.32,32.9-63.48,49.34C348.02,220.57,347.97,220.68,347.77,220.94z"/>
<path class="st0" d="M489.13,228.49c-0.86,0-1.59,0-2.32,0c-18.72,0-37.43,0.01-56.15-0.01c-2,0-4.04,0.04-5.99-0.32
c-5.85-1.06-9.94-5.81-9.68-11.89c0.17-4.05,1.06-8.11,1.99-12.08c2.73-11.62,5.63-23.21,8.51-34.8c0.89-3.59,3.22-5.44,6.87-5.46
c7.1-0.05,14.2-0.05,21.29,0c3.56,0.03,5.13,2.2,4.29,5.67c-2.73,11.27-5.47,22.55-8.15,33.83c-0.27,1.14-0.28,2.4-0.14,3.57
c0.26,2.13,1.7,3.39,3.84,3.4c12.99,0.03,25.99,0,38.98,0.05c1.05,0,1.2-0.58,1.39-1.33c3.21-13.15,6.43-26.29,9.64-39.44
c0.89-3.65,3.3-5.71,7.06-5.74c7.1-0.05,14.2-0.05,21.29,0c3.76,0.03,5.34,2.22,4.43,5.89c-3.22,13.09-6.44,26.17-9.65,39.26
c-0.09,0.38-0.09,0.79-0.14,1.33c0.75,0,1.43,0,2.11,0c16.6,0,33.2-0.03,49.8,0.05c1.32,0.01,2.85,0.51,3.88,1.3
c0.68,0.53,1.01,2.07,0.82,3.03c-0.58,3-1.52,5.93-2.25,8.91c-0.58,2.36-2.47,4.24-4.87,4.58c-1.01,0.15-2.05,0.19-3.08,0.19
c-16.2,0.01-32.4,0.03-48.59-0.02c-1.6-0.01-2.32,0.32-2.73,2.08c-3.54,15.06-7.22,30.08-10.85,45.11
c-0.81,3.36-3.21,5.46-6.68,5.49c-7.38,0.07-14.77,0.07-22.15,0c-3.6-0.03-4.92-1.88-4.08-5.35c3.7-15.25,7.41-30.5,11.1-45.75
C489.03,229.6,489.05,229.15,489.13,228.49z"/>
<path class="st0" d="M89.55,322.76c-3.66,0-7.32,0.02-10.98,0c-3.33-0.02-4.75-1.77-3.98-4.95c3.44-14.2,6.9-28.39,10.36-42.58
c5.11-20.99,10.23-41.97,15.32-62.96c1.04-4.29,3.49-6.29,7.87-6.29c6.52,0,13.04-0.01,19.57,0c3.96,0.01,5.77,2.28,4.85,6.09
c-8.58,35.29-17.16,70.59-25.74,105.88c-0.67,2.77-3.19,4.79-6.1,4.81C96.99,322.78,93.27,322.76,89.55,322.76z"/>
<path class="st0" d="M345.36,342.26c-1.47,7.11-5.76,10.44-12.14,9.48c1.03-4.83,2.03-9.66,3.08-14.48
c1.9-8.72,3.83-17.44,5.74-26.16c1.02-4.67,4.62-7.8,9.46-7.83c11.38-0.08,22.77-0.08,34.15,0c4.77,0.03,7.18,3.2,6.17,7.86
c-1.69,7.84-3.4,15.67-5.13,23.5c-1.01,4.57-4.92,7.61-9.86,7.62c-9.78,0.02-19.57,0.01-29.35,0.01
C346.81,342.26,346.13,342.26,345.36,342.26z M381.26,313.22c-9.88,0-19.63,0-29.58,0c-1.37,6.28-2.75,12.59-4.16,19.03
c9.9,0,19.66,0,29.58,0C378.48,325.96,379.86,319.65,381.26,313.22z"/>
<path class="st0" d="M178.96,303.44c-1.68,7.73-3.33,15.33-4.99,22.93c-1.06,4.83-2.17,9.65-3.16,14.49
c-0.21,1.06-0.56,1.42-1.64,1.42c-13.56-0.03-27.11,0.02-40.67-0.05c-4.76-0.02-7.1-3.25-6.07-7.92c1.69-7.66,3.34-15.33,4.99-23
c1.02-4.75,4.48-7.98,9.31-8.02c13.84-0.11,27.68-0.03,41.52-0.03C178.42,303.27,178.58,303.35,178.96,303.44z M132.95,332.35
c9.64,0,19.14,0.01,28.63-0.05c0.4,0,1.05-0.61,1.15-1.04c0.88-3.71,1.66-7.44,2.47-11.16c0.49-2.26,1-4.52,1.52-6.88
c-9.99,0-19.76,0-29.56,0C135.77,319.55,134.39,325.82,132.95,332.35z"/>
<path class="st0" d="M308.09,303.25c5.55,0,11.1-0.02,16.65,0.01c3.52,0.02,5.72,1.41,6.46,4.21c0.25,0.96,0.3,2.06,0.1,3.03
c-1.72,8.07-3.5,16.12-5.3,24.16c-0.99,4.44-4.7,7.54-9.33,7.57c-11.45,0.07-22.89,0.08-34.34,0c-4.66-0.03-6.98-3.26-5.98-7.83
c1.68-7.67,3.32-15.34,4.95-23.02c1.07-5.03,4.76-8.06,9.96-8.13c0.06,0,0.11,0,0.17,0C296.99,303.25,302.54,303.25,308.09,303.25z
M286.85,332.35c9.64,0,19.08,0.02,28.52-0.05c0.44,0,1.14-0.64,1.26-1.1c0.76-2.97,1.41-5.98,2.07-8.98
c0.65-2.97,1.27-5.95,1.9-8.97c-9.98,0-19.74,0-29.52,0C289.66,319.61,288.28,325.88,286.85,332.35z"/>
<path class="st0" d="M473.33,342.26c-5.61,0-11.22,0.03-16.83-0.01c-4.98-0.04-7.42-3.17-6.33-7.99c0.17-0.78,0.3-1.57,0.46-2.34
c1.51-6.95,2.99-13.9,4.54-20.84c1.06-4.74,4.66-7.76,9.51-7.8c11.39-0.08,22.78-0.08,34.17,0c4.82,0.03,7.11,3.09,6.09,7.85
c-1.67,7.78-3.33,15.57-5.09,23.34c-1.1,4.88-4.82,7.76-9.87,7.79C484.43,342.28,478.88,342.26,473.33,342.26z M460.65,332.34
c9.65,0,19.19,0.01,28.73-0.05c0.36,0,0.93-0.68,1.05-1.14c0.74-2.92,1.39-5.86,2.03-8.8c0.66-3.02,1.28-6.05,1.94-9.14
c-9.97,0-19.73,0-29.54,0C463.46,319.59,462.07,325.9,460.65,332.34z"/>
<path class="st0" d="M192.74,332.26c9.71,0,19.42,0,29.36,0c0.71-3.16,1.45-6.4,2.15-9.65c0.85-3.89,1.63-7.79,2.51-11.67
c1.21-5.3,5.98-8.4,11.71-7.47c-0.53,2.54-1.04,5.08-1.59,7.62c-1.68,7.72-3.39,15.43-5.04,23.16c-1,4.66-4.75,7.96-9.56,7.99
c-11.38,0.07-22.77,0.07-34.15,0c-4.71-0.03-7.1-3.1-6.12-7.69c2.14-10.01,4.36-20,6.48-30.01c0.22-1.03,0.62-1.27,1.57-1.3
c5.63-0.16,8.25,2.97,7.03,8.45c-0.12,0.55-0.24,1.11-0.37,1.67c-1.33,5.94-2.66,11.87-3.97,17.81
C192.68,331.49,192.74,331.84,192.74,332.26z"/>
<path class="st0" d="M525.75,303.27c4.76,0,9.59,0,14.42,0c-0.03,5.44-4.33,9.84-9.48,9.87c-2.06,0.01-4.12-0.05-6.18,0.04
c-0.47,0.02-1.24,0.48-1.33,0.87c-1.33,5.82-2.58,11.65-3.84,17.49c-0.04,0.21,0.02,0.44,0.03,0.79c4.83,0,9.62,0,14.41,0
c-0.08,5.15-3.33,9.23-8.31,9.7c-4.07,0.38-8.23,0.27-12.31-0.05c-3.45-0.28-5.38-3.43-4.64-6.84c2.9-13.45,5.81-26.89,8.69-40.34
c0.19-0.9,0.55-1.2,1.47-1.23c4.07-0.13,6.95,1.59,7.39,4.81C526.29,299.89,525.89,301.5,525.75,303.27z"/>
<path class="st0" d="M255.24,313.14c-1.39,6.36-2.77,12.67-4.19,19.16c4.95,0,9.78,0,14.61,0c0.2,4.92-3.41,9.28-8.49,9.78
c-3.8,0.37-7.67,0.33-11.48,0.04c-4.2-0.33-6.14-3.42-5.2-7.72c2.66-12.28,5.37-24.56,8.07-36.83c0.04-0.17,0.05-0.34,0.09-0.5
c0.33-1.13,0.48-3.1,1.02-3.22c1.53-0.33,3.32-0.18,4.83,0.3c2.79,0.89,4.01,3.75,3.37,7.03c-0.12,0.6-0.22,1.21-0.38,2.04
c4.93,0,9.71,0,14.47,0c0.21,5.16-4.13,9.84-9.02,9.91C260.43,313.16,257.92,313.14,255.24,313.14z"/>
<path class="st0" d="M425.9,332.34c4.97,0,9.81,0,14.65,0c-0.02,5.26-3.64,9.39-8.91,9.81c-3.64,0.29-7.33,0.26-10.97,0
c-4.15-0.29-6.26-3.27-5.38-7.44c2.12-10.07,4.35-20.11,6.54-30.17c0.19-0.87,0.54-1.49,1.6-1.31c1.34,0.22,2.78,0.17,4.02,0.64
c2.74,1.06,3.85,3.88,3.13,7.16C429.01,318.09,427.47,325.13,425.9,332.34z"/>
<path class="st0" d="M401.48,317.9c4.53,0.02,7.01,3.15,6.03,7.55c-1.11,5.04-2.21,10.09-3.24,15.15c-0.26,1.29-0.81,1.73-2.16,1.7
c-5.3-0.1-7.66-3.05-6.53-8.27c1-4.6,1.94-9.22,2.93-13.82C399.02,317.88,399.05,317.89,401.48,317.9z"/>
<path class="st0" d="M400.15,312.96c0.71-3.26,1.41-6.41,2.11-9.62c3.3,0,6.49,0,9.99,0c-0.41,2.11-0.77,4.14-1.21,6.15
c-0.79,3.66-0.81,3.66-4.59,3.66c-1.94,0-3.89-0.01-5.83-0.03C400.52,313.11,400.41,313.04,400.15,312.96z"/>
<path d="M381.26,313.22c-1.4,6.42-2.78,12.73-4.15,19.03c-9.92,0-19.68,0-29.58,0c1.41-6.43,2.78-12.74,4.16-19.03
C361.63,313.22,371.38,313.22,381.26,313.22z"/>
<path d="M132.95,332.35c1.44-6.52,2.82-12.79,4.22-19.13c9.8,0,19.57,0,29.56,0c-0.52,2.36-1.03,4.62-1.52,6.88
c-0.81,3.72-1.59,7.45-2.47,11.16c-0.1,0.43-0.75,1.04-1.15,1.04C152.09,332.36,142.6,332.35,132.95,332.35z"/>
<path d="M286.85,332.35c1.43-6.47,2.82-12.74,4.23-19.1c9.78,0,19.55,0,29.52,0c-0.64,3.02-1.25,6-1.9,8.97
c-0.66,3-1.31,6.01-2.07,8.98c-0.12,0.46-0.82,1.1-1.26,1.1C305.93,332.36,296.49,332.35,286.85,332.35z"/>
<path d="M460.65,332.34c1.42-6.44,2.81-12.75,4.21-19.13c9.82,0,19.58,0,29.54,0c-0.65,3.08-1.27,6.11-1.94,9.14
c-0.64,2.94-1.3,5.88-2.03,8.8c-0.11,0.46-0.69,1.14-1.05,1.14C479.85,332.36,470.3,332.34,460.65,332.34z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 17 KiB

+5 -1
View File
@@ -93,6 +93,7 @@
- [Back-transition Tuning](config_vtol/vtol_back_transition_tuning.md)
- [VTOL w/o Airspeed Sensor](config_vtol/vtol_without_airspeed_sensor.md)
- [VTOL Weather Vane](config_vtol/vtol_weathervane.md)
- [VTOL Ice Shedding](config_vtol/vtol_ice_shedding.md)
- [Flight Modes](flight_modes_vtol/index.md)
- [Mission Mode (VTOL)](flight_modes_vtol/mission.md)
- [Return Mode (VTOL)](flight_modes_vtol/return.md)
@@ -177,6 +178,7 @@
- [CubePilot Cube Orange (CubePilot)](flight_controller/cubepilot_cube_orange.md)
- [CubePilot Cube Yellow (CubePilot)](flight_controller/cubepilot_cube_yellow.md)
- [Cube Wiring Quickstart](assembly/quick_start_cube.md)
- [Gear Up AirBrainH743](flight_controller/gearup_airbrainh743.md)
- [Holybro Kakute H7v2](flight_controller/kakuteh7v2.md)
- [Holybro Kakute H7mini](flight_controller/kakuteh7mini.md)
- [Holybro Kakute H7](flight_controller/kakuteh7.md)
@@ -251,7 +253,7 @@
- [Benewake TFmini Lidar](sensor/tfmini.md)
- [LeddarOne Lidar](sensor/leddar_one.md)
- [Lidar-Lite](sensor/lidar_lite.md)
- [Lightware Lidars (SF/LW)](sensor/sfxx_lidar.md)
- [Lightware Lidars (SF/LW/GRF)](sensor/sfxx_lidar.md)
- [Lightware SF45 Rotary Lidar](sensor/sf45_rotating_lidar.md)
- [TeraRanger](sensor/teraranger.md)
- [✘ Lanbao PSK-CM8JL65-CC5](sensor/cm8jl65_ir_distance_sensor.md)
@@ -350,6 +352,7 @@
- [FrSky Telemetry](peripherals/frsky_telemetry.md)
- [TBS Crossfire (CRSF) Telemetry](telemetry/crsf_telemetry.md)
- [Satellite Comms (Iridium/RockBlock)](advanced_features/satcom_roadblock.md)
- [Analog Video Transmitters](vtx/index.md)
- [Power Systems](power_systems/index.md)
- [Battery Estimation Tuning](config/battery.md)
@@ -905,6 +908,7 @@
- [Terminology/Notation](contribute/notation.md)
- [Licenses](contribute/licenses.md)
- [Releases](releases/index.md)
- [Release Process](releases/release_process.md)
- [main (alpha)](releases/main.md)
- [1.17 (alpha)](releases/1.17.md)
- [1.16 (stable)](releases/1.16.md)
+2
View File
@@ -31,6 +31,7 @@ For more information see the topics for each data type:
- [Parameters & Configurations > Creating/Defining Parameters](../advanced/parameters_and_configurations.md#creating-defining-parameters)
- [Events Interface](../concept/events_interface.md)
- [Actuator Metadata](#actuator-metadata) (below)
## Metadata Toolchain
The process for handling metadata is the same for all metadata types.
@@ -69,6 +70,7 @@ The parameter XML file of the main branch is copied into the QGC source tree via
The following diagram shows how actuator metadata is assembled from the source code and used by QGroundControl:
![Actuators Metadata](../../assets/diagrams/actuator_metadata_processing.svg)
<!-- Source: https://docs.google.com/drawings/d/1hMQmIijdFjr21rREcXj50qz0C1b47JW0OEa6p5P231k/edit -->
- **Left**: the metadata is defined in `module.yml` files in different modules.
@@ -34,4 +34,3 @@ You can locate the parameters in QGroundControl as shown below:
Positive angles increase in CCW direction, negative angles increase in CW direction.
- [SENS_BOARD_Z_OFF](../advanced_config/parameter_reference.md#SENS_BOARD_Z_OFF): Rotation, in degrees, around PX4FMU's Z axis Yaw axis.
Positive angles increase in CCW direction, negative angles increase in CW direction.
@@ -63,7 +63,6 @@ The tool is available for Windows, Linux and macOS.
![Flash bootloader through Secure provisioning - Step 6](../../assets/advanced_config/bootloader_6xrt/bootloader_update_v6xrt_step6.png)
To get the Pixhawk V6X-RT into "ISP bootloader mode" there are 2 options:
1. Launch QGC connect the Pixhawk select **Analayze Tools** and then **MAVLINK Console**.
On the console type `reboot -i`.
This will put the Pixhawk V6X-RT into "ISP bootloader mode"
@@ -89,7 +89,6 @@ To calibrate the ESCs:
:::
Verify the following values:
- The minimum value for a motor (default: `1100us`) should make the motor spin slowly but reliably, and also spin up reliably after it was stopped.
You can confirm that a motor spins at minimum (still without propellers) in [Actuator Testing](../config/actuators.md#actuator-testing), by enabling the sliders, and then moving the test output slider for the motor to the first snap position from the bottom.
File diff suppressed because it is too large Load Diff
@@ -12,19 +12,16 @@ The [ARK Jetson Pixhawk Autopilot Bus (PAB) Carrier](https://arkelectron.gitbook
## Specifications
- **Power Requirements**
- 5V
- 4A minimum (dependent on usage and peripherals)
- **Additional Features**
- Pixhawk Autopilot Bus (PAB) Form Factor ([PAB Standard](https://github.com/pixhawk/Pixhawk-Standards/blob/master/DS-010%20Pixhawk%20Autopilot%20Bus%20Standard.pdf))
- MicroSD Slot
- USA-built, NDAA compliant
- Integrated 1W heater for sensor stability in extreme conditions
- **Physical Details**
- Weight:
- Without Jetson and Flight Controller 80g
- With Jetson, no heatsink or Flight Controller 108g
@@ -18,7 +18,6 @@ The board follows the [Pixhawk Connector Standard](https://github.com/pixhawk/Pi
- [Holybro Pixhawk RPi CM4 Baseboard](https://holybro.com/products/pixhawk-rpi-cm4-baseboard) (www.holybro.com)
The baseboard can be purchased with or without an RPi CM4 and/or flight controller:
- The Raspberry Pi CM4 (CM4008032) supplied by Holybro has the following specification:
- RAM: 8GB
- eMMC: 32GB
@@ -167,7 +166,6 @@ To enable this MAVLink instance on the FC:
![Image of baseboard showing FC USB-C connector](../../assets/companion_computer/holybro_pixhawk_rpi_cm4_baseboard/baseboard_fc_usb_c.jpg)
1. [Set the parameters](../advanced_config/parameters.md):
- `MAV_1_CONFIG` = `102`
- `MAV_1_MODE = 2`
- `SER_TEL2_BAUD` = `921600`
@@ -180,7 +178,6 @@ On the RPi side:
1. Connect to the RPi (using WiFi, a router, or a WiFi Dongle).
1. Enable the RPi serial port by running `RPi-config`
- Go to `3 Interface Options`, then `I6 Serial Port`.
Then choose:
- `login shell accessible over serial → No`
+1 -3
View File
@@ -91,7 +91,7 @@ During PX4 setup and configuration the USB connection with your ground station l
These instructions work on PX4 v1.14 and later.
If you need to update the firmware then connect the Pixhawk to your laptop/desktop via the `USB` port and use QGroundControl to update the firmware as described [Firmware > Install Stable PX4](../config/firmware.md#install-stable-px4).
If you need to update the firmware then connect the Pixhawk to your laptop/desktop via the `USB` port and use QGroundControl to update the firmware as described [Firmware > Install Stable PX4](../config/firmware.md#install-stable-px4).
If you want the latest developer version then update the firmware to the "main" as described in [Firmware > Installing PX4 Master, Beta or Custom Firmware](../config/firmware.md#installing-px4-main-beta-or-custom-firmware).
::: info
@@ -143,7 +143,6 @@ Enter the following commands (in sequence) a terminal to configure Ubuntu for RP
```
1. Go to the **Interface Option** and then click **Serial Port**.
- Select **No** to disable serial login shell.
- Select **Yes** to enable the serial interface.
- Click **Finish** and restart the RPi.
@@ -162,7 +161,6 @@ Enter the following commands (in sequence) a terminal to configure Ubuntu for RP
```
1. Then save the file and restart the RPi.
- In `nano` you can save the file using the following sequence of keyboard shortcuts: **ctrl+x**, **ctrl+y**, **Enter**.
1. Check that the serial port is available.
@@ -60,7 +60,7 @@ Configure collision prevention by [setting the following parameters](../advanced
| <a id="CP_DELAY"></a>[CP_DELAY](../advanced_config/parameter_reference.md#CP_DELAY) | Set the sensor and velocity setpoint tracking delay. See [Delay Tuning](#delay_tuning) below. |
| <a id="CP_GUIDE_ANG"></a>[CP_GUIDE_ANG](../advanced_config/parameter_reference.md#CP_GUIDE_ANG) | Set the angle (to both sides of the commanded direction) within which the vehicle may deviate if it finds fewer obstacles in that direction. See [Guidance Tuning](#angle_change_tuning) below. |
| <a id="CP_GO_NO_DATA"></a>[CP_GO_NO_DATA](../advanced_config/parameter_reference.md#CP_GO_NO_DATA) | Set to 1 to allow the vehicle to move in directions where there is no sensor coverage (default is 0/`False`). |
| <a id="MPC_POS_MODE"></a>[MPC_POS_MODE](../advanced_config/parameter_reference.md#MPC_POS_MODE) | Must be set to `Acceleration based`. |
| <a id="MPC_POS_MODE"></a>[MPC_POS_MODE](../advanced_config/parameter_reference.md#MPC_POS_MODE) | Must be set to `Acceleration based`. |
## Algorithm Description
@@ -213,7 +213,6 @@ The steps are:
3. Open PlotJuggler and navigate to the **Tools > Reactive Script Editor** section.
In the **Script Editor** tab, add following scripts in the appropriate sections:
- **Global code, executed once:**
```lua
-2
View File
@@ -32,7 +32,6 @@ The instructions below might be used to create a task named _MyTask_:
- FlightTaskMyTask.hpp
- FlightTaskMyTask.cpp
3. Update **CMakeLists.txt** for the new task
- Copy the contents of the **CMakeLists.txt** for another task - e.g. [Orbit/CMakeLists.txt](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/flight_mode_manager/tasks/Orbit/CMakeLists.txt)
- Update the copyright to the current year
@@ -135,7 +134,6 @@ The instructions below might be used to create a task named _MyTask_:
Usually a parameter is used to select when a particular flight task should be used.
For example, to enable our new `MyTask` in multicopter Position mode:
- Update `MPC_POS_MODE` ([multicopter_position_mode_params.c](https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/mc_pos_control/multicopter_position_mode_params.c)) to add an option for selecting "MyTask" if the parameter has a previously unused value like 5:
```c
+1 -1
View File
@@ -14,7 +14,7 @@ The directory structure/layout is shown below.
| `/etc/` | Extra config. See [System Startup > Replacing the System Startup][replace system start]. |
| `/log/` | Full [flight logs](../dev_log/logging.md) |
| `/mission_log/` | Reduced flight logs |
| `/fw/` | [DroneCAN](../dronecan/index.md) firmware |
| `/fw/` | [DroneCAN](../dronecan/index.md) firmware |
| `/uavcan.db/` | DroneCAN DNA server DB + logs |
| `/params` | Parameters (if not in FRAM/FLASH) |
| `/dataman` | Mission storage file |
+1 -9
View File
@@ -82,14 +82,9 @@ The test steps are:
If an [Enable/Disable Autotune Switch](#enable-disable-autotune-switch) is configured you can just toggle the switch to the "enabled" position.
</div></div>
1. In QGroundControl, open the menu **Vehicle setup > PID Tuning**:
![Tuning Setup > Autotune Enabled](../../assets/qgc/setup/autotune/autotune.png)
2. Select either the _Rate Controller_ or _Attitude Controller_ tabs.
3. Ensure that the **Autotune enabled** button is enabled (this will display the **Autotune** button and remove the manual tuning selectors).
4. Read the warning popup and click on **OK** to start tuning.
![Tuning Setup > Autotune Enabled](../../assets/qgc/setup/autotune/autotune.png) 2. Select either the _Rate Controller_ or _Attitude Controller_ tabs. 3. Ensure that the **Autotune enabled** button is enabled (this will display the **Autotune** button and remove the manual tuning selectors). 4. Read the warning popup and click on **OK** to start tuning.
<div style="display: inline;" v-if="$frontmatter.frame === 'Multicopter'">
@@ -197,11 +192,8 @@ By default, the autotune maneuvers ensure that a sufficient angular rate is reac
If the signal-to-noise ratio of the vehicle is low, the system identification algorithm might have issues finding the correct coefficients. Ensure that there is no excessive noise and/or platform vibration.
</div>
### The drone oscillates after auto-tuning
Due to effects not included in the mathematical model such as delays, saturation, slew-rate, airframe flexibility, the loop gain can be too high.
+23 -27
View File
@@ -4,15 +4,15 @@ This topic explains how to map [flight modes](../getting_started/px4_basic_conce
:::tip
In order to set up flight modes you must already have:
- [Configured your radio](../config/radio.md)
- [Setup your transmitter](#rc-transmitter-setup) to encode the physical positions of your mode switch(es) into a single channel.
We provide examples for the popular *Taranis* transmitter [below](#taranis-setup-3-way-switch-configuration-for-single-channel-mode) (check your documentation if you use a different transmitter).
:::
We provide examples for the popular _Taranis_ transmitter [below](#taranis-setup-3-way-switch-configuration-for-single-channel-mode) (check your documentation if you use a different transmitter).
:::
## What Flight Modes and Switches Should I Set?
Flight Modes provide different types of *autopilot-assisted flight*, and *fully autonomous flight*.
Flight Modes provide different types of _autopilot-assisted flight_, and _fully autonomous flight_.
You can set any (or none) of the flight modes [available to your vehicle](../flight_modes/index.md#flight-modes).
Most users should set the following modes and functions, as these make the vehicle easier and safer to fly:
@@ -33,26 +33,25 @@ You can also separately specify channels for mapping a kill switch, return to la
To configure single-channel flight mode selection:
1. Start *QGroundControl* and connect the vehicle.
1. Start _QGroundControl_ and connect the vehicle.
1. Turn on your RC transmitter.
1. Select **"Q" icon > Vehicle Setup > Flight Modes** (sidebar) to open _Flight Modes Setup_.
![Flight modes single-channel](../../assets/qgc/setup/flight_modes/flight_modes_single_channel.jpg)
1. Specify *Flight Mode Settings*:
* Select the **Mode channel** (above this shown as Channel 5, but this will depend on your transmitter configuration).
* Move the transmitter switch (or switches) that you have set up for mode selection through the available positions.
The mode slot matching your current switch position will be highlighted (above this is *Flight Mode 1*).
1. Specify _Flight Mode Settings_:
- Select the **Mode channel** (above this shown as Channel 5, but this will depend on your transmitter configuration).
- Move the transmitter switch (or switches) that you have set up for mode selection through the available positions.
The mode slot matching your current switch position will be highlighted (above this is _Flight Mode 1_).
::: info
While you can set flight modes in any of the 6 slots, only the channels that are mapped to switch positions will be highlighted/used.
:::
* Select the flight mode that you want triggered for each switch position.
1. Specify *Switch Settings*:
* Select the channels that you want to map to specific actions - e.g.: *Return* mode, *Kill switch*, *offboard* mode, etc. (if you have spare switches and channels on your transmitter).
- Select the flight mode that you want triggered for each switch position.
1. Specify _Switch Settings_:
- Select the channels that you want to map to specific actions - e.g.: _Return_ mode, _Kill switch_, _offboard_ mode, etc. (if you have spare switches and channels on your transmitter).
1. Test that the modes are mapped to the right transmitter switches:
* Check the *Channel Monitor* to confirm that the expected channel is changed by each switch.
* Select each mode switch on your transmitter in turn, and check that the desired flight mode is activated (the text turns yellow on *QGroundControl* for the active mode).
- Check the _Channel Monitor_ to confirm that the expected channel is changed by each switch.
- Select each mode switch on your transmitter in turn, and check that the desired flight mode is activated (the text turns yellow on _QGroundControl_ for the active mode).
All values are automatically saved as they are changed.
@@ -61,7 +60,6 @@ All values are automatically saved as they are changed.
This section contains a small number of possible setup configurations for taranis.
QGroundControl _may_ have [setup information for other transmitters here](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/flight_modes.html#transmitter-setup).
<a id="taranis_setup"></a>
### Taranis Setup: 3-way Switch Configuration for Single-Channel Mode
@@ -70,7 +68,7 @@ If you only need to support selecting between two or three modes then you can ma
Below we show how to map the Taranis 3-way "SD" switch to channel 5.
::: info
This example shows how to set up the popular *FrSky Taranis* transmitter.
This example shows how to set up the popular _FrSky Taranis_ transmitter.
Transmitter setup will be different on other transmitters.
:::
@@ -78,15 +76,14 @@ Open the Taranis UI **MIXER** page and scroll down to **CH5**, as shown below:
![Taranis - Map channel to switch](../../assets/qgc/setup/flight_modes/single_channel_mode_selection_1.png)
Press **ENT(ER)** to edit the **CH5** configuration then change the **Source** to be the *SD* button.
Press **ENT(ER)** to edit the **CH5** configuration then change the **Source** to be the _SD_ button.
![Taranis - Configure channel](../../assets/qgc/setup/flight_modes/single_channel_mode_selection_2.png)
That's it!
Channel 5 will now output 3 different PWM values for the three different **SD** switch positions.
The *QGroundControl* configuration is then as described in the previous section.
The _QGroundControl_ configuration is then as described in the previous section.
### Taranis Setup: Multi-Switch Configuration for Single-Channel Mode
@@ -96,19 +93,18 @@ Commonly this is done by encoding the positions of a 2- and a 3-position switch
On the FrSky Taranis this process involves assigning a "logical switch" to each combination of positions of the two real switches.
Each logical switch is then assigned to a different PWM value on the same channel.
The video below shows how this is done with the *FrSky Taranis* transmitter.
The video below shows how this is done with the _FrSky Taranis_ transmitter.
<!-- [youtube](https://youtu.be/scqO7vbH2jo) Video has gone private and is no longer available -->
<!-- @[youtube](https://youtu.be/BNzeVGD8IZI?t=427) - video showing how to set the QGC side - at about 7mins and 3 secs -->
<lite-youtube videoid="TFEjEQZqdVA" title="Taranis Mode Switches"/>
The *QGroundControl* configuration is then [as described above](#flight-mode-selection).
The _QGroundControl_ configuration is then [as described above](#flight-mode-selection).
## Further Information
* [Flight Modes Overview](../flight_modes/index.md)
* [QGroundControl > Flight Modes](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/flight_modes.html#px4-pro-flight-mode-setup)
* [PX4 Setup Video - @6m53s](https://youtu.be/91VGmdSlbo4?t=6m53s) (Youtube)
* [Radio switch parameters](../advanced_config/parameter_reference.md#radio-switches) - Can be used to set mappings via parameters
- [Flight Modes Overview](../flight_modes/index.md)
- [QGroundControl > Flight Modes](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/setup_view/flight_modes.html#px4-pro-flight-mode-setup)
- [PX4 Setup Video - @6m53s](https://youtu.be/91VGmdSlbo4?t=6m53s) (Youtube)
- [Radio switch parameters](../advanced_config/parameter_reference.md#radio-switches) - Can be used to set mappings via parameters
@@ -18,7 +18,6 @@ To level the horizon:
You should already have set the [Autopilot Orientation](../config/flight_controller_orientation.md). If not, you can also set it here.
:::
1. Place the vehicle in its level flight orientation on a level surface:
- For planes this is the position during level flight (planes tend to have their wings slightly pitched up!)
- For copters this is the hover position.
+9 -9
View File
@@ -106,7 +106,7 @@ The settings and underlying parameters are shown below.
| Setting | Parameter | Description |
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| <a id="COM_FLTT_LOW_ACT"></a> Low flight time for safe return action | [COM_FLTT_LOW_ACT](../advanced_config/parameter_reference.md#COM_FLTT_LOW_ACT) | Action when return mode can only just reach safety with remaining battery. `0`: None, `1`: Warning, `3`: Return mode (default). |
| <a id="COM_FLTT_LOW_ACT"></a> Low flight time for safe return action | [COM_FLTT_LOW_ACT](../advanced_config/parameter_reference.md#COM_FLTT_LOW_ACT) | Action when return mode can only just reach safety with remaining battery. `0`: None (default), `1`: Warning, `3`: Return mode. |
| <a id="COM_FLT_TIME_MAX"></a> Maximum flight time failsafe level | [COM_FLT_TIME_MAX](../advanced_config/parameter_reference.md#COM_FLT_TIME_MAX) | Maximum allowed flight time before Return mode will be engaged, in seconds. `-1`: Disabled (default). |
## Manual Control Loss Failsafe
@@ -128,10 +128,10 @@ Additional (and underlying) parameter settings are shown below.
| Parameter | Setting | Description |
| ----------------------------------------------------------------------------------------------------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="COM_RC_LOSS_T"></a>[COM_RC_LOSS_T](../advanced_config/parameter_reference.md#COM_RC_LOSS_T) | Manual Control Loss Timeout | Time after last setpoint received from the selected manual control source after which manual control is considered lost. This must be kept short because the vehicle will continue to fly using the last known stick position until the timeout triggers. |
| <a id="COM_RC_LOSS_T"></a>[COM_RC_LOSS_T](../advanced_config/parameter_reference.md#COM_RC_LOSS_T) | Manual Control Loss Timeout | Time after last setpoint received from the selected manual control source after which manual control is considered lost. This must be kept short because the vehicle will continue to fly using the last known stick position until the timeout triggers. |
| <a id="COM_FAIL_ACT_T"></a>[COM_FAIL_ACT_T](../advanced_config/parameter_reference.md#COM_FAIL_ACT_T) | Failsafe Reaction Delay | Delay in seconds between failsafe condition being triggered (`COM_RC_LOSS_T`) and failsafe action (RTL, Land, Hold). In this state the vehicle waits in hold mode for the manual control source to reconnect. This might be set longer for long-range flights so that intermittent connection loss doesn't immediately invoke the failsafe. It can be to zero so that the failsafe triggers immediately. |
| <a id="NAV_RCL_ACT"></a>[NAV_RCL_ACT](../advanced_config/parameter_reference.md#NAV_RCL_ACT) | Failsafe Action | Disabled, Loiter, Return, Land, Disarm, Terminate. |
| <a id="COM_RCL_EXCEPT"></a>[COM_RCL_EXCEPT](../advanced_config/parameter_reference.md#COM_RCL_EXCEPT) | RC Loss Exceptions | Set modes in which manual control loss is ignored. |
| <a id="COM_RCL_EXCEPT"></a>[COM_RCL_EXCEPT](../advanced_config/parameter_reference.md#COM_RCL_EXCEPT) | RC Loss Exceptions | Set modes in which manual control loss is ignored. |
## Data Link Loss Failsafe
@@ -142,11 +142,11 @@ Users that want to disable this failsafe in specific modes can do so using the p
The settings and underlying parameters are shown below.
| Setting | Parameter | Description |
| ---------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Data Link Loss Timeout | [COM_DL_LOSS_T](../advanced_config/parameter_reference.md#COM_DL_LOSS_T) | Amount of time after losing the data connection before the failsafe will trigger. |
| Failsafe Action | [NAV_DLL_ACT](../advanced_config/parameter_reference.md#NAV_DLL_ACT) | Disabled, Hold mode, Return mode, Land mode, Disarm, Terminate. |
| <a id="COM_DLL_EXCEPT"></a>Mode exceptions for DLL failsafe | [COM_DLL_EXCEPT](../advanced_config/parameter_reference.md#COM_DLL_EXCEPT) | Set modes in which data link loss is ignored. |
| Setting | Parameter | Description |
| ----------------------------------------------------------- | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| Data Link Loss Timeout | [COM_DL_LOSS_T](../advanced_config/parameter_reference.md#COM_DL_LOSS_T) | Amount of time after losing the data connection before the failsafe will trigger. |
| Failsafe Action | [NAV_DLL_ACT](../advanced_config/parameter_reference.md#NAV_DLL_ACT) | Disabled, Hold mode, Return mode, Land mode, Disarm, Terminate. |
| <a id="COM_DLL_EXCEPT"></a>Mode exceptions for DLL failsafe | [COM_DLL_EXCEPT](../advanced_config/parameter_reference.md#COM_DLL_EXCEPT) | Set modes in which data link loss is ignored. |
## Geofence Failsafe
@@ -283,7 +283,7 @@ Acting on a detected failure during flight is deactivated by default (enable by
During **takeoff** the failure detector [attitude trigger](#attitude-trigger) invokes the [disarm action](#act_disarm) if the vehicle flips (disarm kills the motors but, unlike flight termination, will not launch a parachute or perform other failure actions).
Note that this check is _always enabled on takeoff_, irrespective of the `CBRK_FLIGHTTERM` parameter.
The failure detector is active in all vehicle types and modes, except for those where the vehicle is _expected_ to do flips (i.e. [Acro mode (MC)](../flight_modes_mc/altitude.md), [Acro mode (FW)](../flight_modes_fw/altitude.md), and [Manual (FW)](../flight_modes_fw/manual.md)).
The failure detector is active in all vehicle types and modes, except for those where the vehicle is _expected_ to do flips (i.e. [Acro mode (MC)](../flight_modes_mc/acro.md), [Acro mode (FW)](../flight_modes_fw/acro.md), and [Manual (FW)](../flight_modes_fw/manual.md)).
### Attitude Trigger
+1 -1
View File
@@ -13,7 +13,7 @@ These are covered in the following topics:
- [Safe Points (Rally)](../flying/plan_safety_points.md)
- [Prearm/Arm/Disarm Configuration](../advanced_config/prearm_arm_disarm.md)
- [Flight Termination Configuration](../advanced_config/flight_termination.md)
- [First Flight Guidelines](../flying/first_flight_guidelines.md)
- [First Flight Guidelines](../flying/first_flight_guidelines.md)
::: tip
Note that the [First Flight Guidelines](../flying/first_flight_guidelines.md) are listed _last_.
-6
View File
@@ -42,14 +42,12 @@ To setup and configure a helicopter:
![Geometry: helicopter](../../assets/config/actuators/qgc_geometry_helicopter.png)
The motors have no configurable geometry:
- `Rotor (Motor 1)`: The main rotor
- `Yaw tail motor (Motor 2)`: The tail rotor
Swash plate servos: `3` | `4` <!-- 4 provides additional stability -->
For each servo set:
- `Angle`: Clockwise angle in degree on the swash plate circle at which the servo arm is attached starting from `0` pointing forwards.
Example for a typical setup where three servos are controlling the swash plate equally distributed over the circle (360° / 3 =) 120° apart each which results in the angles:
@@ -65,7 +63,6 @@ To setup and configure a helicopter:
- `Trim`: Offset individual servo positions. This is only needed in rare case when the swash plate is not level even though all servos are centered.
Additional settings:
- `Yaw compensation scale based on collective pitch`: How much yaw is feed forward compensated based on the current collective pitch.
- `Main rotor turns counter-clockwise`: `Disabled` (clockwise rotation) | `Enabled`
- `Throttle spoolup time`: Set value (in seconds) greater than the achievable minimum motor spool up time.
@@ -73,12 +70,10 @@ To setup and configure a helicopter:
1. Remove the rotor blades and propellers
1. Assign motors and servos to outputs and test (also in [Actuator configuration](../config/actuators.md)):
1. Assign the [motors and servos to the outputs](../config/actuators.md#actuator-outputs).
1. Power the vehicle with a battery and use the [actuator testing sliders](../config/actuators.md#actuator-testing) to validate correct servo and motor assignment and direction.
1. Using an RC in [Acro mode](../flight_modes_mc/acro.md), verify the correct movement of the swash-plate. With most airframes you need to see the following:
- Moving the roll stick to the right should tilt the swash-plate to the right.
- Moving the pitch stick forward should tilt the swash-plate forward.
@@ -144,7 +139,6 @@ The rate controller should be tuned in [Acro mode](../flight_modes_mc/acro.md),
3. Then enable the PID gains.
Start off with following values:
- [MC_ROLLRATE_P](../advanced_config/parameter_reference.md#MC_ROLLRATE_P), [MC_PITCHRATE_P](../advanced_config/parameter_reference.md#MC_PITCHRATE_P) a quarter of the value you found to work well as the corresponding feed forward value in the previous step. `P = FF / 4`
```sh
+2 -4
View File
@@ -123,14 +123,12 @@ Tuning is the final step, carried out only after most other setup and configurat
::: info
Automatic tuning works on frames that have reasonable authority and dynamics around all the body axes.
It has primarily been tested on racing quads and X500, and is expected to be less effective on tricopters with a tiltable rotor.
Manual tuning using these guides are only needed if there is a problem with autotune:
- [MC PID Tuning (Manual/Basic)](../config_mc/pid_tuning_guide_multicopter_basic.md) — Manual tuning basic how to.
- [MC PID Tuning Guide (Manual/Detailed)](../config_mc/pid_tuning_guide_multicopter.md) — Manual tuning with detailed explanation.
:::
:::
- [MC Filter/Control Latency Tuning](../config_mc/filter_tuning.md) — Trade off control latency and noise filtering.
- [MC Setpoint Tuning (Trajectory Generator)](../config_mc/mc_trajectory_tuning.md)
@@ -46,7 +46,6 @@ Then adjust the sliders (as discussed below) to improve the tracking of the resp
These need to be set low, but such that the **motors never stop** when the vehicle is armed.
This can be tested in [Acro mode](../flight_modes_mc/acro.md) or in [Stabilized mode](../flight_modes_mc/manual_stabilized.md):
- Remove propellers
- Arm the vehicle and lower the throttle to the minimum
- Tilt the vehicle to all directions, about 60 degrees
@@ -77,7 +76,6 @@ The tuning procedure is:
As a result, the optimal tuning at hover thrust may not be ideal when the vehicle is operating at higher thrust.
The thrust curve value can be used to compensate for this non-linearity:
- For PWM controllers, 0.3 is a good default (which may benefit from [further tuning](../config_mc/pid_tuning_guide_multicopter.md#thrust-curve)).
- For RPM-based controllers, use 1 (no further tuning is required as these have a quadratic thrust curve).
@@ -120,7 +118,6 @@ The tuning procedure is:
:::
1. Repeat the tuning process for the attitude controller on all the axes.
1. Repeat the tuning process for the velocity and positions controllers (on all the axes).
- Use Position mode when tuning these controllers
- Select the **Simple position control** option in the _Position control mode ..._ selector (this allows direct control for the generation of step inputs)
+27 -17
View File
@@ -18,27 +18,37 @@ A drive mode will only work properly if all the configuration for the preceding
## Flashing the Rover Build
Rovers use a custom build that must be flashed onto your flight controller instead of the default PX4 build:
Rover is built as a [firmware variant](../dev_setup/building_px4.md#px4-make-build-targets), and must be installed as "Custom Firmware" in QGC (other vehicles are present in the default variant).
1. First build the rover firmware for your flight controller from the `main` branch (there is no release build, so you can't just select this build from QGroundControl).
The release versions of Rover firmware for different boards are attached to the associated GitHub release tag.
For example, you can find `px4_fmu-v5x_rover.px4` on [PX4-Autopilot/releases/tag/v1.16.1](https://github.com/PX4/PX4-Autopilot/releases/tag/v1.16.1).
For the `main` branch version of Rover you will need to [build the firmware](#building-rover).
To build for rover with the `make` command, replace the `_default` suffix with `_rover`.
For example, to build rover for px4_fmu-v6x boards, you would use the command:
Load the firmware onto your flight controller as "Custom Firmware" (see [Loading Firmware > Installing PX4 Main, Beta or Custom Firmware](../config/firmware.md#installing-px4-main-beta-or-custom-firmware)).
```sh
make px4_fmu-v6x_rover
```
## Building Rover
::: info
You can also enable the modules in default builds by adding these lines to your [board configuration](../hardware/porting_guide_config.md) (e.g. for fmu-v6x you might add them to [`main/boards/px4/fmu-v6x/default.px4board`](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v6x/default.px4board)):
Rover is built as the `rover` [firmware variant](../dev_setup/building_px4.md#px4-make-build-targets).
What this means is that when building the firmware with the `make` command, you replace the `_default` suffix in the configuration target with `_rover`.
```sh
CONFIG_MODULES_ROVER_ACKERMANN=y
CONFIG_MODULES_ROVER_DIFFERENTIAL=y
CONFIG_MODULES_ROVER_MECANUM=y
```
For example, to build rover for `px4_fmu-v6x` boards, you would use the following command:
Note that adding the rover modules may lead to flash overflow, in which case you will need to disable modules that you do not plan to use (such as those related to multicopter or fixed wing).
:::
```sh
make px4_fmu-v6x_rover
```
2. Load the **custom firmware** that you just built onto your flight controller (see [Loading Firmware > Installing PX4 Main, Beta or Custom Firmware](../config/firmware.md#installing-px4-main-beta-or-custom-firmware)).
Note that configuration targets are constructed with the format "VENDOR_MODEL_VARIANT".
The built firmware can be installed as custom firmware, as shown above in in [Flashing the Rover Build](#flashing-the-rover-build).
::: info
You can also enable the modules in default builds by adding these lines to your [board configuration](../hardware/porting_guide_config.md) (e.g. for fmu-v6x you might add them to [`main/boards/px4/fmu-v6x/default.px4board`](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v6x/default.px4board)):
```sh
CONFIG_MODULES_ROVER_ACKERMANN=y
CONFIG_MODULES_ROVER_DIFFERENTIAL=y
CONFIG_MODULES_ROVER_MECANUM=y
```
Adding the rover modules may lead to flash overflow, in which case you will need to disable modules that you do not plan to use (such as those related to multicopter or fixed wing).
:::
-3
View File
@@ -15,13 +15,11 @@ Configure the following [parameters](../advanced_config/parameters.md) in QGroun
Small rovers especially can be prone to rolling over when steering aggressively at high speeds.
If this is the case:
1. In [Acro mode](../flight_modes_rover/manual.md#acro-mode), set [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM) to a small value, drive the rover at full throttle and steer all the way to the left or right.
2. Increase [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM) until the wheels of the rover start to lift up.
3. Set [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM) to the highest value that does not cause the rover to lift up.
If you see no need to limit the yaw rate, set this parameter to the maximum yaw rate the rover can achieve:
1. In [Manual mode](../flight_modes_rover/manual.md#manual-mode) drive the rover at full throttle and with the maximum steering angle.
2. Plot the `measured_yaw_rate` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) and enter the highest observed value for [RO_YAW_RATE_LIM](#RO_YAW_RATE_LIM).
@@ -51,7 +49,6 @@ Configure the following [parameters](../advanced_config/parameters.md) in QGroun
:::tip
To tune this parameter:
1. Put the rover in [Acro mode](../flight_modes_rover/manual.md#acro-mode) and hold the throttle stick and the right stick at a few different levels for a couple of seconds each.
1. Disarm the rover and from the flight log plot the `adjusted_yaw_rate_setpoint` and the `measured_yaw_rate` from [RoverRateStatus](../msg_docs/RoverRateStatus.md) over each other.
1. Increase [RO_YAW_RATE_P](#RO_YAW_RATE_P) if the measured value does not track the setpoint fast enough or decrease it if the measurement overshoots the setpoint by too much.
+1
View File
@@ -9,3 +9,4 @@ Then perform VTOL-specific configuration and tuning:
- [Back-transition Tuning](../config_vtol/vtol_back_transition_tuning.md)
- [VTOL w/o Airspeed Sensor](../config_vtol/vtol_without_airspeed_sensor.md)
- [VTOL Weather Vane](../config_vtol/vtol_weathervane.md)
- [Ice Shedding](../config_vtol/vtol_ice_shedding.md)

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