Pre-Arm: "Param storage failed" error on Mission Palnner

  • Hello, I am using ArduPlane with a CUAV-X7 board. I have added a new serial library that receives the data, copies specific bytes into variables, logs, and sends them on Mavlink. I have added a scheduled task (Frequency=10Hz, Time=400, Priority=97) in the Plane.cpp.

  • After connecting CUAV with Mission Planner, I am writing parameters(Serial4_Protocol=51, Serial4_Baudrate=115200). After writing these parameters, I am facing the error Pre-Arm: “Param storage failed”. This error unable me from writing some other parameters after rebooting.

I’d appreciate any suggestions or guidance on how to resolve this issue.

Thank you in advance!

Best regards,
Ali Hasnain.

1 Like

Please share .bin log file with LOG_DISARMED enabled and your changes, I would guess you added a parameter that collides with an existing one.

1 Like

Pre-Arm Safety Checks — Plane documentation

1 Like

2025-07-08 10-55-39.tlog (973.2 KB)
Dear Lupus TheCanine,
I didn’t add a new parameter. I just added a new serial protocol and its relevant parameters (baudrate, Tx& Rx buffer size) in AP_serial_manager.
This is the main update code that I have called in the scheduled task of arduplane.cpp.
void NL::update()
{

if (!ECU_FLAG)
{
    // gcs().send_text(MAV_SEVERITY_WARNING, "ECU_FLAG not set. Reinitializing...");
    init();
    return;
}

int8_t nbytes = PAK_PORT->available();
// gcs().send_text(MAV_SEVERITY_INFO, "READY TO READ");
while (nbytes --> 0)
{
    unsigned char received_byte = PAK_PORT->read();
    // gcs().send_text(MAV_SEVERITY_INFO, "Received byte: 0x%02X", received_byte);
    comm_data[comm_received_pointer++] = received_byte;
    if (comm_received_pointer >= sizeof(comm_data))
    {
        // gcs().send_text(MAV_SEVERITY_ERROR, "Buffer overflow detected!");
        comm_received_pointer = 0;
        comm_convert_pointer = 0;
        return;
    }
}
decodeData();

#if HAL_LOGGING_ENABLED
logData();
#endif
}

Dear LanoAstur,
I have replaced hardware, even I have even changed the board to Pixhawk6C. I have also checked the power. But the error is not resolved.
I have noticed that when I upload the default firmware or any other updated firmware, the error doesn’t appear.
Please help me resolve the issue.
Regards,

I have solved this error. This error was due to the manual definition of the class singleton pattern. I resolved this issue using the automatic singleton pattern.

The class constructor is automatically called when an object is created. It is used to initialize data members or perform setup operations.

When a singleton class like AP_GPS, AP_InertialSensor, or AP_Baro is created, its constructor is responsible for:

  • Initializing hardware drivers (e.g., setting up I2C, SPI, UART).
  • Allocating buffers or memory.
  • Setting default values for internal state variables.

So, it is essential to carefully define the class singleton pattern and constructor definition.