← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

There was not enough memory to start the EKF

Stops itPosition and attitude estimate (EKF, AHRS)

What ArduPilot says:

Also explained here: 3 more
  • EKF3 IMUNGSF: allocation failed
  • EKF3 IMUN GSF: not enough memory
  • EKF2 IMUN GSF: not enough memory

The EKF, ArduPilot's position and attitude estimator, needs a large block of memory for each copy it runs (one per IMU in EK3_IMU_MASK), and more for the GSF yaw estimator. At start-up the board did not have it. After “EKF3 not enough memory” or “allocation failed” the EKF is switched off until the next reboot, and the aircraft will not arm. The GSF lines mean the EKF copy for that IMU could not be set up and will be tried again.

What to do, most likely first

  1. A small board (F4, or an F7 with little RAM) runs too many memory-hungry features at once: Lua scripting, terrain, a large log buffer.

    CheckThe ground station shows the free memory (freemem). SCR_ENABLE 1 with a large SCR_HEAP_SIZE is the usual culprit.

    FixSwitch off what you do not use (SCR_ENABLE, TERRAIN_ENABLE), reduce SCR_HEAP_SIZE and LOG_FILE_BUFSIZE, then reboot.

  2. More EKF copies are asked for than the board can hold, or EKF2 and EKF3 are both enabled.

    CheckEK3_IMU_MASK is 3 or 7 (two or three copies); EK2_ENABLE is 1 as well as EK3_ENABLE.

    FixSet EK2_ENABLE to 0. On a small board set EK3_IMU_MASK to 1, one copy on the first IMU, and reboot.

Parameters to look at

ParameterWhat it is
EK3_IMU_MASKBitmask of active IMUs
EK2_ENABLEEnable EKF2
EK3_GSF_RUN_MASKBitmask of which EKF-GSF yaw estimators run
SCR_ENABLEEnable Scripting
SCR_HEAP_SIZEScripting Heap Size
LOG_FILE_BUFSIZELogging File and Block Backend buffer size max (in kilobytes)
TERRAIN_ENABLETerrain data enable
The code that sends it

EKF2 IMUNGSF: allocation failed

libraries/AP_NavEKF2/AP_NavEKF2_core.cpp NavEKF2_core::setup_core() · Open in ArduPilot Copter-4.7.1

EKF3 allocation failed

libraries/AP_NavEKF3/AP_NavEKF3.cpp NavEKF3::InitialiseFilter() · Open in ArduPilot Copter-4.7.1

EKF3 not enough memory

libraries/AP_NavEKF3/AP_NavEKF3.cpp NavEKF3::InitialiseFilter() · Open in ArduPilot Copter-4.7.1

NavEKF2: memory allocation failed

libraries/AP_NavEKF2/AP_NavEKF2.cpp NavEKF2::InitialiseFilter() · Open in ArduPilot Copter-4.7.1

And 5 more messages, sent from the same places.

Written here for Copter 4.6. In the tool you choose your vehicle and version, see your own parameter values beside the ones named here, and drop a flight log to have every message in it explained.

Open it in the Message & Error Explainer