Skip to content
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

Failed to init card on esp32s3 #38

Open
marcfir opened this issue Aug 27, 2024 · 10 comments
Open

Failed to init card on esp32s3 #38

marcfir opened this issue Aug 27, 2024 · 10 comments

Comments

@marcfir
Copy link

marcfir commented Aug 27, 2024

I am trying to read a SD card with an esp32s3. But updating the example of the esp32c6 to esp32s3 just gives me

 Failed to init card, retrying...

Any ideas?

@MabezDev
Copy link
Owner

It's more than likely #29, could you try out #30?

@CBJamo
Copy link
Contributor

CBJamo commented Aug 28, 2024

Out of curiosity, what's the model number of the sd card you're using?

@marcfir
Copy link
Author

marcfir commented Aug 29, 2024

I haven't had time to test #30 yet, but the SD card is a SanDisk Ultra microSD 64GB A1 class 10.
I formatted the card on Windows with a FAT32 partition.

@CBJamo
Copy link
Contributor

CBJamo commented Sep 8, 2024

FYI, I ordered that sdcard and a random esp32s3 board with an sd card socket to reproduce this.

@CBJamo
Copy link
Contributor

CBJamo commented Sep 11, 2024

@marcfir Can you provide a minimal failing example? That card works on the 2040 and 2350 boards I have. I got a esp32s3 board in, but a jumpstart on the code would be appreciated.

@marcfir
Copy link
Author

marcfir commented Sep 12, 2024

Hi, sorry for coming back so late.
Wow, thanks for working on this.
I have published my minimal example here. This already includes #30 from yesterday, but with no effect. Running the example just gives me

INFO - Hello world!
INFO - Failed to init card, retrying...
INFO - Failed to init card, retrying...
INFO - Failed to init card, retrying...
INFO - Failed to init card, retrying...
INFO - Failed to init card, retrying...
INFO - Failed to init card, retrying...
INFO - Failed to init card, retrying...
INFO - Failed to init card, retrying...
INFO - Failed to init card, retrying...
INFO - Failed to init card, retrying...

@MabezDev
Copy link
Owner

I'll look into this shortly, as I will be trying to use this with an esp32s3 soon.

@MabezDev
Copy link
Owner

MabezDev commented Oct 8, 2024

I managed to get it working in my project, but I needed a newer esp-hal rev, I'll retry your example when we release 0.22.0 this week.

@marcfir
Copy link
Author

marcfir commented Dec 30, 2024

I updated my example to esp_hal 0.22 but it still does not work. How did you get it working in your project?

@marcfir
Copy link
Author

marcfir commented Jan 3, 2025

I played around a bit more. I got it working by using a different SD breakout board.

My micro SD breakout board hangs after TRACE - Valid card detected!. So I did some debugging and

loop {
let r = self.acmd(sd_send_op_cond(true, false, true, 0x20)).await?;
if r == R1_READY_STATE {
return Ok(());
}
returns R1_IDLE_STATE instead of R1_READY_STATE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants