FatFs library extended for SDRAM

As mentioned at the beginning of post about FATFS with SDCARD, I’ve updated library to extend support for SDRAM on STM32F429-Discovery or STM324x9-EVAL board.

Low level functions have been added in library for write/read data ti SDRAM.

SDRAM set up

To use SDRAM with my FATFS library, you will need to include my SDRAM library, which implements low level functions for read/write in SDRAM and initialization process. 

Next thing, you need to do, is to open defines.h configuration file and add define:

Functions for interface between SDRAM and FATFS are stored in fatfs/drivers/fatfs_sdram.c .h. Make sure you have included them in your project!

Low level functions for FATFS and SDRAM are now set. You can start working with mounting, opening files, everything you need.

The only problem is, that SDRAM is non-volatile memory which will not store data if there is no power. That’s the reason, why you will always have to make fat file system “on the fly” using “f_mkfs” function from FATFS. Look for example below:



Download library update below.

TM STM32F4 FATFS Library

Read SD card with SDIO or SPI on STM32F4xx using FatFS by Chan


Owner of this site. Also electronic enthusiasts, web developer, 3D printer fan, handball player and more. Big fan of STM32F4 devices. In anticipation of the new Discovery board for STM32F7 lines.

You may also like...

Read before commenting!

Before you make a new comment, make sure you agree with things listed below:

  • - Read post to make sure if it is already posted what you are asking for,
  • - Make sure you have the latest version of libraries used in your project,
  • - Make a clean and grammatically correct written message,
  • - Report as many details as possible, including what have you done so far,
  • - Do NOT post any code here. Use Pastebin,
  • - Do NOT post any error codes here. Use Pastebin,
  • - Specify STM32Fxxx family and used Discovery/EVAL/Nucleo or custom made board,
  • - Make sure your clock is set correct for PLL,
  • - If you are using my HAL drivers, please check this post how to start.
Comment will be deleted on breaking these rules without notification!
  • Pingback: Library 21- Read SD card with FatFs on STM32F4 - STM32F4 Discovery()

  • abdurrahman korkmaz

    it gives error below. Please tell me why?
    .TargetsSTM32F429_Discoveryproject.axf: Error: L6218E: Undefined symbol f_mkfs (referred from main.o).

    • In ffconf file should be enabled. Check this file and defines.

      • abdurrahman korkmaz

        thanks friend
        you are great

  • abdurrahman korkmaz

    Hi majerle again,
    i used stm32f429-discovery kit and it didnt run.
    i controlled f_mount if FR_Ok or not and it gives false all time.
    please help me.