=====Yocto Quick Start Guide for TQMa6x===== ====Development Environment==== ===Preface=== The following instructions have been tested on Ubuntu 16.04 (64 bit) in a VMWare virtual machine. The //meta-tq// layer extends the //Yocto Project's// reference system //Poky// to provide support for a selection of TQ Embedded CPU Modules, including the TQMa6x. It uses the same codebase as the [[en:arm:tqma6x:linux:ptxdist:overview|PTXdist based TQ Linux BSPs]] and therefore provides the same versions of U-Boot and Linux kernel, but doesn't define a specific root filesystem configuration. The instructions on this page refer to the BSP and ancillary tools listed in the following table: ^ **Yocto Project / Poky /meta-tq Release** | pyro | ^ **Target machines** | tqma6qp-mba6x\\ tqma6q-mba6x\\ tqma6dl-mba6x\\ tqma6s-mba6x | ^ **U-Boot** | 2016.03 | ^ **Linux Kernel** | 4.1.15 | It's strongly recommended to use **git** for downloading both the //Yocto Project / Poky// Release as well as //meta-tq// (instead of downloading archives and extracting them). For further details regarding //Yocto Project// please refer to its [[https://www.yoctoproject.org/documentation/archived|official documentation]]. ===Prerequisites=== ==Install necessary Updates for Ubuntu== embedded@ubuntu:~$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \ libsdl1.2-dev xterm ===Building an image === ==Clone Yocto project release via git== embedded@ubuntu:~$ cd ~ embedded@ubuntu:~$ mkdir yocto embedded@ubuntu:~$ cd yocto embedded@ubuntu:~/yocto$ mkdir sources embedded@ubuntu:~/yocto$ cd sources embedded@ubuntu:~/yocto/sources$ git clone https://git.yoctoproject.org/git/poky.git ==Check out Yocto branch== embedded@ubuntu:~/yocto/sources$ cd poky embedded@ubuntu:~/yocto/sources/poky$ git checkout (e.g. morty or pyro) embedded@ubuntu:~/yocto/sources/poky$ cd .. embedded@ubuntu:~/yocto/sources$ ==Clone meta-tq layer== embedded@ubuntu:~/yocto/sources$ git clone https://github.com/tq-systems/meta-tq.git ==Check out meta-tq branch== embedded@ubuntu:~/yocto/sources$ cd meta-tq embedded@ubuntu:~/yocto/sources/meta-tq$ git checkout (e.g. morty or pyro) embedded@ubuntu:~/yocto/sources/meta-tq$ cd .. The branch of the Yocto project and the meta-tq project must be the same. ==Initialize the Build Environment== embedded@ubuntu:~/yocto/sources$ source poky/oe-init-build-env build ==Add meta-tq to your layer configuration== Add the following line to ''conf/bblayer.conf'': /home/embedded/yocto/sources/meta-tq \ It should look like this. BBLAYERS ?= " \ /home/embedded/yocto/sources/poky/meta \ /home/embedded/yocto/sources/poky/meta-poky \ /home/embedded/yocto/sources/poky/meta-yocto-bsp \ /home/embedded/yocto/sources/meta-tq \ " ===Building BSP=== ==Configure the build== embedded@ubuntu:~/yocto/sources/build$ export MACHINE= ++++e.g.| embedded@ubuntu:~/yocto/sources/build$ export MACHINE=tqma6qp-mba6x ++++ Choose one of the following machines for your BSP:\\ ''name of machine''= tqma6qp-mba6x, tqma6q-mba6x, tqma6dl-mba6x, tqma6s-mba6x ==Build an Image== embedded@ubuntu:~/yocto/sources/build$ bitbake core-image-minimal ===Deployment=== The resulting image is located under\\ **~/yocto/sources/build/tmp/deploy/images//core-image-minimal-.wic** ==Create SD Card with BSP Image== For testing purposes we recommend to use SD cards to install new firmware. To write the built images on the host system to a connected card type: embedded@ubuntu:~/yocto/sources/build$ sudo dd if=tmp/deploy/images//core-image-minimal-.wic of=/dev/sdf bs=1M conv=fsync #Assuming the SD card is assigned to /dev/sdf You have to use the raw device of the SD card not a partition! To find out what device file the SD card has, type "dmesg" after you connect the card to see the system messages. At the bottom you'll see some "Attached scsi ..." messages along with something like: [ 8197.588395] sdf: sdf1 ===FAQ=== ==Build process== In case of error messages like "No such file or directory" you have to create the site.conf file: embedded@ubuntu:~$ mkdir ~/.yocto embedded@ubuntu:~$ nano ~/.yocto/site.conf Add the following lines to site.conf: BB_NUMBER_THREADS ?= "2" PARALLEL_MAKE ?= "-j 2" embedded@ubuntu:~$ cd ~/yocto/build/conf embedded@ubuntu:~/yocto/build/conf$ ln -s ~/.yocto/site.conf site.conf Then restart the build process with embedded@ubuntu:~/yocto/build/conf$ cd ~/yocto/build embedded@ubuntu:~/yocto/build$ bitbake -c cleanall u-boot-tq && bitbake core-image-minimal