From efdd1e021fe34217d4a28042f20168139abedb0c Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Tue, 17 Mar 2026 21:43:27 +0100 Subject: [PATCH] fix(rcS): reset the flight mode assignments during an airframe reset (#26773) * fix(rcS): reset the flight mode assignments during an airframe reset because there are many products that have a default flight mode assignment in the airframe file and if the user resets to airframe defaults the flight mode assignment stays custom and doesn't get reset to "factory settings". It's neither a unit specific calibration nor a parameter to track total flights or flight time. I suggest to reset it as well. * fix(posix rcS): sync airframe reset with the px4 common startup script to make simulation testing of an airframe reset more realistic. --- ROMFS/px4fmu_common/init.d-posix/rcS | 7 ++++--- ROMFS/px4fmu_common/init.d/rcS | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index 0e443d30c4..438faf9b48 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -119,10 +119,11 @@ else param set SYS_AUTOCONFIG 1 fi -if param compare SYS_AUTOCONFIG 1 +# To trigger a parameter reset during boot SYS_AUTCONFIG was set to 1 before +if param greater SYS_AUTOCONFIG 0 then - # Reset params except Airframe, RC calibration, sensor calibration, flight modes, total flight time, and next flight UUID. - param reset_all SYS_AUTOSTART RC* CAL_* COM_FLTMODE* LND_FLIGHT* TC_* COM_FLIGHT* + # Reset parameters except airframe, parameter version, RC calibration, sensor calibration, total flight time, flight UUID + param reset_all SYS_AUTOSTART SYS_PARAM_VER RC* CAL_* LND_FLIGHT* TC_* COM_FLIGHT* set AUTOCNF yes fi diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 80749fbe8c..0697b181ae 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -191,8 +191,8 @@ else # To trigger a parameter reset during boot SYS_AUTCONFIG was set to 1 before if param greater SYS_AUTOCONFIG 0 then - # Reset parameters except airframe, parameter version, RC calibration, sensor calibration, flight modes, total flight time, flight UUID - param reset_all SYS_AUTOSTART SYS_PARAM_VER RC* CAL_* COM_FLTMODE* LND_FLIGHT* TC_* COM_FLIGHT* + # Reset parameters except airframe, parameter version, RC calibration, sensor calibration, total flight time, flight UUID + param reset_all SYS_AUTOSTART SYS_PARAM_VER RC* CAL_* LND_FLIGHT* TC_* COM_FLIGHT* fi #