@protoboardai/ext-drone 0.0.0-stage → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +13 -0
- package/README.md +10 -2
- package/evals/gps-moved-to-uart3/case.json +32 -0
- package/lib/betaflight.ts +244 -0
- package/ops/betaflight.ts +16 -0
- package/ops/package.ts +92 -0
- package/package.json +47 -4
- package/protoboard-extension.json +49 -0
- package/skills/firmware-config/SKILL.md +178 -0
- package/skills/firmware-config/references/betaflight-reference.md +258 -0
- package/skills/firmware-verify/SKILL.md +126 -0
package/package.json
CHANGED
|
@@ -1,6 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protoboardai/ext-drone",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Protoboard extension: flight-controller configuration for multirotor drones.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "Delta Robotics, Inc.",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Delta-Robotics-Inc/protoboard-stack.git",
|
|
10
|
+
"directory": "packages/ext-drone"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"files": [
|
|
14
|
+
"protoboard-extension.json",
|
|
15
|
+
"ops",
|
|
16
|
+
"lib",
|
|
17
|
+
"skills",
|
|
18
|
+
"evals",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"NOTICE"
|
|
21
|
+
],
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=22"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@protoboardai/core": "^0.2.0",
|
|
30
|
+
"@deltarobotics/uhd": ">=0.3.0",
|
|
31
|
+
"@protoboardai/ext-release": "^0.2.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependenciesMeta": {
|
|
34
|
+
"@protoboardai/ext-release": {
|
|
35
|
+
"optional": true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"protoboard",
|
|
40
|
+
"hardware",
|
|
41
|
+
"drone",
|
|
42
|
+
"betaflight",
|
|
43
|
+
"multirotor"
|
|
44
|
+
],
|
|
45
|
+
"homepage": "https://protoboard.ai",
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/Delta-Robotics-Inc/protoboard-stack/issues"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "protoboard.extension/v0",
|
|
3
|
+
"id": "@protoboardai/ext-drone",
|
|
4
|
+
"version": "0.2.1",
|
|
5
|
+
"description": "Multirotor domain pack: flight-controller configuration (Betaflight) generated from the UHD model.",
|
|
6
|
+
"compatibility": {
|
|
7
|
+
"protoboard": "^0.2.0",
|
|
8
|
+
"uhd": ">=0.3.0"
|
|
9
|
+
},
|
|
10
|
+
"skills": [
|
|
11
|
+
{
|
|
12
|
+
"id": "firmware-config",
|
|
13
|
+
"summary": "Derive a flight-controller configuration from UHD links and part facts, every line cited, every setting checked against pinned firmware sources",
|
|
14
|
+
"path": "skills/firmware-config/SKILL.md",
|
|
15
|
+
"verifiedBy": "firmware-verify"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "firmware-verify",
|
|
19
|
+
"summary": "Bench-verify a generated FC configuration on hardware (props off) and record the result as measured test data",
|
|
20
|
+
"path": "skills/firmware-verify/SKILL.md"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"operations": [
|
|
24
|
+
{
|
|
25
|
+
"id": "betaflight-cli",
|
|
26
|
+
"summary": "Generate a Betaflight CLI dump (serial ports, receiver, OSD/VTX, GPS, compass) from the model's links; every line cites its link or part fact",
|
|
27
|
+
"entry": "./ops/betaflight.ts#betaflightCliOp",
|
|
28
|
+
"effect": "export",
|
|
29
|
+
"inputs": {
|
|
30
|
+
"out": {
|
|
31
|
+
"description": "output file, project-relative",
|
|
32
|
+
"default": "firmware/betaflight/cli.txt"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "package:work-order",
|
|
38
|
+
"summary": "Manufacturing Package: the flight-controller configuration (file and loading steps) in the root unit's work order; refuses a configuration that no longer matches the model",
|
|
39
|
+
"entry": "./ops/package.ts#workOrder",
|
|
40
|
+
"effect": "pure"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "package:test-plan",
|
|
44
|
+
"summary": "Manufacturing Package: the props-off bench check of the flight controller in the root unit's test plan",
|
|
45
|
+
"entry": "./ops/package.ts#testPlan",
|
|
46
|
+
"effect": "pure"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: firmware-config
|
|
3
|
+
description: Derive a controller's firmware configuration from a UHD system's links and part facts — Betaflight CLI for flight controllers today (protoboard run betaflight-cli; the same method for INAV, ArduPilot or PX4), and the firmware capability's pin and peripheral configuration for microcontroller boards as it lands — with every line citing the link or fact it comes from and every setting checked against the firmware's own source at a pinned version. Use when a system has a controller and its wiring is modelled, when wiring changes, or when moving firmware versions; follow with firmware-verify on the bench.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Firmware configuration from the model
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
UHD links + part facts ──► reference doc (settings verified in firmware source, pinned) ──► generator
|
|
10
|
+
│
|
|
11
|
+
firmware/<fw>/cli.txt (every line: "# link <id>: …" or "# <part>: <fact>") ◄──────┘
|
|
12
|
+
│
|
|
13
|
+
firmware-verify (bench) ◄────────┘
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The configuration is a *view* of the model: which UART the receiver is wired
|
|
17
|
+
to is a link, the current-sensor scale is an ESC fact, the compass address is
|
|
18
|
+
a GNSS fact. Nothing is typed from memory, and nothing is claimed flight-ready.
|
|
19
|
+
|
|
20
|
+
## Purpose
|
|
21
|
+
|
|
22
|
+
Produce the controller configuration a unit is flashed with, derived from the
|
|
23
|
+
model so it cannot disagree with the wiring silently. Use it when a system
|
|
24
|
+
has a flight controller or a microcontroller board and its wiring is
|
|
25
|
+
modelled, whenever wiring changes, and when moving firmware versions. In
|
|
26
|
+
**build-a-project** it is stage 9, after the checks are clean; the
|
|
27
|
+
configuration goes into the Manufacturing Package's `files/` and its
|
|
28
|
+
UNVERIFIED items into the test plan. **firmware-verify** follows on the
|
|
29
|
+
bench, performed by a person.
|
|
30
|
+
|
|
31
|
+
## Inputs
|
|
32
|
+
|
|
33
|
+
| Input | Where | From |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| The links to the controller (UARTs, I2C, motor outputs) | the root system and sub-assemblies, `npx protoboard inspect <fc instance>` | **system-compose**, **harness-author** |
|
|
36
|
+
| Part facts (firmware target, sensor scale, I2C address, motor poles, DShot rates) | the parts' definitions and evidence | **uhd-part-author**, the catalog |
|
|
37
|
+
| The firmware reference, source-pinned | `references/betaflight-reference.md` (this skill) | step 2 |
|
|
38
|
+
| A board's nets and pin assignment (microcontroller boards) | `src/boards/<module>/<module>.uhd.ts` | **circuit-board** |
|
|
39
|
+
|
|
40
|
+
## Steps
|
|
41
|
+
|
|
42
|
+
### 1. Generate (Betaflight)
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx protoboard run betaflight-cli # → firmware/betaflight/cli.txt + operation record
|
|
46
|
+
npx protoboard run betaflight-cli --format json # data: target, minFirmware, buildOptions, warnings
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Look at `data.warnings`: each is something the model could not decide (an
|
|
50
|
+
unknown peer on a UART, a motor-order mismatch, a target claimed only by
|
|
51
|
+
compatibility) and goes on the **firmware-verify** list.
|
|
52
|
+
|
|
53
|
+
Implementation: `@protoboardai/ext-drone` `lib/betaflight.ts`; reference:
|
|
54
|
+
[betaflight-reference.md](references/betaflight-reference.md) (every setting
|
|
55
|
+
checked against Betaflight 4.5.5, 2025.12.5 and 2026.6.2 sources, commits
|
|
56
|
+
pinned, UNVERIFIED items marked). Read the reference's gotchas before trusting
|
|
57
|
+
any output.
|
|
58
|
+
|
|
59
|
+
What the configuration is derived from:
|
|
60
|
+
|
|
61
|
+
| Setting family | Model input | Rule |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| Target | FC part facts (target name in traits/description, e.g. `MATEKF405TE`) | The FC must state its firmware target with a source; if it only claims compatibility (DolphinRC → MATEKF405TE), that is UNVERIFIED and goes to the bench list. |
|
|
64
|
+
| Serial ports | every `uart` link with the FC on one end: FC interface id `uartN` → port N; the other end's protocol/kind → function | CRSF receiver → `RX_SERIAL` (64) + `feature TELEMETRY`; u-blox GNSS → `GPS` (2) + provider; DJI air unit → `MSP + VTX_MSP` (131073) + HD OSD settings. An unknown peer is a warning, never a guess. |
|
|
65
|
+
| Motor protocol | FC motor outputs' and ESC inputs' `esc_signal_rate` | highest DShot rate both state; bidirectional only if both state the capability (cite it). |
|
|
66
|
+
| Unused UARTs | every `uartN` interface of the FC with no link | `serial UARTn 0 115200 57600 0 115200` (function 0, per-port default bauds), so a pasted file is complete: a port the model stopped using (the GPS moved from UART1 to UART3) is cleared, not left with its old function. |
|
|
67
|
+
| Motor poles | motor stator/magnet config fact (`12N14P`) | magnet poles. |
|
|
68
|
+
| Motor order | `bldc_3phase` links: ESC channel n → arm | compare with the firmware's mixer order (Quad-X: M1 rear-right, M2 front-right, M3 rear-left, M4 front-left); mismatch → warning (remap or rewire). |
|
|
69
|
+
| Current meter | ESC current-sensor fact (scale, offset) | `current_meter = ADC`, `ibata_scale`, `ibata_offset` from the ESC's manufacturer values. |
|
|
70
|
+
| Compass | `i2c` link to the FC; the peer's `i2c_address` and alignment fact | driver per address (0x2C QMC5883P needs ≥ 2025.12.1 → `minFirmware`), `align_mag` from the maker's mounting statement. |
|
|
71
|
+
| Build options | whatever the lines above need | e.g. `GPS`, `MAG`, `OSD_HD`, `SERIALRX_CRSF`, `DSHOT` for a cloud build. |
|
|
72
|
+
|
|
73
|
+
Each emitted line carries its reason: `serial UART2 64 … # link rx_crsf: stack:uart2 ↔ receiver:crsf (CRSF receiver → RX_SERIAL)`.
|
|
74
|
+
|
|
75
|
+
### 2. Add or change a rule
|
|
76
|
+
|
|
77
|
+
1. **Verify the setting first** in the firmware source at a pinned tag: the
|
|
78
|
+
CLI parser, the setting's table, value ranges, defaults, the target's
|
|
79
|
+
`config.h`. Add a section to the reference with `file#Lx-Ly` links, the
|
|
80
|
+
commit, and a **Δ** note for version differences. What cannot be checked in
|
|
81
|
+
source is marked **UNVERIFIED** and becomes a firmware-verify item.
|
|
82
|
+
2. **Find the model input.** If the fact is not in the model (a pad label, a
|
|
83
|
+
scale factor), add it to the part with its source (**uhd-part-author**,
|
|
84
|
+
repair mode) instead of hard-coding it in the generator.
|
|
85
|
+
3. **Emit with a reason** naming the link id or `<part id>: <fact>`, and a
|
|
86
|
+
warning when the model cannot decide.
|
|
87
|
+
4. Regenerate, diff `firmware/<fw>/cli.txt`, commit output and operation
|
|
88
|
+
record together.
|
|
89
|
+
|
|
90
|
+
### 3. Another firmware
|
|
91
|
+
|
|
92
|
+
Same pattern, new files in `@protoboardai/ext-drone`: `lib/<fw>.ts` (pure:
|
|
93
|
+
model → lines with reasons + warnings), `ops/<fw>.ts` (writes
|
|
94
|
+
`firmware/<fw>/…`), an operation in the manifest, and
|
|
95
|
+
`skills/firmware-config/references/<fw>-reference.md` written *before* the
|
|
96
|
+
generator, with the same verification standard (source-pinned, UNVERIFIED
|
|
97
|
+
marked, version deltas). Parameter names and serial-function values differ per
|
|
98
|
+
firmware; the link → function mapping in step 1 does not.
|
|
99
|
+
|
|
100
|
+
### 4. Microcontroller boards (the firmware capability, planned)
|
|
101
|
+
|
|
102
|
+
Custom boards with a microcontroller (Zephyr devicetree overlays and Kconfig
|
|
103
|
+
for nRF52840, ESP-IDF pin headers and sdkconfig for ESP32-C3) get their
|
|
104
|
+
starting configuration from a `firmware` capability provider, being built
|
|
105
|
+
now. It follows the capability pattern, so expect:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npx protoboard run firmware:generate --module <board> # planned
|
|
109
|
+
npx protoboard run firmware:check --module <board> # planned: pins exist and are assigned once, peripherals match buses, strapping pins respected, I2C addresses match parts
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Until it is in your CLI (`npx protoboard capabilities` lists `firmware`),
|
|
113
|
+
write the board's pin and peripheral assignment as a table from the board
|
|
114
|
+
module's nets (each row citing its net and part fact) in the board's notes,
|
|
115
|
+
and list the configuration as an open item for the release.
|
|
116
|
+
|
|
117
|
+
### 5. What the output does not establish
|
|
118
|
+
|
|
119
|
+
A generated configuration is consistent with the model and the checked
|
|
120
|
+
firmware sources. It does not prove the pads are labelled as the target
|
|
121
|
+
expects, that motor directions are right, that the compass alignment matches
|
|
122
|
+
the physical mounting, or that bidirectional DShot works on this ESC. Those
|
|
123
|
+
are bench checks: **firmware-verify**. The CLI header says NOT FLIGHT-TESTED
|
|
124
|
+
until they pass and are recorded.
|
|
125
|
+
|
|
126
|
+
## Decision points
|
|
127
|
+
|
|
128
|
+
| Decision | Rule |
|
|
129
|
+
| --- | --- |
|
|
130
|
+
| The model cannot decide a setting | Emit a warning, never a guess; it goes on the bench list. |
|
|
131
|
+
| A fact is missing from the model | Add it to the part with its source (**uhd-part-author**), not to the generator. |
|
|
132
|
+
| A setting not checkable in source | Mark it **UNVERIFIED** in the reference; it becomes a **firmware-verify** item. |
|
|
133
|
+
| Firmware version | The lowest version every emitted line needs (`minFirmware`), recorded in the header and the release manifest. |
|
|
134
|
+
| Motor order mismatch | Remap in firmware or rewire; decide and record it in `docs/decisions.md`. |
|
|
135
|
+
|
|
136
|
+
## Outputs
|
|
137
|
+
|
|
138
|
+
| Output | Where |
|
|
139
|
+
| --- | --- |
|
|
140
|
+
| Betaflight configuration (generated; never edit) | `firmware/betaflight/cli.txt` |
|
|
141
|
+
| Operation record | `operations/` |
|
|
142
|
+
| Reference, source-pinned | `references/<fw>-reference.md` in this skill |
|
|
143
|
+
| Board pin and peripheral configuration | `firmware/<fw>/` from the firmware capability (planned) |
|
|
144
|
+
|
|
145
|
+
## Verification
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
npx protoboard run betaflight-cli --format json # succeeded; data.warnings reviewed, each on the bench list
|
|
149
|
+
git diff --stat firmware/ # only the changes the model change explains
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Every line of `cli.txt` carries a `# link …` or `# <part>: …` reason. Then
|
|
153
|
+
**firmware-verify** on the bench.
|
|
154
|
+
|
|
155
|
+
## Failure handling
|
|
156
|
+
|
|
157
|
+
| Code or symptom | Means | Do |
|
|
158
|
+
| --- | --- | --- |
|
|
159
|
+
| `run betaflight-cli` fails: "project has no root system" | `protoboard.config.ts` names no loadable root | Fix `root` (`PB_ROOT_NOT_FOUND`) |
|
|
160
|
+
| Summary says "unknown target" | The FC part states no firmware target | Add the target to the FC part with its source; until then a bench item |
|
|
161
|
+
| Warning: "no Betaflight serial function derived" | A UART link to something the generator has no rule for | Add the rule (step 2) or set it on the bench and record it |
|
|
162
|
+
| Warning: "no common DShot rate" | FC outputs and ESC inputs state no shared rate | Add the rates from the datasheets, or choose compatible parts |
|
|
163
|
+
| Warning: no spin, or spins not Quad-X | `spin` missing on the arms, or diagonal motors disagree | Set `ChildModuleRef.spin` once per arm (**system-compose**) |
|
|
164
|
+
| Warning: motor order differs from the mixer | ESC channels and arms disagree | Remap or rewire; record the decision |
|
|
165
|
+
| `UHD_LINK_STATE` on a link to the FC | The wiring the configuration would encode is wrong | Fix the system first (**system-compose**) |
|
|
166
|
+
| `UHD_INTERFACE_REUSE` on an FC UART | Two devices on one UART | Fix the wiring; the generator cannot assign one port twice |
|
|
167
|
+
| `UHD_BUS_ADDRESS` on the FC's I2C | Two devices share an address | Fix the system |
|
|
168
|
+
| `run firmware:generate` not available | The firmware capability has not landed | Step 4's interim table and an open item |
|
|
169
|
+
|
|
170
|
+
Every other code: **system-compose** [diagnostic codes](../system-compose/references/diagnostic-codes.md).
|
|
171
|
+
|
|
172
|
+
## Hard rules
|
|
173
|
+
|
|
174
|
+
1. Every emitted line cites the link or part fact it comes from.
|
|
175
|
+
2. Never hand-edit a generated configuration; change the model or the
|
|
176
|
+
generator and regenerate.
|
|
177
|
+
3. Nothing generated is flight-ready until **firmware-verify** passes on the
|
|
178
|
+
recorded firmware version and unit.
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# Betaflight CLI reference: 5" quad (DolphinRC F405 V3 / MATEKF405TE)
|
|
2
|
+
|
|
3
|
+
Every item below was checked against the Betaflight source or the official docs. Nothing here comes from memory. Anything that could not be checked is marked **UNVERIFIED**.
|
|
4
|
+
|
|
5
|
+
## 0. Versions checked
|
|
6
|
+
|
|
7
|
+
| Source | Ref | Commit |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Firmware (primary) | `betaflight/betaflight` tag **4.5.5**, the newest 4.5.x tag | `4adbd3ef7cb546947600e5f747bd5453c9573063` |
|
|
10
|
+
| Firmware (delta check) | tag **2025.12.5** | `7348054f268f0058574719c134e9f149565bb8ea` |
|
|
11
|
+
| Firmware (delta check) | tag **2026.6.2**, the newest stable release on 2026-09-26 | `e0b7bb01b17b21351057e9ead2d1ab39dd44fa16` |
|
|
12
|
+
| Target config (4.5) | `betaflight/config` branch `4.5-config`, `configs/MATEKF405TE/config.h` | `7b1f01a25d8cb6379ebeeeca9f0e91c24925e907` |
|
|
13
|
+
| Target config (master) | `betaflight/config` branch `master`, `configs/MTKS/MATEKF405TE/config.h` (the file has moved into a manufacturer folder) | `96910e90881573589b2a6c41f7392b7afad63973` |
|
|
14
|
+
| Docs | `betaflight/betaflight.com` master | `0589eb3b938ca3b9782aae6eb91f323604b9a39c` |
|
|
15
|
+
|
|
16
|
+
The `config.h` for MATEKF405TE is **byte-identical** on `4.5-config` and `master`. The `2025.12-config` branch points at the same commit as `4.5-config`.
|
|
17
|
+
|
|
18
|
+
Note: 4.5.x is **no longer the current stable line**. 2025.12.x and 2026.6.x have both shipped since. Where they differ from 4.5.5, the difference is flagged with a **Δ** marker.
|
|
19
|
+
|
|
20
|
+
Short link prefixes used below:
|
|
21
|
+
- `BF` = `https://github.com/betaflight/betaflight/blob/4.5.5/`
|
|
22
|
+
- `BF25` = `https://github.com/betaflight/betaflight/blob/2025.12.5/`
|
|
23
|
+
- `BF26` = `https://github.com/betaflight/betaflight/blob/2026.6.2/`
|
|
24
|
+
- `CFG` = `https://github.com/betaflight/config/blob/4.5-config/configs/MATEKF405TE/config.h`
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Final CLI block (4.5.5)
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
# ports: serial <identifier> <functionMask> <msp_baud> <gps_baud> <telem_baud> <blackbox_baud>
|
|
32
|
+
serial 0 2 115200 115200 0 115200 # UART1 -> GPS (FUNCTION_GPS=2), GPS baud 115200
|
|
33
|
+
serial 1 64 115200 57600 0 115200 # UART2 -> Serial RX (FUNCTION_RX_SERIAL=64) (already the target default)
|
|
34
|
+
serial 4 131073 115200 57600 0 115200 # UART5 -> MSP(1) + VTX_MSP(131072) = MSP DisplayPort for DJI O4
|
|
35
|
+
|
|
36
|
+
feature GPS
|
|
37
|
+
feature TELEMETRY # needed for CRSF/ELRS telemetry back to the TX
|
|
38
|
+
feature OSD
|
|
39
|
+
|
|
40
|
+
set serialrx_provider = CRSF
|
|
41
|
+
set gps_provider = UBLOX
|
|
42
|
+
set gps_auto_config = ON
|
|
43
|
+
set osd_displayport_device = MSP
|
|
44
|
+
set vcd_video_system = HD
|
|
45
|
+
set motor_pwm_protocol = DSHOT600 # or DSHOT300
|
|
46
|
+
set dshot_bidir = ON
|
|
47
|
+
set motor_poles = 14
|
|
48
|
+
set current_meter = ADC
|
|
49
|
+
set ibata_scale = 150
|
|
50
|
+
set ibata_offset = 0
|
|
51
|
+
set mag_hardware = QMC5883 # AUTO also works; needs a MAG-enabled build (see section 4)
|
|
52
|
+
set align_mag = CW270FLIP
|
|
53
|
+
save
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Δ 2025.12.x / 2026.6.x:** the `serial` command takes a port *name* instead: `serial UART1 2 115200 115200 0 115200`, `serial UART2 64 ...`, `serial UART5 131073 ...`. The old numeric identifiers 0-19 are still accepted and are remapped as legacy values (see section 1). All the `set` lines are unchanged.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 1. `serial` command, function bitmask, UART mapping
|
|
61
|
+
|
|
62
|
+
### Syntax (4.5.5)
|
|
63
|
+
|
|
64
|
+
`serial <identifier> <functionMask> <msp_baud> <gps_baud> <telemetry_baud> <blackbox_baud>`. All **6 arguments** are required.
|
|
65
|
+
|
|
66
|
+
- Parser: `BF src/main/cli/cli.c#L1288-L1375`. Output format `"serial %d %d %ld %ld %ld %ld"` is at L1290. The command fails with an invalid-argument error when `validArgumentCount < 6` (L1361-L1364).
|
|
67
|
+
- Baud limits the parser enforces (`cli.c#L1320-L1359`):
|
|
68
|
+
- MSP: 9600 to 1000000
|
|
69
|
+
- GPS: 9600 to **115200**
|
|
70
|
+
- Telemetry: `0` (= AUTO) or up to 115200
|
|
71
|
+
- Blackbox: 19200 to 2470000
|
|
72
|
+
- Baud table: `baudRates[] = {0, 9600, 19200, 38400, 57600, 115200, 230400, 250000, 400000, 460800, 500000, 921600, 1000000, 1500000, 2000000, 2470000}` at `BF src/main/io/serial.c#L114-L115`. `0` is `BAUD_AUTO` (`src/main/io/serial.h#L60`).
|
|
73
|
+
- Per-port defaults: MSP 115200, GPS 57600, telemetry AUTO, blackbox 115200 (`BF src/main/io/serial.c#L136-L142`).
|
|
74
|
+
- Docs: https://betaflight.com/docs/wiki/guides/current/Serial ("The `serial` CLI command takes 6 arguments").
|
|
75
|
+
|
|
76
|
+
### Unused ports
|
|
77
|
+
|
|
78
|
+
`serial` changes only the port it names, and every other port keeps its saved
|
|
79
|
+
function. A generated block is complete only when it also writes the ports it
|
|
80
|
+
does not use: `serial UARTn 0 115200 57600 0 115200` (function 0 with the
|
|
81
|
+
per-port default bauds above). ext-drone writes such a line for every hardware
|
|
82
|
+
UART of the flight controller that the model does not link. This is safer than
|
|
83
|
+
a `defaults nosave` preamble, which would also reset modes, rates and PIDs.
|
|
84
|
+
|
|
85
|
+
### Function bitmask (`serialPortFunction_e`, `BF src/main/io/serial.h#L35-L54`)
|
|
86
|
+
|
|
87
|
+
| Function | Value |
|
|
88
|
+
|---|---|
|
|
89
|
+
| FUNCTION_MSP | 1 (L37) |
|
|
90
|
+
| FUNCTION_GPS | 2 (L38) |
|
|
91
|
+
| FUNCTION_TELEMETRY_SMARTPORT | 32 (L42) |
|
|
92
|
+
| FUNCTION_RX_SERIAL | 64 (L43) |
|
|
93
|
+
| FUNCTION_BLACKBOX | 128 (L44) |
|
|
94
|
+
| FUNCTION_VTX_MSP | 131072 (L53) |
|
|
95
|
+
|
|
96
|
+
The values are identical in 2025.12.5 and 2026.6.2 (`serial.h` L37, L38, L43, L53).
|
|
97
|
+
|
|
98
|
+
**TELEMETRY for ELRS:** there is **no CRSF telemetry function bit**. CRSF telemetry runs on the RX_SERIAL port itself:
|
|
99
|
+
- `initCrsfTelemetry()` enables only if `crsfRxIsActive()` (`BF src/main/telemetry/crsf.c#L731-L739`).
|
|
100
|
+
- It only runs when `FEATURE_TELEMETRY` is on (`BF src/main/fc/init.c#L976-L980`).
|
|
101
|
+
|
|
102
|
+
So ELRS needs `64` on the RX port plus `feature TELEMETRY`, and no extra bit. The docs confirm: "CRSF, GHST and F.Port receivers cannot share their port with a telemetry slot — they carry telemetry over the receiver protocol itself" (Serial guide, "Validation and Recovery").
|
|
103
|
+
|
|
104
|
+
### UART to identifier mapping (4.5.5)
|
|
105
|
+
|
|
106
|
+
`serialPortIdentifier_e` (`BF src/main/io/serial.h#L81-L101`):
|
|
107
|
+
- `SERIAL_PORT_USART1 = 0`, USART2 = 1, USART3 = 2, UART4 = 3, **UART5 = 4**, USART6 = 5
|
|
108
|
+
- `SERIAL_PORT_USB_VCP = 20`, SOFTSERIAL1 = 30
|
|
109
|
+
|
|
110
|
+
So in 4.5.5 **UART1 = 0, UART2 = 1, UART5 = 4**. These are fixed identifiers, not array positions. The `portConfigs[]` array puts VCP first (`serial.c#L69-L90`), but the CLI takes the identifier.
|
|
111
|
+
|
|
112
|
+
**Δ 2025.12+:**
|
|
113
|
+
- UART identifiers moved to 51+ (`SERIAL_PORT_USART1 = SERIAL_PORT_UART_FIRST = 51`, `BF25 src/main/io/serial.h#L97-L105`).
|
|
114
|
+
- The CLI prints and accepts names (`"serial %s %d ..."`, `BF25 src/main/cli/cli.c#L1292`). Names come from `serialPortNames[]` (`"UART1"`, `"UART5"`, ..., `BF25 src/main/io/serial.c#L147-L170`).
|
|
115
|
+
- Numeric 0-19 is still accepted: `identifier += SERIAL_PORT_UART1` for the legacy range 0..19 (`BF25 src/main/cli/cli.c#L1306-L1316`, `serial.h#L86-L87`). 2026.6.2 behaves the same (`BF26 src/main/cli/cli.c#L1414-L1509`).
|
|
116
|
+
|
|
117
|
+
**Δ future 2026.12 (unreleased):** the docs say `serial` becomes read-only and ports are assigned with `rx_uart`, `gps_uart`, `msp_uart_N`, `vtx_uart` and similar settings (Serial guide, "Per-Feature Port Assignment"). This does not apply to 4.5.5, 2025.12 or 2026.6.
|
|
118
|
+
|
|
119
|
+
### MATEKF405TE hardware UARTs
|
|
120
|
+
|
|
121
|
+
- The MCU target enables `USE_UART1` through `USE_UART6` plus VCP and softserial (`BF src/main/target/STM32F405/target.h#L35-L50`).
|
|
122
|
+
- The config defines pins for UART1 to UART6 (`CFG#L52-L63`):
|
|
123
|
+
|
|
124
|
+
| UART | TX | RX |
|
|
125
|
+
|---|---|---|
|
|
126
|
+
| UART1 | PA9 | PA10 |
|
|
127
|
+
| UART2 | PA2 | PA3 |
|
|
128
|
+
| UART3 | PC10 | PC11 |
|
|
129
|
+
| UART4 | PA0 | PA1 |
|
|
130
|
+
| UART5 | PC12 | PD2 |
|
|
131
|
+
| UART6 | PC6 | PC7 |
|
|
132
|
+
|
|
133
|
+
- No special or remapped UART numbering. The only target serial default is `SERIALRX_UART SERIAL_PORT_USART2` (`CFG#L123`). That makes UART2 = RX_SERIAL by default through `pgResetFn_serialConfig` (`BF src/main/io/serial.c#L160-L165`).
|
|
134
|
+
- **UNVERIFIED:** that the DolphinRC F405 V3 pads are labelled to match MATEK's UART numbering. Check the DolphinRC wiring diagram.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 2. Settings
|
|
139
|
+
|
|
140
|
+
### Serial RX (ELRS)
|
|
141
|
+
- `set serialrx_provider = CRSF`. The setting is at `BF src/main/cli/settings.c#L769`, and the name comes from `src/main/fc/parameter_names.h#L45`.
|
|
142
|
+
- Allowed values (`lookupTableSerialRX`, `settings.c#L239-L256`): `NONE, SPEK2048, SBUS, SUMD, SUMH, XB-B, XB-B-RJ01, IBUS, JETIEXBUS, CRSF, SRXL, CUSTOM, FPORT, SRXL2, GHST, SPEK1024`.
|
|
143
|
+
- The default is already CRSF when the build includes `USE_SERIALRX_CRSF` (`BF src/main/pg/rx.c#L37-L40`, `L84`). Setting it explicitly is harmless.
|
|
144
|
+
- `feature RX_SERIAL` is already the target default (`DEFAULT_RX_FEATURE FEATURE_RX_SERIAL`, `CFG#L124`, applied at `BF src/main/config/feature.c#L35`).
|
|
145
|
+
|
|
146
|
+
### GPS (u-blox M10)
|
|
147
|
+
- `feature GPS` (feature name list `BF src/main/cli/cli.c#L234-L237`). GPS init is gated on `FEATURE_GPS` (`BF src/main/fc/init.c#L762-L763`).
|
|
148
|
+
- `set gps_provider = UBLOX`. Values are `NMEA, UBLOX, MSP` (`settings.c#L201-L203`, setting at `L1020`). UBLOX is the default (`BF src/main/pg/gps.c#L35`). **Δ** 2025.12 adds `VIRTUAL` (`BF25 settings.c#L254-L256`).
|
|
149
|
+
- `gps_auto_config` defaults to ON (`pg/gps.c#L37`). With UBLOX and auto-config on, the FC probes baud rates with MON-VER and then commands the module to the port's configured GPS baud (`BF src/main/io/gps.c#L425-L452`, `#L1044-L1052`). M10 is recognised (`gps.c#L479`, `UBX_VERSION_M10`).
|
|
150
|
+
- `gps_auto_baud` defaults to OFF (`pg/gps.c#L38`). In 4.5.5 it is referenced only by CLI GPS passthrough (`cli.c#L4813`), so you do not need to set it.
|
|
151
|
+
- Optional settings:
|
|
152
|
+
- `gps_ublox_use_galileo` (ON/OFF, default OFF, `settings.c#L1028`)
|
|
153
|
+
- `gps_ublox_flight_model` (default `AIRBORNE_4G`; values `PORTABLE, STATIONARY, PEDESTRIAN, AUTOMOTIVE, AT_SEA, AIRBORNE_1G, AIRBORNE_2G, AIRBORNE_4G`, `settings.c#L209-L211`)
|
|
154
|
+
- `gps_update_rate_hz` (default 10)
|
|
155
|
+
- GPS baud goes in the `serial` line's 4th field. The CLI accepts at most 115200.
|
|
156
|
+
- **UNVERIFIED:** the Matek M10Q-5883 factory baud rate. It does not matter much because UBLOX auto-config probes for it.
|
|
157
|
+
|
|
158
|
+
### MSP DisplayPort OSD (DJI O4)
|
|
159
|
+
- **`displayport_msp_serial` does not exist in 4.5.5.** A grep of `src/main` finds no hits. The DisplayPort UART is chosen as the **first non-VCP port whose mask includes both `FUNCTION_MSP` and `FUNCTION_VTX_MSP`** (`BF src/main/config/config.c#L616-L630`). So the port setting is the `serial ... 131073 ...` line. The same logic is in 2025.12.5 (`config.c#L537`) and 2026.6.2 (`config.c#L576`).
|
|
160
|
+
- `set osd_displayport_device = MSP`. Values are `NONE, AUTO, MAX7456, MSP, FRSKYOSD` (`settings.c#L491-L493`, setting at `L1514`). **Δ** 2026.6 adds `FBOSD`.
|
|
161
|
+
- `set vcd_video_system = HD`. Values are `AUTO, PAL, NTSC, HD` (`settings.c#L392-L394`, setting at `L1570`). When `vcd_video_system == HD`, init forces the MSP device (`BF src/main/fc/init.c#L896-L900`) and uses the canvas size (`src/main/io/displayport_msp.c#L215-L217`).
|
|
162
|
+
- **Why both settings matter on this board:** MATEKF405TE has an onboard MAX7456 (`USE_MAX7456`, `CFG#L34`). With `AUTO`, init falls through to the MAX7456 case before MSP (`init.c#L920-L937`).
|
|
163
|
+
- Firmware defaults are already MSP and HD when `USE_OSD_HD` is built (`BF src/main/osd/osd.c#L415-L419`, `src/main/pg/vcd.c#L33-L37`), but set them explicitly anyway.
|
|
164
|
+
- The 4.4 release notes give exactly these two lines: https://betaflight.com/docs/wiki/release/Betaflight-4-4-Release-Notes (section "2. HD OSD").
|
|
165
|
+
- `displayport_msp_fonts` (`settings.c#L1588`) is **not required**.
|
|
166
|
+
- HD canvas defaults to 53x20 and is renegotiated by the VTX (`osd.h#L89-L90`; 4.4 notes).
|
|
167
|
+
- **UNVERIFIED (not in Betaflight sources):** DJI "Canvas mode" is a goggle/O4 menu option on the DJI side and needs no extra Betaflight setting beyond the above.
|
|
168
|
+
|
|
169
|
+
### Motor protocol, bidirectional DShot, poles
|
|
170
|
+
- `set motor_pwm_protocol = DSHOT600` (or `DSHOT300`). Values are `PWM, ONESHOT125, ONESHOT42, MULTISHOT, BRUSHED, DSHOT150, DSHOT300, DSHOT600, PROSHOT1000, DISABLED` (`settings.c#L302-L306`, setting at `L865`). The default is DSHOT600 (`BF src/main/pg/motor.c#L71`). **Δ** 2026.6 appends `DRONECAN`.
|
|
171
|
+
- `set dshot_bidir = ON`. Values are OFF/ON (`settings.c#L856`). The default is OFF (`pg/motor.c#L47-L48`, `L118`).
|
|
172
|
+
- `USE_DSHOT_TELEMETRY` is defined whenever `USE_DSHOT` is (`BF src/main/target/common_pre.h#L56-L60`). That block is outside the `CLOUD_BUILD` guard, so selecting DSHOT in a cloud build includes bidir.
|
|
173
|
+
- `set motor_poles = 14`. The range is 4 to 255 (`settings.c#L868`), and the default is already 14 (`pg/motor.c#L107`).
|
|
174
|
+
- **UNVERIFIED:** AM32 bidirectional DShot support on this particular ESC. Confirm in the Motors tab (RPM readout / 0% error) after setup.
|
|
175
|
+
|
|
176
|
+
### Current and voltage meter
|
|
177
|
+
- `set current_meter = ADC`. Values are `NONE, ADC, VIRTUAL, ESC, MSP` (`BF src/main/sensors/current.c#L45-L47`, setting at `settings.c#L902`). The target default is already ADC (`CFG#L108`).
|
|
178
|
+
- `battery_meter` values are `NONE, ADC, ESC` (`src/main/sensors/voltage.c#L51-L53`). The target default is ADC (`CFG#L109`). `vbat_scale` target default is 210 (`CFG#L110`).
|
|
179
|
+
- `set ibata_scale = 150`. The range is -16000 to 16000 (`settings.c#L924`). The target default is already 150 (`CFG#L111`).
|
|
180
|
+
- `set ibata_offset = 0`. The range is -32000 to 32000 (`settings.c#L925`). The default is 0 (`BF src/main/sensors/current.c#L97-L105`).
|
|
181
|
+
|
|
182
|
+
### Compass (QMC5883L on I2C1, 0x0D)
|
|
183
|
+
- `set mag_hardware = QMC5883` (or `AUTO`). Values are `AUTO, NONE, HMC5883, AK8975, AK8963, QMC5883, LIS2MDL, LIS3MDL, MPU925X_AK8963, IST8310` (`BF src/main/cli/settings.c#L159-L161`, setting at `L731`). The docs recommend `AUTO` (https://betaflight.com/docs/wiki/guides/current/Magnetometer, "set mag_hardware = AUTO").
|
|
184
|
+
- `set align_mag = CW270FLIP`. Values are `DEFAULT, CW0, CW90, CW180, CW270, CW0FLIP, CW90FLIP, CW180FLIP, CW270FLIP, CUSTOM` (`settings.c#L181-L192`, setting at `L723`). Enum value 8 is `CW270_DEG_FLIP` (`src/main/common/sensor_alignment.h#L39`). "Flip" means a 180 degree rotation about Y (Magnetometer doc). **UNVERIFIED:** that CW270FLIP is right for this mounting. It comes from the module vendor, so verify it in the Sensors tab.
|
|
185
|
+
- Bus settings need **no change**:
|
|
186
|
+
- The target sets `MAG_I2C_INSTANCE I2CDEV_1` (`CFG#L105`).
|
|
187
|
+
- `pgResetFn_compassConfig` sets `mag_bustype = I2C`, `mag_i2c_device = I2C_DEV_TO_CFG(I2CDEV_1) = 1`, `mag_i2c_address = 0` (`BF src/main/sensors/compass.c#L125-L130`; `I2C_DEV_TO_CFG(x) = x+1`, `src/main/drivers/bus_i2c.h#L50`).
|
|
188
|
+
- Address 0 makes the QMC driver use `0x0D` (`src/main/drivers/compass/compass_qmc5883l.c#L43`, `#L148-L149`).
|
|
189
|
+
- If you set them explicitly: `set mag_bustype = I2C`, `set mag_i2c_device = 1`, `set mag_i2c_address = 13` (`settings.c#L727-L729`).
|
|
190
|
+
- `USE_MAG` is **not** defined by the target config. `CFG` defines only `MAG_I2C_INSTANCE`. I2C1 (PB8 SCL / PB7 SDA, `CFG#L64-L65`) is the only I2C bus defined, and it is **shared with the onboard DPS310 baro** (`BARO_I2C_INSTANCE I2CDEV_1`, `CFG#L106-L107`). **UNVERIFIED:** which physical pads on the DolphinRC board expose I2C1.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 3. Motor order (Quad-X) and motor resources
|
|
195
|
+
|
|
196
|
+
`mixerQuadX[]` (`BF src/main/flight/mixer_init.c#L72-L77`). The row comments give the positions:
|
|
197
|
+
|
|
198
|
+
| Motor | Position |
|
|
199
|
+
|---|---|
|
|
200
|
+
| Motor 1 | REAR_R (rear-right) |
|
|
201
|
+
| Motor 2 | FRONT_R (front-right) |
|
|
202
|
+
| Motor 3 | REAR_L (rear-left) |
|
|
203
|
+
| Motor 4 | FRONT_L (front-left) |
|
|
204
|
+
|
|
205
|
+
The order is identical in 2025.12.5 and 2026.6.2 (`mixer_init.c#L85-L88`). QUADX is the default mixer (`DEFAULT_MIXER MIXER_QUADX`, `BF src/main/target/common_defaults_post.h#L108`), so no `mixer` line is needed. The docs point to the same expected mapping (https://betaflight.com/docs/wiki/getting-started/troubleshooting, motor order section).
|
|
206
|
+
|
|
207
|
+
Motor pin defaults (`CFG#L39-L46`):
|
|
208
|
+
|
|
209
|
+
| Motor | Pin | Timer map (`CFG#L86-L94`) |
|
|
210
|
+
|---|---|---|
|
|
211
|
+
| M1 | PC9 | timer index 2 |
|
|
212
|
+
| M2 | PC8 | timer index 2 |
|
|
213
|
+
| M3 | PB15 | timer index 1 |
|
|
214
|
+
| M4 | PA8 | timer index 1 |
|
|
215
|
+
|
|
216
|
+
M5 to M8 are PB11, PB10, PB3 and PA15. The pins are loaded into `motorConfig->dev.ioTags[]` (`BF src/main/pg/motor.c#L81-L104`). **No `resource` changes are needed** unless the ESC harness order differs. In that case remap with `resource MOTOR n <pin>`, or use the Motors tab reorder (`motorOutputReordering`, `pg/motor.c#L109-L110`).
|
|
217
|
+
|
|
218
|
+
### 3a. Motor spin direction (fetched 2026-09-26 from `master`)
|
|
219
|
+
|
|
220
|
+
Quad-X default, viewed from above: **M1 rear-right CW, M2 front-right CCW, M3 rear-left CCW, M4 front-left CW** ("props in"). `set yaw_motors_reversed = ON` reverses every motor ("props out").
|
|
221
|
+
|
|
222
|
+
- `yaw_motors_reversed` is an OFF/ON setting on `mixerConfig_t` (`BF src/main/cli/settings.c`, `{ "yaw_motors_reversed", VAR_INT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_MIXER_CONFIG, ... }`). The default comes from `#define YAW_MOTORS_REVERSED 0` (`BF src/main/flight/mixer_init.c#L50-L51`), and `configs/MATEKF405TE/config.h` does not override it. So the default is OFF.
|
|
223
|
+
- `mixerQuadX[]` yaw column (`mixer_init.c#L84-L89`): REAR_R −1, FRONT_R +1, REAR_L +1, FRONT_L −1. In the same file, `mixerY4[]` labels its rows `// REAR_TOP CW` (yaw −1) and `// REAR_BOTTOM CCW` (yaw +1). With that sign convention, M1 and M4 turn CW and M2 and M3 turn CCW. Source file sha256 `0b080d762403ca067fc4c5728d9dd5651a68311bcc1407f2ade9a6cf278d8418`.
|
|
224
|
+
- Docs, motors tab (https://github.com/betaflight/betaflight.com, `docs/wiki/app/motors-tab.md`): "The normal setting assumes your props will spin in towards the camera at the front of your quad "props in"".
|
|
225
|
+
- Docs, reversed motor direction (`docs/wiki/guides/current/Reversed-motor-direction.md`): "Reversed motors would be spinning outwards (contrary to the standard inwards), that is the front left spins counterclockwise, front right clockwise". The default is the opposite: front-left CW, front-right CCW. Diagonal motors share a direction.
|
|
226
|
+
- The setup guide's props-in/props-out diagram is `static/img/betaflight_props_in_out.png` in the same repo.
|
|
227
|
+
|
|
228
|
+
The UHD model records direction as `ChildModuleRef.spin` on each arm instance. `betaflight.ts` emits `yaw_motors_reversed` from it, and the `prop_handedness` check compares it with the prop variant on each motor.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 4. Target defaults, compatibility, gotchas
|
|
233
|
+
|
|
234
|
+
| Item | Target default | Source |
|
|
235
|
+
|---|---|---|
|
|
236
|
+
| Serial RX on UART2 | Yes (`SERIALRX_UART SERIAL_PORT_USART2`, mask 64) | `CFG#L123`, `BF serial.c#L160-L165` |
|
|
237
|
+
| RX feature | `FEATURE_RX_SERIAL` | `CFG#L124` |
|
|
238
|
+
| serialrx_provider | Not set by target. The firmware default is CRSF if built in. | `BF pg/rx.c#L37-L40` |
|
|
239
|
+
| Blackbox | `BLACKBOX_DEVICE_FLASH` (M25P16 on SPI2) | `CFG#L116`, `#L35-L36`, `#L118` |
|
|
240
|
+
| Current/voltage source | ADC / ADC, scale 150 / 210 | `CFG#L108-L111` |
|
|
241
|
+
| Gyro | ICM42688P, SPI1, `GYRO_1_ALIGN CW270_DEG_FLIP` (the gyro, not the mag) | `CFG#L29-L32`, `#L120-L121` |
|
|
242
|
+
| Baro | DPS310 on I2C1 | `CFG#L33`, `#L106-L107` |
|
|
243
|
+
| OSD chip | MAX7456 on SPI1 | `CFG#L34`, `#L117` |
|
|
244
|
+
| GPS / MSP UART | None defined (no `GPS_UART` / `MSP_UART`) | `CFG` |
|
|
245
|
+
|
|
246
|
+
Gotchas:
|
|
247
|
+
|
|
248
|
+
1. **The compass needs a custom build with `MAG`.**
|
|
249
|
+
- `USE_MAG` is only auto-defined for builds *without* a board config (`#if !defined(USE_CONFIG)` inside `#if !defined(CLOUD_BUILD)`, `BF src/main/target/common_pre.h#L72-L77`).
|
|
250
|
+
- MATEKF405TE does not define it, so `mag_hardware` and the QMC driver are compiled out unless you select **"MAG"** under "Other Options" in the cloud build (`https://betaflight.com/docs/development/API/Cloud-Build-API`, "Other Options" list). For local builds use `-DUSE_MAG` (Magnetometer doc: "Betaflight's build system must include `Magnetometers`... or `-DUSE_MAG`").
|
|
251
|
+
- With `USE_MAG`, the QMC5883 driver is pulled in automatically (`BF src/main/target/common_post.h#L88-L101`).
|
|
252
|
+
- Also select `GPS`, `OSD_HD` (or both SD and HD), `SERIALRX_CRSF` and `DSHOT`. CRSF telemetry is included automatically (Cloud-Build-API note).
|
|
253
|
+
2. **Onboard MAX7456.** Because of it, `osd_displayport_device = MSP` and `vcd_video_system = HD` must be set explicitly (section 2).
|
|
254
|
+
3. **UART5 mask must be 131073, not 131072.** A port with VTX_MSP alone is not picked for DisplayPort (`config.c#L625`), and the docs say "MSP VTX is alone on a port — it has to share with MSP" (Serial guide).
|
|
255
|
+
4. **Features.** `feature TELEMETRY` is required for ELRS telemetry (`init.c#L978`). `feature GPS` is required for GPS init (`init.c#L762`). `DEFAULT_FEATURES` is 0 (`BF src/main/config/feature.h#L25-L26`). FEATURE_OSD is auto-enabled only on an unconfigured board (`BF src/main/config/config.c#L484-L494`), so add `feature OSD` to be safe.
|
|
256
|
+
5. **QMC5883P variant.** 4.5.5 supports only the QMC5883**L** (`compass_qmc5883l.c`, address 0x0D). 2025.12+ adds a QMC5883**P** driver at address 0x2C (`BF25 src/main/drivers/compass/compass_qmc5883.c#L82-L83`). The Magnetometer doc notes the L was "Discontinued in 2025 and replaced by the QMC5883P". If a newer M10Q-5883 ships with the P variant, 4.5.5 will not detect it. **UNVERIFIED:** which chip this unit carries. The user states 0x0D, which is the L variant.
|
|
257
|
+
6. **Target file path.** The user-supplied path `configs/MATEKF405TE/config.h` is correct only on the `4.5-config` / `2025.12-config` branches. On `master` the file is at `configs/MTKS/MATEKF405TE/config.h`. Contents are identical.
|
|
258
|
+
7. **DolphinRC F405 V3 → MATEKF405TE.** **UNVERIFIED** from Betaflight sources. DolphinRC is a registered manufacturer (`DOLP`, `Manufacturers.md#L44`), but its only config is `configs/DOLP/DOLPHINRC_F722`. There is no DolphinRC F405 config, so the pin compatibility is taken from the vendor's claim.
|