cancel
Showing results for 
Search instead for 
Did you mean: 

SDMMC FR_NO_FILESYSTEM STM32H7

JuanBT
Associate II

Hi everyone. I'm trying to build a data logger using a SD Card using SDMMC. I'm using the STM32-H747i DISCO, STM32 Cube IDE and following the example STM32 - Creating a File System on a SD card from STMicroelectronic youtube channel.

The program passes the f_mount function, passes the f_mkfs function, but at the f_open function it stops, with the error: FR_NO_FILESYSTEM.

I ran out of options of what the problem could be, also I tried several solutions posted about same problem but nothing. Anyone has an idea?

1.jpg2.jpg3.jpg4.jpg5.jpg6.jpg7.jpg8.jpg10.jpg

 

1 ACCEPTED SOLUTION

Accepted Solutions

You don't need to use f_mkfs() on cards you buy from a store, they come pre-formatted, properly, and need no further interaction.

When debugging initially, don't do any write operations to the card. Test and validated the read operation, check files content that you have previously put on the cards from a PC. It is the functionality of the DISKIO layer with SD/MMC peripheral which is critical. Debugging top-level code and the inner workings of FatFS is not where to focus.

On the H7 and F7 you need to be wary of cache coherency, and memories, when using DMA. DMA is generally recommended so you don't run out of bandwidth or stall the transfer.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

6 REPLIES 6

You don't need to use f_mkfs() on cards you buy from a store, they come pre-formatted, properly, and need no further interaction.

When debugging initially, don't do any write operations to the card. Test and validated the read operation, check files content that you have previously put on the cards from a PC. It is the functionality of the DISKIO layer with SD/MMC peripheral which is critical. Debugging top-level code and the inner workings of FatFS is not where to focus.

On the H7 and F7 you need to be wary of cache coherency, and memories, when using DMA. DMA is generally recommended so you don't run out of bandwidth or stall the transfer.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Piranha
Chief II

Taking a broken bloatware and expecting it to work is absurd. As Tesla said, ST's broken bloatware is full of D-cache related issues because the HAL/Cube geniuses do not understand it. Also there were some topics about SDIO 4-bit interface related problems.

https://community.st.com/t5/stm32-mcu-products/maintaining-cpu-data-cache-coherence-for-dma-buffers/m-p/95746

JamesP
Associate

Hi Juan

I was just about to post as I am having the same issue getting an SD card to work.  I am following the same ST youtube video as you which couldn't be much simpler

To start with i was working with my own hardware with an F429 processor  with SDIO (and a CrossWorks compiler) and hitting  a dead end.  Thought it was my hardware or importing from MX to my compiler that could be the issue.

To eliminate this I have replicated the Youtube project in Cube IDE and run on the exact same F476 disco board as Fillon's video. Still wont work   I always succeed with mounting, but everting else after that fails.  I have looked at numerous online videos on using the SD card with STM32 and seem to be doing everything the same as everyone else.

I am beginning to think ST have messed something up recently behind the scenes in Cube regarding SD card access.

Let me know if you make any  further progress and I am going to do a bit more digging before escalating this with ST.

Regards

James

 

 

 

 

 

 

Thank you for your response and suggestions. It manage to make on of the examples for the H747 work. As you said there is no need to use f_mkfs(), but they use a wrapper for the HAL library, and there is no ioc file on the example, so I'm having a little bit of trouble replicating it. Besides that, on my program when I enabled the DMA template on the SDMMC configuration the program fails at f_open(), but if I disable it, it doesn't mount, so I have the DMA template enabled. I'll look into the cache coherency, but I don't see where to activate the DMA_TX and DMA_RX for the SDMMC, or how to actually activate the DMA with the SDMMC. I think those things might be the problem.

Thanks for your response and the link, I'll read the link, I think the problem I've been having is DMA related, I didn't know about the cache issue, I'll look into it. I enabled the DMA on the SDMMC configuration in the IOC file, but I haven't been able to configure the DMA_RX/TX they or how to configure the DMA with the SDMMC.

Hi, I think the problem is related to the DMA configuration with the SDMMC, also Pirahna and Tesla response added that there could be issues with the cache, read their response. I'll post my solution as soon as I can get it to work