Custom parameters not saving

Hi all,

I have added new parameters to the Ardusub/Parameters.cpp class.
The parameters show up in QGC and can be set without an issue.
However, after a reboot the parameters are always back at default value.

Interestingly enough, i also added a parameter to AP_MOTOR/Motors6dof.cpp class, which also works fine. This parameter is also persisten through reboots.

Example of implementation in Ardusub/Parameters.cpp

  • added to var_info[]
	// @Param: DOCKING_YAW_P
	// @DisplayName: Docking Mode Heading P
	// @Description: Docking mode heading PID controller, P gain
	// @Range:-10000 10000
	// @User: Advanced
	GSCALAR(docking_mode_yaw_p, "DOCKING_YAW_P", DOCKING_YAW_P_DEFAULT),

The example parameter is added in the enum in Ardusub/Parameters.h as

k_param_docking_mode_yaw_p = 5000,

and the variable is defined as

AP_Float docking_mode_yaw_p;

The default value is defined in ArduSub/config.h as

#ifndef DOCKING_YAW_P_DEFAULT
#define DOCKING_YAW_P_DEFAULT 25
#endif

Any thoughts on how to get this to be persisten through reboots?

Cheers

Similar issue. Any insight?

Can you share your code on a pull request, and post a .bin file using something like wetransfer.com ?