Skip to content

Examples have no Serial output on Arduino Nano ESP32 #24

@VeloSteve

Description

@VeloSteve

Operating System

Windows 11

IDE version

2.2.1

Board

Arduino Nano ESP32

BSP version

2.0.13

SPIFlash Library version

Automatically included?

Sketch

The included example SdInfo. I got the same results from BufferedPrint.

What happened ?

When running the example there is no Serial output at all. This on a Nano ESP32 which has been writing Serial output every day, still connected the same way.

The problem does not appear to be SD related.

How to reproduce ?

  1. Go to File -> Examples -> SdFat - Adafruit Fork -> SdInfo
  2. Click the arrow to install and upload.
  3. Check the Serial Monitor
  4. Nothing there

This does not seem to be SD related. I added a single Serial.println before any SD-related coded and it still does nothing:

void setup() {
  Serial.begin(9600);
  // Wait for USB Serial
  while (!Serial) {
    yield();
  }
  Serial.println("Anything?");  // NEW LINE
  cout << F("SdFat version: ") << SD_FAT_VERSION_STR << endl;
  printConfig(SD_CONFIG);

}

A workaround is simple enough. Change setup() to this and the example works perfectly:

void setup() {
  Serial.begin(9600);
  // Wait for USB Serial
  delay(5000);  // Fixed delay instead of a while()
  cout << F("SdFat version: ") << SD_FAT_VERSION_STR << endl;
  printConfig(SD_CONFIG);
}

This may not be the best code to put into the repository, but it works!

Debug Log

No response

Screenshots

No response

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