Skip to content

Longer logging ends in error of FAT32 filesystem, Corrupted SD card #18672

@roman-dvorak

Description

@roman-dvorak

Hi, we repeatedly have a problem with logging to the SD card. It happened to us several times that the card was corrupted during the inflight logging. The SD card or filesystem during read by computer seems to be flagged as read-only. And the log file was not complete.

For the first time, it happened to us on 7. 10. 2021 with takeoff mode (#18582), which was based on a few days old PX4 master version. At that time, I thought it was due to a large number of debug text logs (PX4_INFO("...")). In the meantime, we tried to use a new (32GB SD card)[], format the card (completely erased) to FAT32. And the problem was repeated several times. Therefore we didn't have a log that we really needed.. It does not matter that we create a smaller 4GB FAT32 volume on SDcard. The situation was almost the same, corrupted filesystem with missing logs and sometimes other files which were previously on SDcard.

Next time, I limited number of PX4_INFO messages to the minimum number of these logs. And the SD card was corrupted again. With such FW. But it was the Firmware with my modifications.

The first used card was:
obrazek

After a debate in (#18419), we decided to test this “airspeed mode” PR with our second autogyro (FMU v5, CUAV NANO) and this was almost unmodified FW (f814a52). But during the flight, the SDcard filesystem corruption happened again. This piece of autogyro (the same autopilot, the same SDcard, ..) was previously used in the same configuration with several months old master FW. Without any signs of this problem.

This always happened after a few seconds of flight. I don’t see any clear cause for this behaviour in the same fragments of the logs, retrieved from SDcard after fsck recovery, containing the takeoff

obrazek
obrazek

I tried to repeat this on the ground. But I was unsuccessful. Logging worked for a very long time.

From these experiments, I conclude that this is a problem in Firmware (I don’t know at what level).

During the first attempts (when this issue occurred) I used the internal reader of my laptop. During the next experiments, I used an external uSD card reader from Kingstone. But the result was the same.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions