Forums

Flash translation layer

Started by Himanshu Patel August 31, 2009
Hi All,

Actually we are developing a Reade based on LPC2458. The Reader will have NFC, Bluetooth, mass storage and CCID functionalities When connected with USB, the reader will act as USB mass storage and CCID device.

We are going to use eCos operating system. We will be required to have flash translaton layer aswell as bad block management software for NAND.

Has any one worked with any open source/third party flash translation layer?

Regards,

Himanshu Patel





An Engineer's Guide to the LPC2100 Series

Hi Himanshu,

the flash-sector-remapping is not complicated. Say the flash area visible as
USB mass storage has capacity of N sectors, then the translation is just
mapping from logical sector number (0,.., N-1) to physical sector number
(0,..,N). The translation is implemented as a table, which is stored in
other part of flash. There is one free sector. If you want to write to
logical sector i, you find its physical sector (table[i] = k). If you cannot
write in that sector k because the values are not FFs, then you erase the
current physical free sector f (can be stored in table[N-1]), write the
existing content plus the new data you want to write to it, and then remap
the logical sector i to f, so that table[i] = f and make the sector k free,
so table[N-1] = k. This remapping means you have to store new image of the
mapping table to the flash. I have allocated 2 fixed flash sectors just for
storing these table images, one after another, in such a way that you can
always find which is the current table image after reset. It works similar
to circular buffer. Regarding the bad block management, given the sectors
store data (e.g. FAT16 data) which the translation layer doesn't understand,
the only option I can imagine is to have couple of sectors as replacement
sectors, when the writing fails. In this case the capacity will not be N,
but say N-x, and x sectors will be aside waiting to be used when a regular
sector became corrupted. I didn't implement this part though.

With regards,
Jan

On Mon, Aug 31, 2009 at 11:13 AM, Himanshu Patel wrote:

> Hi All,
>
> Actually we are developing a Reade based on LPC2458. The Reader will have
> NFC, Bluetooth, mass storage and CCID functionalities When connected with
> USB, the reader will act as USB mass storage and CCID device.
>
> We are going to use eCos operating system. We will be required to have
> flash translaton layer as well as bad block management software for NAND.
>
> Has any one worked with any open source/third party flash translation
> layer?
>
> Regards,
>
> Himanshu Patel
>
>
>
>