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.

problem about uart boot for am3358

My MLO 、u-boot and kernel works quite well for a very very long time. Today , I tried to boot my board form uart, a problem bothered me : the u-boot alway told : no nand flash found!!  What happened? how should i do?Thank you!

PS: There's  no problem for the DIP switchs setting for boot sequence .

  • Is this a custom board? What Linux version are you using?

  • Hi,

    What command did you use to compile the U-Boot?

    Sichao Tang said:
    the u-boot alway told : no nand flash found!!

    Did you mean "No NAND device found!!!" ? This will happen in the nand_scan_ident() function inside <u-boot_dir>/drivers/mtd/nand/nand_base.c, which scans for NAND devices. There is the following call:

        /* Read the flash type */
        type = nand_get_flash_type(mtd, chip, busw,
                    &nand_maf_id, &nand_dev_id, table);

        if (IS_ERR(type)) {
    #ifndef CONFIG_SYS_NAND_QUIET_TEST
            printk(KERN_WARNING "No NAND device found!!!\n");
    #endif
            chip->select_chip(mtd, -1);
            return PTR_ERR(type);
        }

    , which obviously returns an error. You need to check what type of error is returned from the nand_get_flash_type() function in order to analyse further.

    Best regards,
    Miroslav

  • I used the following command for compiling:

    make O=am335x  am335x_evm

    My  u-boot works well when my board booting from mmc or nand. Only when booting via uart, the u-boot cannot find nand flash.

  • The build command is correct.

    Please print the return value of the nand_get_flash_type() function. Better yet, put some print statements before each return inside the nand_get_flash_type() function, so that we know what goes wrong with the NAND detection.

    Best regards,
    Miroslav

  • Hi,

    I inserted some output statements inside nand_get_flash_type() function. And  it shows that ,when booting from NAND and MMC, the u-boot can grub the Manufacturer ID and Device ID correctly;But if I try to boot via UART,  the  Manufacturer ID and Device ID read by u-boot  are both ZERO. The logs are as following:

    Booting from NAND:

    U-Boot# CCC
    U-Boot SPL 2012.10 (Dec 11 2013 - 13:55:02)
    >>spl:board_init_r()
    boot device - 5
    spl: nand - using hw ecc
    spl: payload image: U-Boot 2012.10 for am335x board load addr: 0x807fffc0 size: 397668
    Jumping to U-Boot
    image entry point: 0x80800000
    U-Boot 2012.10 (Jan 06 2014 - 11:49:00)
    U-Boot code: 80800000 -> 80857DB4 BSS: -> 808AA8D8
    I2C: ready
    monitor len: 000AA8D8
    ramsize: 10000000
    TLB table at: 8fff0000
    Top of RAM usable for U-Boot at: 8fff0000
    Reserving 682k for U-Boot at: 8ff45000
    Reserving 1152k for malloc() at: 8fe25000
    Reserving 32 Bytes for Board Info at: 8fe24fe0
    Reserving 120 Bytes for Global Data at: 8fe24f68
    New Stack Pointer is: 8fe24f58
    RAM Configuration:
    Bank #0: 80000000 256 MiB
    relocation Offset is: 0f745000
    WARNING: Caches not enabled
    monitor flash len: 00061124
    Now running in RAM - U-Boot at: 8ff45000
    NAND: Manufacturer ID: 2c    <------- the ID value is right
    Device ID : da
    0
    -1879534528                  <------- the return value is right
    256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
     
     
    Booting via UART:
    CC
    Starting ymodem transfer. Press Ctrl+C to cancel.
      100% 347 KB 3 KB/s 00:01:29 0 Errors
    Loaded 355796 bytes
    U-Boot 2012.10 (Jan 06 2014 - 13:37:51)
    I2C: ready
    DRAM: 256 MiB
    WARNING: Caches not enabled
    NAND: Manufacturer ID: 0        <------- the ID value is zero
    Device ID : 0
    0
    error pos:1
    -19                             <------- the return value is -ENODEV
    No NAND device found!!!
    0 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 

     

  • Hi,

    Please provide information about the state of your SYSBOOT pins (0-15) in both cases, NAND boot and UART boot? Are you only changing SYSBOOT pins 0-5 ?

    Please also provide information about which processor pins are you connecting to the NAND flash? The WAIT signal?

    Best regards,
    Miroslav

  • My  SYSBOOT pins  from  bit 15 to bit 0 in both cases are 01000000 00000100. 

    The information about processor pins connected to the NAND flash,Please check the pictures,as follows :

                                                                                                                

  • HI,

    I solved this problem.

    First , I must set  SYSBOOT pins (from  bit 15 to bit 0) as  01000000 00000001 ,but  no documents describe that  the SYSBOOT pins must be  setting as 01000000 00000001 ;

    Second, I must wait for some 'C'  printed by the ROM code.  If there is no wait ,or if I finished setting Xmodem first ,then power on the board , although the u-boot can be loaded and run ,  the u-boot will find no NAND.

    So, is this a bug? 

     

    Thanks 

  • Hi,

    I just tried both cases, having set Xmodem first and setting Xmodem after some 'C' characters are printed on the AM335x GP EVM and the NAND flash is detected by U-Boot in both cases. There doesn't seem to be a bug in the ROM code.

    Best regards,
    Miroslav

  • HI,

    I have another question: SYSBOOT pins (from  bit 4 to bit 0) must be  00001 ?

    If it's true, why there are so many boot settings which will boot via UART first? If false, I don't know what happened.

    Would you please have a try on your GP EVM?Thank you!

     

    Best regards

  • Hi,

    I have tried the following SYSBOOT configurations (bits 4-0) on the AM335x GP EVM:

    00001
    00010
    00100

    All three UART0 boot configurations work as expected and the NAND flash is detected.

    Best regards,
    Miroslav

  • Hi,

    Thank you!

    I will try to find out the reasons.

    Best regards,

    Simon Tang