Maximum Log files on SD card

I´m not able to find info about maximum data flash files on a SD card.

On one of our copters with 548 flights we could no read the SD card via mission planner (only the extracted SD card) and I noticed that it seems to be a circular structure with maximum of 500 files. When reaching 501 logs, the first one is overwritten, and so on. On the “LASTLOG.TXT” is written the last valid log file (in our case 48). Is this assumption correct? If so, why can´t I read the logs via Mission Planner when I reach more than 500 logs (I get a timeout and error messages)?

I had other cases with more than 500 logs on the SD card and the behaviour is exactly the same as written in my previous post: it is impossible to extract the Logs via MAVFtp or DataFlash Logs in Mission Planner. Only extracting phisically the SD card and reading the logs (Arducopter 4.0.7). The SD card only holds 500 logs. After 500 logs are reached, the next log will ovewrite Log# 00000001.BIN - and so on. I think this is OK to be circular, but as long as it is possible to extract logs via MAVFtp or DataFlash Logs in Mission Planner.

Trying to extract Logs via DataFlash Logs when having more than 500 Logs on SD card I get the following error message:

Trying to extract Logs via MAVFtp when having more than 500 Logs on SD card (shows the log directory empty but it has 500 .BIN files on the SD):

Link for an SD card image with more than 500 logs (Cube Orange):

The moment where the most recent LOG has overwritten a older LOG (this SD card has 555 .BIN logs):

After erasing the Logs on the SD card, everything works great until reaching agian 500 logs. This is clearly a BUG since the downlod via MAVFtp or DataFlash Logs in Mission Planner stops working as soon as 500 “phisical” log files are present on the SD card.


Any suggestions?

I can confirm that the hard limit for number of log files is 500
#define MAX_LOG_FILES 500

to confirm the error in Mission Planner, could you check if you can download logs with MavProxy ?

Hi Andreas,

I will test tomorrow and send feedback.

@Eosbandi I made some tests this morning. With Arducopter 4.0.7 using MavProxy only the first 55 logs are downloded (the last 55 that were overwritten) and an error message “unable to fetch Log File Size: ENOENT”. All other logs don´t exst.

But the good thing is, I have updated the firmware to 4.1.2 and all 500 logs are correctly downloaded via MAVFtp, DataFlash Logs and MavProxy. They worked fine with an older version of Mission Planner and the last 1.3.76. I it most probably was an firmware issue.

Below the correct log downloader:

Cool, so this one is sorted :slight_smile:

Thanks for the help!