Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Mounting File-System on NAND problem

Not open for further replies.


Newbie level 2
Sep 16, 2015
Reaction score
Trophy points
Activity points
Hi, i have a board which includes a stm32f103re and a 256MB NAND, as you may know this MCU does not have a external memory controller peripheral, so i wrote the required NAND driver in GPIO level . the routines include: Init, Uninit, PageRead, PageWrite and BlockErase
All this functions seems working, i have successfully wrote,read on pages and erased blocks.
the problem is when i call finit("N0") function it returns 2, meaning an unsuccessful attempt.
what could be wrong? any idea?

Just to clarify my question, i'm using RL-FlashFs library and the documentation provided for this library states that for using Nand-Flash, developer must provide his code for accessing Nand flash,namely: Uninit, PageRead, PageWrite and BlockErase. ( ,

The weird part is that i have provided those functions and each of them works fine individually, but when i use higher level functions for example finit("N0"), it return 2(an error).
in fact it seems finit just invokes init and PageRead(5,0,2112) one time and returns 2.(i might be wrong but correct me if so), and as the source code is not open, i can't understand what's going on in the Rl-FlashFs library(i also have increased heap and stack but no success).
please let me know if you have any suggestions.

if you already have the low level functions, you can try checking ELM ChaN's FAT File System, It seems there's an example implementation for **broken link removed** so you can check that too...

I wasn't used Keil's FAT system,but I have used Fatfs in project,so I think NAND flash need bad block manage.

I considered using FatFs but as you mentioned NAND-Flash needs bad-block management, wear leveling and ECC. and providing those function to FatFs just adds load to CPU and it is not what i want, i'm doing some DSP and my cpu is not free that much.
The reason i thought RL-FlashFs would work is that they claim that it supports all the required NAND operation(ECC, ...). which i think it should be written efficiently along with the file-system stuff.
But anyway i am writing my own simple file-system now.
Thanks for your response guys.

So in embedded system,FAT file system is not suitable for NAND flash.
Usually NAND flash uses yaffs.
  • Like
Reactions: Liara


    Points: 2
    Helpful Answer Positive Rating
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to