Wiki

Clone wiki

meta-calixto / calixto-optima512

Host System Requirements

Host machine running a GNU/Linux OS preferably Ubuntu 14.04

Please ensure you have git installed in your host machine

$ sudo apt-get install git

Clone the yocto buildsystem into your host system.

$ git clone -b krogoth git://git.yoctoproject.org/poky.git

Now clone calixto bsp layer

$ git clone -b krogoth  https://calixtolinuxplatform@bitbucket.org/calixtolinuxplatform/meta-calixto.git

Enter into calixto directory

$ cd meta-calixto

Now run the script file to install basic packages required for building the images.

Note : this script was tested for Ubuntu 14.04.You may have to manually install packages if Ubuntu 14.04 is not your distribution

$ sudo ./install_prerequisites.sh 
$ cd ../

Create yocto build directory

$ cd poky
$ source oe-init-build-env ../build

Add calixto-bsp (meta-calixto)layer to yocto build configuration. Append file conf/bblayers.conf like shown below (Here a sample path of bsp layer is given,User should add the path where calixto bsp layer(meta-calixto) is cloned in their machine)

$ BBLAYERS += "/home/user/yocto/meta-calixto "

Configure MACHINE for which image has to build. Append file conf/local.conf like shown below

$ MACHINE = "calixto-optima512"

Come out of build directory

$ cd ../

Building

Enter into build directory

$ cd poky
$ source oe-init-build-env ../build

Building sample image provided by calixto,

$ bitbake calixto-sample-image

Note: There are other images provided by Yocto such as core-image-base,core-image-minimal

Output Image Location

After building calixto-sample-image,the output images for the same will be in calixto-images/calixto-optima512/calixto-sample-image

After building core-image-base,the output images for the same will be in calixto-images/calixto-optima512/core-image-base

The wiki uses calixto-sample-image as an example, replace it with the name of the image you have build

Booting

SD Card

First check whether following files are in the output directory

  • create-sdcard-boot.sh
  • MLO
  • MLO.byteswap
  • u-boot.img
  • rootfs.tar
$ ls calixto-images/calixto-optima512/calixto-sample-image/SD_Card/

Insert SD Card in to the host system and prepare sd card

$ cd calixto-images/calixto-optima512/calixto-sample-image/SD_Card
$ ./create-sdcard-boot.sh
$ cd -

Now insert the same SD Card to the slot in the board,power on

eMMC

