2022-03-16 07:39 AM
I have a new project on an STM32H7A3 processor with a microSDHC Card. We want to read/write files with FatFS.
In another project with STM32H7A3 we have SDHC Cards working perfectly.
Code is created with the latest release of CubeMX 6.5.0 and HAL V: 1.10.0.
In the new project we had to use microSD card for reduced space reasons.
With the microSD the call to fmount returns "FR_NO_FILESYSTEM". But on the PC the card is readable and has one folder installed.
I stepped through the source code and fount that the "find_volume" routine returns FR_NO_FILESYSTEM due to "fmt=3" .
Currently we have no idea for a possible solution. The pins are working and pin connection is checked, data is sent/received on the MISO/MOSI lines.
Clockspeed was 25 MHz, reducing to 20 and 16.6 MHz did not solve the problem.
USE_SD_TRANSCEIVER = 0.
Has anybody an idea where to look at further?
Is there any futher switch necessary to specify "micro"SDHC cards instead of SDHC?
Thank you for any comments.
BR GS
Solved! Go to Solution.
2022-03-16 11:54 AM
Hi,
Now I got it to work: By disabling the call to SCB_EnableDCache.
With DCache is enabled and even activated chache handling before DMA access the SD card read/write routines don't work.
I am not an expert on the cache handling and therefore I leave it this way with deactivated DCache for now.
Thank you for your hints on these aspects!!! As always: Very much welcome!
BR GS
2022-03-16 08:46 AM
Hi
What kind of Micro SD-Card are you using? Do you have it formatted correctly? . Your error code usually means, that the sd-card cannot be initialized due to wrong formatting. Try formatting to FAT/FAT32. If you've got another Micro SD card, give it a try. Also try a non-HC one, if you have got one laying around.
Kind regards and good luck
2022-03-16 08:53 AM
Card is a brand new 32 GB SDHC SanDisk card, which I formatted with FAT32. The other card (16 GB SDHC) did not work either. I don't have a NON-HC in house.
Thank you for your suggestions anyway.
2022-03-16 09:04 AM
Most SDHC, SDXC in micro and full-size all behave materially the same. Use 512-byte block numbering unlike the sub-4GB cards of yore that used byte level addressing. All microSD cards should be rated to at least 50 MHz.
So using SDMMC (1-bit) or SPI ?
Validate your read/write implementation in DISKIO, if this doesn't retrieve data properly nothing built on top is going to work either.
On H7 be conscious of DMA and cache coherency issues/management.
Polled mode should be impervious to that, but slower.
I'd expect FATFS/SDMMC demo code to be in the Applications directories for the 7A3/7B3 DISCO/DK/EVAL boards. Should port, should be configurable for 1-bit mode.
2022-03-16 11:54 AM
Hi,
Now I got it to work: By disabling the call to SCB_EnableDCache.
With DCache is enabled and even activated chache handling before DMA access the SD card read/write routines don't work.
I am not an expert on the cache handling and therefore I leave it this way with deactivated DCache for now.
Thank you for your hints on these aspects!!! As always: Very much welcome!
BR GS
2022-05-01 04:21 PM
> I am not an expert on the cache handling and therefore I leave it this way with deactivated DCache for now.
Here is an instruction on how to do it properly: