During my development using AM3505, I frequently find the UBI data partition is corrupted by some unknown reason. It is resulting the system can’t startup or the application is damage.
This problem may happened at the test case of Power ON/OFF continuously for many time, sometimes it is up to several hundred times.
It is not only the data partition corrupted, the system partition is also corrupted with the error message of UBIFS error (pid 15670): ubifs_check_node: bad CRC: calculated 0x85ecb0de, read 0x866864b0
Initially, I suspect it is come from the UBI system, so I add the YAFFS2 to test it. But the result is even worse.
Then I think that data partition should be un-mount first and before the shutdown, it should stop all the Android service.
But unfortunately after I tested, the data partition is still happened
So I re-think that the reason may come from the NAND Flash driver or the hardware problem.
In order to prove this, I have used two T.I Logic PD development board to do below experience.
1.hardware: two logicPD AM3517 boards.
2.OS: Android 2.3.4 based on TI support bsp(don't any changes for nand driver).
3.NAND partition(MT29F4G16ABCHC):
xloader-nand: 0x00000-0x80000.
uboot-nand: 0x80000-0x240000.
params-nand: 0x240000 - 0x280000.
linux-nand: 0x280000-0x780000.
rootfs-nand: 0x780000-0x16580000.
user-data: 0x16580000-0x20000000.
4. add follow options in init.rc:
mkdir /disk
chmod 0777 /disk
service cache_mount /system/bin/mount -t ubifs /dev/ubi1_0 /disk
disabled
oneshot
service cache_umount /system/bin/umount /disk
disabled
oneshot
5.Software: Android apk, used to test read & write something on ubi1_0(user-data partition).. this software will do follows operations:
a. mount /dev/ubi1_0 to disk
b. write something to disk directory
c. umount /disk.
d. mount /dev/ubi1_0 to disk
e.read something from /disk directory.
f. write something to disk directory
g. umount /disk.
h. a --- g step again.
Attached is the my testing source code, debug & log message to share with you for interest
6.Result
after the software run 53 times by a-g steps, the one board of two logicpd AM3517 board have found data corruption issues in ubi system.
after 107 times,the another board have found data corruption too.
7. Conclusion:
Even the LOGICPD development board still happen the UBI data corruption problem.
Can we conclude that the TI BSP’s NAND driver has problem?
But the NAND flash is only controlled on CS0 of AM3517 and the CONFIG to CSO timing is limited and fixed by CPU.
May I draw any attention from you, guy who can help us and give your precious advise.
Thanks you very much!
(Please visit the site to view this file)