ubx: add option to wipe flash

This commit is contained in:
Alexander Lerach
2025-07-17 14:31:57 +02:00
parent 9c1a22e74e
commit 752ecd3d1b
3 changed files with 26 additions and 1 deletions
+9
View File
@@ -909,6 +909,15 @@ GPS::run()
gpsConfig.interface_protocols = static_cast<GPSHelper::InterfaceProtocolsMask>(gps_ubx_cfg_intf);
int32_t gps_cfg_wipe = 0;
handle = param_find("GPS_CFG_WIPE");
if (handle != PARAM_INVALID) {
param_get(handle, &gps_cfg_wipe);
}
gpsConfig.cfg_wipe = static_cast<bool>(gps_cfg_wipe);
if (_helper && _helper->configure(_baudrate, gpsConfig) == 0) {
/* reset report */
+16
View File
@@ -142,6 +142,22 @@ PARAM_DEFINE_INT32(GPS_UBX_BAUD2, 230400);
*/
PARAM_DEFINE_INT32(GPS_UBX_CFG_INTF, 0);
/**
* Wipes the flash config of UBX modules.
*
* Some UBX modules have a FLASH that allows to store persistent configuration that will be loaded on start.
* PX4 does override all configuration parameters it needs in RAM, which takes precedence over the values in FLASH.
* However, configuration parameters that are not overriden by PX4 can still cause unexpected problems during flight.
* To avoid these kind of problems a clean config can be reached by wiping the FLASH on boot.
*
* Note: Currently only supported on UBX.
*
* @reboot_required true
* @group GPS
* @boolean
*/
PARAM_DEFINE_INT32(GPS_CFG_WIPE, 0);
/**
* Heading/Yaw offset for dual antenna GPS
*