The part of ArduPilot that writes the log is stuck
What ArduPilot says:
- AP_Logger: IO thread died
- AP_Logger: stuck thread (…)
Writing to a card or flash chip is slow, so ArduPilot does it in a separate thread that reports back every pass. “stuck thread” (microSD) means no report for 5 seconds; the word in brackets is what it was doing: write, fsync, close or disk_space_avail. “IO thread died” (flash chip) means none for 3 seconds, and logging stays off until reboot. The aircraft keeps flying, but the log has a hole from here on, and the pre-arm checks will say “Logging failed”.
What to do, most likely first
The microSD card hung in the middle of a write: a worn, counterfeit or very slow card.
CheckThe word in brackets is write or fsync, and the same card shows errors or stalls when it is filled and read back in a computer.
FixReplace the card before the next flight. A log that stops in the air is useless exactly when you need it.
The file system on the card is damaged (power was cut during a write).
CheckA computer offers to repair the card, or some log files have a size of zero.
FixCopy what you need and format the card. Disarm before removing power, so the log is closed.
On a flash-chip board: the chip or its connection to the processor is failing.
Check“IO thread died” returns after a reboot and a full erase of the logs.
FixDo not rely on this board's log. Use a card slot if it has one (
LOG_BACKEND_TYPE1), or replace the board.
Parameters to look at
| Parameter | What it is |
|---|---|
LOG_BACKEND_TYPE | AP_Logger Backend Storage type |
BRD_SD_SLOWDOWN | microSD slowdown |
LOG_FILE_TIMEOUT | Timeout before giving up on file writes |
Where to do it:Setup & Tuning Guide
The code that sends it
AP_Logger: IO thread died
libraries/AP_Logger/AP_Logger_Block.cpp AP_Logger_Block::periodic_1Hz() · Open in ArduPilot Copter-4.7.1
AP_Logger: stuck thread (…)
libraries/AP_Logger/AP_Logger_File.cpp AP_Logger_File::periodic_1Hz() · Open in ArduPilot Copter-4.7.1