1 Overview
Ubuntu Linaro Alip is pre built file system. For more information Ubuntu based Rootfs provided by Linaro. Variscite used linaro-vivid-alip-20151215-714 image added Vivante Graphic acceleration and compile the GStreamer with i.MX6 support.
Build Ubuntu Alip NFS is prerequisite step. Please make sure you run it and have a complete NFS build directory as described in the linked WIKI. Also make sure you target is booted from NFS. We deliver a complete Linux in source code adopted to our development platforms. Our customers may require additional changes. You can change and adopt the Linux kernel and/or the device tree’s to your requirements.
2 Linux Changes
$ cd ~/var-som-mx6-alip $ export PATH=/opt/gcc-linaro-arm-linux-gnueabihf-4.9-2014.05_linux/bin/:$PATH
Make your kernel changes and test them. Most of the changes will be in Linux kernel configuration. For example:
Add a printer gadget $ make -j6 ARCH=arm CROSS_COMPILE=aarm-linux-gnueabihf- menuconfig
diff .config arch/arm/configs/imx_v7_var_ubuntu_defconfig 3359c3359 < CONFIG_USB_G_PRINTER=m --- ># CONFIG_USB_G_PRINTER is not set
$ cp .config arch/arm/configs/imx_v7_var_custom_defconfig $ git status On branch imx_3.14.38_6qp_ga_var01 Untracked files: (use "git add . " to include in what will be committed) arch/arm/configs/imx_v7_var_custom_defconfig nothing added to commit but untracked files present (use "git add" to track) $ git add arch/arm/configs/imx_v7_var_custom_defconfig $ git commit -a -m "Custom"
3 Build and run the system
root@var-som-mx6:~# find /lib/modules/ -name *.ko | grep print /lib/modules/3.14.38-6QP+g5b28091/kernel/drivers/usb/gadget/g_printer.ko
1 Introduction
Variscite supports its VAR-SOM-MX6 with Linaro Ubuntu (11.10) distribution.
Your Ubuntu folder on your CD / FTP contains ready-to-run pre-built image which contain:Kernel, U-boot, and Ubuntu File system.
2 Installation
Plug your SD card to your Linux machine, run dmesg and see which device is added (i.e. /dev/sd X ). Copy the Ubuntu image to your SD card:
$ gunzip mx6-som-ubuntu-oneric-sd.vx.img.gz $ dd if=mx6-som-ubuntu-oneric-sd.vx.img of=/dev/sdX bs=4M
3 Boot
The default u-boot environment settings will load the on-som Nand flash based image.
In order to boot from SD-Card:
- use our standard nand-recovery image. Boot into it and flash Yocto by running «nand-recovery.sh» after boot.
- reboot the system (nand). Hit space bar to go into u-boot prompt.
- change the environment variables:
U-Boot > setenv bootcmd run bootcmd_mmc U-Boot > saveenv
This method will use the u-boot from nand while booting kernel and using fileystem from the sd-card.
The default username and password are:
4 Build Kernel and U-Boot from Sources
4.1 Linux
$ mkdir ~/VAR-MX6-ub/ $ cd ~/VAR-MX6-ub/ $ git clone git://github.com/varigit/linux-2.6-imx.git $ cd linux-2.6-imx/ $ git checkout -b rel_imx_3.0.35_4.1.0-var17-release remotes/origin/rel_imx_3.0.35_4.1.0-var17-release
Comment:
get var_som_mx6_ubuntu_defconfig from the ftp site and relpace arch/arm/configs/var_som_mx6_ubuntu_defconfig with it.
$ make ARCH=arm CROSS_COMPILE=arm-fsl-linux-gnueabi- mrproper $ make ARCH=arm CROSS_COMPILE=arm-fsl-linux-gnueabi- var_som_mx6_ubuntu_defconfig $ make -j7 ARCH=arm CROSS_COMPILE=arm-fsl-linux-gnueabi- uImage $ make -j7 ARCH=arm CROSS_COMPILE=arm-fsl-linux-gnueabi- modules
Comment:
/dev/mmcblk0 is used here in all SD card commands. You need to use dmesg and change it to your device name.
Flash the kernel to the sd-card and transfer the modules:
$ sudo dd if=arch/arm/boot/uImage of=/dev/mmcblk0 bs=512 seek=2048 conv=fsync;sync $ sudo make ARCH=arm CROSS_COMPILE=arm-fsl-linux-gnueabi- modules_install INSTALL_MOD_PATH=/media/VAR_MX6_UB4.1/
4.2 u-boot
$ cd ~/VAR-MX6-ub/ $ git clone git://github.com/varigit/uboot-imx $ cd uboot-imx/ $ git checkout -b imx_v2009.08_3.0.35_4.1.0-var15 remotes/origin/imx_v2009.08_3.0.35_4.1.0-var15
$ make -j6 ARCH=arm CROSS_COMPILE=arm-fsl-linux-gnueabi- mrproper $ make ARCH=arm CROSS_COMPILE=arm-fsl-linux-gnueabi- mx6q_var_som_config $ make -j6 ARCH=arm CROSS_COMPILE=arm-fsl-linux-gnueabi-
Flash u-boot to the sd-card:
$ sudo dd if=u-boot.bin of=/dev/mmcblk0 bs=512 seek=2 skip=2 conv=fsync; sync
Un mount the sdcard. Press eject first.
3 Step Three: Evaluation Kit Power Up
You should have the serial cable connected to the debug port, as describe in the quick start guide.
Under Ubuntu (or other Linux based OS) minicom or picocom are recommended.
Under Windows PuTTY or Tera Term are recommended.
For example, to use picocom under Ubuntu:
Open a terminal a run:
$ dmesg One of the last lines should be something like: "FTDI USB Serial Device converter now attached to ttyUSBX" (the X should be a number) $ sudo apt-get install picocom $ sudo picocom -b 115200 /dev/ttyUSBX (replace the X with the number from the dmesg output). (If you want to exit picocom press Ctrl+A+X)
And to use PuTTY under Windows:
Click the "Windows key"+"R" to open the "Run" window, type "devmgmt.msc" and hit "Enter" to open the Device Manager. In Device Manager, expend the "Ports (COM & LTP)" entry. You should have a "USB Serial Port (COMXX)" entry there after you connect the Debug cable (the XX should be a number). In the Putty "Session" screen: Choose "Serial" under "Connection type". in the "Serial line" field, put in COMXX (replace the XX with the number seen in your Device Manager). Under "Speed" put in "115200". In the "Connection" -> "Serial" screen: Make sure the "Data bits" are set to "8", "Stop bits" to "1", "Parity" to "None" and "Flow control" to "None". Click on "Open".
Note:
If you are using a virtual machine, make sure the USB device is used by the correct OS.
Power up the board.
When board boots, make sure you see the U-Boot and kernel prints on your host PC terminal. You will need to type-in commands in the command prompt late in the development stages.
The Linux login is root (no password).
4 Step Four: A quick test with a recovery SD card
Please follow the below guide to boot the DVK with a bootable SD card, and burn a complete Yocto/Android into the SOM’s internal storage device/s.
5 Step Five: What next?
Your next step can be one of :
- Build a complete Yocto (Krogoth). This guide will help you build a complete Yocto build, resulting in all required binaries to create a full bootable Yocto SD card, and all required binaries to burn to the SOM’s internal storage device/s.
- Yocto common build errors
- Use your pre-built recovery SD card, as-is, to boot system, and start applications programming.
- Hello World ‘C’ application
- Building A QT Hello World
- Debugging with Eclipse
- TFTP & NFS