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.

AM335x evm always boot from NAND ( SD card problem)

Hi,

I'm unable to make the AM335x evm board boot from the SD-card. it always boot from the NAND ( see attached file for u-boot log)

I tried several DIP switches config but none ofthem seems to work. 

Here are the DIP switch configs I tried : 

http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide#Boot_Switch_Settings

http://processors.wiki.ti.com/index.php/TI-Android-ICS-4.0.3-DevKit-3.0.1_DevelopersGuide#Booting_the_Platform

http://processors.wiki.ti.com/index.php/AM335X_StarterWare_Booting_And_Flashing#Boot_Modes ( 11100 & 10111 )

And I'm aware that " ON is labeled on the wrong side of SW3 boot mode switch "

I really appreciate your help.

Thanks in advance.

B.R

  • Hi Hafedh,

    I can't find the attached log file. Could you please attach it again?

    Best regards,
    Miroslav

  • Hi,

    Please set as mentioned below as its working on my AM335x EVM for SD boot.

    SW4 - switch pins towards ON side if mentioned else off side...

    1    2    3   4   5   6   7   8

    on on on on on on off on

    SW3 - switch pin towards ON side...

    1    2    3   4   5   6   7   8

    off off off on off on on on

     

  • Hi Miroslav,

    I was able to solve the problem "temporary" by erasing the NAND.

    So, here's the u-boot log for SD card DIP switches config.

    Thank you in advance.

    Best regards

    U-Boot SPL 2011.09-00381-g6309768 (Mar 13 2013 - 14:41:38)                                           
    Texas Instruments Revision detection unimplemented                                                   
    Found a daughter card connected                                              
    OMAP SD/MMC: 0                                                               
    reading u-boot.img                                   
    reading u-boot.img                                   
                                                         
                                                         
    U-Boot 2011.09-00381-g6309768 (Mar 14 2013 - 13:22:41)
                                                         
    I2C:   ready
    DRAM:  256 MiB
    WARNING: Caches not enabled
    Found a daughter card connected
    NAND:  HW ECC Hamming Code selected
    256 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Net:   cpsw
    Hit any key to stop autoboot:  0 
    Booting from nand ...
    HW ECC BCH8 Selected
    
    NAND read: device 0 offset 0x280000, size 0x500000
     5242880 bytes read: OK
    ## Booting kernel from Legacy Image at 81000000 ...
       Image Name:   Linux-3.2.0-gb02ab39
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    3574368 Bytes = 3.4 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK
    
    Starting kernel ...
    
    
    

  • Hi,

    Vageesh KM said:

    SW4 - switch pins towards ON side if mentioned else off side...

    1    2    3   4   5   6   7   8

    on on on on on on off on

    SW3 - switch pin towards ON side...

    1    2    3   4   5   6   7   8

    off off off on off on on on

    This is the DIP switch config that I was using but I had to erase the NAND in order to

    make the board boot from the SD card.

    I don't know if it's the expected behavior or not .

    Best regards

  • Hi Hafedh,

    It seems like your U-Boot is loaded from the SD-Card correctly, but the Kernel is then read from the NAND memory.

    What are the contents of your SD-Card?

    Please interrupt the U-Boot timer:

    Hit any key to stop autoboot:  3

    and post the results of the following command in U-Boot: print - this will print all the U-Boot environment settings.

    Best regards,
    Miroslav

  • Hi,

    I erased my NAND content so, I hope that the u-boot print command's output still relevant.

    Best Regards 

    U-Boot SPL 2011.09-00381-g6309768 (Mar 25 2013 - 17:04:06)
    Texas Instruments Revision detection unimplemented
    Found a daughter card connected
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img
    
    
    U-Boot 2011.09-00381-g6309768 (Mar 25 2013 - 17:04:06)
    
    I2C:   ready
    DRAM:  256 MiB
    WARNING: Caches not enabled
    Found a daughter card connected
    NAND:  HW ECC Hamming Code selected
    256 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Warning - bad CRC, using default environment
    
    Net:   cpsw
    Hit any key to stop autoboot:  0 
    U-Boot# print
    autoload=yes
    baudrate=115200
    bootargs_defaults=setenv bootargs console=${console} ${optargs}
    bootcmd=if mmc rescan; then echo SD/MMC found on device ${mmc_dev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd;
    bootdelay=3
    bootenv=uEnv.txt
    bootfile=uImage
    console=ttyO0,115200n8
    ethact=cpsw
    ethaddr=00:18:31:e0:a3:df
    importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
    ip_method=none
    kloadaddr=0x80007fc0
    loadaddr=0x82000000
    loadbootenv=fatload mmc ${mmc_dev} ${loadaddr} ${bootenv}
    mmc_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${mmc_root} rootfstype=${mmc_root_fs_type} ip=${ip_method}
    mmc_boot=run mmc_args; run mmc_load_uimage; bootm ${kloadaddr}
    mmc_dev=0
    mmc_load_uimage=fatload mmc ${mmc_dev} ${kloadaddr} ${bootfile}
    mmc_root=/dev/mmcblk0p2 rw
    mmc_root_fs_type=ext3 rootwait
    nand_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${nand_root} noinitrd rootfstype=${nand_root_fs_type} ip=${ip_method}
    nand_boot=echo Booting from nand ...; run nand_args; nandecc hw 2; nand read.i ${kloadaddr} ${nand_src_addr} ${nand_img_siz}; bootm ${kloadaddr}
    nand_img_siz=0x500000
    nand_root=ubi0:rootfs rw ubi.mtd=7,2048
    nand_root_fs_type=ubifs rootwait=1
    nand_src_addr=0x280000
    net_args=run bootargs_defaults;setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
    net_boot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${kloadaddr} ${bootfile}; run net_args; bootm ${kloadaddr}
    nfsopts=nolock
    nor_args=run bootargs_defaults;setenv bootargs ${bootargs} root={nor_root} rootfstype=${nor_root_fs_type} ip=${ip_method}
    nor_boot=echo Booting from NOR ...; run nor_args; cp.b ${0x08080000} ${kloadaddr} ${nor_img_siz}; bootm ${kloadaddr}
    nor_img_siz=0x280000
    nor_root=/dev/mtdblock3 rw
    nor_root_fs_type=jffs2
    nor_src_addr=0x08080000
    rootpath=/export/rootfs
    script_addr=0x81900000
    spi_args=run bootargs_defaults;setenv bootargs ${bootargs} root=${spi_root} rootfstype=${spi_root_fs_type} ip=${ip_method}
    spi_boot=echo Booting from spi ...; run spi_args; sf probe ${spi_bus_no}:0; sf read ${kloadaddr} ${spi_src_addr} ${spi_img_siz}; bootm ${kloadaddr}
    spi_bus_no=0
    spi_img_siz=0x380000
    spi_root=/dev/mtdblock4 rw
    spi_root_fs_type=jffs2
    spi_src_addr=0x62000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial
    stdin=serial
    stdout=serial
    
    Environment size: 2663/8188 bytes
    
    

  • Hi,

    And what are the contents of your SD card? I'm interested in the /boot partition. Is there a uEnv.txt file? If yes - please attach it.

    Best regards,
    Miroslav

  • Hi,

    my SD card contains :

    -  boot partition : MLO , u-boot.img, uImage, uEnv.txt

    - rootfs partition : rootfs

    - data partition : nothing

    and I'm using the same uEnv.txt found on http://processors.wiki.ti.com/index.php/TI-Android-ICS-4.0.3-DevKit-3.0.1_DevelopersGuide#.3D_Configure_Boot_Arguments

    and I made sure to do chmod a+x uEnv.txt as all the SD card example provided by TI are having this privilege.

    Thank you.

    Best Regards

  • Hi,

    From your log posted a few posts above I see this output:

    Hit any key to stop autoboot:  0
    Booting from nand ...

    This print is part of the nand_boot command:

    nand_boot=echo Booting from nand ...; run nand_args; nandecc hw 2; nand read.i ${kloadaddr} ${nand_src_addr} ${nand_img_siz}; bootm ${kloadaddr}

    This means that some other command is invoking nand_boot. However, I can't manage to find which, neither in your U-Boot environment, nor in the three lines of the uEnv.txt file posted in the wiki:

    File: uEnv.txt
    bootargs=console=ttyO0,115200n8 androidboot.console=ttyO0 mem=256M root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait init=/init ip=off
    bootcmd=mmc rescan ; fatload mmc 0 81000000 uImage ; bootm 81000000
    uenvcmd=boot
    

    Are you sure this is the only content in your uEnv.txt file? Perhaps there were some erroneous environment settings before you erased your NAND. Does this issue still occur?

    Please try executing these commands by hand while in U-Boot:
    mmc rescan
    fatload mmc 0 81000000 uImage
    bootm 81000000

    Best regards,
    Miroslav

  • Hi Miroslav,

    I'm sure that this is my uEnv.txt file.

    Miroslav Kiradzhiyski XID said:
    Please try executing these commands by hand while in U-Boot:
    mmc rescan
    fatload mmc 0 81000000 uImage
    bootm 81000000

    And yes, when I tried those commands, I was able to boot from the SD card.

    and, that's why I erased the NAND.

    Best Regards

  • Hi,

    So I suppose this means that the issue does not occur any more?

    Best regards,
    Miroslav

  • Hi Miroslav,

    well, my NAND is empty, so I'm not facing the issue.

    however, I hope this will be the case when I will try to flash the NAND.

    Thank you for your guidance.

    Best Regards

  • Hi,

    You should not face this problem once you flash your NAND.

    Take a look at this link about the NAND layout. This is where the ENV settings are stored:

    0x00260000-> ENV start

    0x0027FFFF-> ENV end

    When you erased the NAND, you erased the erroneous env settings. After you flash your NAND, please check your environment settings (print command). If you wish to alter them and then write them to NAND use the setenv and saveenv commands in U-Boot:

    saveenv - save environment variables to persistent storage
    setenv  - set environment variables

    Best regards,
    Miroslav