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.

FLASH1.4 nand flash X-LOADER write Problem

Other Parts Discussed in Thread: AM3517

CPU:am3517

tool:FLASH1.4

flash1.4 configuration:

memory NANDINFO      driver Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin parameters gpmc 0x6E000000 cs 0 address 0x00000000 bberase 0 onfi 0 bpp 2048 sbpp 64 ppb 64 bpl 2048 l 1 acv 0x23 f 0x0018)

nand : K9F2G08U0B-PCB0

interface:USB

problem:

MLO had been downloaded to K9F2G08U0B-PCB0 succussfully,but there is no response after reset the boad.

the boot sequence is 0x101100(EMAC USB MMC1 NAND).

when inserted the SD card,it boot up rightly.I can compare the two MLO file between the SD card and the nandflash through the uboot cmp command,it is same.

so why?

FLASH 1.4 print info:

-stdout

-omap 3

-t 60

-p EVM_MDDR_MICRON_2G_EMIF

-2

chip_erase NANDINFOSWECC 40000

Leaving parameter file:temp_script.txt

@temp_script.txt

Looking for device (omap usb)

Please turn on device

Waiting for device (omap usb)

Found device (omap usb)

Awaiting ASIC id

AsicId items 05

AsicId id 01 05 01 34 30 07 58

AsicId secure_mode 13 02 01 00

AsicId public_id 12 15 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

AsicId root_key_hash 14 15 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

AsicId checksum 15 09 01 93 B6 BC 4A 00 00 00 00

Searching 2nd for: EVM_MDDR_MICRON_2G_EMIF 343007 58 GP

Loading second file Targets\2nd-Downloaders\dnld_startup_omap3_gp_2g.2nd

Entering parameter file:omapflash2nd.txt at line: 15

-pheriphalboot_reopen

Reading board configuration file Targets\Configurations\configuration_am35xxevm_micron_2g.txt

Reading definition file .\targets\definitions\definitions_omap3.txt

-board_config Targets\Configurations\configuration_am35xxevm_micron_2g.txt

Leaving parameter file:omapflash2nd.txt

Sending size of second file (0x00006804 bytes)

Transferring second file to target (0x6804 bytes)

Closing boot connection

Found device (omap usb)

Waiting for 2nd

Found 2nd

Looking for a driver for 'NANDINFOSWECC'

chip_driver NANDINFOSWECC Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin gpmc 0x6E000000 cs 0 address 0x00000000 bberase 0 onfi 0 bpp 2048 sbpp 64 ppb 64 bpl 2048 l 1 acv 0x23 f 0x0018 swecTxp...

Downloading driver

Downloading 'Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin'

 

Sending data (41724 bytes) :::::::::::::::..... [32764]

Sending data (41724 bytes) :::::::::::::::::::: [41724]

Sending data (41724 bytes) :::::::::::::::::::: [41724]

Interface 'OMAPFLASH DRIVER v5'

Driver 'NAND ONFI 16/8 BIT'

Driver configuration: gpmc = 0x6E000000

Driver configuration: cs = 0x00000000

Driver configuration: address = 0x00000000

Driver configuration: bberase = 0x00000000

Driver configuration: onfi = 0x00000000

Driver configuration: bpp = 0x00000800

Driver configuration: sbpp = 0x00000040

Driver configuration: ppb = 0x00000040

Driver configuration: bpl = 0x00000800

Driver configuration: l = 0x00000001

Driver configuration: acv = 0x00000023

Driver configuration: f = 0x00000018

Driver configuration: swecc = 0x00000001

NAND SW ECC

NAND BCH Mode = 0

NAND HWECC offset = 1, size = 12

NAND NONEv0 VENDOR 0x00 UNKNOWN

NAND 8 BIT DEVICE 0x00 UNKNOWN

NAND NAND CYCLES 0x23 (3 ROW, 2 COLUMN)

NAND 2048 BYTES/PAGE (SPARE 64)

NAND 64 PAGES/BLOCK (131072 BYTES/BLOCK)

NAND 2048 BLOCKS/UNIT (268435456 BYTES/UNIT)

