The main purpose of this document is to help developers understand the overall software layout structure and enable them to compile each part of the software separately. It 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 platform and how to install the images to bring the evaluation board up and running. It is very helpful for gaining a better understanding of the entire system.

The host Linux machine is recommended Ubuntu 16.04.
Once you have Ubuntu 16.04 LTS running, install the additional required support packages using the following console command:
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo build-essential chrpath libsdl1.2-dev xterm python python-m2crypto bc dos2unix socat libsdl1.2-dev -y
Availability
SMARC-T3354 at Embedian.
Carrier Board
EVK-SMART-BEE (for all SMARC 1.0 modules) at Embedian.
Basic Resources
- ARM Cross Compiler
- Linaro: https://launchpad.net/linaro-toolchain-binaries
- Bootloader
- Das U-Boot – the Universal Boot Loader http://www.denx.de/wiki/U-Boot
- Source – http://git.denx.de/?p=u-boot.git;a=summary
- Linux Kernel
- Linus’s Mainline tree: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary
- TI Linux source tree: http://git.ti.com/git/ti-linux-kernel/ti-linux-kernel.git
- TI’s overall Processor SDK build and test process: http://arago-project.org/git/projects/tisdk-build-scripts.git
- Embedian SMARC-T3354 Linux kernel source tree: https://github.com/embedian/smarc-fsl-linux-kernel.git
ARM Cross Compiler: GCC
To build Embedian’s SMARC-T3354 u-boot and linux kernel, you will need to install the following ARM compiler:
For u-boot 2017.04 and Linux kernel 4.9.41 (paired by TI Processor SDK 04.01.00.06 release), you need to use the following Arm compiler.
$ wget -c http://releases.linaro.org/components/toolchain/binaries/6.2-2016.11/arm-linux-gnueabihf/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf.tar.xz
$ sudo tar -C /opt -xJf gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf.tar.xz
$ export CC=/opt/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
Test:
arm-linux-gnueabihf-gcc (Linaro GCC 6.2-2016.11) 6.2.1 20161016$ ${CC}gcc --version
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Bootloader: U-Boot
The boot file is called u-boot.imx. Clone the U-Boot source code from Embedian Guthub Server.
For u-boot 2017.01 and Linux kernel 4.9.41 (Paired from TI Processor SDK 04.01.00.06 release)
Download:
For u-boot v2017.01: (Paired from TI Processor SDK 04.01.00.06 release)
$ git clone https://github.com/embedian/smarc-uboot.git v2017.01 -b v2017.01-smarct3x
Notes
Note 1:
If Boot up from eMMC, change #define CONFIG_SYS_MMC_ENV_DEV from 0 to 1 in include/configs/smarct335x_evm.h file and compile again. User can also
$ git clone https://github.com/embedian/smarc-uboot.git v2017.01 -b v2017.01-smarct3x-emmc
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}
Notes
Note 1:
“ser3” stands for console debug port in SMARC definition. In this example, we uses SER3 as debug port. If user uses SER0 as your debug port, make change to “ser0” instead, and same as SER1.
Linux Kernel
Download:
For Linux Kernel v4.9.41 (Paired from TI Processor SDK 04.01.00.06 release)
$ git clone https://github.com/embedian/smarc-ti-linux-kernel.git v4.9.41 -b smarct3x-processor-sdk-04.01.00.06
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} zImage modules am335x-smarct335x.dtb
All available DTB files are listed in the table below.
DTB FILENAME | DESCRIPTION |
am335x-smarct335x.dtb | Device tree binary for SMARC-T335X |
Root File System
Ubuntu 16.04 Xenial:
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/ubuntu/xenial/am-ubuntu-16.04.2-armhf-2017-03-02.tar.gz
Verify:
$ md5sum am-ubuntu-16.04.2-armhf-2017-03-02.tar.gz
c6f1a6b72fb4e3373f2f62d73078bb8d am-ubuntu-16.04.2-armhf-2017-03-02.tar.gz
Debian 11 Bullseye:
USERNAME | PASSWORD |
root | root |
debian | temppwd |
Debian 11 Bullseye Download:
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/debian/bullseye/am-debian-11.5-minimal-armhf-2022-10-06.tar.gz
Verify:
$ md5sum am-debian-11.5-minimal-armhf-2022-10-06.tar.gz
0749b64bb8b87a5d2f2459081b10e73c am-debian-11.5-minimal-armhf-2022-10-06.tar.gz
Yocto Morty (TI Processor SDK 04.01.00.06):
USERNAME | PASSWORD |
root | N/A |
Yocto Morty Download:
$ wget -c ftp://ftp.embedian.com/public/dev/minfs/dev/minfs/morty/smarct335x-rootfs-image-smarct335x.tar.xz
Verify:
$ md5sum smarct335x-rootfs-image-smarct335x.tar.xz
43ed7b4b937d4143530d1ba15485cbd7 smarct335x-rootfs-image-smarct335x.tar.xz
Setup SD Card
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:
$ sudo dd if=/dev/zero of=${DISK} bs=1M count=160
Create Partition Layout: Leave 1MB offset for boot file. With util-linux v2.26, sfdisk was rewritten and is now based on libfdisk.
(sfdisk)
$ sudo sfdisk --version
sfdisk from util-linux 2.34
Create Partitions:
(sfdisk >=2.26.x)
$ sudo sfdisk ${DISK} <<-__EOF__
1M,48M,0x83,*
,,,-
__EOF__
(sfdisk <=2.25)
$ 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
build/arago-tmp-external-linaro-toolchain/deploy/images/smarct335x
$ sudo cp -v MLO /media/boot/
$ sudo cp -v u-boot.img /media/boot/
Install uEnv.txt based bootscript
Create “uEnv.txt” boot script: ($ vim uEnv.txt)
~/uEnv.txt
optargs=”consoleblank=0 mem=512M”
#u-boot eMMC specific overrides; Angstrom Distribution (SMARC-T335X) 2014-05-20
kernel_file=zImage
initrd_file=initrd.img
loadaddr=0x82000000
initrd_addr=0x88080000
fdtaddr=0x88000000
fdtfile=am335x-smarct335x.dtb
initrd_high=0xffffffff
fdt_high=0xffffffff
loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${kernel_file}
loadinitrd=load mmc ${mmcdev}:${mmcpart} ${initrd_addr} ${initrd_file}; setenv initrd_size ${filesize}
loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /dtbs/${fdtfile}
#
##Un-comment to enable systemd in Debian Wheezy
#optargs=quiet init=/lib/systemd/systemd
console=ttyS3,115200n8
mmcroot=/dev/mmcblk1p2 ro
mmcrootfstype=ext4 rootwait fixrtc
mmcargs=setenv bootargs console=${console} root=${mmcroot} rootfstype=${mmcrootfstype} ${optargs}
#zImage:
uenvcmd=run loadimage; run loadfdt; run mmcargs; bootz ${loadaddr} – ${fdtaddr}
#zImage + uInitrd: where uInitrd has to be generated on the running system.
#boot_fdt=run loadimage; run loadinitrd; run loadfdt
#uenvcmd=run boot_fdt; run mmcargs; bootz ${loadaddr} ${initrd_addr}:${initrd_size} ${fdtaddr}
###Begin Rootfs from NFS
#serverip=192.168.1.51
#rootpath=/srv/nfs/smarct335x/ubuntu1204/
#nfsopts=nolock,acdirmin=60
#netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
##netboot=echo Loading kernel from SDCARD and booting from NFS …; run loadimage; run netargs; bootz ${loadaddr} – ${fdtaddr}
##uenvcmd=run netboot
###End Rootfs from NFS
###Begin Load kernel from TFTP
#netmask=255.255.255.0
#ipaddr=192.168.1.65
#serverip=192.168.1.51
#netboot=echo Loading kernel and device tree from TFTP and booting from NFS …; setenv autoload no; tftp ${loadaddr} ${kernel_file}; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} – ${fdtaddr}
#uenvcmd=run netboot
###End Load kernel from TFTP
Copy uEnv.txt to the boot partition:
~/
$
sudo cp -v ~/uEnv.txt /media/boot/
Install Linux Kernel zImage
Copy zImage to the boot partition:
~/<linux kernel source directory>/
$ sudo cp -v arch/arm/boot/zImage /media/boot/
Install Linux Kernel Device Tree Binary
~/<linux kernel source directory>/
$ sudo mkdir -p /media/boot/dtbs
$ sudo cp -v zImage-am335x-smarct335x.dtb /media/boot/dtbs/am335x-smarct335x.dtb
All available DTB binary files are listed in the table below.
DTB FILENAME | DESCRIPTION |
am335x-smarct335x.dtb | Device tree binary for SMARC-T335X |
Install Root Filesystem
Extract root filesystem to your SD card
~/<directory where your rootfs is>/
$ sudo tar jxvf <filename.tar.bz2> -C /media/rootfs
~/<directory where your rootfs is>/
$ sudo tar xvfz <filename.tar.gz> -C /media/rootfs
Install Kernel Modules
~/<Linux kernel source directory>/
$ sudo make ARCH=arm CROSS_COMPILE=${CC} INSTALL_MOD_PATH=/media/rootfs modules_install
Notes
1. SMARC-T335X boots up from SD card or on-module eMMC flash depending on the BOOT_SEL configuration that defined by SMARC specification on your carrier board and load Image and device tree blob from the partition one of the device (could be SD card, eMMC, GBE,..etc) that you selected.
2. MAC address is factory pre-installed at on board I2C EEPROM at offset 60 bytes. It starts with Embedian’s vendor code 10:0D:32. u-boot will read it and pass this parameter to kernel.
3. The kernel modules is already included in the rootfs.
Remove SD card:
$ sync
$ sudo umount /media/boot
$ sudo umount /media/rootfs
Setup eMMC
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. For SMARC-T335X, the SD card is always emulated as /dev/mmcblk1
and on-module eMMC is always emulated as /dev/mmcblk0
. Setting up eMMC now is nothing but changing the device descriptor.
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.
First, we need to backup the final firmware from your SD card or NFS.
Prepare for eMMC binaries from SD card (or NFS):
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/
$ 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
<u-boot source directory>
$ sudo cp -v MLO /media/rootfs/home/root
Copy u-boot.img to rootfs partition
<u-boot source directory>
$ sudo cp -v u-boot.img /media/rootfs/home/root
Notes
The U-Boot for eMMC Boot up has one line difference in include/configs/smarct335x_evm.h. The mmcdev for SD boop up is 0 and is 1 for eMMC boot up. Please go to
recipes-bsp/u-boot/u-boot-smarct335x_2017.01-smarct335x.bb and make changes as follows.
# BRANCH = “v2017.01-smarct3x”
# SRCREV = “93e96ce2ff6bd0458bcf3ab2861832b277628277”
BRANCH = “v2017.01-smarct3x-emmc”
SRCREV = “3f80471242ce4c8754ab700a97a32111e17c96d7”
Copy zImage to rootfs partition
<kernel source directory>
$ sudo cp -v zImage /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)
~/uEnv.txt
optargs=”consoleblank=0 mem=512M”
#u-boot eMMC specific overrides; Angstrom Distribution (SMARC-T335X) 2014-05-20
kernel_file=zImage
initrd_file=initrd.img
loadaddr=0x82000000
initrd_addr=0x88080000
fdtaddr=0x88000000
fdtfile=am335x-smarct335x.dtb
initrd_high=0xffffffff
fdt_high=0xffffffff
loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${kernel_file}
loadinitrd=load mmc ${mmcdev}:${mmcpart} ${initrd_addr} ${initrd_file}; setenv initrd_size ${filesize}
loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdtaddr} /dtbs/${fdtfile}
#
##Un-comment to enable systemd in Debian Wheezy
#optargs=quiet init=/lib/systemd/systemd
console=ttyS3,115200n8
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait fixrtc
mmcargs=setenv bootargs console=${console} root=${mmcroot} rootfstype=${mmcrootfstype} ${optargs}
#zImage:
uenvcmd=run loadimage; run loadfdt; run mmcargs; bootz ${loadaddr} – ${fdtaddr}
#zImage + uInitrd: where uInitrd has to be generated on the running system.
#boot_fdt=run loadimage; run loadinitrd; run loadfdt
#uenvcmd=run boot_fdt; run mmcargs; bootz ${loadaddr} ${initrd_addr}:${initrd_size} ${fdtaddr}
###Begin Rootfs from NFS
#serverip=192.168.1.51
#rootpath=/srv/nfs/smarct335x/ubuntu1204/
#nfsopts=nolock,acdirmin=60
#netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
##netboot=echo Loading kernel from SDCARD and booting from NFS …; run loadimage; run netargs; bootz ${loadaddr} – ${fdtaddr}
##uenvcmd=run netboot
###End Rootfs from NFS
###Begin Load kernel from TFTP
#netmask=255.255.255.0
#ipaddr=192.168.1.65
#serverip=192.168.1.51
#netboot=echo Loading kernel and device tree from TFTP and booting from NFS …; setenv autoload no; tftp ${loadaddr} ${kernel_file}; tftp ${fdtaddr} ${fdtfile}; run netargs; bootz ${loadaddr} – ${fdtaddr}
#uenvcmd=run netboot
###End Load kernel from TFTP
Copy device tree binary to rootfs partition
<kernel source directory>
$ sudo cp -v /media/boot/dtbs/am335x-smarct335x.dtb /media/rootfs/home/root/am335x-smarct335x.dtb
Copy final root file system to rootfs partition
build/arago-tmp-external-linaro-toolchain/deploy/images/smarct335x
$ 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
rootfs$ sudo umount /media/
Copy Binaries to eMMC from SD card
Insert this SD card into your SMARC-T335X device.
Now it will be almost the same as you did when setup your SD card, but the eMMC device descriptor is /dev/mmcblk0 now. Booting up the device from SD card (shunt cross TEST#).
$ export DISK=/dev/mmcblk0
Erase eMMC:
$ sudo dd if=/dev/zero of=${DISK} bs=1M count=160
Create Partition Layout:
$ sudo sfdisk --in-order --Linux --unit M ${DISK} <<-__EOF__
1,48,0x83,*
,,,-
__EOF__
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 binaries to boot partition
Copy uEnv.txt/Image/*.dtb to the boot partition
$ sudo cp -v zImage uEnv.txt /media/boot/
Copy Linux kernel device tree binary
$ sudo mkdir -p /media/boot/dtbs
$ sudo cp -v am335x-smarct335x.dtb /media/boot/dtbs/
Copy root file system to rootfs partition
$ 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 (OFF ON ON) and you will be able to boot up from eMMC now.
version 1.0a, 10/28/2024
Last updated 2024-10-28