Inorder to use built in eMMC as rootfs location,first it has to flashed.The image can either be flashed after booting from SD Card.In situation where one doesnt have SD Card slot built in to their custom board,the image also can be flashed through ethernet

  • Flashing Image from SD Card

    Boot from SD Card as described in the previous section. Then run following script in the target board.

    root@calixto-optima512:~# cd /etc/
    root@calixto-optima512:/etc# ./flash_emmc.sh
    

    After completion of flashing,Power off,Remove SD Card and Power On

  • Flashing Image from Ethernet

    • On target set to boot from ethernet for flashing
       root@calixto-optima512:~# fw_setenv boot_targets flasher
      

      It can be set from u-boot prompt by

       U-Boot# setenv boot_targets flasher
       U-Boot# saveenv
       U-Boot# boot
      
    • Setup a tftp Server in the host machine
    • Change ethernet IPv4 Settings in the host machine

      Open Network Connections Window(Go to VPN Connections->Configure VPN)

      Edit Wired Connection 1 (Ethernet->Wired Connection 1->Edit)

      Change Method in IPv4 Setting as Shared to Other Computers and Save

    • Restart the host machine
    • Ensure following files are in the output build directory

       $ ls calixto-images/calixto-optima512/calixto-sample-image/eMMC-ethflasher/
      
      • am335x-calixto-optima.dtb
      • flasher.sh
      • rootfs.tar
      • zImage
    • Copy all files to tftpboot folder in your host

       $ cp calixto-images/calixto-optima512/calixto-sample-image/eMMC-ethflasher/* /tftpboot/
      
    • Connect ethernet cable to target board

    • After completion of flashing restart the board

NFS

  • On target set to boot from ethernet for flashing
     root@calixto-optima512:~# fw_setenv boot_targets net
    

    It can be set from u-boot prompt by

     U-Boot# setenv boot_targets net
     U-Boot# saveenv
     U-Boot# boot
    
  • Setup a tftp Server in the host machine
  • Setup a NFS Server in the host machine
  • Change ethernet IPv4 Settings in the host machine

    Open Network Connections Window(Go to VPN Connections->Configure VPN)

    Edit Wired Connection 1 (Ethernet->Wired Connection 1->Edit)

    Change Method in IPv4 Setting as Shared to Other Computers and Save

  • Restart the host machine
  • Ensure following files are in the output build directory

     $ ls calixto-images/calixto-optima512/calixto-sample-image/nfs/
    
    • am335x-calixto-optima.dtb
    • rootfs.tar
    • zImage
  • Copy all files to tftpboot folder in your host

     $ cp calixto-images/calixto-optima512/calixto-sample-image/nfs/zImage /tftpboot/
     $ cp calixto-images/calixto-optima512/calixto-sample-image/nfs/am335x-calixto-optima.dtb /tftpboot/
    
  • Extract rootfs in your host

     $ rm -rf /export/rootfs/*
     $ tar -xf calixto-images/calixto-optima512/calixto-sample-image/nfs/rootfs.tar -C /export/rootfs/
    
  • Connect ethernet cable to target board

  • Restart the board

Configuring Kernel

Please go through board/calixto/optima/docs/Calixto_AM335x_OPTIMA_SOM_DataManualV05.pdf for mapping SOM pin numbers to processor pins.Then,According to your need add and/or remove device tree entries from default device tree source file.TI Pin Mux tool can be used for generating dts entry for pins

$ gedit board/calixto/optima/linux-calixto_4.1.18/ddr512/am335x-calixto-optima.dts

Now Configure the kernel options according to your need and build the image

$ make linux-menuconfig
$ make linux-rebuild
$ make

Test the image with new kernel on the target board and if everything is working as you wished it to be, save the kernel configuration file

$  cp output/build/linux-4.1.18/.config board/calixto/optima/linux-calixto_4.1.18/calixto_optima_linux_defconfig

Configuring rootfs

First build image with your customization using menuconfig

$ make menuconfig
$ make

Test the image on the target board,and if everything is fine save the configuration for future use.

$ cp .config configs/custom_imagename_defconfig

Building Applications

Before starting to build set cross compiler definitions
For setting cross compiler path, change buildroot_path variable in buildroot/board/calixto/am335x/compiler_settings.sh
For eg buildroot_path=/home/user to buildroot_path=/home/sooraj/project/ Now source the script

$ source buildroot/board/calixto/am335x/compiler_settings.sh

Go to your application and build it. To add the application in the rootfs append post build script of the som

install -D -m 755 /your_app_path_in_host $TARGET_DIR/your_app_path_in_target

post build script will be in board/calixto/optima/post-build.sh

Note:- Please go through sample applications in the below repository

 $ git clone https://calixtolinuxplatform@bitbucket.org/calixtolinuxplatform/linux-sampleapps.git

Updating Bootloader

Calixto Optima SOMs are preloaded with latest u-boot.Calixto may do some feature enhancement in u-boot.To use the latest version of u-boot,

On target set to boot from SD card and set bootdelay so that we can get into u-boot prompt

root@calixto-optima512:~# fw_setenv boot_targets mmc
root@calixto-optima512:~# fw_setenv bootdelay 3

Build calixto-sample-image in your host machine

$ cd poky
$ source oe-init-build-env ../build 
$ bitbake -c cleansstate calixto-sample-image
$ bitbake calixto-sample-image

Insert SD Card in to the host system and prepare sd card

$ cd calixto-images/calixto-optima512/calixto-sample-image/SD_Card
$ ./create-sdcard-boot.sh
$ cd -

Now insert the same SD Card to the slot in the board,power on, and Hit any key to stop autoboot Then give following commands from the u-boot prompt

U-Boot# run reflash_spi
U-Boot# reset

Frequently Asked Questions

  1. How to set custom MAC address to ethernet PHY on AM335x based SOMs?

    Ans:Assume the MAC to be set is f0:ee:f1:54:35:09.You can set custom MAC by executing following command from console.

    root@calixto-optima512:~# fw_setenv ethaddr f0:ee:f1:54:35:09
    
  2. If we don't plan to use sd card slot in our custom board based on OPTIMA SOM.Is there another way to flash the generated image into eMMC?

    Ans:Yes,please refer Flashing Image from Ethernet section in this page

  3. How to remove linux kernel messages during booting (quiet boot)

    Ans:Running following command will remove all kernel related messages other than errors from the console.

    root@calixto-optima512:~# fw_setenv optargs quiet
    

    Please run the following command from console to renable it.

    root@calixto-optima512:~# fw_setenv optargs
    
  4. How to change bootdelay in u-boot

    Ans:The default bootdelay in u-boot is 3 seconds,one can remove the delay , (i.e set it to 0) by

    root@calixto-optima512:~# fw_setenv bootdelay 0
    

Updated