SD size() returns random value until file has non-zero bytes of content #8625
Labels
Area: Libraries
Issue is related to Library support.
Status: Needs investigation
We need to do some research before taking next steps on this issue
Board
ESP32-S3 Dev Module
Device Description
I use my Reflections board, it is an open-source Arduino compatible ESP32-S3 board built from the ESP32-S3 Dev Module. Details at https://github.com/frankcohen/ReflectionsOS
Hardware Configuration
// SPI Bus
#define SPI_MOSI 35
#define SPI_MISO 37
#define SPI_SCK 36
// NAND Storage
#define NAND_SPI_CS 15
Version
latest master (checkout manually)
IDE Name
Arduino IDE 2.1.0 nightly
Operating System
MacOS 13.5.1
Flash frequency
80 Mhz
PSRAM enabled
yes
Upload speed
921600
Description
I'm using an external SD/NAND with an ESP32-S3 to create and save log values to a file. NAND is a surface mount version of an SD card. I connect the NAND over SPI using pin 15 for the CS. This is part of my Reflections open-source project https://github.com/frankcohen/ReflectionsOS.
I see random size values in the Serial monitor. For example mylog.size = 1070537564. When I write the the file first, then the size values return correctly.
size returns 14, which is correct.
-Frank
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: