← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

The main loop stood still for half a second

Act nowBoard, internal errors, CAN, scripting

What ArduPilot says:

The main loop reads the sensors and drives the motors hundreds of times a second. A separate monitor looks every 100 ms whether it is still running. After 200 ms without it, the monitor starts writing what the loop was doing into the log (MON messages); after 500 ms, unless ArduPilot expected the delay (erasing flash, a calibration), it records main_loop_stuck. The l: number is then the source line where the main loop was waiting for a lock. If the loop stays stuck, the watchdog restarts the board.

What to do, most likely first

  1. Lua scripts run at a raised priority and keep the processor from the main loop.

    CheckSCR_THD_PRIORITY is not 0. Stop the scripts and see whether the error still comes.

    FixSet SCR_THD_PRIORITY back to 0 (Normal) and reboot.

  2. Two parts of the firmware wait for each other (a deadlock): a bug, more likely in a beta or custom build.

    Check“CRITICAL Deadlock …” may appear with it. Note the l: number and what you were doing: a parameter download, a log download, a calibration.

    FixUse the stable release and report the line, the log and the steps to the ArduPilot developers.

  3. A sensor or storage device answers so slowly that the loop waits on it.

    Checkspi_fail or i2c_isr is in the same mask, or the error stops when a device is unplugged.

    FixReplace that device or its cable.

Half a second without control is enough to lose a copter. Do not fly until you can run a whole battery on the bench, props off, without it.

Parameters to look at

ParameterWhat it is
SCR_THD_PRIORITYScripting thread priority
BRD_OPTIONSBoard options

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