The bootloader boot-delay feature has been mechanically broken on
every modern FMU board since the STM32F7/H7 transition. It has three
independent bugs that prevent it from ever working:
1. Offset mismatch: BOOT_DELAY_ADDRESS is hardcoded to 0x1a0, but the
NuttX vector table is 504 B (F76x) to 664 B (H743) long. The
linker places _bootdelay_signature at ALIGN(32) past end of
vectors (e.g. 0x2a0 on CubeOrange), never at 0x1a0. The bootloader
reads random exception_common pointers in place of the magic and
never matches BOOT_DELAY_SIGNATURE1/2. Verified on CubeOrange with
objdump of cubepilot_cubeorange_default.elf.
2. Flash cache never flushes: fc_write() stores arbitrary writes in
cache line 1 and only flushes on a very specific condition tied
to the sequential firmware upload flow. A standalone write during
PROTO_SET_DELAY is cached forever. fc_read() then returns the
cached value, so the post-write verify lies and the bootloader
reports success. Nothing ever reaches flash.
3. H7 write granularity: the STM32H7 flash controller requires a
full 32-byte program cycle per write. Single 32-bit writes from
flash_func_write_word() would not be accepted by the controller
even if they reached it.
The feature has been silently dead on every H7/F7 FMU board for
years and no one noticed, which is strong evidence nothing actually
depends on it. Rather than fix it (which would mean rewriting
PROTO_SET_DELAY, the flash cache path, and the H7 flash programming
path), remove it.
Changes:
- bl.c: PROTO_SET_DELAY case now immediately NACKs (goto cmd_bad)
so clients that still send the command get a clear rejection
instead of the previous silent fake-success. The opcode stays in
the protocol enum for backwards compatibility.
- bl.h: drop BOOT_DELAY_SIGNATURE1/2 and BOOT_DELAY_MAX.
- stm/stm32_common/main.c, nxp/imxrt_common/main.c: drop the
startup boot-delay sig check block.
- image_toc.c: decouple find_toc() from BOOT_DELAY_ADDRESS.
BOARD_IMAGE_TOC_OFFSET is now the required define when
BOOTLOADER_USE_TOC is enabled. The body is wrapped in #ifdef
BOOTLOADER_USE_TOC and falls back to a stub returning false when
the TOC is not in use (no upstream board currently enables it).
- Linker scripts: strip EXTERN(_bootdelay_signature) and the
FILL/. += 8 block from all 142 affected .ld files across boards/.
- hw_config.h: strip the #define BOOT_DELAY_ADDRESS and its comment
block entry from all 48 affected boards.
- Tools/px4_uploader.py, Tools/teensy_uploader.py: remove --boot-delay,
set_boot_delay(), and SET_BOOT_DELAY client-side counterpart.
Smoke-built on cubepilot_cubeorange_default and
cubepilot_cubeorange_bootloader; no link errors, no unresolved
symbols, flash usage unchanged.
Tested:
- New BL, new FW
- Old BL, old FW
- Old BL, new FW
- New BL, old FW
The logger rework grows text slightly, pushing the already
flash-constrained zenoh variant over budget. Drop a handful of
optional features to recover the needed headroom:
- osd_msp_osd (MSP OSD, niche)
- actuator_test (bench diagnostic)
- fw_autotune_attitude_control / mc_autotune_attitude_control
(tuning can be done on a default build)
Replace the old SDLOG_DIRS_MAX=3 + larger-buffer override with the
new rotation-based tuning: SDLOG_MAX_SIZE=40 caps each log file at
40 MB so a handful of recent logs fit, and SDLOG_ROTATE=95 lets logs
fill up to 95% of the 128 MB volume.
Also set COM_ARM_SDCARD=0 (no SD on this board) and
SYS_DM_BACKEND=1 so missions are stored in RAM.
Replace the old SDLOG_DIRS_MAX=3 + larger-buffer override with the
new rotation-based tuning: SDLOG_MAX_SIZE=40 caps each log file at
40 MB so a handful of recent logs fit, and SDLOG_ROTATE=95 lets logs
fill up to 95% of the 128 MB volume.
Drop the BOARD_SMALL_FLASH_LOGGING define from board_config.h; the
logger no longer keys off a per-board compile flag.
The kakuteh7mini ships with a W25N01GV (1Gbit/128MB) SPI NAND flash on
SPI1, but the board init was treating SPI1 as an MMC/SD slot and the
W25N driver was not enabled. Enable the chip and use it for logging:
- spi.cpp: register the device as SPIDEV_FLASH(0) instead of SPIDEV_MMCSD(0)
- init.c: initialize the W25N MTD driver, register /dev/mtd0, mount
littlefs at /fs/flash with autoformat, and print the flash geometry
on boot for verification.
- nuttx defconfig: enable CONFIG_MTD_W25N, CONFIG_FS_LITTLEFS,
SPI1 DMA + DMAMUX1, drop the unused RAMTRON config.
- board_dma_map.h: define DMAMAP_SPI1_RX/TX for the SPI1 DMA channels.
- default.px4board: set CONFIG_BOARD_ROOT_PATH to /fs/flash.
- rc.board_defaults: drop the SDLOG_BACKEND=0 override that was
disabling logging entirely, drop COM_ARM_SDCARD (no SD card), and
tune SDLOG_MAX_SIZE=40 / SDLOG_ROTATE=95 to keep a few recent logs
in the 128 MB flash.
Add an NSH command to format a device with littlefs, analogous to
mkfatfs for FAT filesystems. The command unmounts the mount point,
then remounts with forceformat to format and mount in one step.
Enable the command on boards that use littlefs as primary storage
(airbrainh743 and kakuteh7v2), and document it in the airbrainh743
flight controller page as a recovery procedure for a corrupted
flash filesystem.
Usage: mklittlefs /dev/mtd0 /fs/flash
* feat(drivers): add ST LSM6DSV16X IMU driver
Add a new SPI driver for the ST LSM6DSV16X 6-axis IMU with FIFO-based
accel, gyro, and temperature acquisition.
The driver supports continuous FIFO mode with tagged sample parsing,
DRDY interrupt triggering via FIFO threshold, and dynamic watermark
configuration based on the selected sample rate. It also falls back to
scheduled polling when a GPIO interrupt is not available.
To improve robustness, the driver periodically validates critical
register settings and limits FIFO draining per cycle.
Tested on Pixhawk6C with ground testing and flight validation.
* feat(boards/px4_fmu-v6c): add LSM6DSV16X support for Pixhawk6C
Enable the ST LSM6DSV16X as an alternative probe-based IMU on
Pixhawk6C.
The sensor is configured on SPI1 with chip-select PC13 and shares the
same CS and DRDY lines as the ICM42688P across all supported hardware
revisions. Board startup first probes the ICM42688P and then the
LSM6DSV16X, so only the IMU populated on a given board is started.
This change enables the LSM6DSV16X driver in the board configuration,
registers the device type in `spi.cpp`, and adds board sensor probing
for the new IMU.
Use rotation `-R 26` (`ROTATION_PITCH_180_YAW_90`) to match the sensor
orientation on the Pixhawk6C PCB.
* fix(drivers/lsm6dsv): address review comments
- add missing #include <cstddef> for size_t
- check FIFO status transfer() return value
- fix FIFO word count to sample period conversion (DIFF_FIFO reports
words, not sample periods; each sample period is 2 words)
- fix drv_sensor.h macro alignment (spaces to tab)
* drv_sensor: move LSM6DSV devtype into IMU range
* fmu-v6c: use quiet LSM6DSV fallback probe
MODULES_TEMPERATURE_COMPENSATION defaults to n in Kconfig, so explicit
=n and "is not set" entries are unnecessary.
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
These are generic flight controller boards (not drone-specific
products), so they should not come with a pre-selected airframe like
every other PX4 board. Drop the SYS_AUTOSTART default, matching the
convention used across the rest of the tree.
Drone-specific products (bitcraze/crazyflie, atl/mantis-edu) retain
their default airframe.
* refactor: make timer_io_channels[].timer_channel 0-indexed
timer_channel was 1-indexed (1-4) to mirror STM32 hardware naming
(TIM_CH1-CH4), but this was purely cosmetic — the ccr_offset field
already handles register mapping. Every consumer did timer_channel - 1
to get a 0-based index, creating underflow bugs when the guard was
missing (e.g. dshot.c capture_complete_callback,
output_channel_from_timer_channel, up_bdshot_get_erpm).
Changes:
- STM32: Timer::Channel enum starts at 0, initIOTimerChannel assigns
directly, removed all timer_channel - 1 in dshot.c and io_timer.c
- NXP (kinetis, s32k1xx, s32k3xx): removed the + 1 in
initIOTimerChannel, removed timer_channel - 1 in io_timer.c,
led_pwm.cpp, and input_capture.c
- RPI: Channel enum starts at 0, removed timer_channel - 1 in
io_timer.c
- Validity checks updated from timer_channel <= 0 || >= 5 to
timer_channel >= 4
Closes#26747
Signed-off-by: Pavel Guzenfeld <pavelgu@gmail.com>
* fix: complete 0-indexed timer_channel migration across all platforms
Address review feedback for incomplete migration:
1. STM32H7 io_timer_hw_description.h: update standalone
initIOTimerChannel() to assign timer_channel from enum
(0-based) instead of hardcoded 1/2/3/4
2. Switch case labels: update all switch(timer_channel) blocks
from 1/2/3/4 to 0/1/2/3 in:
- stm32_common: input_capture.c (4 blocks), led_pwm.cpp (3),
io_timer.c DMA base register switch
- kinetis: input_capture.c (2 filter blocks)
- s32k1xx: input_capture.c (2 filter blocks)
- spix_sync.c (ark/fpv + ark/pi6x, 3 blocks each)
3. Sentinel checks: replace timer_channel != 0 / == 0 (which
now conflicts with valid channel 0) with gpio_out-based
checks in:
- io_timer_validate_channel_index() across all 5 platforms
- led_pwm_channel_init() and led_pwm_servo_get() in all
led_pwm.cpp variants (STM32 + 4 NXP)
- spix_sync_channel_init() and spix_sync_servo_get()
Tested: px4_fmu-v6x_default (H7) build OK, px4_sitl_default
build OK, 154/154 unit tests pass, ASan build clean.
* fix: update NXP board led_pwm_channels to 0-indexed timer_channel
These 4 board files manually specify led_pwm_channels[] with
1-indexed timer_channel values. Since the platform code no longer
subtracts 1, decrement all values to match the new 0-indexed
convention.
* fix: correct FTM CH3 filter mask in kinetis and s32k1xx input capture
Case 3 in up_input_capture_set_filter() was using CH2FVAL_MASK/SHIFT
instead of CH3FVAL_MASK/SHIFT due to a copy-paste error, causing
channel 3 filter writes to modify channel 2's filter register instead.
---------
Signed-off-by: Pavel Guzenfeld <pavelgu@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
This board is not available for purchase online and the author confirmed
that it is "only used for research and educational purposes". Given
there are no docs about it, we should just remove it.
- Replace all MINDPX/MINDPXv2/PX4FMU board references with SaamPixV1_1
- Update Airmind Development Team to Saam Drones Development Team in copyright headers
- Update PX4 copyright year range to 2020-2026 on all C/C++ files
- Rename bootloader binary to match board version (v1_1)
- Remove untracked backup files
Set BOARD_FLASH_SECTORS to 13 so the bootloader does not erase the
parameter sectors (14 and 15) during firmware updates. Previously set
to 14 which allowed the bootloader to erase sector 14, potentially
wiping stored parameters.
Several helper scripts assumes bash is available at /bin/bash. That breaks on systems
such as NixOS, where bash is resolved from PATH instead of a fixed /bin location and
causes failures like `bad interpreter` during `make format`, e.g., on my host machine:
```sh
$ make format
/PX4-Autopilot/Tools/astyle/check_code_style.sh: /PX4-Autopilot/Tools/astyle/fix_code_style.sh: /bin/bash: bad interpreter: No such file or directory
```
This change switches these entrypoints to `#!/usr/bin/env bash` so they locate bash properly.
No functional changes intended.
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Disable EKF2 fusion features with no corresponding hardware:
- px4_fmu-v2: optical flow, range finder (~17 KB saved)
- mamba-f405-mk2: optical flow, range finder, external vision,
aux global position, aux velocity, baro compensation,
drag fusion (~42 KB saved)
Add INA226 and INA228 power monitor drivers to the voxl2 SLPI board
config and add startup options in voxl-px4-start to select them via
the POWER_MANAGER environment variable.