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.

arm335x nand recovery

Hi everybody, I executed an nand scrub in am335x development kit. Now I booting by SD card and I am trying to recovery the nand boot.

nandtest does not identify any badblock.

to mark badblocks it was used:

nand erase.chip

nandump -p --noskipbad --file=/home/root/dump_mtd0.txt /dev/mtd0
nandump -p --noskipbad --file=/home/root/dump_mtd1.txt /dev/mtd1
nandump -p --noskipbad --file=/home/root/dump_mtd2.txt /dev/mtd2
nandump -p --noskipbad --file=/home/root/dump_mtd3.txt /dev/mtd3
nandump -p --noskipbad --file=/home/root/dump_mtd4.txt /dev/mtd4
nandump -p --noskipbad --file=/home/root/dump_mtd5.txt /dev/mtd5
nandump -p --noskipbad --file=/home/root/dump_mtd6.txt /dev/mtd6
nandump -p --noskipbad --file=/home/root/dump_mtd7.txt /dev/mtd7

checked the dump_mtdX.txt for  00 blocks, but any one bad block was find.

so I started to write mlo and uboot:

mmc rescan
fatls mmc 0
nandecc hw 2

fatload mmc 0 0x80000000 mlo
nand write 0x80000000 0x0 0x20000

fatload mmc 0 0x80000000 uimage
nand write 0x80000000 0x00280000 0x0050000

changed  the dipswitch: http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User's_Guide
to
 

Dip switch # 1 2 3 4 5
Position OFF ON OFF OFF ON

but there isn't  boot response in serial port.. 

Am I doing somthing wrong? What can i do?

  • Hi Daniel,

    Please check the NAND Layout section of the U-Boot User's Guide:

    0x00000000-> SPL start (SPL copy on 1st block)
    |
    0x0001FFFF-> SPL end
    0x00020000-> SPL.backup1 start (SPL copy on 2nd block)
    |
    0x0003FFFF-> SPL.backup1 end
    0x00040000-> SPL.backup2 start (SPL copy on 3rd block)
    |
    0x0005FFFF-> SPL.backup2 end
    0x00060000-> SPL.backup3 start (SPL copy on 4th block)
    |
    0x0007FFFF-> SPL.backup3 end
    0x00080000-> U-Boot start
    |
    0x002BFFFF-> U-Boot end
    0x00260000-> ENV start
    |
    0x0027FFFF-> ENV end
    0x00280000-> Linux Kernel start
    |
    0x0077FFFF-> Linux Kernel end
    0x00780000-> File system start
    |
    0x10000000-> NAND end (Free end)

    Please try the following commands to flash your NAND chip:

    U-Boot# mmc rescan
    U-Boot# nand erase.chip
    U-Boot# fatload mmc 0 0x81000000 MLO
    U-Boot# cp.b 0x81000000 0x81020000 20000
    U-Boot# cp.b 0x81000000 0x81040000 20000
    U-Boot# cp.b 0x81000000 0x81060000 20000
    U-Boot# fatload mmc 0 0x81080000 u-boot.img
    U-Boot# fatload mmc 0 0x81280000 uImage
    U-Boot# nand write 0x81000000 0x0 0x2000000

    Note that you will also need a file system to boot, so if you want it located inside the NAND flash, you need to write it after the kernel.

    Then change the boot switch pins accordingly and try to boot from NAND.

    Best regards,
    Miroslav

  • Hi Miroslav, I tried the commands, but it not worked too: no started u--boot.

    1) Are the mlo and u-boot.img  from  ../ti-sdk-am335x-evm-05.04.01.00/board-support/prebuilt-images directory fit to NAND Flash? or need I recompile the u-boot with specific parameters?

    2) Now I upload to flash the u-boot.bin file:
    U-Boot# fatload mmc 0 0x81080000 u-boot.bin 
    and it comes up with the follow message:

    U-Boot SPL 2011.09 (Apr 08 2012 - 18:29:14)
    Texas Instruments Revision detection unimplemented
    spl: ERROR: This bootmode is not implemented - hanging### ERROR ### Please RESET the board ###


    u-boot generate 3 type of files: u-boot.img, u-boot and u-boot.bin  for Nand Flash seem to be correct u-boot.bin. Nevertheless it found u-boot but it continues with error.
     

    3) No bad blocks was marked and not identified. That is odd, the flash has not any bad block. How could i identify them?

    See what I did to identify them in first post..

  • Hi Daniel,

    You are using a quite old release of the SDK. I don't suggest that there are any problems with it, but keep that in mind. The latest SDK release is version 05.07.00.00.

    1) Yes, the pre-built images are OK to be written to NAND flash.

    2) You should use u-boot.img, not u-boot.bin.

    3) Did you by any chance perform a "nand scrub"? The scrub option will erase all factory set bad blocks and as far as I know there is no reliable way to recover them completely.

    Best regards,
    Miroslav

  • Dear Miroslav I update the u-boot version in http://arago-project.org/git/projects / u-boot-am33x.git   and now the nand boot is ok.

    I used the commands:

    U-Boot# mmc rescan
    U-Boot# nandecc hw 2

    U-Boot# nand erase.chip
    U-Boot# fatload mmc 0 0x81000000 MLO
    U-Boot# cp.b 0x81000000 0x81020000 20000
    U-Boot# cp.b 0x81000000 0x81040000 20000
    U-Boot# cp.b 0x81000000 0x81060000 20000
    U-Boot# fatload mmc 0 0x81080000 u-boot.img
    U-Boot# fatload mmc 0 0x81280000 uImage
    U-Boot# nandecc hw 2

    U-Boot# nand write 0x81000000 0x0 0x2000000

    thanks for your help.

    df.