ESP32 SD-Card can no longer be initialised

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

ESP32 SD-Card can no longer be initialised

Post by stefan.erni »

Hi Ben

I wanted to use an SD card in the current project with an ESP32.

The programme compiles without any problems
But when I started the hardware, it always stopped at the SD card initialisation.

So i compiled an older project, which worked fine, but now this also hangs at the sd card initialisation while loop.

regards

Stefan

always in the while loop....
Snag_28589d.png
Snag_28589d.png (40.73 KiB) Viewed 6272 times

BenR
Matrix Staff
Posts: 1733
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 439 times
Been thanked: 602 times

Re: ESP32 SD-Card can no longer be initialised

Post by BenR »

Hello,

We are using an SD card here with ESP without any issues, please can you check the fast SPI rate property for the SD card component. We are using 20MHz I beleive and most cards are working fine with this but I have found a couple of cards that don't work at all.

stefan.erni
Valued Contributor
Posts: 755
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: ESP32 SD-Card can no longer be initialised

Post by stefan.erni »

Hi Ben

It's good to know that it should actually work. Thank you.

The card is aways the same type and the speed I did not change.

On the hardware is a display on the same SPI bus. Maybe I cached a problem with one of this both component.

The cards was working always fine even with the display.

In the schematic the display has no MISO pin A19

I will take a closer look where the problem is

regards

Stefan

Both on SPI bus was working....
Attachments
Snag_c8831d.png
Snag_c8831d.png (41.35 KiB) Viewed 6256 times
Snag_c873eb.png
Snag_c873eb.png (40.31 KiB) Viewed 6256 times

BenR
Matrix Staff
Posts: 1733
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 439 times
Been thanked: 602 times

Re: ESP32 SD-Card can no longer be initialised

Post by BenR »

Initial prescaler needs to be 400KHz max. Hopefully this will solve things for you.

stefan.erni
Valued Contributor
Posts: 755
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: ESP32 SD-Card can no longer be initialised

Post by stefan.erni »

Hi Ben

I tried with 400kHz but it does not work.

What is a little funny is that it has already worked half a year ago.
I have not changed anything in the hardware or at the program.
I will take a closer look

regards

Stefan

stefan.erni
Valued Contributor
Posts: 755
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: ESP32 SD-Card can no longer be initialised

Post by stefan.erni »

Hi Ben

I made a second testprogram (test_no_display) and with the USB I control the ret_sdcard byte.
It's working nice.
So I added the display to this programm and still working.

But I did the same commands in the test1 and there it's not working.

no idea what the difference is.

regards

Stefan
Attachments
Test_no_display1.fcfx
(19.28 KiB) Downloaded 218 times
Test1.fcfx
(19.29 KiB) Downloaded 213 times

stefan.erni
Valued Contributor
Posts: 755
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: ESP32 SD-Card can no longer be initialised

Post by stefan.erni »

Hi Ben

The File SD/SDHC and Display GLCD (ILI9341 SPI)

are not working on the same SPI Bus anymore.
If I change the File SD/SDHC component to SPI software mode then it's working again

regards

Stefan

BenR
Matrix Staff
Posts: 1733
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 439 times
Been thanked: 602 times

Re: ESP32 SD-Card can no longer be initialised

Post by BenR »

Hi Stefan,

It might be interesting to see how the C code differs between the two projects. Looking at the source there is nothing jumping out at me other then the order of components in the project file.

I'll try generating the C here and see if that's got any clues.

stefan.erni
Valued Contributor
Posts: 755
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 171 times

Re: ESP32 SD-Card can no longer be initialised

Post by stefan.erni »

Hi Ben

I guess there is still a problem with the Ili9341 SPI display, the File SD and ESP32.
When I load the File SD2 component I cannot select a pin like before File SD1. Also something is wrong with the display, in one program it's working but it does not work in another. Although same configuration and hardware.

regards

Stefan

Snag_9c9870.png
Snag_9c9870.png (34.94 KiB) Viewed 6097 times
Snag_9c874a.png
Snag_9c874a.png (41.53 KiB) Viewed 6097 times

BenR
Matrix Staff
Posts: 1733
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 439 times
Been thanked: 602 times

Re: ESP32 SD-Card can no longer be initialised

Post by BenR »

Hello,

Thanks for letting us know, hopefully all solved for you now.


You might want to switch the properties back to the titles rather then the variables unless your specifically using the variables.

To do this right click on the Properties text and select Show titles.

ShowTitles.jpg
ShowTitles.jpg (27.76 KiB) Viewed 6091 times

Post Reply