* 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
tune_control play -f <frequency> -d <duration> fills a custom tune, tune ID 0, with the note, but then replaced the tune ID 0 with 1, the startup tune, so the tone alarm played the startup tune instead of the note. The startup tune is now the default only when neither a tune nor a frequency is given.
Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
* 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 BSON document length is the first four bytes of the document and is signed.
bson_decoder_init_buf() checked it against the buffer size, but the check only
ran when the value was positive, so a negative length skipped it and decoding
proceeded with no bound. bson_decoder_init_file() did not check the length at
all.
Reject a negative length in both, and add a regression test, since the existing
BSON test only covers a round trip of data it encoded itself.
Reported by @lihnucs.
Assisted-by: Claude:claude-opus-5[1m]
Signed-off-by: Julian Oes <julian@oes.ch>
Shorten the cmake, cdev and gps_blending comments, drop the unreachable
snprintf clamp in test_uart_send and simplify the pure pursuit bearing
assertions to the absolute value with a 1e-6 tolerance, which covers both
sides of the +-pi cut. Cosmetic, no behaviour change.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
* fix(tests): use snprintf in test_uart_send
The macOS SDK marks sprintf deprecated, and PX4 builds with -Werror
-Wfatal-errors, so this is a hard build failure on macOS before any
test binary is produced:
test_uart_send.c:83:7: fatal error: 'sprintf' is deprecated
The return value is used as the write() length and snprintf() returns
the length it would have written rather than what fit, so clamp it to
the buffer.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
* fix(navigator): give publish_global_pos a float altitude parameter
The test helper declared its altitude parameter double, but it assigns
to vehicle_global_position_s.alt, which is float32, and all eight call
sites pass a float. Every call therefore promoted a float to double and
converted it straight back, which Apple Clang reports as
-Wdouble-promotion and -Werror turns into a build failure.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
* fix(tests): use a double NaN for double latitude and longitude fields
The NAN macro is a float, so using it for a double lat/lon field is an
implicit float to double promotion. Apple Clang reports it under
-Wdouble-promotion and -Werror makes it fatal, so these tests could not
be compiled on macOS. Same class of fix as 25596.
Only genuinely double-typed fields are changed: altitude and the other
float members deliberately keep the plain NAN.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
* fix(cmake): link the functional gtest stubs with -force_load on macOS
px4_add_functional_gtest() pulls in the daemon app-map stubs with GNU
ld's --whole-archive. Apple's ld64 has no such option and rejects the
link outright:
ld: unknown options: --whole-archive --no-whole-archive
so every functional gtest failed to link on macOS. ld64 spells the same
thing -force_load <archive>.
test_stubs stays in the link library list on that path: a $<TARGET_FILE:>
inside a link flag does not make the executable depend on the archive, so
editing a stub would rebuild libtest_stubs.a without relinking the tests
that use it.
This affects the 40 px4_add_functional_gtest definitions across the tree.
Non-Apple platforms keep the existing flags unchanged.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
* fix(cdev): take the px4_poll deadline from the semaphore's clock
macOS has no pthread_condattr_setclock(), so px4_sem_init() leaves the
condition variable behind px4_sem_t on its default CLOCK_REALTIME, while
px4_poll() built its absolute deadline from CLOCK_MONOTONIC.
On Darwin CLOCK_MONOTONIC counts from boot and CLOCK_REALTIME is the
epoch, so the deadline lands decades in the past: measured on one
machine the two clocks were about 56 years apart. pthread_cond_timedwait()
therefore returned ETIMEDOUT immediately and every px4_poll() with a
positive timeout returned without waiting. The teardown pass then
overwrote the result, so callers just saw px4_poll() == 0.
Take the deadline from CLOCK_REALTIME on Darwin builds without the
lockstep scheduler, which is the clock the wait actually uses. Lockstep
builds provide their own consistent simulated time and are untouched, as
are all other platforms; px4_poll() is the only POSIX caller of
px4_sem_timedwait().
Fixes the uORB poll timeouts in functional-test_mission_route_cache and
sitl-uorb_tests on macOS.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
* test(pure_pursuit): compare bearings across the +-pi branch cut
Two cases asserted an exact -M_PI_F. The bearing there is 180 degrees,
which wrap_pi()'s [-pi, pi) range can legitimately represent as either
end, and on macOS the arithmetic lands 2 ULP below +pi. PX4 also builds
with -fno-signed-zeros, so the sign of an atan2f() result at the cut is
not portable in the first place.
Compare the wrapped difference instead, which treats +pi and -pi as the
same bearing, and give it a tolerance that survives the subtraction.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
* fix(gps_blending): accumulate the blended timestamp without truncating
Each weighted timestamp was cast to uint64_t before being added, so
every contributing receiver's term lost its fractional microsecond and
the blended timestamp came out low by up to one microsecond per
receiver. The normalised weights are floats, so their rounding error
biased the result further: two receivers reporting an identical
timestamp did not blend back to that timestamp.
Accumulate in double, divide by the accumulated weight, and round once.
The truncation is platform independent; gps_blending_test caught it on
macOS only because the float weights round differently there.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
---------
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
Co-authored-by: Farhang <46557204+farhangnaderi@users.noreply.github.com>
unitName()/typeName() lacked the FAILURE_UNIT_DATALINK_*/FAILURE_UNIT_BUS_* units, so `failure can off` was announced as unit "unknown". FailureInjection.msg and VehicleCommand.msg also disagreed on FAILURE_TYPE_DRIFT (MAVLink FAILURE_TYPE 8).
Name every unit and type, add FAILURE_TYPE_DRIFT to both messages and the `failure` console command, and add a test that fails whenever a message constant has no name.
bootloader: update main prototype for NuttX 12.12.0
platforms/nuttx: Add wrapper for queue.h
For some reason the queue.h header was moved, add this wrapper so
posix and nuttx builds can both still use #include <queue.h>
Fix print_load to be compatible with upstream NuttX
Also Change tg_filelist -> tg_fdlist as per new NuttX
Co-authored-by: Ville Juven <ville.juven@unikie.com>
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
The ctor tested uninitialized _batt_index instead of the parameter, so
`start -b 1` with no -t stored -1 and INA226 rejected it after the 1-3
index check. instances[] was indexed by 1-based bus number but sized as
the bus count, so bus == N wrote one past the end.
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* feat(failure_injection): add ADS-B traffic-avoidance failure injection
Wire up FAILURE_UNIT_SYSTEM_TRAFFIC_AVOIDANCE (107) for the MAVLink-based
traffic avoidance path:
- OFF suppresses and STUCK freezes the incoming transponder_report, applied
both at the MAVLink ADS-B ingestion (handle_message_adsb_vehicle) and at
the navigator consumer (check_traffic), so it works for real ADS-B over
MAVLink, simulated ADS-B and the fake_traffic command.
- OFF additionally marks the ADS-B/FLARM heartbeat unhealthy so the traffic
avoidance system health check fails, using a message-less process()
overload.
- Add the unit to the capability catalogue (OK/OFF/STUCK), the failure
console command, the RC-switch unit selector and the docs.
The matching MAVLink FAILURE_UNIT enum entry lives in the mavlink submodule
(common.xml) and is handled by a separate PR; the uORB mirrors in
VehicleCommand.msg and FailureInjection.msg are included here.
* feat(failure_injection): enhance battery failure injection with severity levels
* feat(failure_injection): improve battery failure handling with dynamic threshold parameters
* refactor(failure_injection): remove traffic avoidance example from documentation
* docs(docs): subedit
* feat(failure_injection): add variance setting for distance sensor and integrate rangefinder in simulator
* feat(docs): add failure injection to release notes
* docs(docs): Add sim_mavlink back to heading
* fix(failure_injection): update default battery failure injection severity to Emergency
* docs(docs): get away from footnotes
* feat(failure_injection): enhance battery failure injection handling and update traffic unit support
* feat(failure_injection): add traffic avoidance handling tests and configurations
* [AUTO COMMIT] update EKF change indication
See .github/workflows/checks.yml for more details
* Apply suggestion from @hamishwillee
* feat(failure_injection): update failure types and handling for traffic avoidance and ESC telemetry
* fix(typo)
* [AUTO COMMIT] update EKF change indication
See .github/workflows/checks.yml for more details
* fix(docs): clarify notes on GPS and airspeed handling in failure injection documentation
---------
Co-authored-by: Claudio Chies <chiesc@chies.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
* feat(navigator): cache complete mission route data
* refactor(navigator): pack mission requests into a single struct
* rework(navigator): set pending to false instead of full struct reset
* refactor(navigator): remove missionExceedsCacheLimit
* chore(navigator): clean comments
* perf(navigator): syncMissionItem do not fully restart if not needed
* refactor(navigator): better naming and remove unreachable retry
* refactor(navigator): comments
* refactor(navigator): do not restart from scratch on single read failure, restart from failure
* refactor(navigator): use navigator poll to load mission cache and move full mission cache into its own class
* perf(mission-cache): add perf counter for the full mission load
* fix(navigator): keep route cache in sync with DO_JUMP counters
* feat(navigator): add min rate for full navigator update
* docs(docs): add docs for mission route cache
* docs(docs): revert change to auto-generated file
---------
Co-authored-by: jonas <jonspero@me.com>
Currently we can only set such parameters to specific values, but we
cannot toggle on and off individual bits programmatically.
This allows us to modify only some bits of a param, while leaving others
the same. This is essential for parameters which:
- are an int32 bitset
- have some bits which should persist
- have some bits which should take on a specified value
Motivating example here is EKF2_SENS_EN. With this we can replace the
current
param set EKF2_GPS_CTRL 0 # Disable GPS Aiding on every boot
in airframes that expect spoofing by
param bitclear EKF2_SENS_EN 3
This accomodates for the change in parameter semantics from
https://github.com/PX4/PX4-Autopilot/pull/26739 - see
src/modules/ekf2/EKF/common.h:
struct FusionSensor {
bool enabled{false}; // runtime toggleable via MAVLink
bool available{false}; // CTRL-param != disabled-value (functions as factory-setting)
bool intended() const { return enabled && available; }
};
and the one we want to disable on every boot to escape spoofing is
enabled, not available.
* feat(failure_injection): add process_esc() telemetry helper
Add a shared helper that applies the active FAILURE_UNIT_SYSTEM_ESC (106)
failures to an esc_status before it is published, matched per ESC by
esc_report.actuator_function: Off reports the ESC offline (clears its
esc_online_flags bit) so it reads as "completely non-responsive"; Wrong keeps
the ESC online but reports consistently wrong values. Mirrors process_battery();
a no-op stub keeps builds without the failure injection manager zero-cost.
Unit tested here.
* feat(failure_injection): inject ESC failures at the esc_status producers
Call process_esc() where esc_status is produced (UAVCAN ESC driver and SIH) so
injected ESC failures reach every consumer. Wire the ESC unit end to end: add
the "esc" key to the failure CLI and mark FAILURE_UNIT_SYSTEM_ESC as supporting
Off and Wrong. Regroup MOTOR to Off-only (actuation): its stuck/wrong were
never implemented, so stop advertising them.
* refactor(failure_detector): drop the misplaced ESC telemetry injection masks
FailureInjector mapped FAILURE_UNIT_SYSTEM_MOTOR Stuck/Wrong to ESC-telemetry
masks consumed by manipulateEscStatus() -- on the wrong MAVLink unit (telemetry
belongs to FAILURE_UNIT_SYSTEM_ESC) and dead code: manipulateEscStatus() has had
no callers since the ESC checks moved into escCheck. The equivalent behaviour
now lives on the ESC unit in process_esc (Wrong directly; the old zero+offline
"Stuck" as esc off). Remove the masks and the dead method; the motor-stop (Off)
path ControlAllocator consumes is unchanged.
* refactor(failure_injection): do the copy for the amneded esc_status in the process_esc() function
This results in a clearer interface with less lines to call and the same overhead of copying once.
* fix(failure_injection): add esc telemetry failure support for all simulation interfaces
* fix(failure_injection): zero a disconnected ESCs telemetry
It's not entirely realistic because the value would go stale in a real disconnect but better than just flagging it offline but still reporting new telemetry.
---------
Co-authored-by: Matthias Grob <maetugr@gmail.com>
* feat(failure_injection): integrate failure injection support across sensor drivers
* feat(failure_injection): enhance failure injection with RC switch support and instance bitmasking
feat(failure_injection): add disabled failure injection manager and system command support for v5x and v6x boards
* feat(failure_injection): add battery failure injection
Add a value-mutating apply-site for FAILURE_UNIT_SYSTEM_BATTERY. On an
injected OFF the outgoing battery_status is reported as a depleted pack
(zero remaining, emergency warning) so the low-battery failsafe triggers.
The apply-site lives in the shared Battery library, covering the analog
ADC, INA power monitors, ESC battery and SITL in one place, plus the
UAVCAN battery driver which publishes battery_status directly. The
previous SITL-only hack in BatterySimulator is removed in favour of this
shared path so simulation and hardware behave identically.
* fix(failure_injection): change parameter types from int32 to enum
* refactor(failure_injection): disable failure injection manager and system commands across multiple boards
* feat(failure_injection): enhance failure injection with timestamp handling and message-less support
* refactor(failure_injection): simplify has_timestamp_sample implementation and remove unused includes
* refactor(failure_injection):move conditional compilation into helper libary
* refactor(failure_injection): update CMakeLists to include failure_injection dependency across multiple drivers
---------
Co-authored-by: Claudio Chies <chiesc@chies.com>
Times perf_count and perf_begin/perf_end in tight loops with hrt, plus a
plain non-atomic counter loop as reference, to quantify the overhead of
the atomic perf_counter change. Run with: microbench microbench_perf
* platforms/common/uORB/uORB.h: Add definition for orb_sub_t and handle check functions
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
* uORB: Change subscriber id:s from int to orb_sub_t
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
* uxrce_dds_client: Change polling of transport device from px4_poll to poll
Use posix poll directly, there is no need to use px4_poll unless uORBs are
being polled.
The one used here is a normal filesystem/device poll, so we can use normal "poll",
this is the common pattern in the codebase.
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
* Fix linking for protected build
This fixes errors for memalign not linking on some configurations.
Memalign exists in nuttx kernel-side mm library and it may fail in configurations
where kernel and userspace are separated. This has no effect on other than
"CONFIG_BUILD_PROTECTED" or "CONFIG_BUILD_KERNEL" NuttX builds.
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
---------
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
Co-authored-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
Flashing PX4 over another firmware (e.g. ArduPilot on an ARK FPV) or
first-booting a board with blank parameter storage played the error tune
on every boot: the param layer treated a blank store as corruption, and
the rcS recovery persisted with a file cp that is a no-op on
FLASH_BASED_PARAMS boards, so the store never became valid.
- param_import()/param_load() return 1 ("not yet stored") for a blank
source - empty file, zeroed FRAM, or erased flash - on both the file
and flash backends; a store that holds data but no valid entry (torn
write, bit-rot, foreign data) is still reported as corrupt (-EILSEQ).
The file backend detects a zero-length file via fstat (NuttX FAT
cannot read() a 0-byte file: no cluster chain returns an error, not
EOF) and otherwise inspects the leading BSON document length; the
flash backend scans the whole store
- new 'param load-or-init <backup>' command: loads from the default
storage; a blank store is seeded from the SD backup (or firmware
defaults) and persisted so the next boot loads normally. A corrupt
store, a backup that exists but cannot be opened or imported, or a
result that cannot be persisted returns failure. The three-way
loaded/blank/corrupt logic lives in C because nsh $? is a binary
success flag. A failed backup seed does not reset to defaults, which
preserves parameters loaded earlier in boot (e.g. factory calibration
from /fs/mtd_caldata)
- rcS uses 'param load-or-init' instead of 'param import', and the
corrupt-store recovery persists via 'param save' (works on
flash-backed boards) only when the backup actually imported, so a
corrupt backup keeps alerting the operator on the next boot
- commander ParamLoadDefault treats blank storage (1) as success and
warns the GCS that parameters were reset to defaults, instead of
reporting "Error loading settings"
- parameter_flashfs_init() in flashfs.c no longer reports a successful
erase byte count as a failure (parity with flashfs32.c)
Tested with new blankImport and corruptImport cases in 'tests
parameters' (empty/zeroed/erased sources import as "not yet stored",
garbage fails to import); the CustomDefaults test now restores the
firmware default so the suite is repeatable within one boot.
The STM32H7 flash-erase DCACHE invalidate fix this depends on
(PX4/NuttX#381) is already in main's NuttX submodule.
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Add an on-target microbenchmark for LatLonAlt::Wgs84::gravity(), the
Somigliana latitude-dependent gravity used by EKF2 (APX4-4273), to
bound its CPU cost on the flight controller.
Measured ~0.45 us/call on fmu-v6s (STM32H7). The value is cached and
only recomputed when latitude moves >1 deg, so the steady-state EKF
cost is unchanged.
Enabled on the fmu-v6s performance-test board. Run with:
nsh> microbench microbench_gravity
APX4-4273
Integrators can declare read-only parameters in a per-board YAML file:
readonly_params.yaml.
There are two ways to define the read-only params:
- "block": default writable, explicitly list params to be locked
- "allow": default readonly, explicitly list params to be writable
Enforcement is activated by `param lock` in rcS after all startup
scripts have run, so board defaults and airframe scripts can still set
params during init.
The feedback via MAVLink uses the new
MAV_PARAM_ERROR_READ_ONLY as part of the PARAM_ERROR message.
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
Automatically generate the clang-tidy exclusion list from .gitmodules
so new submodules are excluded without manual intervention.
Changes:
- Makefile: Generate CLANG_TIDY_SUBMODULES from .gitmodules paths
- Makefile: Add CLANG_TIDY_EXCLUDE_EXTRA for manual exclusions:
- src/systemcmds/tests (test code, looser style allowed)
- src/examples (educational code, not production)
- src/modules/gyro_fft/CMSIS_5 (vendored ARM DSP library)
- Delete src/systemcmds/tests/.clang-tidy (stale since 2019)
- Delete src/modules/gyro_fft/CMSIS_5/.clang-tidy (redundant)
Rationale: Submodules and vendored code should be linted in their
upstream repositories, not here. This reduces noise and focuses
clang-tidy on code that PX4 maintainers actually edit.
Contributors adding vendored (non-submodule) third-party code should
add their path to CLANG_TIDY_EXCLUDE_EXTRA in the Makefile.
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
* listener: only clear screen with multiple messages
* listener: fully clear before printing again
Otherwise, we end up seeing artifacts from the previous print.
I suggest to clear the screen when using the listener with -n.
This way the updates don't just scroll by which isn't legible but
instead stay in place and update, similar to the top command.
* param: add a newline for the output of param show -q
Otherwise the output doesn't get flushed and doesn't show.
* param: remove deprecated PARAM_PRINT for QURT
We're not carrying platform defines in applications.