Wiki

Clone wiki

meta-calixto / calixto-stamp

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-stamp"

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-image-base

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-stamp/calixto-image-base

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

The wiki uses calixto-image-base 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-stamp/calixto-sample-image/SD_Card/

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

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

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

NAND

Inorder to use built in NAND 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-stamp:~# cd /etc/
    root@calixto-stamp:/etc# ./flash_nand.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-stamp:~# 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-stamp/calixto-sample-image/NAND-ethflasher/
      
      • calixto-stamp.out
      • debrick.scr
    • Copy all files to tftpboot folder in your host

       $ cp calixto-images/calixto-stamp/calixto-sample-image/NAND-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-stamp:~# 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-stamp/calixto-sample-image/nfs/
    
    • am335x-calixto-stamp.dtb
    • rootfs.tar
    • zImage
  • Copy all files to tftpboot folder in your host

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

     $ rm -rf /export/rootfs/*
     $ tar -xf calixto-images/calixto-stamp/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/stamp/docs/AM335x_STAMP_PIN_MUX_TABLE.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/stamp/linux-calixto_4.1.18/am335x-calixto-stamp.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/stamp/linux-calixto_4.1.18/calixto_stamp_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/stamp/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 Stamp 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@stamp:~# fw_setenv boot_targets mmc
root@stamp:~# fw_setenv bootdelay 3

Do a clean build

$ make clean
$ make calixto_stamp_defconfig
$ make

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

$ cd calixto-images/stamp/buildroot-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@stamp:~# 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 STAMP SOM.Is there another way to flash the generated image into NAND?

    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@stamp:~# fw_setenv optargs quiet
    

    Please run the following command from console to renable it.

    root@stamp:~# 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@stamp:~# fw_setenv bootdelay 0
    

Updated