Skip to content

SD card doesn't mount after extraction #5609

@SlimRG

Description

@SlimRG

What you are trying to do?
I use M5Core2 wich has your library inside.
I use that code to check SD card:

bool __hasSD = false; // In setup
void check_SD() {
  bool tmp_status = __hasSD;

  // Проверка инициализации карты
  if (!__hasSD)
    __hasSD = SD.begin();

  // Проверка типа карты
  Serial.print(SD.cardType());
  Serial.print("|");
  Serial.print(CARD_NONE);
  Serial.print("\n");
  //__hasSD = SD.cardType() != CARD_NONE;

  // Проверка наличия файла
  if (__hasSD)  
    __hasSD = SD.exists("/Data/checker.txt");

  // Проверка файла
  if (__hasSD) {
    File entry = SD.open("/Data/checker.txt", FILE_READ);
    __hasSD = entry.size() != 0;
    entry.close();
  }

This code works for all exept one situation.
So, this situation:

  1. I start M5Core2 without SD card
    *) check_SD works fine
  2. I insert SD card
    *) check_SD works fine
  3. I extract SD card
    *) check_SD works fine
  4. I insert SD card
    *) check_SD says that no SD in M5Core2

Logs on 4th step:

[W][sd_diskio.cpp:137] sdCommand(): no token received
[W][sd_diskio.cpp:137] sdCommand(): no token received
[W][sd_diskio.cpp:137] sdCommand(): no token received
[W][sd_diskio.cpp:137] sdCommand(): no token received
[W][sd_diskio.cpp:137] sdCommand(): no token received
[W][sd_diskio.cpp:137] sdCommand(): no token received

Hardware:

Board: M5Stack M5Core2
Core Installation version: M5Core2 0.0.6 (esp-idf 1.0.6)
IDE name: Arduino IDE 1.8
Flash Frequency: 240Mhz
PSRAM enabled: yes
Upload Speed: 115200
Computer OS: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions