I have NAND flash memory dump, as a separate MTD partitions copied from NAND flash chip use built-in nanddump commands. I need to reflash some corrupted MTD partitions. In order to reflash partitions properly, should I use the partition dump that contain only the actual data, cleaned first from OOB data dummy chunks?
This depends very much on how exactly you plan to write the data back; some options would accept only "payload", others may need OOB too.
If you use U-Boot's nand write
, it seems it accepts data without OOB but you need to erase target pages manually first.
-
I used U-boot built-in commands
nand erase
andnand write
. Before flashing I used python script to process dump and separate the actual data from OOB data. The test was unsuccessful, when I tried write data, an error was shownAttempt to write non page aligned data. 13548080 bytes written: ERROR
. Before this I tried also write raw partition dump (with OOB), but linux kernel didn't loaded, not sure what was wrong with my dump. – minto Sep 16 '19 at 19:37 -
1@minto maybe this will help e2e.ti.com/support/legacy_forums/embedded/linux/f/354/t/… – Igor Skochinsky♦ Sep 16 '19 at 21:53
-
Cleaned dump is 13548080 bytes in size. NAND device have
Block size 16384, page size 512, OOB size 16 bytes
. 13548080 bytes is incomplete 26462 pages. A complete 26462 pages is 26462 x 512 = 13548544 bytes. The difference is 464 bytes: so need I append these 464 bytes for the complete page? – minto Sep 18 '19 at 18:36
It depends. For example Samsung XSR stores information about the blocks in spare area, thus you need to have to dump both data and spare.