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.

booting linux kernal using U-boot

I'm trying to booting linux kernal using U-boot.(I'm using TCI6630, EVMK2L Evaluation Module)

I'm following the steps in  http://processors.wiki.ti.com/index.php/Booting_Linux_kernel_using_U-Boot . 

2. Download uImage and copy it to the SPI flash partition:

U-Boot> tftp 0xc0700000 uImage

I got following in the terminal

K2L EVM # tftp 0xc0700000 uImage
Using K2L_EMAC0 device
TFTP from server 192.168.1.225; our IP address is 192.168.1.206
Filename 'uImage'.
Load address: 0xc0700000
Loading: T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T
Retry count exceeded; starting again
*** ERROR: `eth2addr' not set
*** ERROR: `eth3addr' not set

 

1) what is eth2addr? eth3addr?

In the steps in the above link there was no such an instruction to set eth2addr, eth3addr

  • 1) what is eth2addr? eth3addr?

    In the steps in the above link there was no such an instruction to set eth2addr, eth3addr

    No need to set  eth2addr and eth3addr for your case. The u-boot failed to download with default network connection(port 0) and re-tried to subsequent Ethernet ports to download the uImage.

    Please ensure the following steps are done:

    1. The ethernet cable is connected on port 0 of EVM.

    2.  Please eusure to complete section "Setting_up" on below link.

    3.  Ensure that the network is up between EVM and host (server) by following(U-Boot> setenv serverip <ip addr of server>),

    In your case,

    K2L EVM # setenv serverip  192.168.1.225

    K2L EVM # ping $serverip

  • when I ping , it give following

    K2L EVM # ping $serverip
    Using K2L_EMAC0 device
    host 192.168.1.225 is alive

    Does it mean tftp server been properly setup?

    But still I'm getting previous error.
  • 1. Then there may be issue with tftp server configuration in host machine.

    processors.wiki.ti.com/.../Setting_Up_a_TFTP_Server

    2. How are you setting ip address to EVM (static or dynamic)?(Step 4 of Setting_up section)

    Static:
    K2L EVM # setenv ipaddr 192.168.1.206
    Dynamic:
    K2L EVM # dhcp

    Thank you.
  • I set static ip,

    I think Error is in 2nd step of SPI Flashing (Download uImage and copy it to the SPI flash partition:).

    In there it says that,

    IMPORTANT
    The size and offset values given below are to be considered representative only. To know the exact value of offset, please refer to the SPI flash partition information from Kernel bootlog. Size parameter depends on the actual size of respective images.

    1)From where can I found values for those addresses?
    2) How to find SPI flash partition information from Kernel bootlog ?

    I didn't find a bootlog file. (Please excuse me, I'm new to the field).

    Thank you,

  • U-Boot> tftp 0xc0700000 uImage

    I got following in the terminal


    Kernel load address (0xc0700000) is not correct for K2L device, you should refer to the following TI wiki.
    processors.wiki.ti.com/.../MCSDK_UG_Chapter_Exploring

    You can also get the kernel load address in u-boot environment itself.
    u-boot# print loadaddr
    Now you would get the Kernel load address.

    You can't boot the Linux only with uImage on K2 devices but also you need dtb and boot monitor.
    Latest processor SDK using the zImage for booting Linux kernel.

    I used the following commands to boot the Linux OS on K2 devices (K2H).

    I have copied all the images from "prebuilt-images" folder of the Processor SDK.

    I have all the images under the below directory of my PC for TFTP setup.
    /tftpboot/processor_sdk_02_00_01_07/

    u-boot# env default -a
    u-boot# setenv ipaddr 10.100.1.10
    u-boot# setenv serverip 10.100.1.40
    u-boot# setenv tftp_root processor_sdk_02_00_01_07
    u-boot# run get_ubi_net
    u-boot# run burn_ubi
    u-boot# setenv boot ubi
    u-boot# saveenv
    u-boot# reset
  • I copied all "prebuilt-images" to a folder in tftpboot. Following are the copied images.
    ( keystone-k2l-evm.dtb, skern-k2l.bin, u-boot-k2l-evm.img, u-boot-spi-k2l-evm.gph ,zImage-k2l-evm.bin, k2-fw-initrd.cpio.gz )

    and followed the steps given by you. but in the step : u-boot# run get_ubi_net

    I got following,

    run get_ubi_net
    BOOTP broadcast 1
    BOOTP broadcast 2
    /*
    *
    *
    *Upto 32
    *
    *
    *
    /*
    BOOTP broadcast 29
    BOOTP broadcast 30
    BOOTP broadcast 31
    BOOTP broadcast 32

    Retry count exceeded; starting again
    *** ERROR: `eth2addr' not set
    *** ERROR: `eth3addr' not set
    BOOTP broadcast 1
    BOOTP broadcast 2
    BOOTP broadcast 3

    What could be the reason?
  • Please refer to the below link for setting up the TFTP server on your ubuntu host PC.
    askubuntu.com/.../how-do-i-install-and-run-a-tftp-server

    And do confirm like this.

    Testing our tftp server:
    Create a file named test with some content in /tftpboot path of the tftp server
    Obtain the ip address of the tftp server using ifconfig command
    Now in some other system follow the following steps.

    tftp 192.168.1.2
    tftp> get test
    Sent 159 bytes in 0.0 seconds
    tftp> quit

    cat test


    when I ping , it give following

    K2L EVM # ping $serverip
    Using K2L_EMAC0 device
    host 192.168.1.225 is alive

    Does it mean tftp server been properly setup?

    But still I'm getting previous error.

    It seems your IP configuration in PC and EVM are correct but still has the problem with TFTP server setup in Ubuntu Host Linux PC.
  • I checked tftp server. It has been properly setup (test file sent successfully).

    But still I'm getting the previous error at run get_ubi_net.
    Are there any other steps to follow other than you specified in the link.

    Thank you.
  • Do you have another EVM to test or any board which has u-boot which can download the image using tftp to validate?
    If yes, please try.
  • I tried using dynamic ip;(Instead of static ip as u-boot# setenv ipaddr 192.168.1.xxx);

    Then I got following;


    K2L EVM # env default -a
    ## Resetting to default environment
    K2L EVM # setenv autoload no
    K2L EVM # dhcp
    BOOTP broadcast 1
    DHCP client bound to address 192.168.1.206
    K2L EVM # setenv serverip 192.168.1.225
    K2L EVM # setenv tftp_root processor_sdk
    K2L EVM # run get_ubi_net
    BOOTP broadcast 1
    DHCP client bound to address 192.168.1.206
    K2L EVM # run burn_ubi

    NAND erase.part: device 0 offset 0x180000, size 0x7fe80000
    Skipping bad block at 0x7ff00000
    Skipping bad block at 0x7ff40000
    Skipping bad block at 0x7ff80000
    Skipping bad block at 0x7ffc0000

    OK

    NAND write: device 0 offset 0x180000, size 0x7fe80000
    Attempt to write outside the flash area
    0 bytes written: ERROR

    Can you help me to solve this error?

    Thank you,
  • When I try to the kernel load address,

    K2L EVM # print loadaddr
    ## Error: "loadaddr" not defined

    And only addresses found as env were,

    addr_fdt=0x87000000
    addr_fs=0x82000000
    addr_kern=0x88000000
    addr_mon=0x0c140000
    addr_secdb_key=0xc000000
    addr_ubi=0x82000000
    addr_uboot=0x87000000
  • Sorry,
    Yes, you are right.
    We need to use "addr_kern" for loading and running kernel.

    PS: I don't have K2L board, just I checked the u-boot source code and confirmed on KERNEL address.
  • when running "get_ubi_net" ,(in the step u-boot# run get_ubi_net;)
    It runs; get_ubi_net=dhcp ${addr_ubi} ${tftp_root}/${name_ubi}

    here, name_ubi=k2l-evm-ubifs.ubi

    but in "prebuilt-images" folder there was no such a file.

    Further in environmental variables I found followings. (I assume that they are the image files that we want);

    name_fdt=uImage-k2l-evm.dtb
    name_fs=arago-console-image-k2l-evm.cpio.gz
    name_kern=uImage-keystone-evm.bin
    name_mon=skern-k2l-evm.bin
    name_ubi=k2l-evm-ubifs.ubi
    name_uboot=u-boot-spi-k2l-evm.gph
    name_uinitrd=uinitrd.bin


    But in my "prebuilt-images" folder I have only followings;(only 6 files)

    keystone-k2l-evm.dtb
    k2-fw-initrd.cpio.gz
    zImage-k2l-evm.bin
    skern-k2l.bin
    u-boot-k2l-evm.img
    u-boot-spi-k2l-evm.gph

    So what I did was I change above environmental variables as follows: (considering there extensions and names)

    name_fdt=keystone-k2l-evm.dtb
    name_fs=k2-fw-initrd.cpio.gz
    name_kern=zImage-k2l-evm.bin
    name_mon=skern-k2l.bin
    name_ubi=u-boot-k2l-evm.img
    name_uboot=u-boot-spi-k2l-evm.gph

    and kept name_uinitrd=uinitrd.bin as it is.

    But still I'm getting same error;

    K2L EVM # run get_ubi_net
    BOOTP broadcast 1
    DHCP client bound to address 192.168.1.206
    K2L EVM # run burn_ubi

    NAND erase.part: device 0 offset 0x180000, size 0x7fe80000
    Skipping bad block at 0x7ff00000
    Skipping bad block at 0x7ff40000
    Skipping bad block at 0x7ff80000
    Skipping bad block at 0x7ffc0000

    OK

    NAND write: device 0 offset 0x180000, size 0x7fe80000
    Attempt to write outside the flash area
    0 bytes written: ERROR


    Can you help me to solve this error?

    Thank you,
  • U-boot would work with DHCP environment and not with Static IP.
    Please refer to this wiki page.
    processors.wiki.ti.com/.../MCSDK_UG_Chapter_Exploring


    when running "get_ubi_net" ,(in the step u-boot# run get_ubi_net;)
    It runs; get_ubi_net=dhcp ${addr_ubi} ${tftp_root}/${name_ubi}

    here, name_ubi=k2l-evm-ubifs.ubi

    but in "prebuilt-images" folder there was no such a file.


    Please use the *.ubi filesystem (put this into tftpboot directory of PC) from "filesystem" folder in SDK instillation folder.
  • In "filesystem" there are 2 .ubi files, tisdk-server-rootfs-image-k2l-evm.ubi (455.1 MB) and arago-base-tisdk-image-k2l-evm.ubi (61.3 MB)

    I tried using tisdk-server-rootfs-image-k2l-evm.ubi. It was loaded

    u-boot# run get_ubi_net
    u-boot# run burn_ubi
    u-boot# setenv boot ubi
    u-boot# saveenv
    u-boot# reset

    all above steps were succeeded.

    but after reseting autoboot ; it gave following


    Creating 1 MTD partitions on "nand0":
    0x000000180000-0x000080000000 : "mtd=2"
    UBI: attaching mtd1 to ubi0
    UBI: physical eraseblock size: 262144 bytes (256 KiB)
    UBI: logical eraseblock size: 253952 bytes
    UBI: smallest flash I/O unit: 4096
    UBI: VID header offset: 4096 (aligned 4096)
    UBI: data offset: 8192
    UBI: volume 0 ("rootfs") re-sized from 1734 to 8097 LEBs
    UBI: attached mtd1 to ubi0
    UBI: MTD device name: "mtd=2"
    UBI: MTD device size: 2046 MiB
    UBI: number of good PEBs: 8182
    UBI: number of bad PEBs: 4
    UBI: max. allowed volumes: 128
    UBI: wear-leveling threshold: 4096
    UBI: number of internal volumes: 1
    UBI: number of user volumes: 1
    UBI: available PEBs: 0
    UBI: total number of reserved PEBs: 8182
    UBI: number of PEBs reserved for bad PEB handling: 81
    UBI: max/mean erase counter: 1/0
    UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:boot", error -19
    UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume 'ubi:boot' errno=-19!

    ubifsmount - mount UBIFS volume

    Usage:
    ubifsmount <volume-name>
    - mount 'volume-name' volume
    UBIFS not mounted, use ubifs mount to mount volume first!
    ubifsload - load file from an UBIFS filesystem

    Usage:
    ubifsload <addr> <filename> [bytes]
    - load file 'filename' to address 'addr'








    Is this *.ubi is correct ? (I feel that it is too large compared to other pre-built images)
  • It will work.
    Can you please try to flash one more time ?
  • I tried but the result was same.

    It gave following errors;

    UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:boot", error -19
    UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume 'ubi:boot' errno=-19!

    ubifsmount - mount UBIFS volume

    Usage:
    ubifsmount <volume-name>
    - mount 'volume-name' volume
    UBIFS not mounted, use ubifs mount to mount volume first!
    ubifsload - load file from an UBIFS filesystem



    what this means?
  • Please do make sure that you have used the u-boot version which you used from the same SDK version.
    All the binaries (u-boot, kernel and filesystem) should be from the same SDKs (Processor SDK package) package.
  • Yes they are, I'm using the latest version
    ti-processor-sdk-linux-k2l-evm-03.00.00.04

    why it gives an error as

    ubifsmount - mount UBIFS volume UBIFS not mounted, use ubifs mount to mount volume first!, as follows



    Usage:
    ubifsmount <volume-name>
    - mount 'volume-name' volume
    UBIFS not mounted, use ubifs mount to mount volume first!
    ubifsload - load file from an UBIFS filesystem