UFFS on spi Flash

511 views
Skip to first unread message

Nikita Smelov

unread,
Feb 26, 2013, 2:54:43 AM2/26/13
to uf...@googlegroups.com
Hello, Ricky

In my project I need to write various logs and use configuration files to set up device(LPC4088 + 64Mbit SPI Winbond flash connected via SPIFI). I've decided to use UFFS because in such FS like FATfs wearing level algorithms aren't included by default. So it is easier for me to reduce UFFS functionality to work with my memory type, than to extend simple FS functionality.  

There is no physical spare bytes in this kind of flash, so I've taken some space from end of pages.
Current configuration looks like:
// full size of page
PAGE_FSIZE 4096
// size of spare
PAGE_SPARE_SIZE 64
// data size is calculated from page full size and spare size
PAGE_DATA_SIZE (PAGE_FSIZE - PAGE_SPARE_SIZE)

Also I've created memory layout. I was choosing between different possibilities, and decided to use 4k page size (device interface uses 256 page sizes) to reduce FS overhead. So final layout looks like:
Page data size 4032
Blocks in page 16
Total blocks 256

In uffs_config.h I have switched off CRC calculation - CONFIG_ENABLE_PAGE_DATA_CRC

I've spent some time creating low level interface abstraction such as nand_write_page() and, finally, UFFS is working.

Thank you for developing UFFS! Could you tell me, maybe I need to change some settings in uffs_config.h on account of using simple flash instead of nand flash?

Cheers,
Nikita


Ricky Zheng

unread,
Mar 4, 2013, 9:09:59 PM3/4/13
to uf...@googlegroups.com
Hi Nikita,

UFFS was designed for NAND flash, it might not be very efficient on other types of media. Does your SPI flash has something like block (minimal erasable unit), page (minimal programmable unit) ?




--
You received this message because you are subscribed to the Google Groups "UFFS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uffs+uns...@googlegroups.com.
To post to this group, send email to uf...@googlegroups.com.
Visit this group at http://groups.google.com/group/uffs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Emmanuel Blot

unread,
Mar 5, 2013, 4:17:15 AM3/5/13
to uf...@googlegroups.com
> UFFS was designed for NAND flash, it might not be very efficient on other
> types of media. Does your SPI flash has something like block (minimal
> erasable unit), page (minimal programmable unit) ?

Hi All,

Just to let you know: we have ported UFFS (on eCos RTOS) some time ago
on various *25* SPI "data flash" devices: (Atmel) AT25, (SST) SST25,
(Macronix) MX25, (Numonix) M25P, (Spansion) S25FL, … ranging from 4MiB
to 32MiB flash sizes.
We chose a 512 write block size - that is two flash device blocks are
always aggregated, and depending on the flash device capabilities, a
4KiB or 64KiB erase block size. The block sizes are picked up at run
time, once the actual device capabilities are detected (i.e. at run
time, not at build time).
As all these devices are supposed to be error-free (NOR-kind, lack of
spare area), we do not use EDC/ECC.

The backend is somewhat different from the original UFFS' one, as we
use a custom partition management for these devices, where blocks are
not share across partitions (this is suboptimal for wear levelling,
but we need to keep sensitive data out of UFFS management).

UFFS works smoothly on these devices, although NOR serial flash
devices are not the primary target for UFFS :-)

HTH,
Manu

Nikita Smelov

unread,
Mar 6, 2013, 3:51:26 AM3/6/13
to uf...@googlegroups.com
Yes, page size is 256, block size is 4k.

вторник, 5 марта 2013 г., 6:09:59 UTC+4 пользователь Ricky написал:

Nikita Smelov

unread,
Mar 6, 2013, 4:01:12 AM3/6/13
to uf...@googlegroups.com
Manu,

Thanks for information, I'm using same kind of memory, but connected via SPIFI(QuadSPI). I'm going to decide on exact write page size later, when I can understand application data write size and frequency.

вторник, 5 марта 2013 г., 13:17:15 UTC+4 пользователь Emmanuel Blot написал:
Reply all
Reply to author
Forward
0 new messages