Comments (14)
it work only one time over ten trial......don't ask me why.
You don't know or you won't tell us?
If you do the same change in the arduino library, example should work:
https://github.com/espressif/arduino-esp32/blob/master/libraries/SD_MMC/src/SD_MMC.cpp
host.max_freq_khz = SDMMC_FREQ_HIGHSPEED;
//host.flags = SDMMC_HOST_FLAG_1BIT; //use 1-line SD mode
to
host.max_freq_khz = SDMMC_FREQ_PROBING;
host.flags = SDMMC_HOST_FLAG_1BIT; //use 1-line SD mode
from esp32-evb.
SS should be connected if you're using SD card in SPI mode, which is unnecessary. SD protocol needs only 3 pins: CMD, DATA0 and CLK.
You can check Physical Layer Simplified Specification here:
https://www.sdcard.org/downloads/pls/index.html
We will upload SD-card example later today.
from esp32-evb.
You can see working example here:
https://github.com/OLIMEX/ESP32-EVB/tree/master/SOFTWARE/sd_card
Here is the example output:
I (967) example: Initializing SD card
Name: SL08G
Type: SDHC/SDXC
Speed: default speed
Size: 7580MB
CSD: ver=1, sector_size=512, capacity=15523840 read_bl_len=9
SCR: sd_spec=2, bus_width=5
I (1137) example: Opening file
I (1247) example: File written
I (1317) example: Renaming file
I (1347) example: Reading file
I (1357) example: Read from file: 'Hello SL08G!'
I (1357) example: Card unmounted
from esp32-evb.
I have tested your example : it work only one time over ten trial......don't ask me why.
Arduino-core SdMMc example never work and it should!( It call same idf functions)
May be you closed the issue too soon!
If you don't have any other suggestions I will continue the discussion on arduino-esp32 site.
from esp32-evb.
Yes thanks
It is what I did , in my case it didn't work! May be you have to try this yourself.
Major problem anyhow is reliability : your code it doesn't work all the time.
I doubt may be due to the default pin left unconnected and may be used by other applications.
from esp32-evb.
Here is my output.
rst:0x10 (RTCWDT_RTC_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0008,len:8
load:0x3fff0010,len:160
load:0x40078000,len:10632
load:0x40080000,len:252
entry 0x40080034
SD_MMC Card Type: SDHC
SD_MMC Card Size: 7580MB
Listing directory: /
FILE: /test.txt SIZE: 0
FILE: /foo.txt SIZE: 13
Creating Dir: /mydir
Dir created
Listing directory: /
FILE: /test.txt SIZE: 0
FILE: /foo.txt SIZE: 13
DIR : /mydir
Removing Dir: /mydir
Dir removed
Listing directory: /
FILE: /test.txt SIZE: 0
FILE: /foo.txt SIZE: 13
Writing file: /hello.txt
File written
Appending to file: /hello.txt
Message appended
Reading file: /hello.txt
Read from file: Hello World!
Deleting file: /foo.txt
File deleted
Renaming file /hello.txt to /foo.txt
File renamed
Reading file: /foo.txt
Read from file: Hello World!
0 bytes read for 0 ms
1048576 bytes written for 25351 ms
Maybe there is something wrong with the SD-card?
from esp32-evb.
The main problem is in HW.
I guess is probably a contact from card holder and SD. Moving the SD card goes and fail.
I tried also with core SdMMc library with similar results : could be the holder of the SD but I tried with several SD.
I had also a problem of SD non written by the SW (with no error) probably because it was a Fat32 SD.
from esp32-evb.
Could you try several tests, while you press the SD card towards the board?
from esp32-evb.
Done several test, unfortunately I have only 2 SD formatted FAT16 :
for booth moving SD sideways (perpendicular to insertion movement) create bad or good contact.
This may be due to an holder too large or due to two narrow SD.
from esp32-evb.
Sorry,
:)
I have the problem of I can use SPI with SD_MMC,
I understand that the pinout is:
MISO 02
MOSI 15
CLK 14
CHIP SELECT CS0 14
But that also need a SPI with four wires.
Can you help me?
Thanks!
from esp32-evb.
Sorry,
:)
I have the problem of I can't use SPI with SD_MMC,
I understand that the pinout is:
MISO 02
MOSI 15
CLK 14
CHIP SELECT CS0 14
But that also need a SPI with four wires.
Can you help me?
Thanks!
from esp32-evb.
Hi, did anyone had it working with the Arduino IDE?
from esp32-evb.
SD_CARD working in Arduino IDE when changing library from SD to MMC.
(This fixes the 4-bit vs 1-bit problem)
Likewise, any references to SD needs to be changed to MMC. Working example:
#include "SD_MMC.h"
#include "SPI.h"
void initSDCard(){
if(!SD_MMC.begin("/sdcard",true)) {
Serial.println("Card Mount Failed");
return;
}
uint8_t cardType = SD_MMC.cardType();
if(cardType == CARD_NONE){
Serial.println("No SD card attached");
return;
}
Serial.print("SD Card Type: ");
if(cardType == CARD_MMC){
Serial.println("MMC");
} else if(cardType == CARD_SD){
Serial.println("SDSC");
} else if(cardType == CARD_SDHC){
Serial.println("SDHC");
} else {
Serial.println("UNKNOWN");
}
uint64_t cardSize = SD_MMC.cardSize() / (1024 * 1024);
Serial.printf("SD Card Size: %lluMB\n", cardSize);
}
void setup() {
delay(1000);
Serial.begin(115200);
initSDCard();
}
void loop() {
}
from esp32-evb.
@teson2000, thanks kindly - I have been trying to get this to work for hours. The SD_MMC example works for me.
from esp32-evb.
Related Issues (20)
- Schematics blank in Altium HOT 1
- Modbus transceiver generates CRC Check errors HOT 1
- ESP32-EVB vs ESP32-EVB-IND HOT 4
- Ethernet disconnects when relay is switching 240V HOT 43
- ESP32-WROOVER kit code don't work on ESP32-EVB HOT 1
- pdf for REV K HOT 1
- ESP32-EVB_Ethernet_v4.4 compilation error HOT 2
- Wifi to lan adapter. HOT 1
- 12VDC 5A power input... HOT 1
- J1939 canbus Supported HOT 3
- Ethernet problem HOT 3
- GPIO pins used by board hardware HOT 2
- Step CAD file of whole board ESP32-EWB HOT 1
- Reset / Power on is entering DownloadBoot mode HOT 2
- Lipo Battery with CAN and Ethernet HOT 3
- Is CAN library interrupt based HOT 1
- SD and MOD 2.8 TFT LCD HOT 1
- Power supply through barrel connector 5V/2A results in instable webserver HOT 1
- USB driver for MacOs Sonoma M2 HOT 2
- Question about the SD card's CS connection HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp32-evb.