The flight log cannot be written
What ArduPilot says:
- PreArm: No SD card
- PreArm: Logging failed
Logging is on (LOG_BACKEND_TYPE) and the logger says it cannot write. With an SD card: opening a log file failed within the last 5 seconds, the last write failed, or the logging thread has stopped. With a flash chip: it was not found or is full. ArduPilot will not fly without the log you would need after a crash. A missing card normally shows as “Logging failed”, because that test comes first; “No SD card” means the same.
What to do, most likely first
There is no SD card, or it is not pushed in all the way.
FixInsert a card and reboot.
The card cannot be read or written: wrong format, worn out, or a fake.
CheckPut it in a computer: there should be an APM folder with a LOGS folder in it, and the newest files should open.
FixFormat it as FAT32 on a computer, or replace it with a good brand-name card of 32 GB or less. If a good card fails only on this board, try
BRD_SD_SLOWDOWN1 or 2.LOG_BACKEND_TYPEasks for logging over MAVLink, and no ground station is taking the log.FixSet
LOG_BACKEND_TYPEto your board's default: 1 for an SD card, 4 for a flash chip.The board logs to a flash chip, and it is full.
FixDownload the logs you want to keep, then erase them all from the ground station's log screen.
With LOG_DISARMED 0 (the default) nothing is written before arming, so a missing card is often noticed only at that moment, as “Arm: Logging not started”.
Parameters to look at
| Parameter | What it is |
|---|---|
LOG_BACKEND_TYPE | AP_Logger Backend Storage type |
LOG_DISARMED | Enable logging while disarmed |
LOG_FILE_MB_FREE | Old logs on the SD card will be deleted to maintain this amount of free space |
BRD_SD_SLOWDOWN | microSD slowdown |
Where to do it:Setup & Tuning Guide
The code that sends it
PreArm: No SD card
libraries/AP_Arming/AP_Arming.cpp AP_Arming::logging_checks() · Open in ArduPilot Copter-4.7.1
PreArm: Logging failed
libraries/AP_Arming/AP_Arming.cpp AP_Arming::logging_checks() · Open in ArduPilot Copter-4.7.1