I am using IMX53 based custom board with micron flash. I have flashed NAND as follows after booting with sdcard, but in Kernel partition (/dev/mtd1) specific memory locations (2002 byte, 4050=2002+2048 byte, 6098=4050+2048 byte) at end of every 2048 byte was corrupted(the values is always FF).
Step 1. Flashed kernel image using nandwrite.
#flash_erase /dev/mtd1 0 0
#nandwrite -b 1 -n /dev/mtd1 -p /home/uImage
Step 2. Flashed u-boot using kobs-ng.
#flash_erase /dev/mtd0 0 0
#kobs-ng init -v --chip_0_device_path=/dev/mtd0 /home/u-boot.bin
After Step1 the memory locations(2002 byte, 4050=2002+2048 byte, 6098=4050+2048 byte etc...) are having correct values, but after flashing u-boot with kobs-ng those memory locations(2002 byte, 4050 (2002+2048)byte, 6098(4050+2048) etc...) of kernel partition values are changes to FF.
Following is the first memory location corruption example:
Actual value after Step 1:
---------------------------------
# nanddump -c -n -l 1 /dev/mtd2 | grep "000007d0:"
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00000001...
0x000007d0: 10 af 40 ee 9a af 07 ee 15 af 07 ee 9a af 07 ee |..@.............|
#
Corrupted value after Step 2:
--------------------------------------
# nanddump -c -n -l 1 /dev/mtd2 | grep "000007d0:"
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00000001...
0x000007d0: ff af 40 ee 9a af 07 ee 15 af 07 ee 9a af 07 ee |..@.............|
#
The corrupted value(10 changes to ff) highlighted with bold.
My doubht here is why kernel partition value is corrupted while flasing u-boot using kobs-ng. When I flash u-boot also with nandwrite then values are not corrupted.
When I flash u-boot first( using kobs-ng) and kernel second then also same issue.
Can you guide me to debug the issue while using kobs-ng for flashing u-boot.