Skip to main content
Senior
Feb 16, 2024 11:48 AM UTC
Solved

SD Card no file system error.

Hi,

I would like to make an application to access micro sd card via SPI from STM32F407VG-DISC1 board. I have configured the pins as seen in table below.

Main file is also attached. 

However, when I run the application I get FR_NO_FILESYSTEM error. My card is formatted as FAT32. It is class4 2GB micro SD card. 

When I remove the SD card then I received another error that is FR_NOT_READY. So, this got me thinking that, I have made proper connections, but there is problem with the code.

Could you please point me to the right direction ?

 

STM32F407VG-DISC1HW125 SD CARD MODULE
PC2 MISO PIN
PC3MOSI PIN
PB10 SCK PIN
PB12 GPIO_OUTPUT
GNDGND
5VVCC



 

This topic has been closed for replies.
demirBest answer
Senior
Feb 19, 2024 2:37 PM UTC

Hi @Andrew Neil 

I came to know that SD Card needs some to settle. So, the only I have done is that, I added some delay before mountin the SD card as below. Hope it helps.

demir_0-1708351527727.png

 

 

11 replies

AScha.3
Super User
Feb 16, 2024 12:04 PM UTC

Hi,

Just a question: F407 has SDIO for sd-card access -- why you dont use it ?

 

AScha3_0-1708084970675.png

+

Keep wires to sd-card short , < 50mm is ok; long wires will make problems....

If you feel a post has answered your question, please click on " Best Answer ".
demirAuthor
Senior
Feb 16, 2024 12:10 PM UTC

Thanks Ascha.3.

This is the task actually.

Andrew Neil
Super User
Feb 16, 2024 12:24 PM UTC

@demir wrote:

When I remove the SD card then I received another error that is FR_NOT_READY. So, this got me thinking that, I have made proper connections,


Not necessarily.

The card present/not-present might just be detected on a switch ...

Have you tried tracing back to where the error is actually raised?

 


@demir wrote:

HW125 SD CARD MODULE


Do you mean one of these?

AndrewNeil_0-1708086235076.png

Do you have a link to its datasheet?


 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
demirAuthor
Senior
Feb 16, 2024 1:29 PM UTC

Thanks Andrew.

Yes, I use one of those. I searched but cant find the datasheet.

I ve debugged the code, please see the attachment. This is where code returns no file system.

Andrew Neil
Super User
Feb 16, 2024 1:37 PM UTC

If you can't find a datasheet, how can you be sure you have the correct connections?

:flushed_face:

 


@demir wrote:

This is where code returns no file system.


So step into find_volume() to find what causes it to return that error

AndrewNeil_0-1708090561676.png

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
demirAuthor
Senior
Feb 19, 2024 3:18 PM UTC

Cant mark it as the solution, there is no option to select.

Andrew Neil
Super User
Feb 19, 2024 3:19 PM UTC

You have to un-mark one before you can mark a different one

Clikck on the AndrewNeil_3-1708356226886.pngin the top-right of the post:

AndrewNeil_1-1708356181338.png

Then choose 'Not the solution':

AndrewNeil_0-1708356121086.png

#UnmarkSolution

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
HDaji.1
Senior
Apr 10, 2025 12:36 AM UTC

Hi @demir 

Did you figure it out this solution yourself or you follow some examples?
I only find a kind-of-official tutorial by STM staff, which, however, uses SDIO, not SPI.

 

Best