Page 2 of 2
Re: ESP32 4Bit SD-Mode Init problem
Posted: Thu Feb 27, 2025 4:33 pm
by medelec35
Hi Stefan.
Apologies for the delay.
I will make this a priority to sort the issue out for you.
Re: ESP32 4Bit SD-Mode Init problem
Posted: Tue Mar 04, 2025 9:43 am
by medelec35
Hi Stefan.
I have thoroughly looked into this.
Unfortunately, the write functions are not supported, which is the reason they don't work correctly.
Many thanks for bringing this to our attention.
What I'm going to do is check all the functions, and if not supported I will add a tooltip with states its not supported.
Re: ESP32 4Bit SD-Mode Init problem
Posted: Tue Mar 04, 2025 1:05 pm
by stefan.erni
Hi Martin
Thanks Martin
if the Sd-card works fast enough, I can do without some modes.
I guess these 3 points would already help me, to store data fast enough.
1. change to the next sector much faster
2. SPI clock should work and set to 50Mhz as an option
3. 4Bit mode working (there is no difference to 1Bit detectable)
Re: ESP32 4Bit SD-Mode Init problem
Posted: Wed Mar 12, 2025 3:42 pm
by stefan.erni
Hi Martin
1. change to the next sector much faster
It would already help if this time was reduced by half. It's just a change to the next sector
reduce the "orange" time:

- 2025-03-12_16-36-12.PNG (150.42 KiB) Viewed 3195 times
Re: ESP32 4Bit SD-Mode Init problem
Posted: Thu Mar 13, 2025 5:14 pm
by stefan.erni
Hi Martin
I made a second version of my programme. I have used the normal SD card component and am testing it now with this
I have replaced all commands.
i guess it is slow but i can maybe write sectoren with 512byte like by the PIC32
The pins are like this:

- 2025-03-13_17-16-30.PNG (221.03 KiB) Viewed 3094 times
config the Sd component:

- 2025-03-13_18-03-47.PNG (35.76 KiB) Viewed 3094 times
add 2 pins and set to high

- 2025-03-13_18-04-53.PNG (5.89 KiB) Viewed 3094 times
Re: ESP32 4Bit SD-Mode Init problem
Posted: Tue Mar 18, 2025 10:17 am
by stefan.erni
Hi Martin
I can write sectors with the old SD component, is this also possible with the 4bit SD component?
And can the 4Bit Sd component also work on an STM32?
Re: ESP32 4Bit SD-Mode Init problem
Posted: Tue May 06, 2025 3:36 pm
by stefan.erni
Hi Martin
any news on the points yet?
1. change to the next sector much faster
2. SPI clock should work and set to 50Mhz as an option
3. 4Bit mode working (there is no difference to 1Bit detectable)
Re: ESP32 4Bit SD-Mode Init problem
Posted: Thu May 15, 2025 3:29 pm
by stefan.erni
Hi Martin
I looked at the writing on the disk again and noticed something even worse.
I always write the same amount of bytes to the disk. Once it takes 54uSec then after 2-3 times it takes 1.12mSec and then also once 3.25mSec.
So 60 times longer. This always happens at regular intervals.
These 3.25mSec rarely but regularly.
It prevents me from being able to sample and save easily with 480Hz (2.08mSec)
Osciloscope I measured the other values separately in order to have the exact duration.

- 2025-05-15_16-03-25.PNG (156.94 KiB) Viewed 519 times
Re: ESP32 4Bit SD-Mode Init problem
Posted: Fri May 16, 2025 9:40 am
by BenR
Hi Stefan,
I'd probably need to see your program to be able to comment.
One thing could be the ESP IDF adding delays. Are you writing byte by byte? It might be better if you can put in an array in one go as the SD mode likely uses DMA to write to the card in a burst and writing byte by byte probably doesn't allow the DMA to run efficiently.
Re: ESP32 4Bit SD-Mode Init problem
Posted: Fri May 16, 2025 10:35 am
by stefan.erni
Hi Ben
I will prepare a program to post.
I always append a string with length 147Byte and that works perfectly.
Hour-long recordings succeed.
Writing (append) a string 147Byte without changing sector or cluster takes only 54uSec (2.7Mbyte per Second?)
Writing with changing sector or cluster takes 3.25mSec (45Kbyte per Second?)
Do you remember a few years ago my PIC32 with SD-Card?
I had some problems with the SD-Card speed and you reduced the time to change sector and cluster.
My goal is to sample at 480hz and save to csv. I am making another device that samples at 8Khz and generates wave files
Actual result of recording with 120Samplerate on ESP32 are perfect!

- 2025-05-16_11-11-07.PNG (67.46 KiB) Viewed 321 times