UFFS on Kinetis internal flash

69 views
Skip to first unread message

Sergei Sharonov

unread,
Jun 29, 2015, 12:16:58 AM6/29/15
to uf...@googlegroups.com
Hello,
I am using internal FLASH memory on Kinetis Cortex M4F to store configuration, calibrations, logs, etc. IMHO there is enough memory and CPU cycles left to warrant some sort of a small filesystem. Unfortunately small, power-fail safe filesystems are scarce and UFFS seems the best candidate even though it is primarily for NAND. In this regard I have a few questions:

1. MCU has two independent blocks of flash 256kB each. I intend to use one for data storage. Flash is organized into 2 kB erase blocks. Data inside erase block is word (4-byte) writable, e.g. cannot write single bytes. Also cannot write twice to the same word without erase. Well, modern NAND allows only single write to a page, so I presume UFFS should be OK with 4-byte minimum write? How are status byte and seal byte written? That is, how many times does UFFS write to a page?

2. Does anybody have an example of NOR flash implementation that they can share? How do I disable ECC? What flash access functions need to be implemented for NOR?

3. What files need to be provided by a port? I presume they are:
    uffs_config.h,  uffs_os.c, flash-interface-xxx.c

4. Does anybody have test results for power cycling? I recall somebody mentioned 11kCycles?

Regards,
Sergei

Ricky Zheng

unread,
Jun 29, 2015, 3:54:09 AM6/29/15
to uf...@googlegroups.com
1. UFFS only write once to a page. It's OK with 4-byte minimum write.
2. To disable ECC, use UFFS_ECC_NONE for uffs_StorageAttrSt#ecc_opt
3. Normally only need to modify uffs_config.h and uffs_os.c. You need to provide flash adaptor/driver and some glue codes, flash-interface-xxx.c is an example.
4. I have done a few k cycles before, on a samsung NAND.

Hope that help.

- Ricky



--
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.
For more options, visit https://groups.google.com/d/optout.

Sergei Sharonov

unread,
Jul 6, 2015, 5:17:26 PM7/6/15
to uf...@googlegroups.com
Ricky,
Thank you for the prompt reply. I was a bit worried about low activity on the mailing list but it looks like UFFS is alive and well.
Now back to my original post. I got UFFS working on Kinetis internal flash and a few included tests (t1, t2, t4 and t5) passed.
Not sure how to populate a test file for t3.
The next thing I would like to do is to run some sort of regression test suite to extensively check filesystem functionality. Can anybody recommend one?
Obviously I cannot run SQL thing on a small embedded system. LTP has quite a few test modules but I think it may be a bit of an overkill and would be pita to port.
Would probably kill my flash too as it is limited to 10000 erase cycles.
Regards,
Sergei

P.S. Is anybody interested in collaboration on UFFS port to Kinetis flash?
Reply all
Reply to author
Forward
0 new messages