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.

Build and install Linux kernel for EVMK2E

I need to rebuild the TI Linux Kernel for EVMK2E to add in USB serial support, among other things, and need instructions on where to get the source code, what options are used on the TI board (SMP etc), how to configure/build the Linux kernel (3.10.10 as supplied) and how to install the kernel on the EVMK2E evaluation board.

  • 1) You have to git clone the latest keystone linux.
    2) Do a git reset for the released MCSDK version (refer to the appropriate release notes of MCSDK) if you wish or you can use the latest cloned one.
    3) Recompile the linux kernel for your K2HK EVM board.
    4) I hope, by default the USB3.0 support had been enabled.

    You can refer to the following TI Wiki page.

    processors.wiki.ti.com/.../MCSDK_UG_Chapter_Exploring
  • Hi Robert,

    Robert said:
    Where to get the source code

    you have to do git clone to the arago repository to get the source code.

    To get the source code of Linux, use the below command,

    $ git clone git://git.ti.com/keystone-linux/linux.git linux-keystone

    $ cd linux-keystone

    $ git reset --hard <Release tag> where release tag can be obtained from Release notes. For example tag is DEV.MCSDK-03.08.04.11 for the release. You will find the release notes document enclosed in the MCSDK package

    To get the source code of u-boot, use the below command,

    $ git clone git://git.ti.com/keystone-linux/u-boot.git u-boot-keystone

    $ cd u-boot-keystone

    $ git reset --hard <Release tag>where release tag can be obtained from the release notes. For example, release tag used is DEV.MCSDK-2013-01.11

    To get the source code of u-boot monitor, use the below command,

    $ git clone git://git.ti.com/keystone-linux/boot-monitor.git

    Robert said:
    rebuild the TI Linux Kernel for EVMK2E to add in USB serial support

    After doing defconfig, enable the USB serial driver support using menuconfig option like below commands

    $ make keystone2_defconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

    $ make menuconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

    --> enable USB serial support --> save changes

    $ make uImage ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

     

    For more info on building, please visit processors.wiki.ti.com/.../MCSDK_UG_Chapter_Exploring

     

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    --------------------------------------------------------------------------------------------------------

  • Shankari,

      When I try to git clone the repo, I get a timeout error.  I go to the TI gitorious website for the repo and when I click the "clone" button, I get a login screen.  I try to create an account and the webpage displays a msg sending verification email, but after an hour, I have still not received an email and cannot login.  I tried to email the TI admin link on the webpage for account issues, but the email came back (from nobody@ti) stating I did not have permission to send to that email list. 

  • I'm able to do "git clone" through command terminal, I think, your LAN connection stops the git clone, please do check with your IT team for that issue.
    Also, you can download the latest keystone source from the following link.
    Go to source tree and download the linux by clicking the "download master as .tar.gz"
    Please note that you will not get git repository in it.

    git.ti.com/.../master
  • Hi Shankari,

      If I rebuild the kernel (for usb support etc) do I also have to rebuild uboot and the boot monitor?  I thought since they are already on the board, I would not have to do anything other than build the kernel?  Also once built, is there a link to tell me how to install the new kernel, and how to go back to the old kernel if the new one does not boot up?

    Thanks

  • Hi Robert,

    Robert said:
      If I rebuild the kernel (for usb support etc) do I also have to rebuild uboot and the boot monitor?  I thought since they are already on the board, I would not have to do anything other than build the kernel

    yes, your understanding is right. Re-building the kernel (with usb support) alone is enough. You need not rebuild the uboot and boot monitor.

    Robert said:
    Also once built, is there a link to tell me how to install the new kernel, and how to go back to the old kernel if the new one does not boot up?

    You can use the below linux commands

    For K2E:-

    u-boot# tftpboot 0x87000000 k2e-evm.dtb

    u-boot# 0x88000000 uImage-keystone-evm.bin

    u-boot# tftpboot 0x0c140000 skern-k2e.bin

    u-boot# mon_install 0x0c140000

    u-boot# bootm 0x88000000 - 0x87000000

    You can refer to the below links on re-building  and booting linux. You can however find the working pre-built linux image as a part of MCSDK release.

    If have any problems, please revert.

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------

  • Hi Shankari,

      I am still not following the install instructions.  I found the prebuilt kernel called uImage-keystone-evm.bin under directory /opt/ti/mcsdk_linux_3_01_01_04/images# but that does not match my new kernel, when I tried to build a new kernel with USB serial support the result is a file called vmlinux with a size of approx 96 MBytes.  I have not found instructions on how to load/install this vmlinux kernel anywhere, please let me know how to proceed?

    Thanks

  • You have to use the kernel image "uImage" which is located at "arch/arm/boot/uImage"
  • Ok I have the uImage (had to install u-boot-tools) Is there a way of loading/replacing just the kernel, or do I have to install the kernel, DTB and file system all at once?
  • Hi Robert,

    You can just replace the kernel. DTB and filesystem need not to be replaced.

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------

  • Ok I saved the new kernel according to the instrucitons and now the board hangs on Starting kernel...

    I did the following:

    root@keystone-evm:~# mkdir /mnt/boot
    root@keystone-evm:~# mount -t ubifs ubi0_0 /mnt/boot

    root@keystone-evm:~# root@keystone-evm:~# cd /mnt/boot

    removed the old uImage-keystone-evm.bin file

    copied my uImage file to /mnt/boot/uImage-keystone-evm.bin

    reboot and now the board hangs

    K2E EVM # boot
    Creating 1 MTD partitions on "nand0":
    0x000000180000-0x000020000000 : "mtd=2"
    UBI: attaching mtd1 to ubi0
    UBI: physical eraseblock size:   131072 bytes (128 KiB)
    UBI: logical eraseblock size:    126976 bytes
    UBI: smallest flash I/O unit:    2048
    UBI: VID header offset:          2048 (aligned 2048)
    UBI: data offset:           UBI: attached mtd1 to ubi0
    UBI: MTD device name:            "mtd=2"
    UBI: MTD device size:            510 MiB
    UBI: number of good PEBs:        4080
    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:     5
    UBI: available PEBs:             0
    UBI: total number of reserved PEBs: 4080
    UBI: number of PEBs reserved for bad PEB handling: 40
    UBI: max/mean erase counter: 11/2
    UBIFS: mounted UBI device 0, volume 0, name "boot"
    UBIFS: mounted read-only
    UBIFS: file system size:   9269248 bytes (9052 KiB, 8 MiB, 73 LEBs)
    UBIFS: journal size:       1650688 bytes (1612 KiB, 1 MiB, 13 LEBs)
    UBIFS: media format:       w4/r0 (latest is w4/r0)
    UBIFS: default compressor: LZO
    UBIFS: reserved for root:  0 bytes (0 KiB)                                                                  
    Loading file 'securedb.key.bin' to addr 0x0c000000 with size 28 (0x0000001c)...                             
    Done                                                                                                        
    Loading file 'uImage-k2e-evm.dtb' to addr 0x87000000 with size 39238 (0x00009946)...                        
    Done                                                                                                        
    Loading file 'skern-k2e-evm.bin' to addr 0x0c140000 with size 45056 (0x0000b000)...                         
    Done                                                                                                        
    Loading file 'uImage-keystone-evm.bin' to addr 0x88000000 with size 3990352 (0x003ce350)...                 
    Done                                                                                                        
    ## installed monitor, freq [208333333], status 0                                                            
    ## Booting kernel from Legacy Image at 88000000 ...                                                         
       Image Name:   Linux-3.10.10                                                                              
       Created:      2015-03-30  16:20:30 UTC                                                                   
       Image Type:   ARM Linux Kernel Image (uncompressed)                                                      
       Data Size:    3990288 Bytes = 3.8 MiB                                                                    
       Load Address: 80008000                                                                                   
       Entry Point:  80008000                                                                                   
       Verifying Checksum ... OK                                                                                
    ## Flattened Device Tree blob at 87000000                                                                   
       Booting using the fdt blob at 0x87000000
       Loading Kernel Image ... OK
    OK
       Using Device Tree in place at 87000000, end 8700c945

    Starting kernel ...

    Please help, we need this board up and running quickly for an upcoming demo, and need USB to serial support in the kernel.

  • What changes have you been made in kernel ?
  • Added the ftdi usb to serial driver
  • Hi Robert,
    Able to success anytime by replacing the any kernel through UBIFS filesystem in linux ?
    Even using pre-built images (kernel) ?
    Try to update the kernel with pre-built kernel by using this method.

    Also I would like to suggest to use NFS booting for your development purpose.
    If its success then you can continue with UBIFS boot (NAND)
  • Sorry, I do not understand what you are asking, since the kernel does not boot up, I cannot mount the ubi0_0 drive and overwrite the kernel. The board will NOT boot, although I can get into uboot.
  • How do you setup the NFS boot method?
  • Anyone gonna answer my question and help me unbrick this board?

  • Hi, Robert,

    After replacing the kernel image with the one you built, did you "umount /mnt/boot"? If not, /mnt/boot stays opened and can not be accessed after reboot. /mnt/boot must be umounted before reboot.

    If you have worked with Marc D, please check with him. I enabled USB serial and have it working by using Moschip 7720 cable. I gave Marc instruction on how I did it.

    Rex