Message-ID: <970440977.5217.1711653099035.JavaMail.root@dns3> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_5216_938040572.1711653099035" ------=_Part_5216_938040572.1711653099035 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
On this page:
Eric Lee= p>
version 1.0a, 8/19/2014
This document describes how Embedian builds a customized version of TI= =E2=80=99s am335x AMSDK 7.0 release for Embedian's SMARC T335X product plat= form. The approach is to pull from Embedian's public facing GIT repository = and build that using bitbake. The reason why we use this approach is that i= t allows co-development. The build output is comprised of binary image= s, feed packages, and an SDK for SMARC T335X specific development.
TI makes their AMSDK Arago build scripts available via the following GIT= repository:
=20 =20
=20 =20
It is this repository that actually p= ulls in the oe-layersetup= project to perform the Linu= x AMSDK builds for TI=E2=80=99s entire suite of ARM CortextA chips. In this= document we are only concerned with the oe-layersetup&nbs= p;project.
The supplied meta-embedian-sdk7 Yocto compliant layer has the following organization:
=20 =20
Notes on meta-embedian-sdk7 layer content
conf/machine/*
This folder contains the machine definiti= ons for the smarct335x platform and bac= kup repository in Embedian. These select the associated kernel, kernel conf= ig, u-boot, u-boot config, and UBI image settings.
recipes-bsp/u-boot/*
This folder contains recipes used to buil= d DAS U-boot for smarct335x platform.= p>
recipes-connectivity/lftp/=
*
This folder adds lftp ftp client utility = for smarct335x platform.
=
p>
recipes-core/base-files/*
This recipe is used to amend the device h= ostname for the platform.
recipes-core/busybox/*
This recipe modifies TI=E2=80=99s BusyBox= configuration to remove telnet from the image.
recipes-core/images/*
These recipes are used to create the fina= l target images for the devices. When you run Bitbake one of these recipes = would be specified. For example, to build the root file system for the = ;smarct335x&n= bsp;platform:
=20 =20recipes-core/init-ifupdown*=
span>
This recipe is used to amend device netwo= rk interfaces
recipes-devtools/nodejs/*<=
/span>
These recipes build the Node.js Javascrip= t server execution environment.
recipes-kernel/linux/*
Contains the recipes needed to build the&= nbsp;smarct335x Linux kernels.
recipes-multimedia/amsdk-a=
v-files/*
This recipe is to add smarct335x compatib= le machine for the platform.
recipes-multimedia/x264/*<=
/span>
This original commit history has been rew= ritten.
recipes-support/boost/*
Adds Boost to the images. Boost provides = various C++ libraries that encourage cross-platform development.=
recipes-support/ntp/*
Network time protocol support.
recipes-tisdk/ti-tisdk-mak=
efile/*
Add smarct335x device tree into Makefile.=
To build the latest TI am335x 7.0 AMSDK you first need an Unbuntu Linux 12= .04LTS or Ubuntu 14.04LTS installation (preferably 32bit). Since bitbake do= es not accept building images using root privileges, please do= not login as a root user when performing the instructions in= this section.
Once you have Ubuntu 12.04 LTS or Ubuntu 14.04LTS running, install the add= itional required support packages using the following console command:
=20 =20If you are using a 64-bit Linux, then= you'd also need to install 32-bit support libraries, needed by the pre-bui= lt Linaro toolchain and other binary tools.
=20 =20You=E2=80=99ll also need to change th= e default shell to bash= span> from Ubuntu=E2=80=99s default= dash shell (select the <No>= option):
=20 =20To build TI=E2=80=99s am335x SDK you will need to install the Li= naro arm compiler that TI used for the release:
=20 =20PATH
definition to the
.bashrc
file in your
$HOME
directory:
=20 =20
=20 =20
=20 =20
meta-embedian-sdk7
layer to the build process
.
=20 =20
=20 =20
=20 =20
=20 =20
Please do not enable the sgx MACHINE FEATURES if your platform is SMARC = T3352.
To build the Embedian SMARC T335X and= am335x-evm developer board images, respectively, us= e the following commands:
=20 =20 =20
Once it done, you can find all required images under ~/oe-layersetup-sdk7/build/arago-tmp-external-linar= o-toolchain/deploy/images/
You may want to build programs that aren=E2=80=99t installed into a root= file system so you can make them available via a feed site (described belo= w.) To do this you can build the package directly and then build the packag= e named package-index&nbs= p;to add the new package to the feed site.
The following example builds the minicom program and makes it available on the feed site:
=20 =20~/oe-layersetup-sdk7/build/arag=
o-tmp-external-linaro-toolchain/deploy
.
deploy/images/*
deploy/images/u-boot.img
deploy/images/MLO
deploy/images/zImage
<=
/span>
deploy/images/zImage-am335x-=
smarct335x.dtb
deploy/images/smarct335x-rootf=
s-image-smarct335x*
deploy/images/smarct335x-ams=
dk-image*
deploy/imag=
es/arago-base-tisdk-image-smarct335x*
smarct335x-amsdk-imag=
e-smarct335x*
).
deploy/imag=
es/tisdk-rootfs-image-am335x-evm*
deploy/ipk/*<=
/code>
deploy/licenses/*
deploy/sdk/arago-2013.=
12-cortexa8-linux-gnueabi-tisdk.sh
For these instruction, we are assuming: DISK=3D/dev/mmcblk0, "lsblk= " is very useful for determining the device id.
=20 =20Erase SD card:
=20 =20Create Partition Layout:
With util-linux v2.26, sfdisk was rewritten and is now based on = libfdisk.
=20 =20Create Partitions:
=20 =20 =20Format Partitions:
=20 =20Mount Partitions:
On some systems, these partitions may be auto-mounted...
=20 =20Copy MLO/u-boot.img to the boot partition
=20 =20Create "uEnv.txt" boot script: (vim uEnv.txt)
For 3.12.y or after := strong>
=20 =20
Copy uEnv.txt to the boot partition:
=20 =20Copy zImage to the boot partition:
=20 =20Copy device tree binary to /media/boot/dtbs (Note: the file name in /med= ia/boot/dtbs/ has to be am335x-smarct335x.dtb)
=20 =20
Arago:
=20 =20Note:
Kernel modules are included in root file systems.
The following procedure can be used on a Embedian SMARC T335X device = to download and utilize the feed file show above to install the minicom terminal emulation program= :
=20 =20In order to package your application and include it in the root filesyst= em image, you must write a BitBake recipe for it.
When starting from scratch, it is easiest to learn by example from exist= ing recipes.
For software that uses autotools (./configure; make; make install), writ= ing recipes can be very simple:
DESCRIPTION =3D "Hello World Recipe using autotools" HOMEPAGE =3D "http://www.embedian.com/" SECTION =3D "console/utils" PRIORITY =3D "optional" LICENSE =3D "GPL" PR =3D "r0" =20 SRC_URI =3D "git://git@git.embedian.com/developer/helloworld-autotools= .git;protocol=3Dssh;tag=3Dv1.0" S =3D "${WORKDIR}/git" =20 inherit autotools=20
SRC_URI
sp=
ecifies the location to download the source from. It can take the form of a=
ny standard URL using http://, ftp://, etc. It can also fetch from SCM syst=
ems, such as git in the example above.
PR
is the =
package revision variable. Any time a recipe is updated that should require=
the package to be rebuilt, this variable should be incremented.
inherit autotools
brings in support for the package to be built using autotools, and =
thus no other instructions on how to compile and install the software are n=
eeded unless something needs to be customized.
S
is the s=
ource directory variable. This specifies where the source code will exist a=
fter it is fetched from SRC_URI and unpacked. The default value is ${WORKDIR}/${PN}-${PV}
, where PN
&n=
bsp;is the package name and PV
is the package version. Both PN
and PV
are set by default using the =
filename of the recipe, where the filename has the format PN_PV.bb
.
This example shows a simple case of building a helloworld.c file directl= y using the default compiler (gcc). Since it isn=E2=80=99t using autotools = or make, we have to tell BitBake how to build it explicitly.
DESCRIPTION =3D "HelloWorld" SECTION =3D "examples" LICENSE =3D "GPL" =20 SRC_URI =3D "file://helloworld.c" =20 S =3D "${WORKDIR}" =20 do_compile() { ${CC} ${CFLAGS} ${LDFLAGS} helloworld.c -o helloworld } =20 do_install() { install -d ${D}${bindir} install -m 0755 helloworld ${D}${bindir} }=20
In this case, SRC_URI
specifies a file that must exist locally with the recipe. =
Since there is no code to download and unpack, we set S
to WORKDIR
since that is where he=
lloworld.c will be copied to before it is built.
WORKDIR
is=
located at ${OETREE}/build=
/arago-tmp-external-linaro-tool=
chain/work/armv7ahf-vfp-neon-3.8-oe-linux-gnueabi/<package name and vers=
ion>
for most packages. If the package is machine-spe=
cific (rather than generic for the armv7ahf architecture), it may be locate=
d in the smarct335x-oe-linux-gnueabi subdirectory depending on your hardwar=
e (this applies to kernel packages, images, etc).
do_compile
 =
;defines how to compile the source. In this case, we just call gcc directly=
. If it isn=E2=80=99t defined, make
in the source directory by default.
do_install
 =
;defines how to install the application. This example runs install
to create a bin =
directory where the application will be copied to and then copies the appli=
cation there with permissions set to 755.
D
is the d=
estination directory where the application is installed to before it is pac=
kaged.
${bindir}
=
is the directory where most binary applications are installed, typically&nb=
sp;/usr/bin
.
For a more in-depth explanation of BitBake recipes, syntax, and variable= s, see the Recipe Ch= apter of the OpenEmbedded User Manual.
Setting up eMMC usually is the last step at development stage after the = development work is done at your SD card or NFS environments. eMMC on modul= e will be always emulated as /dev/mmcblk0. Setting up eMMC now is noth= ing but changing the device descriptor.
This section gives a step-by-step procedure to setup eMMC flash. Users c= an 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.
Insert SD card into your Linux PC. For these instructions, we are assumi= ng: DISK=3D/dev/mmcblk0, "lsblk" is very useful for determining t= he device id.
For these instruction, we are assuming: DISK=3D/dev/mmcblk0, "lsblk= " is very useful for determining the device id.
=20 =20Mount Partitions:
On some systems, these partitions may be auto-mounted...
=20 =20Copy MLO to rootfs part= ition:
=20 =20
Copy u-boot.img to root=
fs partition:
Copy initramfs zImage t=
o rootfs partition:
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.12.y+:
=20 =20Copy real rootfs to roo= tfs partition:
=20 =20
Remove SD card:
=20 =20
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 t= he eMMC device descriptor is /dev/mmcblk1 now.
=20 =20Erase SD card:
=20 =20Create Partition Layout:
=20 =20
Format Partitions:
=20 =20
Mount Partitions:
=20 =20Copy MLO/u-boot.img/uEnv.txt/zImage to the boot par= tition
=20 =20
Unmount eMMC:
=20 =20
Switch your Boot Select to eMMC and you will be able to boot up from eMM= C now.
version 1.0a, 8/19/2014
Last updated 2015-12-07