Raw IMU logging was switched on but is not running yet
What ArduPilot says:
- Failed to allocate N bytes for IMU batch sampling
- PreArm: Batch sampling requires reboot
Batch sampling records short bursts of raw gyro or accelerometer data in the log, used to see which frequencies the frame vibrates at. It is switched on with INS_LOG_BAT_MASK, but its memory is set aside only at start-up. The check fails while it is switched on and that memory is not there: either the parameter was changed since the last boot, or at boot there was not enough memory (“Failed to allocate … bytes for IMU batch sampling”).
What to do, most likely first
INS_LOG_BAT_MASKwas changed since the last boot.FixReboot the flight controller.
The message is still there after a reboot: the board has too little free memory for the sample buffer.
Check“Failed to allocate … bytes for IMU batch sampling” appears in the start-up messages.
FixLower
INS_LOG_BAT_CNT(1024 by default) to 512 or 256 and reboot. When the measuring is done, setINS_LOG_BAT_MASKback to 0.
Parameters to look at
| Parameter | What it is |
|---|---|
INS_LOG_BAT_MASK | Sensor Bitmask |
INS_LOG_BAT_CNT | sample count per batch |
Where to do it:Setup & Tuning Guide
The code that sends it
Failed to allocate N bytes for IMU batch sampling
libraries/AP_InertialSensor/BatchSampler.cpp AP_InertialSensor::BatchSampler::init() · Open in ArduPilot Copter-4.7.1
PreArm: Batch sampling requires reboot
libraries/AP_Arming/AP_Arming.cpp AP_Arming::ins_checks() · Open in ArduPilot Copter-4.7.1