Skip to main content
Explorer
December 20, 2023
Solved

sdmmc STM32U5 FatFs 4 bits exFat not working

  • December 20, 2023
  • 1 reply
  • 3278 views

Hello,

I'm trying to set up a micro sd on a nucleo-u575ZI through the sddmc1 with a port of FatFs.

I am using a PmodMicroSD all wired up for 4 bits and the card detect on a GPIO.

I am testing 3 sd card 16GB, 32GB and 64GB.

I have confirmed that all 3 are working in 4 bits mode though SDMMC on a STM32L4R9I Discovery with FatFs.

 

My current implementation on the U575 works only in 1 bit mode. All 3 cards are working and ExFat is enabled on FatFs and I can read and write files no problems.

When I change the SDMMC to 4 bits configuration on the U575 only the 16GB sd card works. The other cards gives me a FR_NO_FILESYSTEM when trying to mount.

I believe it comes from this line in ff.c

if (fmt >= 2) return FR_NO_FILESYSTEM; /* No FAT volume is found */

I'm a bit loss and I was wondering if anyone had any ideas what might go wrong. I ported FatFs from the STM32L4 CubeMX generation. (FatFs version 0.12c) I believe FatFs has exFat bugs in 0.12C as state in the change logs of 0.13 but I am unsure if the bugs affect my issue. I think it's only a wrong configuration but that it's related to exFat.

Thanks

 

 

 

 

    This topic has been closed for replies.
    Best answer by AScha.3

    So i think, its not about FatFs lib problem - its the hardware , as in most cases, when 1-bit works, but 4-bit not. :)

    Whats the distance cpu - sdcard ? Both on your L4 + on U575 ;  + pullups ? (maybe show a photo...)

    1 reply

    Graduate II
    December 20, 2023

    It's a chronically old version of the library. Make sure _FS_EXFAT is enabled in ffconf.h

    No file system is indicative of it not supporting whatever partition or volume is described in the MBR or BPB sector. Make sure it's reading those properly.

    Older libraries had some integrity issues with the larger volumes, but the issue was more subtle.

    broilmontAuthor
    Explorer
    December 20, 2023

    _FS_EXFAT is enabled for the U575.

    What is confusing is that the same library is working flawlessly on the STM32L4, same clock speed, same configuration.

    Why would changing from 4 bit to 1 bit read brake the MBR reading. Because the cards with exFat enabled are working in sdmmc 1 bit mode.

    AScha.3Answer
    Super User
    December 20, 2023

    So i think, its not about FatFs lib problem - its the hardware , as in most cases, when 1-bit works, but 4-bit not. :)

    Whats the distance cpu - sdcard ? Both on your L4 + on U575 ;  + pullups ? (maybe show a photo...)