-
Notifications
You must be signed in to change notification settings - Fork 7.6k
SD library #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As a matter of fact I am currently looking into the SD library :) More so on the actual SD/MMC bus that is on the ESP32 and that will maybe drive the SD library. Also I have running a slight modification to the mbed SD and FAT FS code. To be honest I think that we should replace the whole SD lib with something better and more suitable for the faster and more capable ESP32 chip that this AVR 8 bit compatible lib :) |
the SD library could be re-written but it does the heavy lifting of decoding a FAT16/32 file system which is the most annoying part of an SD library. the reason the performance is sluggish is probably due to SPI.transfer() taking 30us even if the clock speed is 32mhz. e.g. if you call SPI.transfer() twice in a row it puts a huge delay essnetially turning the SPI from 32MHz to 260KHz clk! on most chipsets the transfer itself quite fast, but each transfer on the ESP32 requires a mutex that's probably where the massive delay is coming from. so probably the best bet is just to rewrite the low level parts of SD to not call SPI.transfer multiple times, and use the buffered version - with SD you could probably blit all 512 bytes of a block in the same time of 4 non-buffered reads! probably can spare 2 block buffers on the ESP32 anyhow i can take a look at that and just give you one PR if you want |
I would like to give mbed's fat and sd libs a go first as they are separate things (FATFS is one thing, SD control another thing) which makes FATFS implementable on any storage and not just SD. I guess that hard lifting you are talking about. I will optimize the SPI for it as much as it can be done, but SPI will not be the only way to access SD cards. As mentioned there is SD/MMC hardware bus on the ESP32, which reads the card in 4 bit mode (just like the SPI flash we use for the sketch) and at the end you will be able to use either interface, or even two cards at the same time. |
To add to that, I turned mbed's fatfs to C library which looks muck like the SPIFFS C api and we will need to implement both in esp-idf as well. Arduino will actually attach to IDF and expose the libs through there. |
sounds fine by me! i'll continue using SD for now |
@me-no-dev Just because I am also right now working on a SD-related project: |
as a matter of fact sdmmc driver and fatfs are waiting for merge :) so expect a fast and reliable native SD/MMC support quite soon. |
Thanks for the quick reply! You are talking about IDF here right? So does this mean only "MMC" mode acces is possible or will there also be the possibility for SPI access? Is there a time frame for the merge? |
Actually MMC will not initially be supported. At first we will only support SD cards in ESP-IDF (via SD protocol, not SPI). Support for SPI mode will also be added, but maybe in the next release. Then we can also support MMC/eMMC cards via MMC protocol, if there is request for that. Arduino libraries may be based upon ESP-IDF, if desired. It's mostly up to @me-no-dev. |
Arduino libs for SD/SPIFFS and similar will surely be based on IDF libs. Hardware drivers are usually the only exclusion, because Arduino has different approach towards some of them. |
Hi, i just downloaded the libraries/SD folder (adafruit@15bace7) to my Arduino libraries. But it didn't compile. What do i have to do? Greetings
|
So, I'd like to add sdcard support to an ESP32 project, using the arduino libs. |
please hold on! I'm waiting on some changes to be merged upstream (esp-idf) to release the new file system libs (including SD and SD_MMC). Everything is ready so will be up soon. |
Hi @me-no-dev , is this still blocked with the PR you're trying to get merged in? |
Yes. I was told it will be merged after idf2.0 release |
Sorry for not knowing the timeline, is that on the order of days, weeks,
months ? Thanks
…On Feb 18, 2017 06:54, "Me No Dev" ***@***.***> wrote:
Yes. I was told it will be merged after idf2.0 release
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#43 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABTlRBLh-lIeWxIVKUtb1xT4Ow-3U4e9ks5rdwYvgaJpZM4KwVy7>
.
|
days, weeks |
Thank you! |
:) |
Has this been completed and merged ? |
yes. long time ago |
@me-no-dev does that mean that we also have spiffs support now (or something that looks like spiffs)? |
@andig SPIFFS is about to be merged. There is SD and SD_MMC to work with cards. All 3 are based on VFS so API is the same. |
Thank You |
dear all i'm struggling to get the sd card working on a lolin32 pro. it looks like the pins are wired differently. where can i change the pins in the library or in the code itself? thanks a lot! |
* Allow user to customize installation * Add documentation about INSTALL_PLATFORMS
did some minor tweaks to ESP8266 lib and got it workin'
adafruit@15bace7
its not terribly fast but does work. lemme know if you want a pull req
The text was updated successfully, but these errors were encountered: