Adafruit 512MB SPI SD Flash - can't fill more than 358MB

I’m using the Adafruit SPI Flash SD Card with an ESP32. I am running SimpleFTPServer library / sketch to load files onto the device and FileZilla to connect to the ESP32 fileserver to upload wav files.

Uploads are failing once the flash gets a lot of data on it, on my current attempt it has got to 358,543,782 bytes and 27 files and now it won’t accept any more file writes.

I want to format the flash card but am having trouble finding anything suitable for ESP32.

How can the flash card be formatted?

I have two of these cards and they both exhibit similar problem.

If you haven’t already, I’d also post this issue on the Adafruit Forum. ;)

yep, have done with a chaser but it’s been 10 days and no response.

1 Like

Have you tried this: A better way to format SD cards - Storage - Arduino Forum

1 Like

I see that links back to SDFat which is a library I tried a little while ago but got errors doing the format. I’ll go back and run it again to get the error messages and post here.

I am really interested in your results, since I have a design with this chip (the 1Gbit version, not the 4Gbit version that Adafruit uses). The PCB is already produced but I am still waiting for my sample. I never thought about formatting, and I hope that it turns out that it is not necessary or at least somehow doable.

@bablokb Your link let me to the SDFat library, which includes an example called SDFormatter. This has successfully formatted the SPI flash and it now shows zero bytes used correctly. Thanks!

I can now fill the full 512MB. If a file FTP upload fails half way through whatever size has been uploaded for that file before failure is then ‘lost’ to the file system as the file is no longer seen. This is what was causing the problem.

1 Like

There isn’t a need to format when you receive the card, it’s already formatted.

Good to hear about your solution. Thanks for reporting back.

In my use-case, I will be only writing small amounts of data, so I probably won’t have your specific problem. But there is always the chance that something corrupts the file-system and to know how to fix it is always good.