cancel
Showing results for 
Search instead for 
Did you mean: 

How can format my NAND flash chip ?

antonius
Senior
Posted on September 06, 2015 at 15:35

Guys,

How can I format my NAND flash chip to FAT32 ?

Can I use USB-OTG ?

Any examples or clues ?

Thanks
7 REPLIES 7
Posted on September 06, 2015 at 18:53

For a raw NAND device I think you'd have to do significant block level management.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
antonius
Senior
Posted on September 06, 2015 at 23:47

Any clues / link on how to do that ? thanks

Posted on September 07, 2015 at 03:57

It's complicated, and beyond the level of participation I'm offering on the forum.

You need to review the technical documentation for the NAND device you've picked, and the operation of NAND devices in general. Specifically you need to get your head around the large blocks, the erase block sizes, the speed, and how to rotate through the block inventory to reduce the excessive wear cycles on specific blocks, and perform efficiently. Then you need to get your head around mass-storage, and file system methods, and the small sectors, random access read/write, partial sector writes and sometime sequential sector access.

You should perhaps instrument a FATFS or MSC, and review how data is accessed.

Then you need to ponder how that gets handled. It's going to be difficult because it's going to require you to mediate the differences in expectations between the two systems. ie the random access file system with byte level granularity, and the storage medium with very large, fragile and unwieldy blocks.

I'm not sure there's a simple way to impart the knowledge required, you have to seek it out and do the work to understand it yourself.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
antonius
Senior
Posted on September 07, 2015 at 16:36

Thanks for the knowledge, is there any possibilities I'm using chan FatFS straight away with NAND flash chip ? can the the library detect it as nand flash chip ?

jpeacock
Associate III
Posted on September 08, 2015 at 19:48

The FATFS file system doesn't know about low level NAND block management.  You could get it to work with a simple block read/write routine but it won't be very reliable, and it won't be compatible with anything else.

There's a whole industry based on how to manage NAND flash as storage.  You won't find much public information other than Linux drivers (look at JFFS and UBIFS) and those will be complicated.  Most software to manage NAND is closely guarded and proprietary since it's the basis for commercial SSD flash drives.

You need to learn about NAND characteristics, especially reliability.  Sometimes writes or reads will fail, it's expected that you handle it in your software.  You have to look at wear leveling, since too many writes tot he same area will wear out part of the IC.  And if you use multi-level flash (MLC) you have to keep in mind that a write to one sector may alter the data in another, without warning.

As Clive points out, even for a professional embedded designer with 10 years experience managing NAND is a serious challenge and would require substantial design, coding and testing effort.  You might be better off looking at SD cards or a USB stick (look at the USB mass storage class) where much of that work is done in the card.

  Jack Peacock
antonius
Senior
Posted on September 09, 2015 at 23:59

Thanks for the explaination Jack,

So I'd better use USB thumb drive to store my data and read it from USB ...

Is the any examples from the library for doing it ?

I've done with SDcard with SDIO method and want to explore with other type of storage,

Have you used VS1053 ?

Thanks

antonius
Senior
Posted on September 10, 2015 at 13:35

Do you mean this one ?

\STM32_USB-FS-Device_Lib_V4.0.0\Projects\Mass_Storage