PX4-Bootloader/board_types.txt assigns 1013 to Matek H743 and 139 to
Durandal. hw_config.h's BOARD_TYPE was hardcoded to 139 (Durandal's
ID) on both h743 and h743-mini, causing QGroundControl to reject
flashing with a "board ID 1013 != 139" mismatch.
Fixes#27731
Signed-off-by: FARHANG <farhang.nba@gmail.com>
- platforms/nuttx/NuttX/nuttx: bump to the backport of apache/nuttx
eafd01cecc ("arch/arm/imxrt: a fixed link when no PHY answers").
- boards/px4/fmu-v6xrt: enable CONFIG_IMXRT_ENET_FIXED_LINK. The driver
still probes the board's PHY list first. If no PHY answers, the MAC
runs at 100 Mbps full duplex, so a carrier that wires the FMU's RMII
bus straight to a switch port or another MAC brings eth0 up. Carriers
with a PHY are unchanged.
Assisted-by: Claude:claude-opus-5
Signed-off-by: TheLukaDragar <lukadragarbusiness@gmail.com>
* feat(boards/avianautomata): add 305AP flight controller
Add the Avian Automata 305AP: STM32H743, two IMU slots that accept
either an LSM6DSV16X or an ICM-45686, BMP581 barometer, MMC5983MA
magnetometer, two CAN buses and eight motor outputs plus docs.
Assisted-by: Claude:claude-opus-5-5
---------
Signed-off-by: Aaron <aaron.s.fuller@gmail.com>
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
The stub is a leftover from px4/fmu-v6x, where SPI4 is a sensor bus
powered from PG8. This board has no SPI4 and uses PG8 as a plain GPIO
for the sensor rail, so the note to move PG8 into the bus table has
nothing to act on.
Assisted-by: Claude:claude-fable-5-2
feat(drivers/imu): add ICM-56686 driver and enable GA1 alternate IMUs
Add an InvenSense ICM-56686 SPI FIFO driver (WHO_AM_I 0x08, DEVTYPE
0x39, DS-000563 v1.1 register map, 6400 Hz FIFO). It publishes the
16-bit FIFO fields at full scale (as in #28134) and passes
config.external to the publishers (as in #28352).
GA1 (accton-godwit):
- Each internal SPI socket can hold an ICM-42688P, ICM-45686,
ICM-56686 or LSM6DSV32X/LSM6DSK320X. Probe them in an if/fi chain
and stop at the first one found. SPI2 is probed first so the heater
binds to the heated instance.
- The LSM6DSV now uses the same rotation as the Invensense parts on
each socket (-R 6 on SPI2, -R 14 on SPI1), following #27625.
- The ICM-42688P and ICM-45686 on SPI2 are polled instead of using
DRDY, because only INT2 is routed to the MCU there. This removes
the missed-DRDY counts.
- Drop six drivers that nothing starts at boot (BMP388, MS5611,
BMM150, MMC5983MA, MCP23009, landing target estimator).
Flash use: 98.67% -> 97.52%.
Tested on GA1 hardware with a v1.17-based build: SPI2 polling and the
driver cleanup. Not yet tested on hardware: the ICM-56686 decode
change and the LSM6DSV rotation.
Assisted-by: Grok:grok-4.6
Assisted-by: Kiro:claude-opus-5.5
Signed-off-by: g945643frankie <g945643@oz.nthu.edu.tw>
Co-authored-by: Farhang <46557204+farhangnaderi@users.noreply.github.com>
Some FMUv2/v3 units, including many Pixhawk 2.4.8 clones, carry a 16 KiB FM25V01 instead of the 32 KiB FM25V02. Since 1.15 the default MTD layout asks for a 32 KiB parameter partition, which such a part rejects, so those units had no parameter storage. A 16 KiB partition fits both parts, and it is what these boards had before.
Assisted-by: Claude:claude-opus-5-5
All three fmu-v6xrt boards use ENET_1G (CONFIG_IMXRT_ENET2) and wire
ETH_RX_ER to GPIO_DISP_B1_01, as noted in the inline comment.
GPIO_ENET2_RX_ER was using GPIO_ENET_RX_ER_1, which is the 10/100 ENET
pin on GPIO_DISP_B2_09 (ETH_PHY_nINT). This muxed ETH_PHY_nINT to
10/100 ENET_RX_ER, left GPIO_DISP_B1_01 as a GPIO input, and left the
ENET_1G_RX_ER_SELECT_INPUT daisy register at its reset default (0 =
GPIO_EMC_B2_18, SPI3_DRDY2_SENSOR3 / BMI088 gyro DRDY).
Use GPIO_ENET_1G_RX_ER_2 so GPIO_DISP_B1_01 is muxed to ENET_1G_RX_ER
and the daisy input selects GPIO_DISP_B1_01_ALT1.
Assisted-by: Claude:claude-opus-5
Signed-off-by: TheLukaDragar <lukadragarbusiness@gmail.com>
Only the imx-image-ros image ships mavlink-router, and its main.conf
exposes a UDP server on port 10000 instead of pushing to a ground
station, on purpose, so Wi-Fi is not flooded with broadcast traffic.
Say so, tell the reader to add the board as a UDP server in
QGroundControl or to add a Normal endpoint for a fixed ground station,
and point at the router's own endpoint documentation.
/dev/ttyros existed but no PX4 module could use it: it was not a board
serial port, so UXRCE_DDS_CFG could not select it and nothing started the
client. Registering it as TELEM 2 lets the generated rc.serial start
uxrce_dds_client on it from the parameter, like a companion link on any
other board, with nothing enabled by default. Tested on the board: with
UXRCE_DDS_CFG set to 102 the client starts at boot on /dev/ttyros at
921600 baud and its session frames arrive on the Linux side. The page
gets a ROS 2 section with the three steps, and the agent install points
at the uXRCE-DDS page since the Linux images do not ship it.
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
- USB VALID/CONNECTED set to 0
- TPM: reject OneShot when the clock can't support it, fix W1C status
and hw channel indexing, scale TPM3 to its correct tick
- Set pad pulls through the iomux
- Calibrate LOOPSPERMSEC on hardware (159856)
- Drop I2C_LATEINIT, the ADC critical section and the FAT DMA pool
- Add validateSPIConfig
- Round the LPIT reload up
- Make imx9 its own CI chip family, with its own group and seeder
- Reject BDShot150 and fall back to plain DShot (also a long-standing
bug on i.MX RT)
Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
Co-authored-by: Andre Heinemans <andre.heinemans@nxp.com>
PX4 runs on the Cortex-M7 of the i.MX95. The default label runs from
FlexSPI NOR flash behind MCUboot and the build produces the slot0 image
next to the plain binary; the ddr label runs from SDRAM and is loaded
by Linux. Parameters, dataman and logs live on an RPMsg filesystem
served by Linux, the PX4 shell and MAVLink reach Linux over RPMsg ttys.
The README documents the Linux side, signing and flashing with pyOCD.
The board has no PX4 bootloader and no .px4 package. Pins follow the
MR-NavQ95 schematic: the safety switch input is GPIO2_IO07 on the GPS
connector, the safety and RGB LEDs and the CAN transceiver controls sit
on the IO-board I2C expander and are not driven yet, and the
magnetometer and barometer are started on LPI2C1 only, since LPI2C4 is
shared with the Linux core. Two board Kconfig choices cover the
shared pins: GPIO_IO23 on the PWM header is unused by default, PWM
output 8 or the tone alarm (the latter two need a System Manager
configuration that assigns LPTPM6 to the M7), and LPUART2 is the RC
input by default or an NSH debug shell started after boot. The ITCM
function lists are verified against the linked image.
Co-authored-by: Andre Heinemans <andre.heinemans@nxp.com>
SITL users who want Zenoh had to build the separate px4_sitl_zenoh
target, so the prebuilt packages and containers could only talk
uXRCE-DDS. Build both clients into the SITL default board (and thereby
SIH) and pick one at startup instead.
PX4_ROS2_MIDDLEWARE=uxrce_dds|zenoh|none selects the middleware and is
stored in ZENOH_ENABLE, so without the variable the persisted parameter
decides; uXRCE-DDS stays the default. rcS keeps only this selection and
sources px4-rc.uxrce_dds or px4-rc.zenoh for the client startup. The
Zenoh one maps ROS_DOMAIN_ID to ZENOH_DOMAIN_ID and applies
PX4_ZENOH_LOCATOR, when set, as the router address.
The container entrypoint follows the uXRCE-DDS start command into its
new file so Docker Desktop keeps routing DDS to the host.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
The commit f0a2fa9369 broke the ADIS and iim42652; it mistakenly
changes the spi setup for revision 6, instead of revision 8.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Co-authored-by: Jukka Laitinen <jukka.laitinen@tii.ae>
About 1700 call sites loaded the log level as the first argument of
px4_log_modulename(). Per-level functions drop that load and leave one
more register for the format arguments.
Assisted-by: Claude:claude-opus-5-5
Adds secureboot and bootloader_secureboot variants for fmu-v6xrt
(ed25519 image signing).
The image starts with the 0x2000 FlexSPI boot header, so the TOC sits
at 0x2800, past the vector table, and its first entry starts at
APP_LOAD_ADDRESS.
bl.c: apply APP_VECTOR_OFFSET to the vector base when the TOC has no
vectors entry. No change for boards with a zero offset.
Bootloader grows 8192 B to 96656 B (73.7% of 128 KB).
Tested on hardware: signed image boots; unsigned, tampered and
test-key-signed images are refused.
Signed-off-by: abhijithcv <abhijithcv1212@gmail.com>
* perf(ekf2): skip the zero entries of H in P * H
Most observation Jacobians depend on a handful of states only, yet the
Kalman gain and both P * H products of the Joseph update ran a dense
24x24 matrix-vector product. Accumulating only the non-zero entries of
H, in the same order, leaves every partial sum unchanged, so P and the
gains stay bit-identical while the products drop from 576 multiply-adds
to 24 per non-zero entry.
Add Ekf::computeKalmanGain() and use it at the aid sources that built K
as P * H / innov_var.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
* perf(ekf2): evaluate the Joseph update in a single pass
Step 1 of the Joseph covariance update stored the whole 24x24
P_temp = P - K * PH^T, and step 2 read it back for P_temp * H and the
stabilized update of the lower triangle, overwriting the rest. Evaluate
each P_temp entry where it is used instead: its columns selected by H
for P_temp * H first, then in a single pass over the lower triangle,
mirrored to the upper one. The arithmetic of every entry is unchanged,
so P stays bit-identical, while the temporary is never written or read
back.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
* perf(ekf2): only derive the covariance prediction of the kinematic states
The gyro bias, accel bias, mag, wind and terrain states have an identity
process model, so 120 of the 300 outputs of the generated
PredictCovariance() were plain copies of P, which predictCovariance()
then copied back into P and mirrored in full. Return only the rows of
the quaternion, velocity and position states and update P in place.
Regenerated with symforce 0.9.0, the version that reproduces the
committed headers byte-for-byte: the intermediate terms and the 180
remaining outputs are unchanged, so P stays bit-identical. The function
is 2.8 KB smaller (15.5 to 12.8 KB on Cortex-M7), which matters on
boards executing from external flash, and its stack temporary drops
from 2304 to 864 bytes.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
* refactor(ekf2): take the predicted covariance row count from its type
sizeof(P_pred) gives the row count only while matrix::Matrix holds
nothing but its data. The predict_covariance return annotation still
described the full 24x24 matrix; symforce 0.9.0 regenerates the
committed headers unchanged.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* perf(ekf2): run computeKalmanGain from ITCM
Every fusion now calls it, and on the boards that keep
measurementUpdate and controlGravityFusion in ITCM it sat in flash,
reached through a veneer.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
---------
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* refactor(safety_button): use board macros for the button and LED
The driver read the safety button and wrote the safety LED as the GPIO pinsets GPIO_BTN_SAFETY and GPIO_LED_SAFETY of board_config.h, the LED active low. A board can now define BOARD_SAFETY_BUTTON(), true while the button is pressed, and BOARD_SAFETY_LED(on_true) instead, as the FIXMEs next to these GPIOs in the board_config.h of FMU-v5, FMU-v6X, FMU-v6XRT and 26 other boards suggest, for a button and an LED that aren't GPIO pinsets or whose polarity differs. The macros default to the GPIOs, so that the existing boards are unchanged.
Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
* refactor(boards): drop the safety button and LED FIXMEs
The safety_button driver now takes either the GPIO pinsets or the
BOARD_SAFETY_BUTTON()/BOARD_SAFETY_LED() macros, so the GPIO
definitions are no longer something to replace.
Assisted-by: Claude:claude-opus-5-5
---------
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
The comments are the stream budget for each DMA controller, and several
were wrong: DMA2 is served by DMAMUX1, TIM5's update request is 59, the
FPV listed TIM4 where its DShot timer is TIM8, and DMA2 entries were
labelled DMA1. The Pi6X mapped USART6 for a PX4IO it does not have,
which made DMA1 look full when it has two streams free.
Assisted-by: Claude:claude-opus-5-5
CONFIG_NET_ETH_PKTSIZE includes the 14 byte Ethernet header but not the
4 byte FCS, so the IP MTU is PKTSIZE - 14. With 1518 the MTU was 1504,
larger than the 1500 bytes defined by RFC 894.
ETH header | IP packet (IP | UDP/TCP | payload)
14 | 1500
On the STM32H7 and STM32F7 Ethernet drivers the RX buffer stays 1536
bytes, so full-size frames incl. FCS still fit. ESP32 (Wi-Fi only) uses
the value only for its TX buffer.
Applied to all STM32H7, STM32F7 and ESP32 boards.
i.MX RT (ENET MAX_FL) and S32K3 (RX DMA buffer size) boards are left at 1518,
since there the value also sets hardware limits and 1514 would reject or
truncate full-size frames.
Signed-off-by: Marin Doetterer <marin@auterion.com>
Assisted-by: Claude Opus 5.5
1260 is in the 1251-1260 range ArduPilot reserves for Simplifly. 160 is
free in both board_types.txt lists and is reserved in
PX4/PX4-Bootloader#284.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
The script is derived from the NuttX Erbium ld.script, which has the
same author, so it can carry the PX4 BSD-3-Clause header like the rest
of the board instead of Apache-2.0.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
Add aifoundry_erbium_default for the Erbium Minion core, which runs on
the ET-platform emulator (erbium_emu) until silicon is available. The
target has no sensor or actuator drivers yet, so it boots the SIH
quadcopter airframe and keeps parameters and dataman in RAM.
The CI image has no RISC-V bare-metal toolchain, so the target is
excluded from the CI build matrix for now, as espressif_esp32 is.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
Both boards carry the same RT1176 as the FMU-v6X-RT and had the same
gap: no /dev/random and a software /dev/urandom, so keys and nonces
from px4_get_secure_random() did not come from hardware. Enable the
CAAM driver in their application NuttX configs. The bootloaders draw
no random numbers and stay unchanged.
Assisted-by: Claude:claude-opus-5-5
arc4random_buf(), and so px4_get_secure_random(), reads /dev/random
first. Without a hardware RNG the label had no /dev/random and its
/dev/urandom was a software generator. Enable the CAAM driver so both
devices, and every key and nonce drawn through them, come from the
hardware generator.
Assisted-by: Claude:claude-opus-5-5
* fix(boards/3dr/ctrl-n1): drive the PD10 LED push-pull, active high
The LED on PD10 lights when the pin drives high, and the board has no
pull-up on that line. Configured as an open-drain output driven low to
switch it on, it never lit, in the application nor in the bootloader.
Drive it push-pull, initially low, and high to switch it on.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5.5
---------
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Co-authored-by: Farhang <46557204+farhangnaderi@users.noreply.github.com>
* feat(bootloader): Add flag BOOTLOADER_SKIP_VERIFY_SIG to skip post-flash signature check
In case the full image is not available in memory after flashing, the signature check
can't be performed. This is the case if flashing image in chunks to e.g. SD card or eMMC.
The image will be anyhow verified before booting, so the check is redundant.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* feat(bootloader/toc): Support separately signed TOC in front of the image
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* feat(bootloader): Add support for loading TOC separately into buffer
This changes the prototype of find_toc to pass the address and maximum length of the
area where TOC is to be searched, instead of just letting find_toc search from the
hard-coded APP_LOAD_ADDRESS.
This allows searching for TOC from a separately allocated buffer, which is useful for
a platform where the mass storage is not XIP, where one can first only load a TOC
separately. To keep it secure, the TOC itself needs to be separately signed though.
In image_toc.h two new flags are introduced by taking the reserved bits into use:
The TOC_FLAG2_RELATIVE_ADDRESSES can be set in case of entry being loaded from non-XIP
media to arbitrary addressed buffer; the address entry in TOC can be specified to be
an offset from the load address start instead of being an absolute address in memory.
The TOC_FLAG2_USE_SBI can be used with risc-v targets, in case the entry needs to be
booted via SBI interface.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* docs(secure bootloader): Add prepended toc documentation
Document the feature to add a separately signed TOC in front of the
image.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
* docs(docs): Release note
* fix(bootloader/fmu-v6xrt): Increase bl stack by 200 bytes
It is on the edge and overflows if crypto functionality is added.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* feat(bootloader/fmu-v6xrt): Add signed boot targets for fmu-v6xrt
This adds these two new targets:
- px4_fmu-v6xrt_secureboot : Signed PX4 image, with prepended TOC, for v6xrt
- px4_fmu-v6xrt_bootloader_secureboot: Bootloader version to verify the signed image
Specifically, the implementation has
- px4board for both targets
- A new linker script for px4_fmu-v6xrt_secureboot, including the script.ld and
overriding the "flash" memory area for start and size to account for prepended
TOC structure
- TOC source and linker script
- Bootloader configurations added in hw_config.h
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
---------
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
main has not linked diatone_mamba-f405-mk2 since #28714 (101 B over),
and bitcraze_crazyflie has 3,160 B left. Drop features these boards
cannot use:
- mamba-f405-mk2: the airspeed and optical flow processing in sensors.
The board has no such sensor drivers and already compiles out EKF2
airspeed and flow fusion; kakutef7 and fmu-v2 already build without
them. 1,015,909 -> 1,008,925 B of 1,015,808 (99.32 %).
- crazyflie: attitude_estimator_q, which only runs with ATT_EN=1
(default 0, marked unsupported), as #28916 did for mamba-f405-mk2.
Also the per-segment mission geofence check from #28760, which
mamba-f405-mk2, kakutef7 and fmu-v2 already leave out. The board does
not fuse GNSS and keeps the waypoint check.
1,029,032 -> 1,017,876 B of 1,032,192 (98.61 %).
Measured with arm-none-eabi-gcc 13.2.1.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: jonas <jonas.perolini@rigi.tech>
Co-authored-by: jonas <jonas.perolini@rigi.tech>
* feat(open_drone_id): add locked Basic ID storage and Mach RID target
Persist the first serial-number Basic ID in MTD storage so DroneCAN can
reuse the identity after reboot without falling back to the board GUID
in locked mode.
Provide a separate Mach RID build with EEPROM storage and locked-mode
defaults while keeping EEPROM registration out of the default build.
Signed-off-by: msli-dev <747640013@qq.com>
Assisted-by: Codex
* fix(open_drone_id): gate storage and preserve legacy forwarding
Keep the optional EEPROM identity library, parameters and per-instance
state out of builds that do not enable CONFIG_BOARD_HAS_RID_EEPROM.
Use the same option for Mach EEPROM registration and module dependencies.
Restore the original Basic ID forwarding path when locking is disabled,
including builds without identity storage. Limit persistent identity
resolution to the enabled locked mode.
Signed-off-by: msli-dev <747640013@qq.com>
Assisted-by: Codex
---------
Signed-off-by: msli-dev <747640013@qq.com>
* fix(mavlink): rate-limit the parameter dump to its share of the link
A full PARAM_REQUEST_LIST dump was only throttled in
MAVLINK_MODE_LOW_BANDWIDTH. In every other mode the sole backpressure was
get_free_tx_buf() in send_param(), which on NuttX is just FIONSPACE on the
UART and knows nothing about what the link behind it can carry. MAV_x_RATE
scales _rate_mult, which applies to the streams only, so the dump ignored
it entirely. Since _main_loop_delay is floored at 100 Hz, the dump ran at
~100 Hz (~3.9 kB/s) no matter how low MAV_x_RATE was set.
On a 57600 SiK radio (AIR_SPEED=64) that hands the radio roughly three
times what it can carry. The radio drops whole MAVLink packets, which
shows up as 4-6% loss across everything sharing the link - the parameters
themselves still arrive, it is the rest of the telemetry that suffers.
Measured on an FMU-v6C: 4.4-6.2% loss during a dump, going to 0.00% with
this change.
Derive a minimum send interval from the configured data rate instead, so
the dump takes a bounded share of the budget and scales with the link. The
8 Hz low bandwidth cap is kept as a floor so that mode does not speed up.
Fast links are unaffected: on USB the computed interval falls below the
main loop period, so it never fires.
Also stop advancing _send_all_index when send_param() fails for want of TX
buffer space. The return value was discarded after the index had already
moved on, so that parameter was skipped silently and never resent, leaving
the ground station to notice the gap and re-request it.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
* fix(mavlink): let streams yield budget during a parameter dump
With the dump now taking a defined share of the link budget, the streams
were still sized against the whole of it, so the two together could
over-subscribe the link and push it back into dropping packets.
Reserve the dump's share in update_rate_mult() while a full dump is in
progress, the same way const_rate streams and ulog streaming are already
accounted for. Links with spare bandwidth are unaffected by construction:
bandwidth_mult is capped at 1.0 regardless, so subtracting the reserve only
bites once the streams are actually close to the limit. Verified on USB,
where tx rate mult stays at 1.000 throughout a dump.
This keys off a full PARAM_REQUEST_LIST transfer rather than the existing
sending_parameters(), which stays true for 2 s after any single parameter
goes out and would reserve bandwidth far more often than intended.
Measured on an FMU-v6C over a 57600 SiK: during a dump the streams scale
back from 0.473 to 0.232 and total output drops from 1428 to 1052 B/s,
inside the 1200 B/s budget, with no loss.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
* fix(mavlink): pin the TELEM1 data rate to a radio-safe default
MAV_0_RATE defaulted to a hardcoded 1200 B/s while every other instance
defaulted to 0, meaning baudrate/20. The value predates the yaml config
migration in 2018 and no rationale is recorded for it.
Deriving it from the baudrate is tempting but wrong for a telemetry
radio, where the serial rate says little about what goes over the air. A
SiK radio at 57600 baud with the common 64 kbps air rate carries around
2000 B/s with error correction enabled, and roughly twice that without,
where baudrate/20 would suggest 2880. Error correction is not visible to
us from here, so 2880 over-drives the link on any radio that has it on,
and the radio drops packets rather than telling us.
Measured on an FMU-v6C over a 57600 SiK: at 2880 with error correction
enabled a parameter download loses 1.3-1.8% and an FTP burst download
fails outright, while at 2000 both complete cleanly. With error
correction off there is more headroom and 2880 is fine, so 2000 is the
value that works either way.
Pin instance 0 to 2000 rather than deriving it, and say why in the
parameter description so that anyone on a better link knows they can
raise it.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
* fix(mavlink): keep the FTP session alive while a burst is streaming
_last_work_buffer_access is only updated by _ensure_buffers_exist(), which
runs when a client request arrives. A burst download streams without any
client requests, so nothing refreshes it for the duration of the burst and
send() closes the session out from under the transfer once the inactivity
timeout expires.
A burst is bounded by a 35 KiB chunk, which over USB is done long before
the timeout, so this never shows there. Over a telemetry radio a single
chunk easily takes longer than 30 s, and the session is then torn down
mid-transfer: reproducible against an FMU-v6C over a 57600 SiK as a
failure at just over 31 s, every time.
Treat streaming a burst as the activity it is.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
* fix(mavlink): fit FTP burst downloads to a telemetry radio
A burst download was bounded only by get_free_tx_buf(), the local UART
buffer, which knows nothing about what the radio behind it can carry. Over
a 57600 SiK that hands the radio several times its capacity: the radio's
reported txbuf collapses to zero, PX4 sheds 600-1500 B/s of its own, the
regular streams are squeezed to 40%, and the transfer dies around 10% of
the way through a 128 KiB file. It cannot be reproduced over USB, where
there is no such bottleneck.
Three things are needed, and none of them is sufficient alone.
Keep the packet inside one radio packet. A SiK splits anything larger than
its max_data_packet_length across several radio packets and reassembles
them correctly, but the split costs air time and drops the rate the link
can carry by roughly a third, which is enough to push the burst over the
edge. That limit is 250 bytes without error correction and 118 with it,
and we cannot tell which from here, so size for the smaller. The payload
is derived rather than hardcoded because the framing overhead depends on
whether signing is active.
Pace the burst against its share of the configured rate, scaled by the
radio's own txbuf feedback so it finds whatever the link actually carries:
that differs by more than two to one depending on error correction. Note
this deliberately does not use get_rate_mult(), which folds in the budget
split that this share has already been subtracted from - applying it here
too counts the reduction twice and starves the burst into the client's
inter-packet timeout.
Reserve that share in update_rate_mult() so the streams yield it instead
of the two together over-subscribing the link.
All of it is conditional on a radio reporting RADIO_STATUS, so a direct
serial or USB connection is unaffected.
Measured on an FMU-v6C over a 57600 SiK, downloading a 128528 byte file
with MAVSDK. Without error correction, at the default rate: three runs of
three complete byte-identical in 2:05, with no timeouts, no gap-fill reads
and 1414 burst packets for 1414 packets' worth of file, where the same
download fails outright before this change. With error correction enabled,
which halves both the capacity and the packet size, it completes in 3:10.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
* docs(telemetry): note what a SiK link actually carries
The page says the vehicle-side radio typically needs no configuration,
which is true for getting a link up but leaves out that the serial
baudrate says little about what goes over the air, and that setting
MAV_0_RATE above what the link carries makes the radio drop packets rather
than making telemetry faster.
Add a short section with the rough figures, what to do about it, and the
two AT commands that report the radio's own limits.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
* fix(mavlink): honour the size requested for an FTP burst
_workBurst recorded the offset, sequence number and target ids from a
BurstReadFile request but not its size, and the streaming loop always read
a full payload. A client could not ask for smaller packets, which the
spec provides for and which ArduPilot already honours, so the two servers
behaved differently for the same request. The single-shot ReadFile path
was never affected.
Record the requested size, treating zero as "as much as fits" to match
ArduPilot, and use it for the burst.
The clamp against what a radio carries in one piece stays, and has to be
applied after the request rather than instead of it. Every ground station
in the field asks for a full payload today, so honouring the request on
its own would hand a radio packets it has to split, which is the behaviour
this series set out to fix. Asking for less than the radio can carry is
respected; asking for more is not.
Reported by @DonLakeFlyer.
Measured against an FMU-v6C over a 57600 SiK with error correction on,
where the radio carries 118 bytes in one piece: a request for 239 is
answered with 91 bytes per packet, 200 likewise, and a request for 64 is
answered with 64.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
* fix(mavlink): keep single-shot FTP reads within one radio packet too
_workRead already honoured the size a client asked for, so it was left
alone when the burst path was taught to stay inside one radio packet. That
leaves a hole: when a burst loses something, the client fills the gap with
ReadFile requests, and those go out at the size it asked for. Against a
radio carrying 118 bytes in one piece, a 110 byte request is 137 bytes on
the wire and is split - which is exactly what the burst clamp exists to
avoid, reappearing on the recovery path.
Observed against QGroundControl master over a 57600 SiK with error
correction on: burst packets came back at 91 bytes as intended while the
gap-filling reads came back at 110, and both of the retries in that
download were on the latter.
Apply the same clamp to both, and share it rather than repeating it.
Reducing the reply is safe and stays within the spec, which lets a server
return less than was asked for. Clients already handle it because they
track what is outstanding from the size in the reply: QGroundControl
answers a short read by requesting the remainder, and MAVSDK writes
whatever arrives at the offset given.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
* fix(boards): no more RGB LEDs for out of flash v2
* fix(mavlink): address review of the FTP and parameter pacing
Keep batching parameters. The dump was throttled with a minimum interval
between messages, which the batch loop for USB and UDP links immediately
ran into: it sends up to 20 messages per call, and every one after the
first was refused. Take the budget in bytes instead, accumulated over
time, so a link with room to spare still sends its batch while a slow one
is spread out as before.
Share one budget between bulk transfers. A parameter dump and an FTP burst
each paced themselves against half the link, and the streams only yielded
the larger of the two shares, so the pair of them together could take the
whole link and leave the telemetry nothing. Split one bulk share between
whichever of them are running.
Leave MAVLink 1 replies alone. Only MAVLink 2 drops the trailing zeros of
a payload, so shrinking an FTP reply on a MAVLink 1 link costs the client
bytes without making the packet any smaller, and the pacing has to budget
for the whole payload there.
End a burst that fails. The server returned 'not complete' for a failed
read, so it sent the same NAK every couple of milliseconds until the
client reset the session. ArduPilot marks that packet as the end of the
burst; do the same.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
* fixup! fix(mavlink): rate-limit the parameter dump to its share of the link
Signed-off-by: Julian Oes <julian@oes.ch>
* fixup! fix(mavlink): fit FTP burst downloads to a telemetry radio
Signed-off-by: Julian Oes <julian@oes.ch>
* fixup! fix(mavlink): address review of the FTP and parameter pacing
Signed-off-by: Julian Oes <julian@oes.ch>
* fix(mavlink): treat a UDP data rate of 0 like USB
Now that the parameter dump follows the configured data rate, MAV_x_RATE=0
on an ethernet link matters more. UDP has no baudrate, so 0 fell through to
the 57600 serial initialiser and resolved to 2880 B/s, throttling the dump
to about 39 parameters per second. Every in-tree ethernet configuration
sets a rate explicitly, so this only bites when ethernet is moved to an
instance left at 0, or on av/x-v1, which starts UDP without -r.
Give UDP the same 100000 B/s fallback that USB already has.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>
* fix(mavlink): pace LOG_DATA log downloads behind a radio
A LOG_DATA download was bounded only by the local UART buffer, so it
over-drives a telemetry radio the same way an FTP burst did: the radio
gets far more than it can carry over the air and drops packets, including
the telemetry sharing the link.
Pace it like the FTP burst. Behind a radio that reports RADIO_STATUS, send
one packet per call, against the bulk share of the configured rate scaled
by the radio's txbuf feedback. A log download now also counts as a bulk
transfer, so it splits the bulk share with a parameter dump or FTP burst
running at the same time, and the streams yield that share while it runs.
A direct serial, USB or UDP link is unaffected.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>
---------
Signed-off-by: Julian Oes <julian@oes.ch>
* fix(boards): keep the i.MX RT FlexSPI RAM functions out of line
At -O2, GCC can inline these .ramfunc functions into
imxrt_boardinitialize(), so the FlexSPI is reconfigured from code
running in the flash it reconfigures.
Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
* fix(boards): keep the FPU out of the i.MX RT OCRAM initialization
At -O2, GCC copies the ITCM functions with FPU registers in
imxrt_ocram_initialize(), which runs before the FPU is enabled.
Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
---------
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
* perf(ekf2): reconstruct the output position once per update
After each filter update, the local position, odometry and global
position publishers each rebuilt the output position in double
precision: getLatLonAlt() three times, with trigonometry in the
local-to-global step, and the projection back to local NED twice.
Nothing changes the output predictor between them, so compute the
global position and its local projection once and pass them to the
publishers. The published values are bit-identical.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
* refactor(ekf2): name the global-to-local conversion globalToLocalPosition
getPosition(lla) projects any global position into the EKF's local frame rather than returning the estimator's position, so name it as the inverse of Ekf::localToGlobalPosition().
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
---------
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
ARK Flow LR is ARK Flow MR hardware with an AFBR-S50EX85D in place of the LX85D. A PX4 flight controller serves DroneCAN node firmware by board ID, so the LR needs its own ID (95) and target to get its own firmware file and releases.
* fix(dataman_client): keep request topic advertised on client teardown
* fix(uorb): keep shared topics advertised on publisher teardown
Single-instance publications share one advertised flag, so destroying one
publisher must not hide updates from the others.
Keep automatic unadvertising in PublicationMultiBase and remove the
DatamanClient workaround. Cover surviving publishers and instance reuse,
and reset retained input samples between test cases.
Tested: make tests (215/215), make format.
Signed-off-by: jonas <jonas.perolini@rigi.tech>
Assisted-by: Codex
* docs(uorb): correct unadvertise comments and document teardown
The unadvertise comment claimed it has no effect on single-instance
topics, which is how one publisher's teardown came to hide the others.
State what clearing the shared flag does, and document that only
PublicationMulti releases its instance on destruction.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: jonas <jonas.perolini@rigi.tech>
* test(uorb): keep test cases independent of retained samples
A destroyed single-instance publication now leaves its last sample
visible, so ManualControlTest, test_prec_takeoff and mixer_module_tests
passed only in declaration order and failed under --gtest_shuffle.
Reset with an inert sample where one exists, otherwise unadvertise the
test's own publications, and drop module outputs left over from a
previous case.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: jonas <jonas.perolini@rigi.tech>
* fix(boards): drop the PublicationBase destructor from the ITCM lists
The destructor is now trivial and no longer emitted, so itcm_check.py
fails on the missing section.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
---------
Signed-off-by: jonas <jonas.perolini@rigi.tech>
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: jonas <jonas.perolini@rigi.tech>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* fix(platforms/common): sleep with nanosleep() in px4_usleep()
Outside of the SITL lockstep build, px4_usleep() was usleep(). POSIX only requires usleep() to accept less than 1000000 microseconds and lets it fail with EINVAL from there; POSIX.1-2001 marked it obsolescent and POSIX.1-2008 removed it in favour of nanosleep(). glibc, NuttX and macOS sleep for longer anyway, but other implementations return EINVAL at once, and as no caller checks the result, the sleep would silently not happen. More than twenty call sites ask for a second or more, such as uorb top, mavlink, the ESC calibration or voxl2_io, and some durations are computed at run time, such as the one-second idle period of the POSIX HRT thread.
Outside of the lockstep build, px4_usleep() is now a px4_platform function that converts the microseconds to the timespec of nanosleep(), so the call sites keep passing microseconds of any duration. It is not inline: expanding the conversion at every call site grew px4_fmu-v6xrt_default by 4 kB of flash. QURT has no nanosleep(), which PX4 only stubs there, but its usleep() accepts a second or more, so px4_usleep() remains usleep() there. system_usleep() remains usleep(), for the wall-clock sleeps that bypass the lockstep scheduler.
A signal still ends the sleep early, with -1 and EINTR, rather than restarting it for the remaining time: on POSIX, the HRT and work queue threads sleep in px4_usleep(), and hrt_work_queue() and work_queue() wake them with SIGCONT, so a restarted sleep would delay hrt_call_*() callouts by up to a second. On NuttX, no PX4 code signals its tasks, and px4_task_delete() does not depend on the sleep returning: without cancellation points, which no board enables, task_delete() terminates the task wherever it is.
Failures are now -1 with errno, where the usleep() of NuttX returned the error number. No call site checks the result, so none changes. The sleep test now also sleeps for 1.2 s.
Assisted-by: Claude:opus-5.5
* perf(boards): keep the sleep path in ITCM on i.MX RT boards
The ITCM lists of these boards hold the sleep path of NuttX: usleep(), clock_nanosleep() and nxsig_nanosleep(). px4_usleep() now enters it through its own function and nanosleep(), which take the place of usleep(), so the path stays in ITCM. usleep() remains linked for the code that still calls it directly, such as the start-up code of the boards and NSH.
Assisted-by: Claude:opus-5.5
* fix(drivers): sleep for a second or more with px4_usleep()
bmi088_i2c, microstrain, frsky_telemetry and the bit rate detection of the kinetis, stm32 and stm32h7 UAVCAN drivers asked usleep() for a second or more, which POSIX doesn't require it to accept. The usleep() of NuttX accepts it, but px4_usleep() now does on every platform.
Assisted-by: Claude:opus-5.5
* fix(boards): drive PWM outputs low at reset instead of input pull-up
board_on_reset() was written in 2017 to put the FMU timer pins into a
driven low state so ESCs see a defined level from reset until the
output driver claims them. The fmu-v5 refactor in 54bd0a9f2a switched
the pin list to GPIO_INPUT|GPIO_PULLUP without comment, and the 2020
timer-config refactor propagated that as PX4_MAKE_GPIO_INPUT() to every
board derived from fmu-v5. The px4/fmu-v2..v4 lineage and later
px4/fmu-v6x (#19535) kept the driven low output.
A weak pull-up on the motor line is the state the AM32 bootloader
treats as "stay in the bootloader": it tests the pin against its own
pull-down and only jumps to the application on a clean low
(am32-firmware/AM32-bootloader#24). On boards where the MCU pin goes
straight to the ESC pad, a battery-only boot therefore leaves the ESCs
uninitialised (#27696, #28731). A weak pull in either direction also
leaves unassigned channels high impedance, so edges on a neighbouring
DShot line couple in and can spin a motor with no output assigned
(#26525). The 2021 attempt at pull-downs (#17686) hit the same problem
from the other side.
Switch the remaining STM32, kinetis and rt106x boards to
io_timer_channel_get_gpio_output(), matching the boards that already
drive low. The rt117x boards are unchanged because their input macro
has no pull.
The ARK boards additionally overrode the reset state with a pull-down
via PX4_GPIO_INIT_LIST; those entries are removed so the driven low
from board_on_reset() stands.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* fix(boards): keep capture channels as inputs and cover the missed boards
Driving every timer pin low at reset also drove the capture channels on
fmu-v5, fmu-v5x, fmu-v6u, durandal-v1, pix32v5 and corvon/v5, where a GPS
PPS or camera output may be wired. Until pps_capture or camera_capture
claims the pin, that output would fight a push-pull low, so those
channels keep their previous input state.
The three fmu-v6xrt boards float their PWM pins through a different
input macro and zenfc/h743 landed after this branch was cut; all four now
drive low as well.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
---------
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
main has not linked for holybro_kakutef7 (644 B over) and
diatone_mamba-f405-mk2 (29 B over) since #28350. Drop one feature per
board that these multicopter boards cannot use:
- kakutef7: the per-segment geofence path check from #28760, which that
PR already left out of mamba-f405-mk2, fmu-v2 and corvon 743v1 for
flash. 950,892 -> 944,500 B of 950,272 (99.39 %).
- mamba-f405-mk2: EKF2 wind estimation. Airspeed, sideslip and drag
fusion are already off on this board, so the wind states are
unobservable. 1,015,813 -> 1,014,821 B of 1,015,808 (99.90 %).
Measured with Arm GNU 13.2.rel1 at 97a3c7f0.
* feat(lib/sensor_calibration): add differential pressure calibration
Airspeed sensors had a single global zero offset, so a second or third
sensor could not be calibrated.
Link the calibration to the sensor's device ID, following the existing
barometer and magnetometer pattern, so the offsets stay bound to physical
sensors rather than to uORB instance order.
Signed-off-by: mahima-yoga <mahima@auterion.com>
* feat(sensors): support multiple airspeed sensors
The airspeed selector has always been able to validate and fail over
between three airspeed sensors, but nothing ever produced more than one.
Give each differential pressure sensor its own VehicleAirspeed item,
which owns its calibration, validator and airspeed publication, following the
VehicleIMU pattern.
Airspeed carries the device ID of the sensor it came from, so consumers
can tell the instances apart. The calibration routine now calibrates every
connected sensor.
Signed-off-by: mahima-yoga <mahima@auterion.com>
* refactor(sensors)!: replace SENS_DPRES_OFF with per-sensor calibration
SENS_DPRES_OFF applied one zero offset to whichever airspeed sensor
happened to come first, which cannot work once there is more than one
sensor. It is superseded by CAL_DPRESx_OFF.
BREAKING CHANGE: SENS_DPRES_OFF is removed. Ground stations that read it
to decide whether airspeed has been calibrated must check CAL_DPRES0_ID
instead, matching how CAL_MAG0_ID, CAL_GYRO0_ID and CAL_ACC0_ID are
already used.
Signed-off-by: mahima-yoga <mahima@auterion.com>
* feat(logger): log all airspeed and differential pressure instances
The airspeed selector supports up to three airspeed sensors, but the
logger only recorded one airspeed instance and two differential pressure
instances.
Signed-off-by: mahima-yoga <mahima@auterion.com>
* fix(commander): stop airspeed calibration consuming a new slot each time
Signed-off-by: mahima-yoga <mahima@auterion.com>
* fix(sensors): give the analogue airspeed sensor a device ID
Signed-off-by: mahima-yoga <mahima@auterion.com>
* fix(boards): keep the airspeed conversion in ITCM
Signed-off-by: mahima-yoga <mahima@auterion.com>
* refactor(sensors): initialise airspeed instances outside the main loop
Signed-off-by: mahima-yoga <mahima@auterion.com>
* chore(sensors): correct the copyright year on the new CMakeLists
Signed-off-by: mahima-yoga <mahima@auterion.com>
* refactor(airspeed_selector): share the airspeed sensor count constant
Signed-off-by: mahima-yoga <mahima@auterion.com>
* docs(sensor_calibration): explain the unusable calibration slot guard
Signed-off-by: mahima-yoga <mahima@auterion.com>
* fix(sensors): keep SENS_DPRES_OFF as a mirror of the first sensor
Signed-off-by: mahima-yoga <mahima@auterion.com>
---------
Signed-off-by: mahima-yoga <mahima@auterion.com>
* feat(navigator): check geofence breaches for mission segments (not only waypoints)
* refactor(navigator): move mission path batch off the stack
* fix(navigator): keep the mission verdict while the fence reloads
* test(navigator): check a mission leg across the antimeridian
---------
Co-authored-by: jonas <jonas.perolini@rigi.tech>
* feat(commander): only report safety button as available when it is available and configured to be used via COM_PREARM_MODE
* feat(commander): add a new option to COM_PREARM_MODE to explicitly and exclusively allow prearming via VEHICLE_CMD_DO_SET_SAFETY_SWITCH_STATE
* feat(commander): explicit dedicated safety-button-only and mavlink-only prearm modes
* fix(commander): also accept VEHICLE_CMD_DO_SET_SAFETY_SWITCH_STATE on Always and Disarmed pre-arm profiles to match documentation
* docs(prearm): update docs with new prearm mode behaviour
* fix(commander): fix syntax for bool
* docs(prearm): revert last param table, as COM_FORCE_SAFETY is already mentioned in a table above.
* docs(prearm): fix MAVLink spelling, grammar and parameter table
Make the pre-arm docs consistent with the COM_PREARM_MODE parameter and
the docs style guide: MAVLink is spelled consistently (page and option
labels), selectable option names are shown in code style, the parameter
table lists all five COM_PREARM_MODE options with the correct default,
and sentences are fixed and put one per line.
Question for the author: the COM_PREARM_MODE option labels say "Safety
button", while the docs say "safety switch". Are these synonyms? If so,
which term should we use in both places? If not, what is the difference?
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>
* fix(commander): clean up _button_disabled logic: button still needs to be enabled in Disabled and Always prearmed modes to switch safety off.
* docs(prearm): adjust COM_PREARM_MODE description and clarify/fix/improve prearm docs
* chore(VehicleCommand.msg): improved comments
* chore(msg): v0->v1 translation for VehicleCommand.msg
* Revert "chore(msg): v0->v1 translation for VehicleCommand.msg"
This reverts commit 50ea14fc76310ba7b53ebcd1c6ee8cf4e1c0776b.
* feat(commander): deny VEHICLE_CMD_DO_SET_SAFETY_SWITCH_STATE when not accepted
* feat(commander): COM_SAFETY_MODE replaces CBRK_IO_SAFETY
* docs(prearm): update docs with new COM_SAFETY_MODE behaviour
* docs(prearm): minor cleanup
* fix(commander): migrate CBRK_IO_SAFETY and correct safety ACKs
A stored CBRK_IO_SAFETY=0 was dropped on import, so upgraded vehicles booted with COM_SAFETY_MODE=0 and safety off. The CAN GPS nodes have no commander, so setting COM_SAFETY_MODE there only logged an error at boot. A SAFETY_SAFE command in mode 0 and ESC calibration with safety on were ACKed ACCEPTED while doing nothing.
Assisted-by: Claude:claude-opus-5-5
---------
Signed-off-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* feat(bl_update): pet the watchdog during erase and program
CAN nodes start the IWDG in the bootloader, and nothing else pets it
while bl_update holds the scheduler lock.
Assisted-by: Claude:claude-opus-5-5
* feat(nuttx): emit canbootloader to board extras and build bootloader+app image
canbootloader builds now write extras/<vendor>_<board>_bootloader.bin
like FMU bootloader builds do, which plugs CAN nodes into the existing
ROMFS / rc.board_bootloader_upgrade / jlink wiring. CAN node app builds
with that file also emit <config>_with_bootloader.bin (bootloader padded
to the app's ELF load address, followed by the CRC'd image) so a bare
board is flashed in one SWD step instead of two.
Assisted-by: Claude:claude-opus-5-5
* feat(cannode): run rc.board_bootloader_upgrade at startup
The hook was only wired into the FMU rcS, so SYS_BL_UPDATE did nothing
on CAN nodes even with bl_update built in.
* feat(ark): enable bootloader update on CAN nodes
Ships the CAN bootloader in the app ROMFS so a node can rewrite it via
SYS_BL_UPDATE without SWD.
Assisted-by: Claude:claude-opus-5-5
* docs(dronecan): bootloader update and combined image for CAN nodes
Assisted-by: Claude:claude-opus-5-5
* build(ark): rebuild CAN node bootloaders from current main
The committed binaries predated the F412 chip-selection and linker fixes
and the NuttX 12.12 upgrade, so they no longer matched the source.
Assisted-by: Claude:claude-opus-5-5
* feat(uavcannode): update the bootloader as soon as SYS_BL_UPDATE is set
Same approach as AP_Periph. Running the update on the next boot needed
two reboots and reported nothing over CAN: it ran before uavcannode
started, and the boot script printed "done" even when bl_update failed.
The node now flashes while running, skips an identical bootloader, and
the result reaches the flight controller through the existing log
message forwarding. A value left set from before boot is cleared rather
than acted on.
The flash routine moves into a library so uavcannode can call it.
Assisted-by: Claude:claude-opus-5-5
* docs(dronecan): note that the combined CAN node image resets parameters
Found on the bench: the padding between bootloader and app covers the
parameter sectors, so every SWD flash of the combined image erases them.
Assisted-by: Claude:claude-opus-5-5
* fix(nuttx): limit CAN bootloader extras and combined image to STM32
Every canbootloader build wrote its binary to the board's extras, so a
later nxp_ucans32k146 default or cyphal configure picked it up and failed
in prepend_bootloader.py: the S32K application loads at 0x6000, below
the 0x08000000 base the script and bl_update assume. CI only passed
because the canbootloader was built after both had configured.
Assisted-by: Claude:claude-fable-5-1
* fix(bl_update): pad the image before erasing and warn on every flash failure
The STM32F4 up_progmem_write() returns -EINVAL for an odd byte count,
which was only found out after sector 0 had been erased. An erase or
program failure also leaves the board without a bootloader, but only a
verify failure told the user to retry before rebooting.
Assisted-by: Claude:claude-fable-5-1
* fix(romfs): pack rc.board_bootloader_upgrade only where rcS runs it
CAN nodes with bl_update carried the script in their ROMFS although the
cannode rcS never sources it: uavcannode flashes the bootloader itself.
Assisted-by: Claude:claude-fable-5-1
* refactor(bl_update): move the flash routine to src/lib
The library lived under systemcmds, which is configured after drivers,
so uavcannode could only link it through a forward reference. The
watchdog is now selected by chip because the platform targets do not
exist yet when src/lib is configured.
Assisted-by: Claude:claude-fable-5-1
* docs(dronecan): the CAN bootloader is written to extras on STM32 only
Assisted-by: Claude:claude-fable-5-1
The fmu-v6xrt boards can be fitted with either of two octal flash parts, and
nothing told the user which one is on the board. The identity is already
known: the bootloader stage reads the JEDEC ID to pick a config, and the app
stage recognises the config from the installed read sequence, so no extra
flash access is needed to report it.
Keep the part name behind a weak board_get_flash_type_name() and append it to
the chip tag when the board provides one, so `ver mcu` and the logged chip
name read e.g. "i.MX RT1170 rA0 IS25WX512M". Boards that do not implement it
are unaffected and their tag is unchanged.
Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
The datasheet gives RDSR four dummy cycles in both STR and DTR OPI. FlexSPI
counts DDR dummy cycles in half cycles, so the operand has to be 0x08; 0x04
programmed only two cycles. The ROM issues status reads at the low IP command
clock, where two cycles still read back, so this was latent rather than a live
failure. All three fmu-v6xrt boards carried the same value.
Also describe the config: the part number it is for, the setup command the
boot ROM runs, and the rules the part puts on the sequences. The command
extension here is the inverted opcode, unlike the ISSI part which ignores it.
Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
Probe the JEDEC ID at boot and select the matching octal DDR config; the
MX25UM51345G stays the default. The app keeps the octal read sequence the
bootloader installed instead of reinitialising the flash, and shortens the
chip select gap to the part's read minimum since it never writes the flash
(14% faster uncached reads, 5% faster line fills, one point more idle).
The ROM flash init leaves a pull-down on the DQS pad, which corrupts octal
DDR reads on the IS25WX512M, so float it like the data pads.
Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>