This document provides instructions for advanced users how Embedian offers patches and builds a customized version of u-boot and linux kernel for Embedian's SMARC T335X product platform and how to install the images to bring the evaluation board up and running.
Our aim is to fully support our hardware through device drivers. We also provide unit tests so that testing a board is easy and custom development can start precisely.
SMARC T335X at Embedian
SBC-SMART-BEE (module and carrier board) at Embedian
SBC-SMART-MEN (module and carrier board) at Embedian
This is a pre-built (32bit) version of Linaro GCC that runs on generic linux, so 64bit users need to make sure they have installed the 32bit libraries for their distribution.
debian based | extra | pkgs: (sudo apt-get update ; sudo apt-get install xyz) |
---|---|---|
Ubuntu 12.04 |
| ia32-libs |
Debian 7 (Wheezy) | sudo dpkg --add-architecture i386 | libc6:i386 libstdc++6:i386 libncurses5:i386 zlib1g:i386 |
Ubuntu 12.10 -> 14.04 |
| libc6:i386 libstdc++6:i386 libncurses5:i386 zlib1g:i386 |
Red Hat/Centos/Fedora |
| libstdc++.i686 ncurses-devel.i686 zlib.i686 |
Red Hat based (rpm) | extra | pkgs: (yum install xyz) |
Red Hat/Centos/Fedora |
| libstdc++.i686 ncurses-devel.i686 zlib.i686 |
Ubuntu 12.04 |
| ia32-libs |
Ubuntu 12.10 -> 14.04 |
| libc6:i386 libstdc++6:i386 libncurses5:i386 zlib1g:i386 |
To build Embedian’s smarct335x u-boot and linux kernel, you will need to install the Linaro arm compiler that TI used for their release: [For u-boot 2014.04, u-boot 2014.07, Linux 3.2, Linux 3.12 and Linux 3.14]
$ sudo tar -C /opt -xJf gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux.tar.xz $ export CC=/opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/bin/arm-linux-gnueabihf- |
For u-boot 2015.07 and Linux 4.1.10 or newer, you need to use the following newer Linaro arm compilier that TI used in their Processor SDK 02.00.01.07.
$ sudo tar -C /opt -xJf gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf.tar.xz $ export CC=/opt/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- |
Test:
If this test fails, verify that you have the 32bit libraries installed on your development system.
$ ${CC}gcc --version |
We recommend you use SSH keys to establish a secure connection between your computer and Embedian Gitlab server. The steps below will walk you through generating an SSH key and then adding the public key to our Gitlab account.
First, we need to check for existing ssh keys on your computer. Open up Git Bash and run:
$ cd ~/.ssh $ ls # Lists the files in your .ssh directory |
Check the directory listing to see if you have a file named either id_rsa.pub
or id_dsa.pub
. If you don't have either of those files go to step 2. Otherwise, you already have an existing keypair, and you can skip to step 3.
To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.
$ ssh-keygen -t rsa -C "your_email@example.com" # Creates a new ssh key, using the provided email as a label # Generating public/private rsa key pair. # Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press enter] $ ssh-add id_rsa |
Now you need to enter a passphrase.
Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again] |
Which should give you something like this:
Your identification has been saved in /c/Users/you/.ssh/id_rsa. Your public key has been saved in /c/Users/you/.ssh/id_rsa.pub. The key fingerprint is: 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com |
Copy the key to your clipboard.
$ cat ~/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAABDAQABAAABAQDQUEnh8uGpfxaZVU6+uE4bsDrs/tEE5/BPW7jMAxak 6qgOh6nUrQGBWS+VxMM2un3KzwvLRJSj8G4TnTK2CSmlBvR+X8ZeXNTyAdaDxULs/StVhH+QRtFEGy4o iMIzvIlTyORY89jzhIsgZzwr01nqoSeWWASd+59JWtFjVy0nwVNVtbek7NfuIGGAPaijO5Wnshr2uChB Pk8ScGjQ3z4VqNXP6CWhCXTqIk7EQl7yX2GKd6FgEFrzae+5Jf63Xm8g6abbE3ytCrMT/jYy5OOj2XSg 6jlxSFnKcONAcfMTWkTXeG/OgeGeG5kZdtqryRtOlGmOeuQe1dd3I+Zz3JyT your_email@example.c om |
Go to Embedian Git Server. At Profile Setting --> SSH Keys --> Add SSH Key
Paste your public key and press "Add Key" and your are done.
Clone the U-Boot source code from Embedian Git Server.
Download:
For u-boot v2014.04 (AMSDK6 and AMSDK7):
$ git clone git@git.embedian.com:developer/smarc-t335x-uboot.git $ cd smarc-t335x-uboot $ git checkout v2014.04-smarct33 |
For SBC-SMART-MEN $ git checkout v2014.04-smartmen |
For u-boot v2014.07 (Processor-SDK-01.00.00.03):
$ git clone git@git.embedian.com:developer/smarc-t335x-uboot.git $ cd smarc-t335x-uboot $ git checkout v2014.07-smarct33 |
Configure and Build:
$ make ARCH=arm CROSS_COMPILE=${CC} distclean $ make ARCH=arm CROSS_COMPILE=${CC} smarct335x_evm_uart3_config $ make ARCH=arm CROSS_COMPILE=${CC} |
For u-boot v2015.07 (Processor-SDK-02.00.00.00):
Download
$ git clone git@git.embedian.com:developer/smarc-t335x-uboot.git $ cd smarc-t335x-uboot $ git checkout v2015.07-smarct33 |
Configure and Build:
$ make ARCH=arm CROSS_COMPILE=${CC} distclean $ make ARCH=arm CROSS_COMPILE=${CC} smarct335x_evm_uart3_defconfig $ make ARCH=arm CROSS_COMPILE=${CC} |
Download:
For 3.2 (AMSDK6, Stable, LTS release):
$ git clone git@git.embedian.com:developer/linux-smarc-t335x-v3.2.git $ git checkout v3.2_SMARCT335xPSP_04.06.00.11 |
For board SBC-SMART-MEN: $ git checkout v3.2_SBC_SMARTMEN |
Configure and Build:
$ make ARCH=arm CROSS_COMPILE=${CC} distclean $ make ARCH=arm CROSS_COMPILE=${CC} smarc_t335x_defconfig $ make ARCH=arm CROSS_COMPILE=${CC} uImage modules |
For 3.12.y (AMSDK7, Stable, LTS):
$ git clone git@git.embedian.com:developer/smarc-ti-linux-kernel.git $ cd smarc-ti-linux-kernel $ git checkout smarc-ti-linux-3.12.y |
For 3.14.y (Processor-SDK-01.00.00.03, Stable, LTS):
$ git clone git@git.embedian.com:developer/smarc-ti-linux-kernel.git $ cd smarc-ti-linux-kernel $ git checkout smarc-ti-linux-3.14.y |
For 4.1.y (Processor-SDK-02.00.00.00, Stable, LTS):
$ git clone git@git.embedian.com:developer/smarc-ti-linux-kernel.git $ cd smarc-ti-linux-kernel $ git checkout smarc-ti-lsk-linux-4.1.y |
Configure and Build (v3.12 and later):
$ make ARCH=arm CROSS_COMPILE=${CC} distclean $ make ARCH=arm CROSS_COMPILE=${CC} smarc_t335x_defconfig $ make ARCH=arm CROSS_COMPILE=${CC} zImage modules am335x-smarct335x.dtb |
Note:
MK_FW firmware/am335x-pm-firmware.bin.gen.S make[2]: *** No rule to make target `firmware/am335x-pm-firmware.bin', needed by `firmware/am335x-pm-firmware.bin.gen.o'. Stop. make[1]: *** [firmware] Error 2 make: *** [uImage] Error 2 |
To resolve this for kernel 3.2, after you clone the kernel sources, copy the firmware binary into the firmware/ folder of kernel sources
$ cd linux-smarc-t335x-v3.2/firmware $ wget http://developer.embedian.com/download/attachments/2883656/am335x-pm-firmware.bin |
To resolve this for kernel 3.14 and kernel 4.1, after you clone the kernel sources, copy the firmware elf binary into the firmware/ folder of kernel sources
$ cd smarc-ti-linux-kernel/firmware $ wget http://developer.embedian.com/download/attachments/2883656/am335x-pm-firmware.elf
|
"mkimage" command not found - U-Boot images will not be built |
You can simply install the mkimage by:
$ sudo apt-get install uboot-mkimage |
and make the kernel again.
Arago:
User | Password |
---|---|
root | N/A |
SDK7 Download:
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/arago/smarct335x-rootfs-image-smarct335x-sdk7.tar.gz |
Verify:
$ md5sum smarct335x-rootfs-image-smarct335x-sdk7.tar.gz |
SDK6 Download:
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/arago/smarct335x-rootfs-image-smarct335x-sdk6.tar.gz |
Verify:
$ md5sum smarct335x-rootfs-image-smarct335x-sdk6.tar.gz |
Ubuntu 12.04:
User | Password |
---|---|
root | root |
ubuntu | temppwd |
Download:
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/precise/ubuntu-12.04-minimal-armhf-2012-11-29.tar.gz |
Verify:
$ md5sum ubuntu-12.04-minimal-armhf-2012-11-29.tar.gz a05cd21dc2df12daa2e9962fa92be23e ubuntu-12.04-minimal-armhf-2012-11-29.tar.gz |
Ubuntu 14.04:
User | Password |
---|---|
root | root |
ubuntu | temppwd |
Download:
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/trusty/smarc-ubuntu14.04.tar.gz |
Verify:
$ md5sum smarc-ubuntu14.04.tar.gz e883c8fca4ab5c6e396ee54202f20e35 smarc-ubuntu14.04.tar.gz |
For these instruction, we are assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.
$ export DISK=/dev/mmcblk0 |
Erase SD card:
$ |
Create Partition Layout:
$ sudo sfdisk --in-order --Linux --unit M ${DISK} <<-__EOF__ 1 , 48 , 0xE ,* ,,,- __EOF__ |
Format Partitions:
for : DISK=/dev/mmcblk0 $ sudo mkfs.vfat -F 16 ${DISK}p1 -n boot $ sudo mkfs.ext4 ${DISK}p2 -L rootfs for : DISK=/dev/sdX $ sudo mkfs.vfat -F 16 ${DISK} 1 -n boot $ sudo mkfs.ext4 ${DISK} 2 -L rootfs |
Mount Partitions:
On some systems, these partitions may be auto-mounted...
$ sudo mkdir -p /media/boot/ $ sudo mkdir -p /media/rootfs/ for : DISK=/dev/mmcblk0 $ sudo mount ${DISK}p1 /media/boot/ $ sudo mount ${DISK}p2 /media/rootfs/ for : DISK=/dev/sdX $ sudo mount ${DISK} 1 /media/boot/ $ sudo mount ${DISK} 2 /media/rootfs/ |
Install Bootloader
Copy MLO/u-boot.img to the boot partition
$ sudo cp -v MLO /media/boot/ $ sudo cp -v u-boot.img /media/boot/ |
Create "uEnv.txt" boot script: (vim uEnv.txt)
For v3.2:
optargs="consoleblank=0 mem=512M" #To boot old v3.2.x based kernel enable: (SMARC T335X and BeagleBone) #For u-boot 13.10 ###Begin Rootfs from NFS ###Begin Load kernel from TFTP
|
For 3.12.y or after :
optargs="consoleblank=0 mem=512M" loadaddr=0x82000000 initrd_high=0xffffffff loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${kernel_file} ##Un-comment to enable systemd in Debian Wheezy console=ttyO3,115200n8 mmcargs=setenv bootargs console=${console} root=${mmcroot} rootfstype=${mmcrootfstype} ${optargs} #zImage: #zImage + uInitrd: where uInitrd has to be generated on the running system. ###Begin Rootfs from NFS ###Begin Load kernel from TFTP |
For kernel 3.14.y and after, the serial port device descriptor changes from ttyO to ttyS The above uEnv.txt file needs to change accordingly. (ttyO3 --> ttyS3) |
Copy uEnv.txt to the boot partition:
$ sudo cp -v ./uEnv.txt /media/boot/ |
Copy zImage to the boot partition:
$ sudo cp -v arch/arm/boot/zImage /media/boot |
Only for v3.12.y or after:
$ sudo mkdir -p /media/boot/dtbs $ sudo cp -v arch/arm/boot/dts/am335x-smarct335x.dtb /media/boot/dtbs |
Arago SDK7:
$ sudo tar xvfz smarct335x-rootfs-image-smarct335x-sdk7.tar.gz -C /media/rootfs |
Arago SDK6:
$ sudo tar xvfz smarct335x-rootfs-image-smarct335x-sdk6.tar.gz -C /media/rootfs |
Ubuntu 12.04:
$ sudo tar xvfz ubuntu-12.04-minimal-armhf-2012-11-29.tar.gz -C /media/rootfs |
$ sudo make ARCH=arm INSTALL_MOD_PATH=/media/rootfs modules_install |
Networking:
Edit: /etc/network/interfaces
$ sudo vim /media/rootfs/etc/network/interfaces |
Add:
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp |
Remove SD card:
$ sync $ sudo umount /media/boot $ sudo umount /media/rootfs |
Setting up eMMC usually is the last step at development stage after the development work is done at your SD card or NFS environments. From software point of view, eMMC is nothing but a non-removable SD card on board. When booting from eMMC and SD card is present, SD card is emulated as /dev/mmcblk0 and eMMC is emulated as /dev/mmcblk1. On the other hand, when booting from eMMC and SD card is absent, eMMC will be emulated as /dev/mmcblk0 now. eMMC could be /dev/mmcblk0 or /dev/mmcblk1 depending on if SD card is inserted and the boot device become dynamic when booting from eMMC.
Initramfs is the successor of initrd and has many advantages over initrd. Linux kernel here will mount it as a temperately rootfs and starts the init process from here. The init script will check if the partition 2 of eMMC is exist and them mount the real rootfs.
This section gives a step-by-step procedure to setup eMMC flash. Users can write a shell script your own at production to simplify the steps.
$ cd ~/ $ mkdir initramfs $ sudo tar xvfz initramfs.tar.gz -C initramfs/ |
Note: Regarding to how to generate initramfs, users can refer to Yocto build.
$ cd <kernel source directory> $ export CC=/opt/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/bin/arm-linux-gnueabihf- $ make ARCH=arm CROSS_COMPILE=${CC} smarc_t335x_defconfig $ make ARCH=arm CROSS_COMPILE=${CC} menuconfig |
Select
General setup -->
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
() Initramfs source file(s)
Enter the directory where your initramfs is. In this example
/home/developer/initramfs
Save the kernel config.
Build for kernel 3.2:
$ make ARCH=arm CROSS_COMPILE=${CC} uImage modules |
Build for kernel 3.12.y or later:
$ make ARCH=arm CROSS_COMPILE=${CC} zImage modules am335x-smarct335x.dtb |
Insert SD card into your Linux PC. For these instructions, we are assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.
For these instruction, we are assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.
$ export DISK=/dev/mmcblk0 |
Mount Partitions:
On some systems, these partitions may be auto-mounted...
$ sudo mkdir -p /media/boot/dtbs $ sudo mkdir -p /media/rootfs/ for : DISK=/dev/mmcblk0 $ sudo mount ${DISK}p1 /media/boot/ $ sudo mount ${DISK}p2 /media/rootfs/ for : DISK=/dev/sdX $ sudo mount ${DISK} 1 /media/boot/ $ sudo mount ${DISK} 2 /media/rootfs/ |
Copy MLO to rootfs partition:
$ sudo cp -v /media/boot/MLO /media/rootfs/home/root |
Copy u-boot.img to rootfs partition:
$ sudo cp -v /media/boot/u-boot.img /media/rootfs/home/root |
Copy initramfs zImage to rootfs partition:
$ sudo cp -v <kernel source dorectory>/arch/arm/boot/zImage /media/rootfs/home/root |
For kernel v3.12.y or later:
$ sudo cp -v /media/boot/dtbs/am335x-smarct335x.dtb /media/rootfs/home/root |
Copy uEnv.txt to rootfs partition:
Copy and paste the following contents to /media/rootfs/home/root ($ sudo vim /media/rootfs/home/root/uEnv.txt)
For kernel v3.2:
optargs="consoleblank=0 mem=512M" |
For kernel v3.12.y+:
optargs="consoleblank=0 mem=512M" |
For kernel 3.14.y and after, the serial port device descriptor changes from ttyO to ttyS The above uEnv.txt file needs to change accordingly. (ttyO3 --> ttyS3) |
Copy real rootfs to rootfs partition:
$ pushd /media/rootfs $ sudo tar cvfz ~/smarct335x-emmc-rootfs.tar.gz . $ sudo mv ~/smarct335x-emmc-rootfs.tar.gz /media/rootfs/home/root $ popd |
Remove SD card:
$ sync $ sudo umount /media/boot $ sudo umount /media/rootfs |
Insert this SD card into your SMARC T335X device and boot up the devices from SD card.
Now it will be almost the same as you did when setup your SD card, but the eMMC device descriptor is /dev/mmcblk1 now.
$ export DISK=/dev/mmcblk1 |
Erase SD card:
$ |
Create Partition Layout:
$ sudo sfdisk --in-order --Linux --unit M ${DISK} <<-__EOF__ 1 , 48 , 0xE ,* ,,,- __EOF__ |
In SDK6, Arago rootfs will mount partition2 as /media/mmcblk1p2 automatically after executing the above command. Umount the partition first.
$ |
Format Partitions:
$ sudo mkfs.vfat -F 16 ${DISK}p1 -n boot $ sudo mkfs.ext4 ${DISK}p2 -L rootfs |
Mount Partitions:
$ sudo mkdir -p /media/boot/ $ sudo mkdir -p /media/rootfs/ $ sudo mount ${DISK}p1 /media/boot/ $ sudo mount ${DISK}p2 /media/rootfs/ |
Copy MLO/u-boot.img/uEnv.txt/zImage to the boot partition
$ sudo cp -v MLO u-boot.img zImage uEnv.txt /media/boot/ |
Only for v3.12.y or after:
$ sudo mkdir -p /media/boot/dtbs $ sudo cp -v am335x-smarct335x.dtb /media/boot/dtbs |
$ sudo tar -zxvf smarct335x-emmc-rootfs.tar.gz -C /media/rootfs |
Unmount eMMC:
$ sync $ sudo umount /media/boot $ sudo umount /media/rootfs |
Switch your Boot Select to eMMC and you will be able to boot up from eMMC now.
Last updated 2015-10-22