NAND 256 MB TOTAL SIZE

NAND ONFI DRIVER INIT COMPLETE

Downloading complete

Elapsed time: 0:00.641 (65092 bytes/s)

End loading driver

Erasing

Erasing 262144 bytes starting at 0x00000000

 

Erase progress ::::::::::.......... [131072]

Erase progress :::::::::::::::::::: [262144]

NAND ERASED 262144 BYTES FROM ADDRESS 0x00000000 (0 BAD BLOCKS)

Elapsed time: 0:00.000

 

Console program success, exit code: 0

-stdout

-omap 3

-t 60

-p EVM_MDDR_MICRON_2G_EMIF

-2

chip_download NANDINFOSWECC E:\MLO

Leaving parameter file:temp_script.txt

@temp_script.txt

Looking for device (omap usb)

Please turn on device

Waiting for device (omap usb)

Found device (omap usb)

Awaiting ASIC id

AsicId items 05

AsicId id 01 05 01 34 30 07 58

AsicId secure_mode 13 02 01 00

AsicId public_id 12 15 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

AsicId root_key_hash 14 15 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

AsicId checksum 15 09 01 93 B6 BC 4A 00 00 00 00

Searching 2nd for: EVM_MDDR_MICRON_2G_EMIF 343007 58 GP

Loading second file Targets\2nd-Downloaders\dnld_startup_omap3_gp_2g.2nd

Entering parameter file:omapflash2nd.txt at line: 15

-pheriphalboot_reopen

Reading board configuration file Targets\Configurations\configuration_am35xxevm_micron_2g.txt

Reading definition file .\targets\definitions\definitions_omap3.txt

-board_config Targets\Configurations\configuration_am35xxevm_micron_2g.txt

Leaving parameter file:omapflash2nd.txt

Sending size of second file (0x00006804 bytes)

Transferring second file to target (0x6804 bytes)

Closing boot connection

Found device (omap usb)

Waiting for 2nd

Found 2nd

Looking for a driver for 'NANDINFOSWECC'

chip_driver NANDINFOSWECC Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin gpmc 0x6E000000 cs 0 address 0x00000000 bberase 0 onfi 0 bpp 2048 sbpp 64 ppb 64 bpl 2048 l 1 acv 0x23 f 0x0018 swecTxp...

Downloading driver

Downloading 'Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin'

 

Sending data (41724 bytes) :::::::::::::::..... [32764]

Sending data (41724 bytes) :::::::::::::::::::: [41724]

Sending data (41724 bytes) :::::::::::::::::::: [41724]

Interface 'OMAPFLASH DRIVER v5'

Driver 'NAND ONFI 16/8 BIT'

Driver configuration: gpmc = 0x6E000000

Driver configuration: cs = 0x00000000

Driver configuration: address = 0x00000000

Driver configuration: bberase = 0x00000000

Driver configuration: onfi = 0x00000000

Driver configuration: bpp = 0x00000800

Driver configuration: sbpp = 0x00000040

Driver configuration: ppb = 0x00000040

Driver configuration: bpl = 0x00000800

Driver configuration: l = 0x00000001

Driver configuration: acv = 0x00000023

Driver configuration: f = 0x00000018

Driver configuration: swecc = 0x00000001

NAND SW ECC

NAND BCH Mode = 0

NAND HWECC offset = 1, size = 12

NAND NONEv0 VENDOR 0x00 UNKNOWN

NAND 8 BIT DEVICE 0x00 UNKNOWN

NAND NAND CYCLES 0x23 (3 ROW, 2 COLUMN)

NAND 2048 BYTES/PAGE (SPARE 64)

NAND 64 PAGES/BLOCK (131072 BYTES/BLOCK)

NAND 2048 BLOCKS/UNIT (268435456 BYTES/UNIT)

NAND 256 MB TOTAL SIZE

NAND ONFI DRIVER INIT COMPLETE

Downloading complete

Elapsed time: 0:00.610 (68400 bytes/s)

End loading driver

Downloading

Downloading 'E:\MLO'

 

Sending data (18332 bytes) :::::::::::::::::::: [18332]

