Our board am3517 have hynix 8-bit nand connected on cs0.I defined GPMC_NAND_ECC_LP_x8_LAYOUT in u-boot.
I can write and read MLO into nand from u-boot command.
But After writing u-boot.bin into nand,I cannot read back u-boot.bin from nand.
From 0x00 to 0x6e0000 it marked as bad blocks.How to overcome this problem?
Please suggest.Thanks in advance.
Can you share the log? Commands you are using for flashing images? u-boot version?
Thank you vaibhav.
Please find the attached error log.
Nand commands what I used :
/* MLO */nand erase mmc initfatload mmc 0 0x82000000 MLOnand erase 0x0 0x50000nandecc hw 2nand write 0x82000000 0x0 0x50000nand read 0x82000000 0x0 0x50000/* U-boot */fatload mmc 0 0x82000000 u-boot.binnand erase 0x80000 0x1C0000nandecc swnand write 0x82000000 0x80000 0x1C0000nand read 0x82000000 0x80000 0x1C0000
Your NAND device seems to be completely screwed up, almost all initial blocks are bad.
The failure is very obvious here,look at the steps and log,
# specially u-boot
// You erase only until -x1C0000
# nand erase 0x80000 0x1C0000
// Then you attempted to write and then read
# nand write 0x82000000 0x80000 0x1C0000
# nand read 0x82000000 0x80000 0x1C0000
Both will skip the bad blocks and try to read the next valid block, which has not been erased properly before writing. So please erase the NAND area >0x740000, where u-boot is written.
NOTE: Since your NAND device is screwed up completely, I would recommend to use another board here OR try "nand scrub" command. I would not recommend using this command since it is risky, and may lead to software failures and data loss.
Thank you Vaibhav.
I tried with other board.Earlier erase,read and write was proper.
In my code CFG_NAND macro was disabled.So by default it was booting from mmc card.
I enabled the macro and tried nand boot once.It was not working.So once again I went back to the older code .ie disabling CFG_NAND macro.
After that erase not happening,even for the older code.No problem in hardware,because I tried Erase,Read & Write in ccs.It was working there.
In u-boot prompt,I tried erase.It is not happening.Without erasing properly,I can't expect read and write.
It seems something different.Please help me on this.
This is the latest update in nand issue.
By ccs code,I erased the page0 in block0.(Erasing will clean up full page0 with spare area)
At first boot,page0 is good,not marked as a bad block.
I tried to write some data in page0.
It was writing properly and I was able to read.
But after rebooting(mmc boot),page0 marked as bad.
AM3517_CRANE # Device 0 bad blocks:
00000000 00020000 00040000 00060000 00080000 000a0000 000c0000 000e0000 00100000 00120000 00140000 00160000 00180000 001a0000 001c0000 00240000 16f80000
page0 in Block0 should not be bad.
Please help me to resolve this.
Thanks in advance.
Have you solved your issue?
Through uboot commnads,
for my second nand flash!
ubifs image adding, writing is proper, but if i read same thing back , getting read error?
Please check with ECC Layout section in your code.
For me, that was the problem.I was using 8-bit nand.So ECC position should be 1-12.(ie) 0th byte will be used to mark bad blocks.
For 16-bit nand, ECC should be 2-13.(ie) 0th & 1st byte will be used to mark bad blocks.
This mismatching causes read error for me.
I have x8 NAND connected to am3517 and during debugging u-boot made a lot of mistakes and a IC came with a lot of bad blocks. Do not pay attention to it, just issue the command "nand scrub.chip". The real bad blocks marked by a NAND manufacturer will be in Bad-condition anyway, but your fake-bad blocks will recover.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.