ESP32S3 SD-card init problem

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
stefan.erni
Valued Contributor
Posts: 1224
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 228 times
Been thanked: 244 times

ESP32S3 SD-card init problem

Post by stefan.erni »

Hi Ben

I'm trying to initialize an SD card on a ESP32S3, but I keep getting a 255 return (no card) instead of 0 (card ok).
Is there something else I need to configure to make this work with the S3? With the ESP32 wroom32 This worked very well.
2026-04-23_16-01-33.PNG
2026-04-23_16-01-33.PNG (28.17 KiB) Viewed 1389 times
2026-04-23_16-09-08.PNG
2026-04-23_16-09-08.PNG (117.21 KiB) Viewed 1389 times

BenR
Matrix Staff
Posts: 2208
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 606 times
Been thanked: 803 times

Re: ESP32S3 SD-card init problem

Post by BenR »

Hi Stefan,

What type of card are you using? Not every card supports the 4-bit mode, maybe try the 1-bit mode and see if that works.

We are using the 4-bit mode on an ESP32S3 in house and it is working very well but we have to be careful about which cards we use.

All SDHC or SDXC cards are suppost to support 4-bit mode but this is not my experience.

stefan.erni
Valued Contributor
Posts: 1224
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 228 times
Been thanked: 244 times

Re: ESP32S3 SD-card init problem

Post by stefan.erni »

Hi Ben

Glad to hear it's working for you.
I always use the same type of SD card—a 32GB SanDisk—for the 4-bit version.
It worked fine with the PIC32 and ESP32 WROOM.
I tried a different board—this time from SparkFun—and the card initialization caused problems there as well.
I checked the pins and they should be okay.

I think it's just a startup issue in my program?
Attachments
2026-04-23_17-28-22.PNG
2026-04-23_17-28-22.PNG (77.5 KiB) Viewed 1371 times

BenR
Matrix Staff
Posts: 2208
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 606 times
Been thanked: 803 times

Re: ESP32S3 SD-card init problem

Post by BenR »

The esp may have a different return value for the init. I may simply be ignoring it. Might be worth seeing if the other functions work ok and ill have a gander at the code to check the return values.

stefan.erni
Valued Contributor
Posts: 1224
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 228 times
Been thanked: 244 times

Re: ESP32S3 SD-card init problem

Post by stefan.erni »

Hi Ben

I tried to ignore the return value and create a file, but it didn't work.

stefan.erni
Valued Contributor
Posts: 1224
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 228 times
Been thanked: 244 times

Re: ESP32S3 SD-card init problem

Post by stefan.erni »

Hi Ben

It looks like the ESP32S3 has a lot of advantages.

For example, data sampling works directly in the interrupt macro,
and resetting the watchdog timer no longer requires a wait time of a few milliseconds.

Unfortunately, the SD card isn't working yet.

Post Reply