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.

flash_utils error while writing nand flash(K9F1208)

hi,all:
i just make my new board ,based on dm355. the chip's silicon version is 1.1.
so i use flash_utils.tar.gz to flash the data. however, i got the problem:
(using the dm35x directory, not dm35x_revc)
<<<1>>> erase , seems ok:
...
DONE received.  UBL was accepted.
UBL transmitted successfully.

Waiting for SFT on the DM35x...
        Target: Starting UART Boot...
        Target: BOOTUBL
BOOTUBL commmand received. Returning CMD and command...
CMD value sent.  Waiting for DONE...
        Target:    DONE
DONE received. Command was accepted.
        Target: Unprotecting blocks 0x00000001 through 0x00000031.
        Target: Erasing block 0x00000001 through 0x00000031.
        Target: Erase completed successfully.
        Target: Protecting the entire NAND flash.
        Target:    DONE
        Target:    DONE
Operation completed successfully.
...
<<<2>>> flash it:
>/ sfh_dm35x.exe -nandflash ubl uboot -p COM4
.............
Flashing NAND with ubl_DM35x_nand.bin and u-boot-mine.bin.
DONE received. Command was accepted.
Sending the UBL image
Waiting for SENDIMG sequence...
SENDIMG received. Returning ACK and header for image data...
ACK command sent. Waiting for BEGIN command...
BEGIN commmand received.
Waiting for DONE...
DONE received.  All bytes of image data received...
        Target: Writing UBL to NAND flash
        Target: Unprotecting blocks 0x00000001 through 0x00000018.
        Target: Number of blocks needed for header and data: 0x0x00000001
        Target: NAND block 0x00000001 is bad!!!
        Target: NAND block 0x00000002 is bad!!!
        Target: NAND block 0x00000003 is bad!!!
        Target: NAND block 0x00000004 is bad!!!
        Target: NAND block 0x00000005 is bad!!!
        Target: NAND block 0x00000006 is bad!!!
        Target: NAND block 0x00000007 is bad!!!
        Target: NAND block 0x00000008 is bad!!!
        Target: NAND block 0x00000009 is bad!!!
        Target: NAND block 0x0000000A is bad!!!
        Target: NAND block 0x0000000B is bad!!!
        Target: NAND block 0x0000000C is bad!!!
        Target: NAND block 0x0000000D is bad!!!
        Target: NAND block 0x0000000E is bad!!!
        Target: NAND block 0x00000016 is bad!!!
        Target: NAND block 0x00000017 is bad!!!
        Target: NAND block 0x00000018 is bad!!!
        Target: No good blocks in allowed range!!!
        Target: Writing failed!Starting UART Boot...
        Target: BOOTUBL
Waiting for SFT on the DM35x...
        Target: Starting UART Boot...
        Target: BOOTUBL
