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.

DM385 + IPNC RDK3.5 + U-boot 2010 -> how to flash nand from uboot?

Other Parts Discussed in Thread: DM385

Hi Guys,

We are using Spansion 8-bit NAND, we were able to detect NAND info.

i have followed above document for

Flashing 1st stage to NAND from 2nd stage in SD boot & Flashing 2nd stage to NAND from 2nd stage in SD boot

as we are booting from sd card.

we are able to write.

Now we want to copy uImage and filesystem in to NAND. how to do it?

Logs in case:

DRAM:  1 GiB
NAND:  
nand_init_chip -> NAND base_addr-> 8000000
Searching for NAND device @ GPMC CS:0
board_nand_init : NAND is 8-bit
HW ECC BCH8 Selected
DM385 -> Busw: 0
DM385 : GPMC -> 810 CONTROL_STATUS -> 317
nand_get_flash_type: READ ID 01,f1 against 01,f1
128 MiB
MMC:   : 0, ON-BOARD SDIO: 1
Net:   cpsw
 0
DM385_IPNC#fatls mmc 0
    83296   mlo
   211016   u-boot.bin
  2637408   uimage
   108460   u-boot.min.nand
   211192   u-boot_nand.bin

5 file(s), 0 dir(s)

thanks & regards,

Ganesh

  • Hi Ganesh,

    Do you finally fix your NAND detect issue from the below e2e thread?
    e2e.ti.com/.../534173

    Regarding flashing linux kernel uImage from SD u-boot, see the below pointer:

    processors.wiki.ti.com/.../TI81XX_PSP_UBOOT_User_Guide

    In your case you should use SD command (not TFTP) to copy uImage from SD card to memory.

    TI81XX_EVM# mmc rescan 0
    TI81XX_EVM# mw.b 0x81000000 0xFF 0x20000
    TI81XX_EVM# fatload mmc 0 0x81000000 uImage

    See also if the below pointers will be in help:

    www.ti.com/.../sprui83.pdf
    e2e.ti.com/.../1169674

    Regards,
    Pavel
  • Hi ,

    Yes we have fixed the NAND flash issue today only. software side we have to change some register.

    pavel we have faced some minor issue i need some clarification.

    we got some error:
    DM385_IPNC#mmc rescan 0
    DM385_IPNC#mw.b 0x81000000 0xFF 0x20000
    DM385_IPNC#fatload mmc 0 0x81000000 u-boot.min.nand
    reading u-boot.min.nand

    108192 bytes read
    DM385_IPNC#nand erase 0x0 0x20000

    NAND erase: device 0 offset 0x0, size 0x20000
    Skipping bad block at 0x00000000

    OK
    DM385_IPNC#nand write.i 0x81000000 0x0 0x20000

    NAND write: device 0 offset 0x0, size 0x20000
    Skip bad block 0x00000000
    Skip bad block 0x00020000
    ....
    Skip bad block 0x07fa0000
    Skip bad block 0x07fc0000
    Skip bad block 0x07fe0000
    NAND write to offset 8000000 failed -22
    0 bytes written: ERROR


    any help how to avoid these. actually nand flash has some images which i need to erase and overwrite my new binaries.

    nand erase chip failed

    Skip bad block 0x07fc0000
    Skip bad block 0x07fe0000
    NAND write to offset 8000000 failed -22
     0 bytes written: ERROR

    One clarification: Is it possible to flash nand many times? Because if nand is flashed first time we will not face any issue but if we try to flash new binaries i'm getting above errors.

    regards,
    Ganesh

  • Ganesh,

    The u-boot.min.nand should be written in the range from 0x00000000 to 0x0001FFFF (~130K), and your u-boot.min.nand is ~0.1K (108192). But you have so many bad blocks that it overlaps to the rest of the NAND layout regions:

    processors.wiki.ti.com/.../TI81XX_PSP_UBOOT_User_Guide

    Is this new NAND or it was already used? The NAND chip can be re-flashed many times, but it has write/erase cycles limit and can be wear out. The number of these cycles are documented in the NAND chip datasheet. For example, the MT29F2G16AAD chip has "Endurance: 100,000 PROGRAM/ERASE cycles"

    To view the list of bad blocks:
    TI81XX_EVM# nand bad

    If multiple continuous bad blocks are reported on the NAND flash in the Uboot, run the 'nand scrub' command once. Some good blocks are incorrectly marked bad in this case. Running the 'nand scrub' command once fixes this issue.

    See also if the below e2e threads will be in help:

    e2e.ti.com/.../236820
    e2e.ti.com/.../368352

    Regards,
    Pavel
  • HI Pavel,

    DM385_IPNC#nand scrub

    NAND scrub: device 0 whole chip
    Warning: scrub option will erase all factory set bad blocks!
    There is no reliable way to recover them.
    Use this command only for testing purposes if you
    are sure of what you are doing!

    Really scrub this NAND flash? <y/N>
    Erasing at 0x1ae0000 -- 21% complete.
    nand0: MTD Erase failure: -5
    Erasing at 0x7fe0000 -- 100% complete.
    OK
    DM385_IPNC#mmc rescan 0
    DM385_IPNC#mw.b 0x81000000 0xFF 0x20000
    DM385_IPNC#fatload mmc 0 0x81000000 u-boot.min.nand
    reading u-boot.min.nand

    108192 bytes read
    DM385_IPNC#nand erase 0x0 0x20000

    NAND erase: device 0 offset 0x0, size 0x20000
    Skipping bad block at 0x00000000

    OK
    DM385_IPNC#nand write.i 0x81000000 0x0 0x20000

    NAND write: device 0 offset 0x0, size 0x20000
    Skip bad block 0x00000000
    Skip bad block 0x00020000


    It's a new spansion flash pavel. so only one time we flashed.

    EDIT:

    Pavel i have solved the issue. it was timing issue. One more help i need can you just help in programming my NAND like at what address range i should maintained for u-boot.min.nand, u-boot.bin, uImage & (How to create filesystem first link only tell what utility you need but not clearly how to create .img from filesystem). One little help more: About bootargs from uboot in NAND flash.


    regards,
    Ganesh

  • Ganesh Biradar said:
    can you just help in programming my NAND like at what address range i should maintained for u-boot.min.nand, u-boot.bin, uImage

    The address range is as below:

    Ganesh Biradar said:
    (How to create filesystem first link only tell what utility you need but not clearly how to create .img from filesystem)

    UBIFS is recommended (over JFFS2). For how to create and use ubi.img, see the below pointers:

    Ganesh Biradar said:
    One little help more: About bootargs from uboot in NAND flash.

    See the below pointers regarding bootargs:

    Regards,
    Pavel