Sending data (18332 bytes) :::::::::::::::::::: [18332]

Downloading complete

Elapsed time: 0:00.312 (58756 bytes/s)

Elapsed time: 0:00.000

 

Console program success, exit code: 0

 

UBOOT cmp command print info

 AM3517_EVM # nand read.i 0x80000000 0 40000
NAND read: device 0 offset 0x0, size 0x40000
 262144 bytes read: OK
AM3517_EVM # mmc initmmc1 is available
AM3517_EVM # fatload mmc1 0 0x84000000 MLO

reading MLO

18332 bytes read
AM3517_EVM # cmp 0x80000000 0x84000000 40000

word at 0x8000479c (0xffffffff) != word at 0x8400479c (0x00000000)
Total of 4583 words were the same
AM3517_EVM #

  • when use 1-bit  HWECC ,problem also exist and cause  bad block in the first block when use U-BOOT nand bad command check. if use 1-bit SWECC,there is no bad block.

    we can download U-BOOT,uImage to nand flash successful by flash1.4.but only the X-loader cann't.

    SO what's the problem?

  • zhanghua:

    It looks like you have a 2Gbit (256MB) NAND device with 8-bit interface.   Select "Custom AM35xx Board" as target type in flash tool.   Change the parameters to be like this in the file:

    C:\Program Files\Texas Instruments\Flash v1.4\Targets\Configurations\configuration_custom_am35xx.txt

    memory NANDINFO      driver Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin parameters gpmc 0x6E000000 cs 0 address 0x30000000 bberase 0 onfi 0 bpp 2048 sbpp 64 ppb 64 bpl 4096 l 1 acv 0x23 f 0x0018
    memory NANDINFOBCH4  driver Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin parameters gpmc 0x6E000000 cs 0 address 0x30000000 bberase 0 onfi 0 bpp 2048 sbpp 64 ppb 64 bpl 4096 l 1 acv 0x23 f 0x0018 bch 4
    memory NANDINFOBCH8  driver Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin parameters gpmc 0x6E000000 cs 0 address 0x30000000 bberase 0 onfi 0 bpp 2048 sbpp 64 ppb 64 bpl 4096 l 1 acv 0x23 f 0x0018 bch 8
    memory NANDINFOSWECC driver Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin parameters gpmc 0x6E000000 cs 0 address 0x30000000 bberase 0 onfi 0 bpp 2048 sbpp 64 ppb 64 bpl 4096 l 1 acv 0x23 f 0x0018 swecc 1
    memory SDRAM         parameters address 0x80000000

    1) f 0x0018 specifies 8-bit interface to NAND

    2) address 0x30000000 is the base address of the NAND  (You had 0 - depends on base addr of NAND in your system.)

    3) However, if your device is ONFI compliant you can just check "ONFI Compliant NAND" in flash tool and you won't have to worry about getting the above parameters

    above correct, flash tool will read the configuration form the NAND device.  (You need to have address=0x3000000 correct - depending on the base address of the NAND

    device in your system.)

    4) x-loader must always be programmed into NAND using HWECC, 1-bit ECC.  That is the only format the ROM boot loader works with.  You used SWECC.

    3) With PSP software prior to version v03.00.01.06 , u-boot and kernel needed to be programmed using SWECC, 1-bit ECC.

        But in current PSP version, the ECC format defaults to 4-bit BCH format.  The ability to build x-loader, u-boot and kernel for different ECC modes has

        been added.    See this wiki page for how to build PSP software for different ECC formats.

        http://processors.wiki.ti.com/index.php/Error_Correction_User_Guide

    4) See this wiki for an example of how to program flash for our AM3517EVM.

    http://processors.wiki.ti.com/index.php/Flash_v1.4_User_Guide#Example_2:.C2.A0_Flashing_the.C2.A0AM3517A_Evaluation_Module

    5) If you have earlier PSP software, you would do it this way

        x-loader: HWECC, 1-BIT, OFFSET=0

      u-boot: SWECC, 1-bit, OFFSET=80000

      kernel: SWECC, 1-bit, OFFSET=280000

    6) Make sure NAND is erased before programming

    Regards,

    Michael T

    PS: Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

     

     

     

  • thanks for your reply,we nend more help.thanks.

    1) X-LOADER VERSION:v03.00.00.04,so the ECC format defaults to  HWECC, 1-bit ECC

    2) 2Gbit SUMSUNG K9F2G08U0B NAND FLASH para is:1page=(2k+64)bytes,1block=64pages,1device=2048blocks.

    NAND chip select  is  CS0, the base addr is 0x000000000 .so i set the NANDINFO like this:

    memory NANDINFO      driver Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin parameters gpmc 0x6E000000 cs 0 address 0x00000000 bberase 0 onfi 0 bpp 2048 sbpp 64 ppb 64 bpl 2048 l 1 acv 0x23 f 0x0018

    does this setting ok? 

    and i also try address  0x30000000,it still fail.

    3)when select ONFI,there is error to read ONFI info whatever set  base addr  to 0x00000000  or 0x30000000 .

    Sending data (40768 bytes) :::::::::::::::::::: [40768]

    Interface 'OMAPFLASH DRIVER v5'

    Driver 'NAND ONFI 16/8 BIT'

    Driver configuration: gpmc = 0x6E000000

    Driver configuration: cs = 0x00000000

    Driver configuration: address = 0x30000000

    Driver configuration: bberase = 0x00000000

    Download failed (final data response error): Remote: : Driver init error 0x00000011 - DRIVER UNABLE TO READ ONFI INFORMATION FROM DEVICE

    Elapsed time: 0:03.812 (13589 bytes/s)

    Operation FAILED (Remote: : Driver init error 0x00000011 - DRIVER UNABLE TO READ ONFI INFORMATION FROM DEVICE)

    Elapsed time: 0:00.000

    why?

    4)when use 1-bit  HWECC ,problem also exist and cause one bad block in the first block when use U-BOOT nand bad command check. if use 1-bit SWECC,there is no bad block.

    why 1-bit  HWECC download cause the bad block? or u-boot (nand bad )command is not suitable for this check?

    5)NAND is erased before programming every time.

    6)I can download U-BOOT,uImage to nand flash successful use SWECC by flash1.4.but only the X-loader cann't even if use HW ECC.

    If copy MLO from SD card to NAND Flash by u-boot(hwecc) command ,it will boot successfully.but cause two bad block on 0x00000000 and 0x000020000.

    the bad block number exist a small difference between FLASH1.4 HWECC download and u-boot download,.

    USE  FLASH1.4 only cause one bad block in the first block 0x00000000 

    7)I had try FLASH v1.5.1.0 and  X-LOADER VERSION:v03.00.01.06, fail also.

     

     

     

     

     

     

     

     

  • Zhanghua:

    1. If you get "UNABLE TO READ ONFI" msg, the device is not ONFi compliant so you just need to specify the NANDINFO configuration as you are doing.

    2. X-LOADER VERSION:v03.00.00.04 seems like a very old version.  Where did that originate from?  Downloaded from TI?

    3. Your NANDINFO entry looks OK.  I researched the "address" parameter.  I see where it is passed into the flash tool program but It always gets converted

        to offset from start of NAND.  It is not clear to me how you know what this parameter needs to be in a given system.

    memory NANDINFO      driver Targets\Flash-Drivers\nand_onfi_16bit_8bit.bin parameters gpmc 0x6E000000 cs 0 address 0x00000000 bberase 0 onfi 0 bpp 2048 sbpp 64 ppb 64 bpl 2048 l 1 acv 0x23 f 0x0018

    NANDINFO will be used when HWECC 1-bit is used, which must be used for x-loader.  You can program x-loader up to four times using offsets of 0, 20000, 40000 and 60000.  ROM boot loader will try to load each one in succession until successful.

    4. I am not familiar with x-loader v3.0.0.4.   Need to distinguish between the ECC mode that must be used when programming x-loader (which must be HWECC 1-bit)

        and the ECC mode the x-loader binary will expect to use when reading u-boot and kernel from NAND (which I would guess is SWECC).

        Need to setup the NANDINFOSWECC configuration for that.  must program u-boot and kernel into NAND using SWECC.

    5. After flashing can you do these u-boot commands andpost the results?   From that we can tell how the ECC is programmed in spare area.

         nand dump 0

         nand dump 20000

         nand dump 40000

         nand dump 60000

         nand dump 80000

         nand dump 280000

    6. nand bad u-boot command is also applicable.  Should match report from flash tool.  Can you also post flash tool text output where problem occurs?

    Regards,

    Michael T

    PS: Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

  • 1. we get  X-LOADER VERSION:v03.00.00.04  from TI distributer(realtime), and I also try the newest VERSION:v03.00.01.06

    2. cs 0 address 0x00000000 setting is just a hardware think, As you said,It is not important.

    3. I compared the code of  x-loader v3.0.0.4 and v03.00.01.06 ,if compiling para set as

    make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm PLATFORM_RELFLAGS+=-DONE_BIT_ERROR_CORRECT ,there are same.

    4. After  download by FLASH tool,The results of dump command are 7851.flash.txt

    5. If download by UBOOT,The results of dump command are:7827.u-boot.TXT

    6. After compared flash.txt and u-boot.txt,we find two difference in page 00000000 and 00020000 OOB position.other OBB in page 0x80000 and 0x280000 are same.

    Why difference only exist in OOB position? I think maybe this is the key factor that cause failure in booting.

    Code  downloaded by UBOOT is OK and can boot sucessfully.

    Does this mean the OOB generated by flash tool are wrong?

    Does this problem  related to ONFI selection?

    flash tool download:

    Page 00000000

    OOB:
     ff b1 b1 22 6e 91 b4 cd
     32 4b 8a 75 1e ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff

    Page 00020000

    OOB:
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff

    u-boot download:

    Page 00000000

    OOB:
     ff 6f 90 c3 a7 a7 aa b6
     49 0f 55 aa 78 ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff 

    Page 00020000

    OOB:
     ff 00 00 00 00 00 00 00
     00 00 00 00 00 ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff
     ff ff ff ff ff ff ff ff

    7.  flash tool don't report nand bad block and selection of erase command can take bad mark off.

    flash tool download:

    AM3517_EVM # nand bad
    Device 0 bad blocks:
      00000000

    u-boot download

    AM3517_EVM # nand bad
    Device 0 bad blocks:
      00000000 
      00020000

     

    thanks

    best regards

  • Zhanghua:

    The first two bytes of OOB in the first page of a block have the bad block marker.  These two bytes are normally "ff  ff" for a good block

    and "00 00" for a bad block.    Anything other than "ff  ff" probably is interpreted as a bad block.

    I have a couple of questions about the nand operations using u-boot

    1) It is not clear to me how u-boot knows that the NAND device has an 8-bit interface (especially since not ONFI compliant).

        I will look into that.

    2) If you use the latest u-boot, you have to tell it which ECC mode to use.  For example: "nandecc swecc" is needed before

        writing to nand with u-boot for swecc mode (4-bit BCH is default).   See ECC User Guide here:

       http://processors.wiki.ti.com/index.php/Error_Correction_User_Guide

    3) If you use Flash Tool and program x-loader 4 times at offsets 0, 20000, 40000, 60000 does the board boot from NAND?

        Is the nand dump output the same for all 4 (except for bad block)?

    Regards,

    Michael T

    PS: Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

     

  • Michael.

    I got the problem.

    the para  GPMC_CONFIG1_0     should set to be  0x00000800 for 8-bit nand device.

    now it can boot sucessfully.

    thanks for your patience.

     

     

  • Zhanghua:

    Just wondering...did you have to make that change in your x-loader source code?

    Regards,

    Michael T

  • NO need to change x-loader.

    only set  GPMC_CONFIG1_0  in  configuration_am35xxevm_micron_2g.txt  to be  0x00000800 for 8-bit nand device.

    In X-loader and u-boot, we had defined the MACRO NAND_8BIT,SO the Program know what the device is.

    that all.thanks.