I found out that "nand erase" erases everything, and doesn't print out argument help. Now I am in a situation where the UBL and u-boot are gone and I'd like to restore them. Even the DM365 UBL and u-boot from the DM365-evm should flash, even though a few things such as ethernet will likely not.
I can boot from a SD card, but flashing UBL and u-boot fails. Even writing u-boot's environment fails:
DM365 LEOPARD # saveenv Saving Environment to NAND... Erasing Nand... Erasing at 0x3e0000 -- 100% complete. Writing to Nand... FAILED!
DM365 LEOPARD # tftp 0x82000000 ubl_nand.nandbin.davinci.LeopardBoardDM365sdkEVAL2011Q2.leopard Using DaVinci-EMAC device TFTP from server 10.5.1.3; our IP address is 10.5.1.91 Filename 'ubl_nand.nandbin.davinci.LeopardBoardDM365sdkEVAL2011Q2.leopard'. Load address: 0x82000000 Loading: #### done Bytes transferred = 16384 (4000 hex) DM365 LEOPARD # nand erase 0x20000 0x20000 NAND erase: device 0 offset 0x20000, size 0x20000 Erasing at 0x20000 -- 100% complete. OK DM365 LEOPARD # nand write.ubl 0x82000000 0x20000 0x20000 NAND write: device 0 offset 0x20000, size 0x20000 NAND write to offset 20000 failed -5 0 bytes written: ERROR
However, writing the uImage / root filesystem works fine.
My bad block table is still intact, and does not include any of the addresses I'm trying to write to. Is it possible that my NAND is somehow locked? Using Constantine's SD flash program, every UBL copy fails to write, as does u-boot.
Any ideas?
edit: nand dump of the ubl address (0x20000) shows that it is writing the first 24 bytes.
Page 00020000 dump:
00 ed ac a1 00 01 00 00 07 00 00 00 01 00 00 00
01 00 00 00 20 00 00 00 ff ff ff ff ff ff ff ff