Skip to main content
Explorer
September 19, 2022
Solved

FatFs impementation _ FR_NO_FILESYSTEM error after f_open

  • September 19, 2022
  • 5 replies
  • 5324 views

Hello,

I build an application with FatFs Middleware to log data on a uSD card.

I used the same protocol on FatFs_uSD application with wl55 mcu.

f_mkfs and f_mount function return FR_OK.

but f_open return FR_NO_FILESYSTEM 

i tried to change between SDHC and SDSC

i passed the SD module power supply from 3.3V to 5V

i changed min heap and stack sizes

i changed _MAX_SS in ffconh.h

... but always the same problem !

any suggestion please ?

0693W00000SvhPoQAJ.png

    This topic has been closed for replies.
    Best answer by malarab

    I resolved the problem by modifying spi read ans write functions.

    it is working now, but i still have a problem in fatfs application : i can not write two time on the same file !

    5 replies

    Graduate II
    September 19, 2022

    Top level functionality is predicated by operation of lower level block retrieval by DISKIO layer. If that fails at its basic level the file system won't work.

    C​heck what is read from the card in these failing conditions vs what was written.

    F​or large cards use EXFAT.

    Shouldn't need to use f_mkfs on working cards.

    malarabAuthor
    Explorer
    September 19, 2022

    i tried with exfat card, the SD card start heating. i removed it directly. and now i can not detect this card any more with other uSDcard reader.

    Yes i was tried with and without f_mkfs

    FR_NO_FILESYSTEM is returned from find_volume function.

    Graduate II
    September 19, 2022

    Cards don't run at 5V.

    Are connecting to a simple socket, or something with a regulator and level shifters?

    T​he error suggests the data read does not meet expectations of an MBR or BPB structure on the media.

    Sounds like you need to focus on the electrical interface, and basic block read and write functionality.

    malarabAuthor
    Explorer
    September 19, 2022

    SDcard reader is connected to 3.3V of nucleo board

    I tried 5V because in some forum they say the problem can be resolved with 5V power supply !

    Ok i will check my read write SPI function !

    Thank you.

    malarabAuthor
    Explorer
    September 19, 2022

    check_fs function return 3

    0:FAT, 1:exFAT, 2:Valid BS but not FAT, 3:Not a BS, 4:Disk error

    Super User
    September 19, 2022

    >>i passed the SD module power supply from 3.3V to 5V

    so : 5V at SDcard ?? all cards you "tried" are dead now.

    1. buy new cards.
    2. use 3V3 at SDcard
    3. leave away the  f_mkfs (dangerous!!!)
    4. open root directory
    5. write file (fopen..)
    malarabAuthor
    Explorer
    September 19, 2022

    microSD card still working ... i can read and write on it on PC, camera, phone

    They should be a power regulator on microSD card modul

    Graduate II
    September 19, 2022

    The STM32 runs at around 3V typically.

    It can be directly connected to MicroSD sockets, with a couple of pull-up resistors on the Dx and CMD pins.

    There are dozens of circuit diagrams for this.

    Perhaps pull those for DISCO and EVAL boards, and review. Should be under "CAD Resources"

    Something super simple like this being ideal

    https://www.waveshare.com/micro-sd-storage-board.htm

    Things involving 5V to 3.3V regulators, IO buffers, and Arduino connectivity, a whole lot less so.

    malarabAuthorAnswer
    Explorer
    September 23, 2022

    I resolved the problem by modifying spi read ans write functions.

    it is working now, but i still have a problem in fatfs application : i can not write two time on the same file !

    malarabAuthor
    Explorer
    September 23, 2022

    I should always format the disk to be able to write on it