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.

using load to NAND from u-boot on AM335x EVM

I'm trying to follow the guide: http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User's_Guide#Writing_to_NAND_from_U-Boot

To write my bootloader files to the NAND on my AM335x EVM, rescaning the MMC and eraseing the NAND seem to work find, then on the third step I run into problems.

U-Boot# load mmc 0 0x81000000 MLO
Unknown command 'load' - try 'help'

So I ran help and sure enought, there is no "load" command, but there are other options:

U-Boot# help
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)

What is the correct command to use to write files from my SD card to NAND flash with my version of u-boot?

 

u-boot version:

U-Boot 2013.01.01 (Jun 25 2013 - 16:42:52)

I2C:   ready
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1

Full output of "help" command:

U-Boot# help
?       - alias for 'help'
askenv  - get environment variables from stdin
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
chpart  - change active partition
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dfu     - Device Firmware Upgrade
dhcp    - boot image via network using DHCP/TFTP protocol
echo    - echo args to console
editenv - edit environment variable
eeprom  - EEPROM sub-system
env     - environment handling commands
exit    - exit script
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
false   - do nothing, unsuccessfully
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fatwrite- write file into a dos filesystem
fdt     - flattened device tree utility commands
go      - start application at address 'addr'
help    - print command description/usage
i2c     - I2C sub-system
iminfo  - print header information for application image
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mtdparts- define flash/nand partitions
mtest   - simple RAM read/write test
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sf      - SPI flash sub-system
showvar - print local hushshell variables
sleep   - delay execution for some time
source  - run script from memory
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
true    - do nothing, successfully
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version

  • The file system used to create the boot partition is FAT based:

    mount -t vfat "/dev/""$DEVICEDRIVENAME""1" boot

    Thus the fatload command seems to work here:

    U-Boot# fatload mmc 0 0x81000000 MLO
    reading MLO
    100549 bytes read in 15 ms (6.4 MiB/s)
    

  • You have two threads opened on the same issue. They will be merged.

  • You have two threads opened on the same issue. They will be merged.

  • I've been trying to follow the instructions here: http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User's_Guide#Writing_to_NAND_from_U-Boot

    To write to NAND from u-boot on my AM335x EVM. I ran into a problem where "load" was not the correct command, for my version of u-boot, but I found the fix to that with "fatload" see thread here: http://e2e.ti.com/support/arm/sitara_arm/f/791/p/333189/1161711.aspx#1161711

    I am now on the next step and experiencing a new problem:

    U-Boot# nand write 0x81000000 NAND.SPL
    
    NAND write: incorrect device type in NAND.SPL

    Not quite sure why this is happening. U-boot version and "help" info can be found in my previous thread. I also dumped the mtdparts here:

    U-Boot# mtdparts
    
    device nand0 <omap2-nand.0>, # parts = 8
     #: name                size            offset          mask_flags
     0: SPL                 0x00020000      0x00000000      0
     1: SPL.backup1         0x00020000      0x00020000      0
     2: SPL.backup2         0x00020000      0x00040000      0
     3: SPL.backup3         0x00020000      0x00060000      0
     4: u-boot              0x001e0000      0x00080000      0
     5: u-boot-env          0x00020000      0x00260000      0
     6: kernel              0x00500000      0x00280000      0
     7: rootfs              0x0f880000      0x00780000      0
    
    active partition: nand0,0 - (SPL) 0x00020000 @ 0x00000000
    
    defaults:
    mtdids  : nand0=omap2-nand.0
    mtdparts: mtdparts=omap2-nand.0:128k(SPL),128k(SPL.backup1),128k(SPL.backup2),12
    8k(SPL.backup3),1920k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)

    Why does it tell me I have an incorrect device type in my NAND.SPL and how do I check/change that?

    Note: to program the SD card I used the create-sdcard.sh script that came with the TI 6.0 SDK and I told it to use the pre-built images too, so I would have expected everything to be correct there.

  • Hi Mike,

    As you have already found out, the correct command to load a binary from FAT partition is "fatload".

    Mike Worster said:
    nand write 0x81000000 NAND.SPL

    This is not correct, because your partition is called "SPL", not "NAND.SPL". Try this:

    nand write 0x81000000 SPL

    Best regards,
    Miroslav

  • Miroslav, thanks for that information, I ended up solving it by using the full write commands:

        nand write 0x81000000 0x0 0x20000

    And that worked just fine.

  • At this point I have accomplished the following steps:

        U-Boot # mmc rescan
        U-Boot # nand erase.chip
        U-Boot # fatload mmc 0 0x81000000 MLO
        U-Boot # nand write 0x81000000 0x00000 0x20000 
        U-Boot # nand write 0x81000000 0x20000 0x20000 
        U-Boot # nand write 0x81000000 0x40000 0x20000
        U-Boot # nand write 0x81000000 0x60000 0x20000
        U-Boot # fatload mmc 0 0x81000000 u-boot.img
        U-Boot # nand write 0x81000000 0x80000 0x1e0000

    This (I think) flashing the x-loader and bootloader into NAND. I then powered off the board, removed the SD card, and powered it back on. All I saw on the serial output was:
     

        CCCCCCCCCCCCCCCC...

    Why isn't this booting from NAND flash now?

    My SYSBOOT pins are:

    SW3:
        pin1: 0
        pin2: 1
        pin3: 1
        pin4: 1
        pin5: 1
        pin6: 1
        pin7: 1
        pin8: 1
    SW4:
        pin1: 1
        pin2: 1
        pin3: 1
        pin4: 1
        pin5: 1
        pin6: 1
        pin7: 0
        pin8: 1

    My profile selection is:
    SW8:
        pin1: 0
        pin2: 0
        pin3: 0
        pin4: 0

  • Mike Worster said:
    SW3:
        pin1: 0
        pin2: 1
        pin3: 1
        pin4: 1
        pin5: 1
        pin6: 1
        pin7: 1
        pin8: 1


    Mike, do you refer to the "ON" label of the switches as "1"? These are marked incorrectly on the EVM, as stated here: http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide#Boot_Switch_Settings

    The "ON" label actually corresponds to logical "0", which means that your SYSBOOT configuration (pins 1-5) is actually: 10000 which corresponds to the following boot sequence: UART0 -> XIP -> MMC0 -> SPI0. There is no NAND boot in this configuration.

    Actually SYSBOOT configuration (1-5) 01111 is still incorrect as stated in the TRM. Please check section 26.1.5.2.1 SYSBOOT Configuration Pins of the AM335x TRM for a possible SYSBOOT configuration.

    Best regards,
    Miroslav

  • Miroslav,

        Thanks very much! I had the SW3 boot pins set incorrectly for boot from NAND. That has now been resolved and I do see u-boot come up!

    Final configuration:
    SW3:
        Pin1: ON    (so logic 0)
        Pin2: OFF  (so logic 1)
        Pin3: ON  
        Pin4: ON  
        Pin5: OFF  
        Pin6: ON
        Pin7: ON
        Pin8: ON