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.

Facing issue in booting from NAND in TI AM/DM37x EVM

Hi

I am trying to boot from NAND on the board AM/DM37x EVM. I am following below steps from the document am37xevm_software_developers_guide.

 

How to Flash Linux System from U- boot

"

Run the u-boot commands to flash the NAND

All of the following commands are performed at the u-boot prompt.

These commands are actually a series of u-boot commands that are connected together with semicolons. The

individual commands can be entered separately or simple pasted from here.

• Complete xloader write from MMC to NAND (only erases one block=128k).

mw.b 0x81600000 0xff 0x20000;nand erase 0 20000;mmc init;fatload mmc 0

0x81600000 x-load.bin.ift;nandecc hw; nand write.i 0x81600000 0 20000

• Complete uboot write from MMC to NAND (only erases two blocks=256k)

mw.b 0x81600000 0xff 0x40000;nand erase 80000 40000;mmc init;fatload

mmc 0 0x81600000 u-boot.bin;nandecc sw; nand write.i 0x81600000 80000

40000

• Complete kernel write from MMC to NAND (erases 3M)

mw.b 0x81600000 0xff 0x1400000;nand erase 280000 300000;mmc

init;fatload mmc 0 0x81600000 uImage;nandecc sw; nand write.i

0x81600000 280000 300000

Put the EVM in NAND boot mode

With the EVM in NAND boot mode and the images flashed in NAND as detailed above, the SD card does not need

to be in the EVM at boot up. X-loader and u-boot will run from NAND. In order to also pull the Linux kernel

(uImage) from NAND it will be necessary to halt the boot process and edit some u-boot environment variables.

• SW4 = 00101010 (high to low, i.e. SW4.1 = 0)

• 1 = "On" position on the switch

• Save off the original boot command

setenv bootcmd_original ${bootcmd}

saveenv

• Create command for reading the kernel from NAND and then another command for doing the boot where the

kernel is pulled from NAND and the root filesystem is from the SD/MMC card.

setenv nand_kernel 'nand read.i ${loadaddr} 280000 300000'

setenv nand_mmc_boot 'run nand_kernel;setenv bootargs ${mmcargs}; bootm'

Run this last command to actually perform the boot. And always save the environment after making changes.

saveenv

run nand_mmc_boot "

 

I followed above steps perfectly. But when i changed the switches to

SW4 = 00101010

 

The board is not booting and it is giving error

 

                                                                               
Arago Project http://arago-project.org dm37x-evm ttyS0                         
                                                                               
Arago 2011.02 dm37x-evm ttyS0                                                  
                                                                               
dm37x-evm login:                                                               
                                                                               
Texas Instruments X-Loader 1.46 (Mar 24 2011 - 20:21:25)                       
err_loc=3725                                                                   
err_loc=3670                                                                   
err_loc=2852                                                                   
err_loc=-1049                                                                  
err_loc=2342                                                                   
err_loc=1183                                                                   
err_loc=-1425                                                                  
err_loc=-1807                

 

Please help here.

  • Moving this to the DM37X forum.

  • Hi Any info on this.how to check this issue why the nand location is not read.
    Also i confirmed that MLO written to nand is OK.
    Why the boot loader control is not reaching to the MLO ??
  • Hi Sobin,

    The error messages printed by the x-loader represent the error location polynomial from a set of equations derived from the syndrome. For more details see decode_bch function in ../x-loader/lib/omap_bch_decoder.c file.
    I suggest you to try to rebuild to x-loader and u-boot and try to copy boot loaders to NAND flash again. Copy the commands which you execute and console output to a log file and attach it please.
    There is one more way for NAND flashing: Optionally, you can use windows based serial flasher tool (located in ${DVSDK}/host-tools/flash_utils/windows) for copying boot loaders into NAND flash. For more information about serial flasher usage, see processors.wiki.ti.com/.../Flash_v1.3_User_Guide

    BR
    Tsvetolin Shulev
  • Hi

    We have purchased TI EVM and we recieved the xloader and uboot that came with SD Card.

    Can you please let me know where i can download the xloader and uboot and build it. 

    Any links / document is appreciated.

    regards

    Sobin

  • Sobin,

    You can download the source codes of x-loaed, u-boot and kernel which are included in the dvsdk and some helpful documents at the link:

    BR

    Tsvetolin Shulev

  • Hi ,

    I have used below commands to copy xloader, Uboot and uimage to nand .

    => IMP POINT : I have renamed x-load.bin.ift to MLO as we recieved MLO in the SD Card in the command

    mw.b 0x81600000 0xff 0x20000;nand erase 0 20000;mmc init;fatload mmc 0
    0x81600000 x-load.bin.ift;nandecc hw; nand write.i 0x81600000 0 20000

    Below are the commands that i have passed:

    mw.b 0x81600000 0xff 0x20000;nand erase 0x0 0x20000;mmc init;fatload mmc 0x0 0x81600000 MLO;nandecc sw; nand write.i 0x81600000 0x0 0x20000

    mw.b 0x81600000 0xff 0x40000;nand erase 0x80000 0x40000;mmc init;fatload mmc 0x0 0x81600000 u-boot.bin;nandecc sw; nand write.i 0x81600000 0x80000 0x40000

    mw.b 0x81600000 0xff 0x1400000;nand erase 0x280000 0x300000;mmc init;fatload mmc 0x0 0x81600000 uImage;nandecc sw; nand write.i 0x81600000 0x280000 0x300000

    Output Command Window:

    Texas Instruments X-Loader 1.46 (Mar 24 2011 - 20:21:25)

    Starting X-loader on MMC
    Reading boot sector

    212836 Bytes Read from MMC
    Starting OS Bootloader from MMC...
    Starting OS Bootloader...


    U-Boot 2010.06 (Jan 14 2011 - 15:43:45)

    OMAP34xx/35xx-GP ES2.1, CPU-OPP2 L3-165MHz
    OMAP3 EVM board + LPDDR/NAND                                                    
    I2C:   ready                                                                    
    DRAM:  256 MiB                                                                  
    NAND:  512 MiB                                                                  
    *** Warning - bad CRC or NAND, using default environment                        
                                                                                    
    In:    serial                                                                   
    Out:   serial                                                                   
    Err:   serial                                                                   
    Read back SMSC id 0x92200000                                                    
    Die ID #4e8c00029ff80000016071640800501e                                        
    Net:   smc911x-0                                                                
    Hit any key to stop autoboot:  0                                                
    OMAP3_EVM # mw.b 0x81600000 0xff 0x20000;nand erase 0x0 0x20000;mmc init;fatloa0
                                                                                    
    NAND erase: device 0 offset 0x0, size 0x20000                                   
    Erasing at 0x0 -- 100% complete.                                                
    OK                                                                              
    mmc1 is available                                                               
    reading x-load.bin.ift                                                          
                                                                                    
    ** Unable to read "x-load.bin.ift" from mmc 0:1 **                              
    HW ECC selected                                                                 
                                                                                    
    NAND write: device 0 offset 0x0, size 0x20000                                   
     131072 bytes written: OK                                                       
    OMAP3_EVM # mw.b 0x81600000 0xff 0x20000;nand erase 0x0 0x20000;mmc init;fatloa0
                                                                                    
    NAND erase: device 0 offset 0x0, size 0x20000                                   
    Erasing at 0x0 -- 100% complete.                                                
    OK                                                                              
    mmc1 is available                                                               
    reading MLO                                                                     
                                                                                    
    20060 bytes read                                                                
    HW ECC selected                                                                 
                                                                                    
    NAND write: device 0 offset 0x0, size 0x20000                                   
     131072 bytes written: OK                                                       
    OMAP3_EVM # mw.b 0x81600000 0xff 0x40000;nand erase 0x80000 0x40000;mmc init;fa0
                                                                                    
    NAND erase: device 0 offset 0x80000, size 0x40000                               
    Erasing at 0xa0000 -- 100% complete.                                            
    OK                                                                              
    mmc1 is available                                                               
    reading u-boot.bin                                                              
                                                                                    
    212836 bytes read                                                               
    SW ECC selected                                                                 
                                                                                    
    NAND write: device 0 offset 0x80000, size 0x40000                               
     262144 bytes written: OK                                                       
    OMAP3_EVM # mw.b 0x81600000 0xff 0x1400000;nand erase 0x280000 0x300000;mmc ini0
                                                                                    
    NAND erase: device 0 offset 0x280000, size 0x300000                             
    Erasing at 0x560000 -- 100% complete.                                           
    OK                                                                              
    mmc1 is available                                                               
    reading uImage                                                                  
                                                                                    
    2412992 bytes read                                                              
    SW ECC selected                                                                 
                                                                                    
    NAND write: device 0 offset 0x280000, size 0x300000                             
     3145728 bytes written: OK                                                      
    OMAP3_EVM # setenv bootcmd_original ${bootcmd}                                  
    OMAP3_EVM # saveenv                                                             
    Saving Environment to NAND...                                                   
    Erasing Nand...                                                                 
    Erasing at 0x240000 -- 100% complete.                                           
    Writing to Nand... done                                                         
    OMAP3_EVM # setenv nand_kernel 'nand read.i ${loadaddr} 280000 300000'          
    OMAP3_EVM # setenv nand_mmc_boot 'run nand_kernel;setenv bootargs ${mmcargs}; b'
    OMAP3_EVM # saveenv                                                             
    Saving Environment to NAND...                                                   
    Erasing Nand...                                                                 
    Erasing at 0x240000 -- 100% complete.                                           
    Writing to Nand... done                                                         
    OMAP3_EVM #                                                                     
                                                                                    
    Texas Instruments X-Loader 1.46 (Mar 24 2011 - 20:21:25)                        
    err_loc=3725                                                                    
    err_loc=3670                                                                    
    err_loc=2852                                                                    
    err_loc=-1049                                                                   
    err_loc=2342                                                                    
    err_loc=1183                                                                    
    err_loc=-1425                                                                   
    err_loc=-1807                                                                   
    err_loc=2812                                                                    
    err_loc=2100                                                                    
    err_loc=-1106                                                                   
    err_loc=-3689                                                                   
    err_loc=2545                                                                    
    err_loc=1652                                                                    
    err_loc=957                                                                     
    err_loc=-1681                                                                   
    err_loc=4056                                                                    
    err_loc=-2747                                                                   
    err_loc=-3406                                                                   
    err_loc=-3791                                                                   
    err_loc=287                                                                     
    err_loc=-1112                                                                   
    err_loc=-1986                                                                   
    err_loc=-3523                                                                   
    err_loc=4075                                                                    
    err_loc=1387                                                                    
    err_loc=998                                                                     
    err_loc=-1449                                                                   
    err_loc=2069                                                                    
    err_loc=2071                                                                    
    err_loc=-471                                                                    
    err_loc=-2064                                                                   
    err_loc=2430                                                                    
    err_loc=2328                                                                    
    err_loc=-1966                                                                   
    err_loc=-2157                                                                   
    err_loc=1955                                                                    
    err_loc=-1452                                                                   
    err_loc=-2599                                                                   
    err_loc=-2888                                                                   
    err_loc=2706                                                                    
    err_loc=-2269                                                                   
    err_loc=-3167                                                                   
    err_loc=-3488                                                                   
    err_loc=1218                                                                    
    err_loc=781                                                                     
    err_loc=-3090                                                                   
    err_loc=-3687                                                                   
    err_loc=2002                                                                    
    err_loc=-2179                                                                   
    err_loc=-2497                                                                   
    err_loc=-3645                                                                   
    err_loc=3400                                                                    
    err_loc=168                                                                     
    err_loc=34                                                                      
    err_loc=-967                                                                    
    err_loc=3836                                                                    
    err_loc=2724                                                                    
    err_loc=-127                                                                    
    err_loc=-3950                                                                   
    err_loc=2604                                                                    
    err_loc=2586                                                                    
    err_loc=1621                                                                    
    err_loc=-2386                                                                   
    err_loc=2271                                                                    
    err_loc=1636                                                                    
    err_loc=1081                                                                    
    err_loc=-911                                                                    
    err_loc=599                                                                     
    err_loc=-1220                                                                   
    err_loc=-1702                                                                   
    err_loc=-3968                                                                   
    err_loc=1298                                                                    
    err_loc=22                                                                      
    err_loc=-1081                                                                   
    err_loc=-1591                                                                   
    err_loc=3429                                                                    
    err_loc=-610                                                                    
    err_loc=-3237                                                                   
    err_loc=-3934                                                                   
    Starting OS Bootloader...       .

    Meanwhile i am downloading the SDK and will reply after building the xloader, uboot and uImage.

  • Hi

    I have followed below steps and got some better result ...

    Boot the TI EVM in MMC mode by setting SW4 2,3,4 & 6 pin high
    entered below command


    nand erase
    nandecc hw
    mmc init
    fatload mmc 0 0x81600000 MLO
    nand write.i 0x81600000 0 20000
    nandecc hw
    fatload mmc 0 0x81600000 u-boot.bin
    nand write.i 0x81600000 80000 40000

    then i changed the switch SW4 to 2 & 4 and removed SD Card

    Then i got below result

    OMAP3_EVM #

    Texas Instruments X-Loader 1.46 (Mar 24 2011 - 20:21:25)
    Starting OS Bootloader...


    U-Boot 2010.06 (Jan 14 2011 - 15:43:45)

    OMAP34xx/35xx-GP ES2.1, CPU-OPP2 L3-165MHz
    OMAP3 EVM board + LPDDR/NAND
    I2C: ready
    DRAM: 256 MiB
    NAND: 512 MiB
    *** Warning - bad CRC or NAND, using default environment

    In: serial
    Out: serial
    Err: serial
    Read back SMSC id 0x92200000
    Die ID #4e8c00029ff80000016071640800501e
    Net: smc911x-0
    Hit any key to stop autoboot: 0
    OMAP3_EVM # <INTERRUPT>


    Again i rebooted with MMC inserted i passed this command

    mw.b 0x81600000 0xff 0x1400000;nand erase 0x280000 0x300000;mmc init;fatload mmc 0x0 0x81600000 uImage;nandecc sw; nand write.i 0x81600000 0x280000 0x300000

    Again Booted with NAND Switch Enabled ( SW4 2 & 4)

    Got Below screenshot
    Texas Instruments X-Loader 1.46 (Mar 24 2011 - 20:21:25)
    Starting OS Bootloader...


    U-Boot 2010.06 (Jan 14 2011 - 15:43:45)

    OMAP34xx/35xx-GP ES2.1, CPU-OPP2 L3-165MHz
    OMAP3 EVM board + LPDDR/NAND
    I2C: ready
    DRAM: 256 MiB
    NAND: 512 MiB
    In: serial
    Out: serial
    Err: serial
    Read back SMSC id 0x92200000
    Die ID #4e8c00029ff80000016071640800501e
    Net: smc911x-0
    Hit any key to stop autoboot: 0
    OMAP3_EVM #


    Entered below command
    setenv bootcmd_original ${bootcmd}
    saveenv

    Create command for reading the kernel from NAND and then another command for doing the boot where the
    kernel is pulled from NAND and the root filesystem is from the SD/MMC card.


    setenv nand_kernel 'nand read.i ${loadaddr} 280000 300000'
    setenv nand_mmc_boot 'run nand_kernel;setenv bootargs ${mmcargs}; bootm'


    saveenv
    run nand_mmc_boot

    On entering the last command

    I get below

    NAND read: device 0 offset 0x280000, size 0x300000
    3145728 bytes read: OK
    ## Booting kernel from Legacy Image at 82000000 ...
    Image Name: Arago/2.6.32-psp03.00.01.06.sdk/
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 2412928 Bytes = 2.3 MiB
    Load Address: 80008000
    Entry Point: 80008000
    Verifying Checksum ... OK
    Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Uncompressing Linux...........................................................................................................

    CTRL-A Z for help |115200 8N1 | NOR | Minicom 2.5 | VT102 | Offline


    And it waits until i insert SD Card in the slot.

    As per my understanding it is waiting for the file system from the SD Card

    How can we write file system also in the NAND ? So that we can make it independent of the SD Card.

    Waiting for your answers :)

    regards
    Sobin
    nand
  • Sobin,

    Now you need to write the file system in the NAND. I suggest you to use the linked tutorials:
    processors.wiki.ti.com/.../Put_JFFS2_Image_to_Flash
    elinux.org/BeagleBoardNAND

    BR
    Tsvetolin Shulev
  • Hi

     

    I have used the command mkffs2 to create the jffs file out of the root file system provided with the SDK, the issue is after the jffs2 file is created its size is approx > 400 MB and  i am not able to write to the file.

    Trying to do additional work around for above issue.

    Also,,,, Important thing i want to ask is for AM37x which is the location where i can write the ENV variables .

    i.e i have got environment variable that i want to automatically set once Uboot is executed,

    i am trying to flash the boot.scr to the location 0x001C0000. I am referring to link

    http://processors.wiki.ti.com/index.php/AM35x-OMAP35x-PSP_04.02.00.07_UserGuide#Selecting_boot_mode

    please suggest if the location is correct.

    I am using flash loadert tool to flash this file. 1bit ecc is followed while flashing

  • Hi

    I suppose there is no way to flash environment variable to flash, only way is to change using uboot source code.

     

    regards

    Sobin