Wiki
Clone wikicalixto-buildroot / calixto-versa512
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 buildroot directory into your host system.
$ git clone git://git.busybox.net/buildroot
$ cd buildroot
$ git checkout 2015.08.x
Now enter into board directory and clone calixto bsp
$ cd board
$ git clone https://bitbucket.org/calixtolinuxplatform/calixto-buildroot.git calixto
Enter into calixto directory
$ cd 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 ../..
enter into buildroot directory, copy sample configuration files provided by calixto for its SOMs into config directory
$ cp board/calixto/configs/* configs/
Building
Building sample image,
$ make clean
$ make calixto_versa512_defconfig
$ make
Output Image Location
The Images for Versa with ddr 512 SOM will be in following directory calixto-images/versa512/buildroot-image
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/versa512/buildroot-image/SD_Card/
Insert SD Card in to the host system and prepare sd card
$ cd calixto-images/versa512/buildroot-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@versa-nxt:~# cd /etc/ root@versa-nxt:/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@versa-nxt:~# 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/versa512/buildroot-image/eMMC-ethflasher/
- am335x-calixto-nxt.dtb
- flasher.sh
- rootfs.tar
- zImage
-
Copy all files to tftpboot folder in your host
$ cp calixto-images/versa512/buildroot-image/eMMC-ethflasher/* /tftpboot/
-
Connect ethernet cable to target board
- After completion of flashing restart the board
- On target set to boot from ethernet for flashing
NFS
- On target set to boot from ethernet for flashing
root@versa-nxt:~# 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/versa512/buildroot-image/nfs/
- am335x-calixto-nxt.dtb
- rootfs.tar
- zImage
Copy all files to tftpboot folder in your host
$ cp calixto-images/versa512/buildroot-image/nfs/zImage /tftpboot/ $ cp calixto-images/versa512/buildroot-image/nfs/am335x-calixto-nxt.dtb /tftpboot/
Extract rootfs in your host
$ rm -rf /export/rootfs/* $ tar -xf calixto-images/versa512/buildroot-image/nfs/rootfs.tar -C /export/rootfs/
Connect ethernet cable to target board
- Restart the board
Configuring Kernel
Please go through board/calixto/versa-nxt/docs/Calixto-AM335x-VERSA-SOM-Data_Manual-V07.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/versa-nxt/linux-calixto_4.1.18/ddr512/am335x-calixto-nxt.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/versa-nxt/linux-calixto_4.1.18/calixto_nxt_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/versa-nxt/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 Versa 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@versa-nxt:~# fw_setenv boot_targets mmc
root@versa-nxt:~# fw_setenv bootdelay 3
Do a clean build
$ make clean
$ make calixto_versa512_defconfig
$ make
Insert SD Card in to the host system and prepare sd card
$ cd calixto-images/versa512/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
-
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@versa-nxt:~# fw_setenv ethaddr f0:ee:f1:54:35:09
-
If we don't plan to use sd card slot in our custom board based on VERSA SOM.Is there another way to flash the generated image into eMMC?
Ans:Yes,please refer Flashing Image from Ethernet section in this page
-
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@versa-nxt:~# fw_setenv optargs quiet
Please run the following command from console to renable it.
root@versa-nxt:~# fw_setenv optargs
-
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@versa-nxt:~# fw_setenv bootdelay 0
Updated