.........
==============================
so why are there so many bad blocks? my nand flash is absolutely new!
 
  • it seems the number of block is not corrent.

    for K9F1208, it has 4096 blocks, but the erasing function just found 0x31 blocks. i should check the sft code :(

  • it's really very strange.

    i got the right ID: DM3xx=>>: ID = 0x000000EC0x000000760x0000005A0x0000003F
    but i cannot get right data.
    DM3xx=>>: spreads:0x000000000x00000000 //spread[5] and spread[6]
    DM3xx=>>: 1 err:0x0000002A0x00000000
    DM3xx=>>: NAND block 0x00000001 is bad!!!
    DM3xx=>>: spreads:0x000000000x00000000
    DM3xx=>>: 1 err:0x0000002A0x00000000
    DM3xx=>>: NAND block 0x00000002 is bad!!!
    DM3xx=>>: spreads:0x000000000x00000000
    DM3xx=>>: 1 err:0x0000002A0x00000000
    DM3xx=>>: NAND block 0x00000003 is bad!!!
    DM3xx=>>: spreads:0x000000000x00000000
    DM3xx=>>: 1 err:0x0000002A0x00000000
    what's the matter?  the chip is a fake??

  • Liu,

    From the logs it appears that the flash_utils is not able to talk to NAND.

    The first step is to make sure that the NAND is supported. Can you please refer to Section 11.2.1.2 (http://focus.ti.com/lit/ug/sprufb3/sprufb3.pdf) to confirm if this NAND is supported by ROM bootloader (RBL).

    The latest version of flash_utils works for the NANDs supported by RBL. What is the version of the flash_utils you are using. From where is it downloaded?

    Can you provide details about the NAND and I can help you identify if the NAND is supported:
    1. Part no.
    2. Device ID, Page size, Block size, Address cycles (from the datasheet)

    Thanks,
    Gaurav

  • hi,Gaurav:

    i use the GUN tools. flash_utils.tar.gz, it seems the sfh.exe version is 1.5.
    i use the uart-boot mode.so sfh.exe is the only choice.
    now I can read the flash ID,(K9F1208U0C):ID = 0x000000EC0x000000760x000000A50x000000C0
    but i cannot write data to page, so i cannot use UBOOT! Therefor i doubt that uboot also has the same problem?
    i have tried several days, but cannot figure it out yet!
    help!
    regards!

  • Liu,

    Device ID 0x76 indicates the following (Section 11.2.1.2, ARM SS guide) about the NAND geometry:

    Number of pages per block:32
    Page size:512+16
    Block Shift value:13
    Address cycles: 4

    If this information matches with the information in the datasheet, then the NAND is supported.
    In that case, the next step is to verify the hardware connection on the board. All the required pins should be connected properly.

    The block is declared BAD by the flash utility if:
    1. The block is marked BAD, or
    2. The read (after write) doesn't return the expected data (which was written).

    Please use debug techniques (printf etc in flash utility) to figure out if the problem is 1 or 2. If the problem is 2, and given that the NAND is supported, the problem is likely to be with the layout/hardware connection.

    I would like to also suggest trying mutiple NANDs (in case one particualr NAND is BAD). Also if you have access to DM35x socketed EVM, you can try the NAND on the EVM.

    Thanks,
    Gaurav

     

     

  • hi,Gaurav .

    the K9F1208 is support by the SFH. and now it has no connection with RBL. I use SFT to erase and write NAND flash.

    From SFT, i printf something. The SFT can recognize the flash ID and params. Most important is , the ID I printf through UART is correct.(the SFT will first recognize nand flash ID ,and determine it's timing. So sending cmd and address and reading data will be not a hardware problem.)

    I use the command: sfh.exe -nanderase , and it operates successfully.

    but everytime after i wirte the data(not 0xff) to the page , and i read it, the 0xFF will return :( .

    I checked the hardware connection, and it is OK (every nand signal is valid).

    So i think it is the software problem.

    I reconfigure the A1CR register:

    AEMIF->A1CR = (1<<30)|

       (0x0f<<26)|

       (0x3f<<20)|

       (0x07<<17)|

       (0x0F<<13)|

       (0x3F<<7)|

       (0x07<<4)|

       (0x03<<2)|

       (0x00<<0);

     

     

    finally ,it does not work as before.

  • "The CE input is the device selection control. When CE goes high during a read operation the device is returned to standby mode." This is from K9F1208 Datasheet. Tie CE to ground and try again. Had this problem with K9F5608. But remember, as long as CE is low, the nand device is active and will occupy the EMIF.

  • Thanks Josef.

    Liu,

    Is your issue resolved?

    Regards,
    Gaurav

  • Josef Kohler said:

    "The CE input is the device selection control. When CE goes high during a read operation the device is returned to standby mode." This is from K9F1208 Datasheet. Tie CE to ground and try again. Had this problem with K9F5608. But remember, as long as CE is low, the nand device is active and will occupy the EMIF.

    I really appreciate Josef.

    It is really the damn reason of CE pin. why nobody fix the error? s-h-i-t!

    Thank you both for helping me . In this situation, will the DM355 boot stably ?


     

  • This is not an error, this only means your NAND is too old. DM355 requires a NAND device witch supports the CE-dont-care funtion. Tie CE pin to ground will work with your system, but remember that you can not use any other device on EMIF (like DM9000A on EVM) anymore. I solved this problem by using another NAND device. K9F1G08 is the smallest NAND device from Samsung supporting CE-dont-care. I am usung it, and it works fine. Maybe you think about it.

  • well ,that is a terrible news.

    1GBit is too expensive for my application .i checked APPRO's DM355_IPNC solution, and found it also used K9F5608 :)

    datasheet said it support device id "0x76", could you recommend a cheap one for me ? 

  • K9F5608 has same problem with CE-dont-care. Appro drives CE pin with GPIO. The other problem of K9F5608, production will exprie within this year. If device cost is realy that critical in your applicatin, i think you are going to sell many systems. In this case talk to Samsung Semiconductor, perhaps you get access to FPGA NAND.

  • thanks.

    Now i am tracing u-boot, it will restart sometimes. I have drive CS0 to low as a GPIO. when it runs to nand_scan(), the uart has no response anymore. Don't know why yet.

  • Hi,

    Could it be the GPIO pin used to drive the CS low one of the UART pins? Would you double check?

    Thanks.