I am doing a project, and I need an SD card. Everything worked well, but after a while when I read the SD card from my PC(Windows 10 64 bit, Intel Core), I found a file called eecfbba=.@aa. It's so big that it almost ate up one GB storage of my SD card. But when I tried to open it with notepad, notepad tells me that there is actually no such file, and asks me if I want to create it. I tried to delete it, but file explorer also told me there is no such file. What is it?

This is my code:

#include <ArduinoJson.h>

// Version
// 2020/01/19, 16:10, button record test, 7th version.

#include <SD.h>
#include <SPI.h>
#include <TMRpcm.h>
#include <Wire.h>
#include "RTClib.h"
//#include <string.h>

RTC_DS1307 rtc;
String strdoc;
char daysOfTheWeek[7][2] = {"su", "mo", "tu", "we", "th", "fr", "sa"};
#define SD_ChipSelectPin 10  // 如果使用 arduino nano 328 可使用Pin4

TMRpcm audio;
void setup() {
  audio.speakerPin = 8;
  pinMode(25, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  if (! rtc.isrunning()) {
    Serial.println("RTC is NOT running!");
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    Serial.println("rtc started");

  if (!SD.begin(SD_ChipSelectPin)) {
    Serial.println("SD Fail");
  } else {
    Serial.println("SD OK");

  audio.CSPin = SD_ChipSelectPin;

  StaticJsonDocument<200> doc;
  doc["sensor"] = "gps";
  doc["time"] = 1351824120;
  JsonArray data = doc.createNestedArray("data");
  serializeJson(doc, strdoc);
bool isrecording = false;
bool recordButtonPressed()
  return (digitalRead(25) == LOW);
bool playButtonPressed()
  return (digitalRead(7) == LOW);
void loop() {
  // Below is the formatted datetime.
  DateTime now = rtc.now();
  // Below is the serialized datetime.
  String filename = (String)(now.unixtime() % 10000000) + ".j";
  //  Serial.println(filename);
  if (recordButtonPressed())
    if (!isrecording)
      isrecording = true;
      audio.startRecording("test.wav", 16000, A0);
      isrecording = false;
  if (playButtonPressed())
  String dataString = strdoc;
  if (!isrecording)
    File dataFile = SD.open(filename, FILE_WRITE);

    if (!dataFile) {
      Serial.println(F("Failed to create file"));
      Serial.println("Wrote string.");
      Serial.println("Closed file.");
  /* Please ignore this line */
  //  //    audio.play("test.wav"); break;audio.volume(1); break;audio.volume(0); break;audio.stopPlayback(); break;

P.S. I'm using Mega 2560, so MISO, MOSI, SCK and CS pins are different.(Which is 50,51,52,10).

Edit 2020/1/25, 14:15(Beijing Time) At 1/20 I have bigger problems. There are more and more big files. All of them are the same situation. For details, take a look at this photo(ignore selected files): Imgur or 咱们中国人上不去imgur,用这个:File-up(直接下载)

  • @ jsotola thank you for your quick reply. But now I have bigger problems: there are tons of other files! Screenshot of my SD card (P.S. Ignore the selected ones, they're what I want. Focus on the others) Jan 20, 2020 at 7:41
  • I want to know whet are they and do I need to do anything? Jan 20, 2020 at 7:45
  • don't use String class
    – Juraj
    Jan 20, 2020 at 12:31
  • @Juraj thank you I will try that out. But can you please tell me the real reason , why String class would produce such files? Jan 25, 2020 at 6:41
  • majenko.co.uk/blog/evils-arduino-strings
    – Juraj
    Jan 25, 2020 at 6:47

1 Answer 1


Thanks to @Juraj, I fixed the problem. Deleted those files by manually formatting the SD card.

This is not really the answer, you can see the answer in this comment under the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.