ESP32 Custom Build: PreArm AHRS Error in GPS Hold Mode Despite EKF3 Configuration

ArduPilot ESP32 Custom Build - GPS Hold Mode AHRS Error

Hardware Setup:

Flight Controller: ESP32 (Custom Firmware Build)

  • IMU: GY-91 (MPU9250 + BMP280) via I2C
  • Magnetometer: QMC5883L via I2C
  • GPS: HLRC M100 Pro
  • Frame: Quadcopter

Pin Configuration:

Motors (PWM): GPIO 33, 25, 32, 26 I2C

(SDA/SCL): GPIO 21, 22

UART0 (TX/RX): GPIO 1, 3

UART1 (TX/RX): GPIO 16, 17


Current Status:

:white_check_mark: Working:

  • All sensors detected and functioning
  • STABILIZE mode - flies stable
  • ALTITUDE HOLD mode - working correctly
  • GPS Lock: 36-37 satellites with 3D Fix

:cross_mark: Not Working:

  • GPS HOLD/Loiter mode fails to arm

The Problem:

When attempting to arm in GPS Hold/Loiter mode, I get these errors:

  1. Waiting for home
  2. PreArm: AHRS: not using configured AHRS type

Parameters I’ve Already Set:

AHRS_EKF_TYPE = 3

EK3_ENABLE = 1

Despite having EKF3 properly configured and excellent GPS lock (36-37 sats), the AHRS error persists.


My Questions:

  1. Why is AHRS not using the configured EKF3 type even though it’s explicitly set?
  2. Are there additional EKF3 parameters required for ESP32 custom builds?
  3. Could this be related to I2C sensor configuration or compass setup?
  4. Is there something specific about GPS-dependent modes on ESP32 that I’m missing?

Additional Info:

  • Firmware: ArduPilot 4.x for ESP32 (custom build)
  • Build: Custom pin definitions compiled from source
  • Compass calibration: Completed successfully
  • Accelerometer calibration: Completed successfully
  • Home position: Not being set despite GPS lock

Yes the GNSS update rate must be higher than 5Hz

Typically when the GNSS receiver has too many satellites it lowers the update rate below 5Hz.
That causes ArduPilot to mark the GNSS receiver as unhealthy.

Maybe just enable just the GPS constellation. You only need about 8-10 satellites max for usual purposes and you get diminishing returns after this