This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
for our custom board we have a 512MB Micron NAND flash chip.
I have compiled MTD utilities and changed the number and size of partitions as needed, also flashing root filesystem works with jffs2..all good
however, from time to time, we get a board that fails to flash for some reason, some times IO error or CRC failures...etc
so I'm building a new feature in the firmware for the production group to test the nand chip before flashing it (something like quick test, full test with a progress bar)
so I'm using mtd_pagetest and mtd_oob tests sucess as an indication for a healthy NAND MTD partition.
I have MTD2 used for u-boot environment and it is 1 block in size (128KB). The pagetest always fails on this partition for some reason! I think the partition is good, it has all u-boot variabled read/write fine, so i guess something wrong with page test dealing with a small partition maybe??
so, I'm just asking if anyone knows or have experienced similar problem with the mtd_pagetest?
Regards,
Ahmed
Hi Ahmed,
The last 2 rows of the log:
[ 414.669952] mtd_pagetest: verify failed!
[ 414.707305] mtd_pagetest: error -1 occurred
are caused by discrepancy between written and read buffers in the end of erasecrosstest function in ..linux/drivers/mtd/tests/pagetest.c file. This means that the verification of fails.
I suggest you to print the values of writebuf, readbuf and pgsize variables. This step could be helpful for investigation of the issue.
BR
Tsvetolin Shulev
You need at least 2 eraseblocks to perform this test. Check the working log, it writes to block 0, then erases block 1 and reads back the data in block 0 and they match, otherwise if you run this test on 1 block it erases itself then the comparison fails.
[ 891.339949] mtd_pagetest: erasecrosstest
[ 891.348293] mtd_pagetest: erasing block 0
[ 891.355128] mtd_pagetest: writing 1st page of block 0
[ 891.360769] mtd_pagetest: reading 1st page of block 0
[ 891.370528] mtd_pagetest: verifying 1st page of block 0
[ 891.378542] mtd_pagetest: erasing block 0
[ 891.385647] mtd_pagetest: writing 1st page of block 0
[ 891.391280] mtd_pagetest: erasing block 1
[ 891.400554] mtd_pagetest: reading 1st page of block 0
[ 891.408523] mtd_pagetest: verifying 1st page of block 0
[ 891.416377] mtd_pagetest: erasecrosstest ok