Commit Graph
51005 Commits
Author SHA1 Message Date
7df3dbcc73 feat(boards/agam-robotics): add Agam Robotics FMU-v6XRT board support (#28285)
* feat(boards/agam-robotics): add Agam Robotics FMU-v6XRT board support

---------

Signed-off-by: abhijithcv <abhijithcv1212@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Farhang <46557204+farhangnaderi@users.noreply.github.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2026-09-08 10:47:44 -04:00
PX4BuildBot fc5256cf55 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-09-08 10:05:16 +00:00
Andrea Bernasconi 3677821fed fix(navigator): make RTL_TYPE dropdown options compact (#28528)
The option strings were too long, which made the value
dropdown overflow the window. Used short
names and kept the full explanations, unchanged, in the parameter long
description.
2026-09-08 11:45:45 +02:00
Thomas Stauber 662dd41db8 fix(simulation): correctly fill the device_id of the simulated sensor_gps message (#28592) 2026-09-08 11:34:44 +02:00
Mahima Yoga b95ae09e36 fix(land_detector): keep FW landed while waiting for the takeoff status (#28551) 2026-09-08 10:23:26 +02:00
LtxxandFarhang 2c47a16f56 fix(simulation): restore Gazebo fallback targets (#28339)
* fix(simulation): restore Gazebo fallback targets

Move the airframe glob outside the dependency check and create one fallback target per Gazebo airframe when dependencies are missing.

Assisted-by: OpenAI Codex: GPT-5

---------

Co-authored-by: Farhang <46557204+farhangnaderi@users.noreply.github.com>
2026-09-07 15:59:53 -04:00
Ramon Roche e3480a1e37 chore(agents): add Codex instructions and skills
Expose PX4 guidance and workflows to Codex while keeping root instructions concise and reusing tracked Claude workflows where possible.

Assisted-by: Copilot:gpt-6-astra
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-07 10:51:49 -07:00
Ramon RocheandFarhang 51b9a86a7e docs(dev_setup): refresh macOS environment page to match macos.sh (#28295)
The macOS setup page has not been edited since 2026-04-20, while
Tools/setup/macos.sh changed five times after that. The page still
describes the px4-sim Homebrew formula, which has been a deprecated
no-op in PX4/homebrew-px4 since 2026-04-20, and tells users to add
simulation later with `brew install px4-sim`, which installs nothing.
On Homebrew 6.0+ it does not even load, because the page never mentions
the tap trust the script now performs.

Stop enumerating the script's packages and taps in the page; that list
is what went stale. Say what the script does in one sentence, point at
macos.sh as the source of truth, and document only the user-facing
behaviour: Gazebo, XQuartz and a JDK come with --sim-tools, that path
needs sudo, taps are trusted for Homebrew 6, and the way to add
simulation later is to re-run the script with --sim-tools. Drop the
Python prerequisite; the script installs Python and creates the venv
itself.

Fix the pages it links to that contradict it: the simulation overview
still marked Gazebo on Apple Silicon as unstable (pre-dates the
2026-04-20 fix), the supported-targets table claimed Gazebo Classic on
macOS with nothing installing it, the jMAVSim page said Java must be
installed manually on macOS, and the build troubleshooting page
recommended ulimit 300 and running mac_set_ulimit.sh as a script (which
cannot change the caller's shell limit).

Assisted-by: Claude:claude-fable-5

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Farhang <46557204+farhangnaderi@users.noreply.github.com>
2026-09-07 13:14:34 -04:00
PX4BuildBot 2e20f66af7 build(macos): bump gz tap pin to 9403d12a474c 2026-09-07 08:57:05 -07:00
Jacob Dahl 91bb35c8b3 fix(nuttx): bump to the stm32h7 MDIO poll fix (#28591)
Every PHY register access on STM32H7 spent 5 ms in up_mdelay(), so the
boot-time autonegotiation link wait ran netinit at 44% CPU for 65 s with
the net lock held whenever no ethernet cable was attached (PX4/NuttX#414,
apache/nuttx#20067). Also picks up the two upstream stm32_mdio fixes for
the lower-half cast and the Clause 22 write register field.
2026-09-07 09:44:09 -06:00
PX4BuildBot a9d4516ce9 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-09-07 15:23:17 +00:00
Claudio Chies e87918ea2b fix(failure_injection): keep failure names in sync with FailureInjection.msg (#28376)
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.
2026-09-07 09:16:38 -06:00
Julian Oes 0fb3847cd9 fix(mavlink): reject TUNNEL messages that overstate their payload length (#28573)
The TUNNEL message carries a fixed 128-byte payload alongside a uint8_t
payload_length, so a sender can advertise up to 255 bytes of data in a
buffer that can only ever hold 128. handle_message_tunnel() copied that
length into the uORB topic unchanged.

The consumers trust it: voxl_esc and voxl2_io both pass payload_length
straight to _uart_port.write() over the 128-byte payload, so a length
above 128 reads past the end of the array and transmits whatever follows
it out of the ESC or IO UART.

Drop such a message rather than clamping the length. These payloads are
forwarded verbatim to a device, where a truncated frame would corrupt the
device protocol rather than fail cleanly.

Assisted-by: Claude:claude-opus-5[1m]

Signed-off-by: Julian Oes <julian@oes.ch>
2026-09-07 13:29:21 +12:00
Alex Klimaj 1e015c73e3 feat(drivers/afbrs50): update Broadcom API to 1.6.6.1 (#28262)
* feat(drivers/afbrs50): update Broadcom API to 1.6.6.1

Vendor the latest AFBR-S50 API so the rangefinder driver tracks
Broadcom's 1.6.6.1 library and near-range DCA improvements.

Assisted-by: Grok:grok-4.6
Signed-off-by: alexklimaj <alex@arkelectron.com>

* fix(drivers/afbrs50): print full API version 1.6.6.1

Argus_GetAPIVersion() only encodes major.minor.bugfix, which hides
the vendored 1.6.6.1 patch level in the startup log.

Assisted-by: Grok:grok-4.6
Signed-off-by: alexklimaj <alex@arkelectron.com>

---------

Signed-off-by: alexklimaj <alex@arkelectron.com>
2026-09-06 13:19:38 -06:00
Jacob Dahl 4d99a38b5f docs(maintainers): promote Jonas Perolini to Navigator code owner
Navigator (missions, RTL, detect-and-avoid, takeoff/landing) has no Code Owner. Jonas has been doing that work as a Reviewer.

Assisted-by: Grok:grok-4.6
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-05 16:33:45 -07:00
Jacob Dahl 6dc89338a8 fix(commander): build mag calibration only with CONFIG_SENSORS_VEHICLE_MAGNETOMETER (#28555)
Boards that compile the magnetometer pipeline out still linked 8.6 KB of
calibration that could never run. holybro_kakutef7 is one of them and sits
at 100 % of flash on main. The calibration commands answer UNSUPPORTED
there.
2026-09-04 21:26:50 -06:00
Andreas 29120280ac fix(crsf_rc): avoid out-of-range packet type enum conversion (#28449)
An arbitrary CRSF packet type is an eight-bit wire value. Converting an unknown value to CRSF_PACKET_TYPE before descriptor lookup invokes undefined behavior under C++ enum sanitization. Keep the lookup  boundary as uint8_t; the descriptor table already stores its packet type in that representation.
2026-09-04 21:02:34 -06:00
Jacob Dahl 0294b6200f fix(paa3905): rate-limit challenging surface warning (#28553)
The Motion ChallengingSurface bit stays asserted for the whole time over a bad surface, so PX4_WARN floods the console at the run-loop rate.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-04 17:21:36 -06:00
Ramon Roche 6f93287fdd ci(macos): rewrite gz tap pin refresh in Ruby under brew ruby
The bash version spent most of its lines on plumbing: parsing a report
back out of a per-commit `brew ruby` child, awk and herestrings for set
logic, bash 3.2 workarounds, and a trap to restore the tap. The job
itself is small and lives inside Homebrew anyway, so run the whole thing
under Homebrew's Ruby and call its tap, formula and bottle APIs directly.

One process instead of one Homebrew startup per candidate commit, the
tap checkout restored by ensure, tarballs checked with Net::HTTP, and no
second language embedded in a string. Formulary.clear_cache and
Tap#clear_cache between checkouts keep each candidate's formulae fresh.
GITHUB_OUTPUT still arrives because brew forwards GITHUB_* whenever CI
is set. Same walk, same exemption for formulae unbottled at the pin,
same outputs; verified to pick the same commit as the bash version.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-04 13:26:30 -07:00
Ramon Roche 2d6329fab2 ci(macos): brew update before macos.sh so both legs see current core
The macOS runner images set HOMEBREW_NO_AUTO_UPDATE in their bashrc and
carry a homebrew-core snapshot from image build time. Today the macos-15
image (20260828) installs protobuf 36.0 while macos-26 (20260707) still
installs 35.1, so the two legs of this workflow cannot both be
compatible with any single gz tap pin. The pin is refreshed against tap
HEAD, which OSRF keeps consistent with current homebrew-core, so update
core before installing. Dev machines already do this through brew's
auto-update.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-04 13:26:30 -07:00
Ramon Roche 832f8ebac8 build(macos): bump gz tap pin to 43aee9cc6e02
homebrew-core moved to protobuf 36.0 and abseil 20260817.0, and the
macos-15 runner image (20260828) now ships that snapshot. The gz bottles
at the pinned commit c90f81ac were built against protobuf 35.1, so the
gz_bridge build fails on every run since today with

    gz/msgs/details/discovery.pb.h:17:2: fatal error: "Protobuf C++
    gencode is built with an incompatible version of"

on main as well as on this PR. 43aee9cc is tap HEAD, where OSRF has
rebuilt every gz-harmonic dependency for protobuf 36.0 and abseil
20260817.0 (the gz-msgs10 10.4.0_2 bottle's INSTALL_RECEIPT records
both). Tools/ci/refresh_gz_tap_pin.sh picked this commit.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-04 13:26:30 -07:00
Ramon Roche 045f249929 ci(macos): move gz tap pin refresh into a script that checks bottles
The weekly refresh workflow carried its logic inline, compared only the
tap SHA against the pin, and duplicated the --sim-tools package list.
`brew install --dry-run` never prints "from source", so its bottle check
could not fire.

Tools/ci/refresh_gz_tap_pin.sh now owns the job and the workflow calls
it. It reads the osrf/simulation formulae from macos.sh, walks the tap
from HEAD back to the pin, asks Homebrew at each commit whether every
formula in the runtime closure has a bottle for the host, HEAD-requests
each tarball, and rewrites the pin to the first commit that passes.
Formulae with no bottle at the current pin (the gz-harmonic
meta-formula, which OSRF never bottles) are not required.
peter-evans/create-pull-request opens or updates the bot PR from the
script's outputs, so an unmerged bump is refreshed instead of duplicated.

The job runs on macos-15, the oldest macOS in compile_macos.yml, because
Homebrew pours an older macOS bottle onto a newer one, not the reverse.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-04 13:26:30 -07:00
FARHANG d840da70b6 build(macos): pin gz tap unconditionally, add weekly refresh
macos.sh only pinned osrf/simulation when --ci was passed, so dev
machines still hit OSRF's bottle-gap window and built Gazebo from
source. Apply it whenever --sim-tools runs.

The pin is a point-in-time SHA with nothing to advance it, so add a
weekly workflow that checks whether osrf/simulation HEAD is fully
bottled and opens a PR bumping gz-tap-pin.txt when it is.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: FARHANG <farhang.nba@gmail.com>
2026-09-04 13:26:30 -07:00
XiaoYang ChenandJacob Dahl 354823e2ef fix(load_mon): add return code at module stop path (#28544)
* fix uaf bug in load_mon module

* fix(load_mon): end the perf cycle before deleting the module

exit_and_cleanup() deletes this and frees _cycle_perf, so the elapsed counter has to be closed on the live object.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-04 13:25:32 -06:00
PX4BuildBot f8387d19a1 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-09-04 15:28:01 +00:00
Hamish Willee 7e1298f8da docs(docs): SensorUwb.msg - update to UORB docs standard (#28522)
* docs(docs): SensorUwb.msg - update to docs standard

* docs(docs): Remove whitespace
2026-09-04 08:21:50 -07:00
XiaoYang Chen fec216e9d7 fix oor bug in netman module (#28483) 2026-09-04 08:59:32 -06:00
Kofemolka 5e3aa503e5 fix(mavlink): sync ranging beacon timestamp to local clock domain (#28091)
RANGING_BEACON.time_usec is in the sender's clock domain (Unix epoch or
sender boot time, per the MAVLink spec). handle_message_ranging_beacon copied
it straight into timestamp_sample, unlike every other external-aiding handler
in this file (mocap, vision odometry, landing_target_pose, gps_input target),
which all call _mavlink_timesync.sync_stamp() first.

EKF2 trusts the uORB producer to have already normalized the timestamp: the
ranging beacon ring buffer and controlRangingBeaconFusion() compare
sample.time_us directly against imu_delayed.time_us, both expected to be in
the local hrt_absolute_time() domain. Left unsynced, the mismatch starves or
corrupts beacon fusion depending on which clock domain is larger.

Assisted-by: Claude:claude-sonnet-5

Signed-off-by: kofemolka <kubovich@gmail.com>
2026-09-04 08:58:28 -06:00
Roman Bapst 338592cb98 fix(simulation): fix test filter for loiter tests (#28271)
The fixed wing loiter tests were not running because the test filter did not match.

Also the test was failing because the altitude threshold when to stop checking the "established on loiter" criteria was lower than the fixed wing altitude acceptance radius, so the test was always failing.
2026-09-04 16:42:06 +02:00
airpixel-cz 2843109a79 feat(mavlink): Add handling for MESSAGE_INTERVAL & TIMESYNC in Gimbal mavlink telemetry ports (#28485)
* Add handling for COMMAND_LONG & TIMESYNC

* mavlink: handle COMMAND_INT and scope TIMESYNC in gimbal mode

Address review feedback: TIMESYNC is now handled inside the switch so SYSTEM_TIME can no longer reach MavlinkTimesync and adjust the system clock from a gimbal-mode port. COMMAND_INT is handled through the same allowlist as COMMAND_LONG, factored into a shared helper.
2026-09-04 08:36:24 -06:00
Balduin b2e3023aef fix(boards): raise fmu-v6xrt allyes flash region to 8M
The ark_fmu-v6xrt_allyes target overflows its 4M-128K flash region since
the NuttX 12.12.0 upgrade grew the image to 99.94% and the next small
module change (https://github.com/PX4/PX4-Autopilot/pull/28476) tipped
it over. The ARK board was copied from px4/fmu-v6xrt before that upgrade
raised the px4 allyes region to 6M, so the copy kept the old limit.

allyes is a CI coverage build that compiles every module and is never
flashed. The region length is only an artificial cap on programming
time.

Set both allyes scripts to 8M-128K so they stay identical and leave
headroom for the coverage build to keep growing.
2026-09-04 16:14:51 +02:00
yannickpoffet 3ebb2923a1 fix(rover): fix rover modules to work with SIH lockstep (#28476)
After recent modification to the SIH lockstep, the rover modules were not working anymore.
This commit fixes the issues and makes the rover modules work with the SIH lockstep again.
2026-09-04 09:24:37 +02:00
Patrik Dominik PordiandBeniamino Pozzan f804968467 fix(commander): allow VTOL to register fixed-wing setpoint type form (#28510)
* fix(commander): allow VTOL to register fixed-wing setpoint type from MC form

isSetpointTypeValid() rejected SetpointType::FixedwingLateralLongitudinal
whenever vehicle_type != VEHICLE_TYPE_FIXED_WING. Since a VTOL always
boots (and stays, until it actually transitions) in ROTARY_WING form,
this made it impossible for an external mode to register this setpoint
type up front in order to command the vehicle's own first transition to
fixed-wing - registration is a one-time, synchronous step performed at
mode construction, before the vehicle has ever flown.

Thread the vehicle's is_vtol flag down to isSetpointTypeValid() and
accept FixedwingLateralLongitudinal when is_vtol is true, regardless of
the vehicle's current dynamic form. A VTOL is capable of fixed-wing
control even while currently multicopter, precisely because it is about
to transition.

* Update src/modules/commander/ModeUtil/setpoint_types.cpp

Co-authored-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>

* Update src/modules/commander/ModeUtil/setpoint_types.hpp

Co-authored-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>

---------

Co-authored-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
2026-09-04 08:43:50 +02:00
Jacob Dahl 8f9b91b2bd fix(boards): correct the F412 chip selection and app flash size on ARK cannodes (#28456)
* fix(can-flow-mr): use STM32F412VG and 960K of app flash

The part is STM32F412VGH6 (100-pin, 1MB), not the 48-pin 512KB CE.
App flash starts at 0x08010000 after the 64K bootloader+params window,
so the region is 960K, not 928K.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(boards): select STM32F412VG on the 100-pin 1MB ARK cannodes

Teseo, X20, F9P, and Septentrio/MOSAIC/G5 GPS modules use
STM32F412VGH6, same as Flow MR. They were still selecting the
48-pin 512KB CE and a 928K app region that double-counted params.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(ark/cannode): use STM32F412CG and 960K of app flash

The part is STM32F412CGU6, not the 512KB CE. App flash starts at
0x08010000 after the 64K bootloader+params window, so the region is
960K, not 928K.

* fix(ark/mag): use STM32F412VG and 960K of app flash

The part is STM32F412VGH6, not the 48-pin 512KB CE, and the app region
after the 64K bootloader+params reservation is 960K, not 928K.

* docs(boards): fix the F412 SRAM description in the cannode linker scripts

The F412 has one contiguous 256KB SRAM at 0x20000000. The block list
these scripts carried is F42x boilerplate and describes memory the part
does not have.

* fix(ark/dist): use STM32F412VG and 960K of app flash

The part is STM32F412VGH6, not the 48-pin 512KB CE. App flash starts at
0x08010000 after the 64K bootloader+params window, so the region is
960K, not 928K.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(boards): give F412 cannodes a 256K SRAM region (#28498)

NuttX now ends the F412 heap at 0x20040000. The linker scripts still
capped .data/.bss at 192K, leftover from the F42x split.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* docs(boards): fix the F412 SRAM description on the 512K ARK cannodes

The F412 has one contiguous 256KB SRAM at 0x20000000. The block list
these scripts carried is F42x boilerplate and describes memory the part
does not have.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(ark/cannode): drop the PH1 boot jumper defines

PH1 is OSC_OUT for the HSE crystal. The jumper option was already
undefined, so these defines could not be enabled without stopping
the clock.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* fix(boards): correct ARK cannode I2C bitbang pins

The bitbang GPIO defines did not match the schematic nets, so a bus reset would drive the wrong pins.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-03 19:29:57 -06:00
Hamish Willee 5564fa64b4 docs(tools): Uorb docs generator generate_msg_docs_fix fixes to catch more errors (#28523) 2026-09-04 09:58:41 +10:00
Ramon Roche 0161358033 chore(nuttx): bump NuttX to px4_firmware_nuttx-12.12.0+ tip
Advance the NuttX submodule from 1db7c59 to the fork branch tip
f07832f0 (px4_firmware_nuttx-12.12.0+), pulling in three backports:

  - FlexCAN: store the TX deadline only once the frame is sent
  - FlexCAN: assign MAXMB rather than OR-ing it in
  - STM32F412: set SRAM1_END to 256KiB (#407)

The two FlexCAN backports are the apache/nuttx#19970 follow-ups the
branch was missing; they land the corrected i.MX RT TX-abort behavior.

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Assisted-by: Claude:claude-fable-5-1
2026-09-03 12:31:07 -07:00
Jacob Dahl 39eae27610 fix(uavcan): apply UAVCAN_BITRATE on FlexCAN again, size uavcan/TTY work queues for NuttX 12 (#28509)
* fix(uavcan): apply UAVCAN_BITRATE on FlexCAN again

58dfff0de7 turned the SIOCSCANBITRATE path off for i.MX RT, S32K and Kinetis,
which is every board in the tree that builds SocketCAN, so UAVCAN_BITRATE
stopped doing anything at all. It was written before db6f7ec304, and the crash
it works around is that commit's bug: the driver reports bit/s on NuttX 12 and
the caller still divided by 1000, so a 1 Mbit/s board asked its controller for
1000 bit/s on every boot.

Benched on an ARK FMU-v6XRT with the gate removed: 1 Mbit/s -> 500 kbit/s ->
1 Mbit/s round-trips with both DroneCAN nodes coming back OPERAT, buses
error-active, no fault. Requesting a rate the controller cannot reach is also
survivable now -- it is reported and the configured rate is kept, where before
a negative return from here made CanDriver::init() give up and DroneCAN never
started.

The %u for a uint32_t is fixed as well; nothing compiled this branch while the
gate was in place.

* fix(work_queue): size the uavcan and TTY work queues for NuttX 12

NuttX 12.12 costs a few hundred bytes of stack on the paths that go through
the file layer, and that is more than these two defaults left spare. Measured
against the same PX4 tree on 10.3.0:

  wq:uavcan  2860/3728 -> 3184/3736  (ARK FMU-v6X, two DroneCAN GNSS nodes)
  wq:ttyS4   1088/1704 -> 1432/1712  (ARK FMU-v6XRT, crsf_rc)

load_mon reports wq:ttyS4 low on stack with 280 bytes left, and wq:uavcan sits
at 85 % of its own. 4096 and 2048 restore the margin the 10.3.0 figures had.
2026-09-03 12:31:07 -07:00
Peter van der Perk cff2ed8528 fix(nuttx): propagate ARCHDEFINES to CFLAGS for __NuttX__ flag
Fixes the redefinition warnings in apps/system/dd/dd_main.c.
2026-09-03 12:31:07 -07:00
Peter van der Perk 1a2418ad21 fix(uavcan): NuttX 12.12.0 SocketCAN uses bit/s in can_ioctl_data_s
Kernel update changed can_ioctl_data_s bitrate unit from kbit/s to bit/s
Update uavcan ioctl logic accordingly
2026-09-03 12:31:07 -07:00
Julian Oes b7dcb64f67 fix(nuttx): bump submodule for IGMP General Query fix
The fix is upstream as f20cf4aac3 but landed after the 12.12.0 tag, so
moving the submodule onto 12.12.0 dropped a fix the previous branch
already carried. Backport it.

Without it the group address in the IGMP header, a uint16_t[2] that decays
to a pointer, is compared against INADDR_ANY, which is always false. A
General Query then falls through to the group-specific branch, a group is
allocated for 0.0.0.0, and joined groups never have their report timers
restarted, so the querier ages out the membership and multicast delivery
to the device stops.

CONFIG_NET_IGMP is enabled on ark/fmu-v6xrt, px4/fmu-v6xrt,
nxp/mr-canhubk3, nxp/mr-tropic and nxp/tropic-community.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
2026-09-03 12:31:07 -07:00
Julian Oes cc470e0ebd fix(uavcan): keep the configured CAN bitrate on FlexCAN controllers
The SIOCSCANBITRATE path in CanIface::setBitRate() was gated on
SIOCGCANERRORS, which the NuttX submodule bump now defines. That turned on
a retune sequence that had never been compiled or run in this tree: it takes
the interface down, sets the bitrate and brings it back up.

Two problems surfaced on a Pixhawk v6XRT. The path did not build, because it
still used IFF_DOWN, which NuttX removed; SIOCSIFFLAGS now acts on the
IFF_UP request bit, so clearing it is what takes an interface down. Once it
built, the board booted and then crashed a few seconds later, when uavcan
started and retuned the interfaces. The driver ioctl itself is harmless and
only stores the timings, so the fault is in bringing a FlexCAN interface
down and back up at runtime, where ECC RAM initialisation runs again on a
controller that has already been started.

SIOCGCANERRORS reports whether a driver can read error counters, which says
nothing about whether it can be retuned; the two capabilities only happened
to arrive in the same commit. Gate on the capability that is actually meant,
and keep the configured rate on the FlexCAN chips. Every board in the tree
that enables SocketCAN today is FlexCAN, so this restores the behaviour
those boards already had before the bump.

Verified on px4_fmu-v6xrt: crashes with the retune path active, stable with
the configured rate kept.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
2026-09-03 12:31:07 -07:00
Julian Oes b4c9d109af fix(bootloader): select the MSP before jumping to the application
NuttX 12.12.0 added arm_initialize_stack(), which moves thread mode onto
the process stack pointer whenever CONFIG_ARCH_INTERRUPTSTACK > 7. Every
bootloader config qualifies, so the bootloader now reaches arch_do_jump()
with CONTROL.SPSEL set, where previously it ran on the main stack.

arch_do_jump() writes the MSP and branches, but never selects it. The
application therefore starts on the bootloader's PSP while its own startup
code initialises a stack pointer the CPU is not using. Boards booted far
enough to reach NSH and start MAVLink, then hard faulted once the stale
bootloader stack was overwritten, surfacing as an assertion in Idle_Task
with no useful backtrace.

Clear CONTROL.SPSEL so control passes on the stack the application expects.
The i.MX RT bootloader performs the same jump and its configs also exceed
the interrupt stack threshold, so fix both.

Verified on CubePilot CubeOrange and Pixhawk 6C; the prebuilt bootloaders
for both are regenerated, as the shipped binaries have the defect.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
2026-09-03 12:31:07 -07:00
Julian Oes b407bbd015 fix(nuttx): bump submodule for kthread group crash and CAN ioctl symbol
NuttX 12.12.0 shares one statically allocated g_kthread_group between all
kernel threads, but group_leave() guards the group_release() call behind
HAVE_GROUP_MEMBERS, which is only defined when pthreads are enabled. Every
bootloader config sets CONFIG_DEFAULT_SMALL=y, so DISABLE_PTHREAD defaults
to y, and the first kernel thread to exit tears down the shared group and
calls kmm_free() on a .bss static. The bootloader died before USB
enumeration. Around 64 configs in the tree share that combination.

The submodule now carries the upstream fix, apache/nuttx f20f9ff19e.

The bump also picks up the backport that recombines the per-command CAN
ioctl Kconfig options back into NETDEV_CAN_IOCTL. Defconfigs on this branch
already reference CONFIG_NETDEV_CAN_IOCTL, which does not exist at the
previously pinned commit, so SocketCAN bitrate, filter and state ioctls
were silently disabled on ark/fmu-v6xrt, px4/fmu-v6xrt, nxp/mr-canhubk3,
nxp/tropic-community and nxp/mr-tropic.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>
2026-09-03 12:31:07 -07:00
Ramon Roche edcb4460a1 fix(uavcan): use PRIu32 for bitrate readback print on NuttX 12
The UAVCAN_BITRATE code merged via #28457 prints the driver's
arbi_bitrate (uint32_t) with %u. On the NuttX 12.12 toolchain
uint32_t is unsigned long, so -Werror=format fails every SocketCAN
board (imxrt, s32k). Use PRIu32 for the uint32_t; kbps stays %u as it
is a uint16_t promoted to int.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-03 12:31:07 -07:00
Ramon Roche 296c1e4297 chore(platforms): drop dead cdc_acm_check.cpp resurrected by rebase
Main removed this file in f05739035e (#28185) when USB autostart moved
into the cdcacm_autostart driver. The NuttX upgrade rebase brought back
a NuttX 12 adaptation of it, but nothing references it in any build
file, so it is 370 lines of dead code.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-03 12:31:07 -07:00
Ramon Roche ccc62175e4 fix(boards): restore buffered stdio on fmu-v5x and PIX6
The upgrade defconfig sweep (04c00266e52) replaced
CONFIG_STDIO_BUFFER_SIZE=256 with CONFIG_STDIO_DISABLE_BUFFERING=y on
these two boards. On NuttX 12.12 that config hits an upstream
regression (62c2b1abba): task_init_stream() only assigns
fs_cookie/fs_oflags inside the buffered branch, so with unbuffered
stdio every spawned task's stdout FILE is left zeroed and bound to
fd 0. All printf output on the board is silently discarded, including
the boot log and every shell command that prints via stdio; raw fd
writes (top, dmesg) still work, which made this hard to spot.

Verified on fmu-v5x hardware (fileno(stdout)==0 in spawned tasks,
EACCES on flush over the MAVLink shell). Restoring buffered stdio
returns these boards to their pre-upgrade configuration. The upstream
fix apache/nuttx 2b1cf4238756 (post-12.12.0) should additionally be
backported to px4_firmware_nuttx-12.12.0+ to cure the class for any
unbuffered config.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-03 12:31:07 -07:00
Ramon Roche 49f45653ee fix(mavlink_shell): bump nsh task stack to 4096 for NuttX 12
The nsh output path changed architecture in NuttX 12: nuttx-apps
95f32fd018 decoupled nshlib from FILE streams, so every output call
now runs vdprintf() with the stream engine and full VFS write chain
on the nsh task stack. On CONFIG_DEFAULT_SMALL boards the
lib_get_tempbuffer() fallback additionally compiles to alloca() on
the parse path. The hardcoded 2048 byte stack overflows, and because
NuttX 12 keeps the TLS block at the stack base the failure is a
silent mute shell rather than a hardfault.

Verified on fmu-v5x hardware: shell dead at 2048, working at 4096.
Mirrors the nshterm stack fix already on this branch (8a8f32699b7).

Assisted-by: Claude:claude-fable-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-09-03 12:31:07 -07:00
Marin Doetterer 66f197b6ea fix(nshterm): went out of stack
fix(mavlink_shell): no echo of commands
2026-09-03 12:31:07 -07:00
Peter van der Perkandmarinauterion da60109091 fix(systemcmds/nshterm): echo input and consume enter
Enable ICANON and ECHO, and map CR to NL (ICRNL) so the nshterm console
echoes typed characters and processes the enter key.

Co-authored-by: marinauterion <224611774+marinauterion@users.noreply.github.com>
Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2026-09-03 12:31:07 -07:00
Peter van der Perkandmarinauterion 0501b7e5f9 fix(drivers/mcp23xxx): increase main stack to avoid overflow
Stack usage of the mcp23009/mcp23017 GPIO drivers increased with NuttX
12.12, bump STACK_MAIN to 2560.

Co-authored-by: marinauterion <224611774+marinauterion@users.noreply.github.com>
Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2026-09-03 12:31:07 -07:00