From a3f1fb2e0197f4ddf78f1d3fc7e9565c7e06de09 Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Tue, 15 Jul 2025 13:32:44 +1000 Subject: [PATCH] [Docs] Airframe param reset on update (#24964) * Airframe param reset on update * Update docs/en/dev_airframes/adding_a_new_frame.md * Apply suggestions from code review Co-authored-by: Matthias Grob * Update adding_a_new_frame.md * Update adding_a_new_frame.md --------- Co-authored-by: Matthias Grob --- docs/en/dev_airframes/adding_a_new_frame.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/en/dev_airframes/adding_a_new_frame.md b/docs/en/dev_airframes/adding_a_new_frame.md index a8f6176a8d..addec0b132 100644 --- a/docs/en/dev_airframes/adding_a_new_frame.md +++ b/docs/en/dev_airframes/adding_a_new_frame.md @@ -26,7 +26,7 @@ The recommended process for developing a new frame configuration is: 1. Configure the [geometry and actuator outputs](../config/actuators.md). 1. Perform other [basic configuration](../config/index.md). 1. Tune the vehicle. -1. Run the [`param show-for-airframe`](../modules/modules_command.md#param) console command to list the parameter difference compared to the original generic airfame. +1. Run the [`param show-for-airframe`](../modules/modules_command.md#param) console command to list the parameter difference compared to the original generic airframe. Once you have the parameters you can create a new frame configuration file by copying the configuration file for the generic configuration, and appending the new parameters. @@ -39,7 +39,7 @@ To add a frame configuration to firmware: 1. Create a new config file in the [init.d/airframes](https://github.com/PX4/PX4-Autopilot/tree/main/ROMFS/px4fmu_common/init.d/airframes) folder. - Give it a short descriptive filename and prepend the filename with an unused autostart ID (for example, `1033092_superfast_vtol`). - Update the file with configuration parameters and apps (see section above). -1. Add the name of the new frame config file to the [CMakeLists.txt](https://github.com/PX4/PX4-Autopilot/blob/main/ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt) in the relevant section for the type of vehicle +1. Add the name of the new frame config file to the [CMakeLists.txt](https://github.com/PX4/PX4-Autopilot/blob/main/ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt) in the relevant section for the type of vehicle. 1. [Build and upload](../dev_setup/building_px4.md) the software. ## How to add a Configuration to an SD Card @@ -65,6 +65,18 @@ These aspects are mostly independent, which means that many configurations share New frame configuration files are only automatically added to the build system after a clean build (run `make clean`). ::: +## Force Reset of Airframe Parameters on Update + +To force a reset to the airframe defaults for all users of a specific airframe during update, increase the `PARAM_DEFAULTS_VER` variable in the airframe configuration. +It starts at `1` in [rcS](https://github.com/PX4/PX4-Autopilot/blob/main/ROMFS/px4fmu_common/init.d/rcS#L40). +Add `set PARAM_DEFAULTS_VER 2` in your airframe file, increasing the value with each future reset needed. + +This value is compared to [SYS_PARAM_VER](https://github.com/PX4/PX4-Autopilot/pull/advanced_config/parameter_reference.md#SYS_PARAM_VER) during PX4 updates. +If different, user-customized parameters are reset to defaults. + +Note that system parameters primarily include those related to the vehicle airframe configuration. +Parameters such as accumulating flight hours, RC and sensor calibrations, are preserved. + ### Example - Generic Quadcopter Frame Config The configuration file for a generic Quad X copter is shown below ([original file here](https://github.com/PX4/PX4-Autopilot/blob/main/ROMFS/px4fmu_common/init.d/airframes/4001_quad_x)).