This Quickstart provides you with the tools and know-how to install and work with the Linux Board Support Package (BSP) for the phyBOARD-Mira i.MX6. This Quickstart shows you how to do everything from installing the appropriate tools and source, to building custom kernels, to deploying the OS, to exercising the software and hardware. Please refer to the phyCORE-i.MX6 Hardware Manual for specific information on board-level features such as jumper configuration, memory mapping and pin layout for the phyCORE-i.MX6 System on Module (SOM) and baseboard. Additionally, gain access to the SOM, mapper board, and baseboard schematics for the phyBOARD-Mira i.MX6 by registering at the following:


The following system requirements are necessary to successfully complete this Quickstart. Deviations from these requirements may suffice, or may have other workarounds.


  • phyBOARD-Mira i.MX6
  • Evaluation board PEB-EVAL-01
  • Serial cable  (RS-232)
  • Ethernet Cable
  • Power supply:
    • For the 24 V kit version (includes power module PEB-POW-01 attached to X2): 12V - 24V (+/-10%) DC Power supply
    • For the 5 V kit version: 5 DC/ min. 3 A Power supply
  • LCD (Optional)
    • 10" LVDS Display AUO G104SN02-V2 with resistive touch.
    • Phytec PEB-AV-02 with display ETM0700G0DH6 


  • A modern GNU/Linux Operating host system either natively or via a virtual machine:
    • Ubuntu 14.04 LTS 64-bit recommended. Other distributions will likely work, please note that some setup information as well as OS-specific commands and paths may differ.
    • If using a virtual machine, VMWare Workstation, VMWare Player, and VirtualBox are all viable solutions.
  • Root access to your Linux Host PC. Some commands in the Quickstart will not work if you don’t have sudo access (ex. package installation, formatting SD card).
  • At least 40-50GB free on target build partition.
  • SD card reader operational under Linux.
    • If you do not have SD card access under Linux then formatting, copying the bootloader, and mounting the root file system on an SD card will not be possible.
  • Active Internet connection

Getting Started With Binary Images

This section is designed to get the board up-and-running with pre-built images.

Connector Interfaces

Use the following as a reference for the connector interfaces on the phyBOARD-Mira i.MX6 that will be used in this Quickstart.

Booting the Pre-built Images

The section was designed to show you how to boot the phyBOARD-Mira i.MX6 with the pre-built demo images.

  1. Insert a bootable SD card into the microSD card slot (SD1) on the under side of the board. Configure the boot switch S2 to boot from SD/MMC (Selecting Boot Modes). A bootable SD card with phytec-qt5demo-image-phyboard-mira-imx6-3.sdcard  extracted on the SD card is required. Instructions for creating an SD card are provided in the Creating a Bootable SD Card section of the Quickstart.
  2. If you ordered the 10" LVDS Display AUO G104SN02-V2 with resistive touch, connect the LCD Backlight cable to X8, the display cable to X9, and the resistive touch cable to X21 (For additional instructions see How to connect the 10" AUO G104SN02-V2 LVDS display to the phyBOARD-Mira i.MX6). Alternately, if you ordered the PEB-AV-02, plug this module into the AV connectors X13 and 14.
  3. Connect the serial cable from a free serial port on your host PC to the DB9 connector labeled "UART0" on the eval board PEB-EVAL-01. This is the UART2 communication channel with the i.MX6 at RS-232 levels.
  4. Connect the Ethernet cable from the Ethernet connector X4 on the carrier board to your network hub, router, or switch. If you do not have an Ethernet connection you can postpone this step, Linux will boot without the need for Ethernet connectivity.
  5. Start your favorite terminal software (such as Minicom or TeraTerm) on your host PC and configure it for 115200 baud, 8 data bits, no parity, and 1 stop bit (8n1) with no handshake.
  6. Depending on your kit version, plug a 12 V power adapter into the power module PEB-POW-01, or a 5 V power adapter to X2 on the carrier board. See the Hardware Requirements listed above as well as the picture below for more details:
  7. On powering on, you will instantly see Power LED D1 light up. You will also start to see console output on your terminal window. If everything was done correctly the board should boot completely into Linux, arriving at a root@imx6q-pbab01 prompt. The default login account is root with an empty password. If using the evaluation module PEB-EVAL-01 connected to expansion connector X17, LEDs D1, D2, and D3 will also light up upon booting into Linux. Note that the first time the board is booted it takes a little while for the SSH server to generate new keys. Subsequent boots should be faster.

    Additional software configuration is required in order to enable the LCD display. Please see the section Expansion Board Settings for instructions on how to do so via barebox. Once the LCD is enabled, a Qt5 demo will be displayed upon booting into Linux.

About the Yocto BSP

The Yocto Project is a Linux embedded development environment which provides layers of meta data and tools. PHYTEC's Yocto BSPs are based on the Poky meta layer, which consists of the bitbake build tool, Linux base recipes, and various scripts to define a rudimentary linux system. The openEmbedded meta layer is also included in this BSP and is made up of a collection of meta layers which provide recipes for many software packages. The meta-phytec layer contains recipes and classes common among all BSPs developed by PHYTEC. Within this layer is a SoC specific layer, such as meta-phyimx6, which defines configuration for barebox, the kernel, and software specific to the various PHYTEC boards using the i.MX6.

In order to help get started with PHYTEC's Yocto BSP structure, the phyLinux script can be used to obtain all the BSP sources relevant to your hardware configuration without interfacing with git or repo. Detailed information on building this BSP from source is provided following the Development Host Setup section.

Development Host Setup

Host Debian Packages

Yocto development requires certain packages to be installed. Run the following commands to ensure you have the packages installed:

sudo apt-get install gawk wget git-core diffstat unzip texinfo \
	gcc-multilib build-essential chrpath socat \
	libsdl1.2-dev xterm

The above is the recommended package installation for development on a Ubuntu 14.04 LTS Linux distribution. For a breakdown of the packages as well as a list of packages required for other Linux distributions, see the "Required Packages for the Host Development System" section in the Yocto Project Reference Manual:

Verify that the preferred shell for your Host PC is ''bash'' and not ''dash'':

sudo dpkg-reconfigure dash 
# Respond "No" to the prompt asking "Install dash as /bin/sh?"

Repo Tool

Download and install the repo tool. This tool is used to obtain Yocto source from Git.

cd /opt
sudo mkdir bin

# /opt/ directory has root permission, change the permissions so your user account can access this folder. In the following replace <user> with your specific username
sudo chown -R <user>: bin

cd bin
curl > ./repo
#add directory that contains repo to your path
chmod a+x repo

Add the repo directory in your PATH, using export from the command line or permanently by including it in .bashrc:


Git Setup

If you have not yet configured your Git environment on this machine, please execute the following commands to set your user name and email address. See here for more information on getting started with Git.

git config --global ""
git config --global "Your Name"

Server Setup (Optional)

The following steps describe the setup for TFTP, NFS, and Samba servers. Server setup is not required for working with the board, however they will significantly reduce time and are highly recommended during the building and development phase.


TFTP is a "trivial" file transfer protocol used to transfer individual files across a network. Setting up a TFTP server on your Linux Host PC will allow you to exchange files with the target board. Some examples where this will be advantageous include:

  • Modifying and doing development on the Linux kernel. Barebox can be configured to remotely boot the kernel so you have access to the latest build without needing to continually reflash the target board.
  • Updating images from the bootloader. Transferring files over a network in Barebox is an alternative to using an SD card which eliminates some time consuming steps such as formatting an SD card.
  • Individual file transfer to the root fileystem. When Linux has been fully booted you may want to copy a specific file from your Host PC to the target board (images, application executables).

Install the TFTP server on your Host PC:

sudo apt-get install tftpd-hpa

Specify a folder where the files will reside on your Host PC by replacing the folder path for ''TFTP_DIRECTORY'' with whatever folder you wish to use as your TFTP file storage location, or leave the folder as the default.

sudo gedit /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa

If you made any changes to the settings of the TFTP server, you need to restart it for them to take effect.

sudo restart tftpd-hpa

If you would like to grant every user on the system permission to place files in the TFTP directory, use the following command, replacing ''<TFTP_DIRECTORY>'' with your chosen location.

sudo chmod ugo+rwx <TFTP_DIRECTORY>

Files in the ''<TFTP_DIRECTORY>'' on your Host PC can now be accessed from another machine on the same network such as the target board by simply using the IP address of the Host PC. Take note of this IP address, in a typical wired connection this will be ''inet addr'' listed under ''eth0''.



A network filesystem (NFS) server gives other systems the ability to mount a filesystem stored on the Host PC and exported over the network. Setting up an NFS server on your Linux Host PC gives you access to the target boards root filesystem which will allow you to quickly test applications and evaluate different filesystem setups for the target board. That is, the root filesystem for the board will actually be located on the remote host Linux machine. This enables easy access and modifications to the root filesystem during development.

Install the NFS server on your Host PC:

sudo apt-get install nfs-kernel-server

Exported filesystems are designated in the "/etc/exports" file and allow you to choose both the directory to be exported and many settings for accessing the exports. Below is an example for exporting a folder called "nfs_export-ex" located in a user's home directory.

sudo gedit /etc/exports
# /etc/exports
/home/<user>/nfs_export-ex *(rw,sync,no_root_squash,no_subtree_check)

The options (rw, sync, no_root_squash, no_subtree_check) for this folder are essential in setting up the NFS export correctly. For more information on additional options, refer to the man page for 'exports'.

  • rw enables: read and write access when the directory is mounted
  • sync: tells the file-system to handle local access calls before remote access
  • no_root_squash: allows root access when mounting the file-system
  • no_subtree_check: reduces the number of checks the server must make to ensure that an exported sub-directory is within an exported tree and also enables access to root files in conjunction with no_root_squash

After modifying this file, in order to mount the directories as an NFS, you must force the NFS server to export all of the directories listed in "/etc/exports".

sudo /usr/sbin/exportfs -va


Samba servers are an excellent way to access a Linux file-system on a Windows machine via a network connection. Using a Samba server, it is quick and easy to transfer files between systems.

To install a Samba server, use the following command:

sudo apt-get install samba

Before the Samba share can be mounted on another machine it's necessary to modify the configuration file to allow write access and access to home directories. Start by editing the "/etc/samba/smb.conf" file.

sudo gedit /etc/samba/smb.conf

Inside this file there are four specific things that need to be uncommented (remove the ';' at the beginning of the line) to enable the sharing of home folders and write access. Below is the section that must be modified:

#======================= Share Definitions =======================
# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
; comment = Home Directories
; browseable = yes
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
; read only = no

The outcomes after the changes are made follow:

#======================= Share Definitions =======================
# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
comment = Home Directories
browseable = yes
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = no

It might also be necessary to change the ''workgroup'' line to match the workgroup for your machine.

To apply the changes, the next step is to restart all Samba-related processes.

sudo restart smbd
sudo restart nmbd

Lastly, each user needs to have a password enabled to be able to use the Samba server. There are no rules for this password. The simplest method for choosing this password is to make it the same as the UNIX user's password, but it is not a requirement. After typing in the command below, you will be prompted to enter the password for the specified user.

sudo smbpasswd -a <user>

As mentioned in the configuration file, the samba share can be connected by accessing "\\<host machine ip>\\<user>" by either mounting a network share or using Windows explorer to navigate to it.

Building the BSP from Source

Create a directory which will house your BSP development. In this example the BSP directory is /opt/PHYTEC_BSPs/. This is not a requirement and if another location is preferred (ex. ~/PHYTEC_BSPs) feel free to modify. We recommend using /opt over your HOME directory to avoid errors attributed to ~ syntax as well as the sudo requirement for the root filesystem and automation package building. We also recommend creating a package download directory (yocto_dl) separate from the yocto tree (yocto_fsl), as it makes resetting the build environment easier and subsequent build times much faster.

sudo mkdir /opt/PHYTEC_BSPs
cd /opt/

# /opt/ directory has root permission, change the permissions so your user account can access this folder. In the following replace <user> with your specific username
sudo chown -R <user>: PHYTEC_BSPs

mkdir yocto_fsl
mkdir yocto_dl
cd yocto_fsl
export YOCTO_DIR=`pwd`

At this point you will now be able to navigate to the Yocto directory using the $YOCTO_DIR environment variable.

Download the BSP Meta Layers

Download and run the init script phyLinux:

chmod +x phyLinux

This script will use the repo tool to manage the various git repositories used in this BSP. Repo will automatically be detected by phyLinux if it is found in the PATH. During the execution of the script, you need to choose your processor platform, BSP release and hardware. The following are the available configurations for the phyBOARD-Mira i.MX6:

  • phyboard-mira-imx6-3 : PB-01501-002.A2 (i.MX6 Quad, 1GB RAM)
  • phyboard-mira-imx6-4 : PB-01501-001.A2 (i.MX6 Solo, 256MB RAM) [RAM calibration values not verified]

The rest of the Quickstart assumes that the standard phyboard-mira-imx6-3 is used, although the other phyBOARD-Mira i.MX6 configurations may be used as well.

# You can provide the SoC platform and BSP release as arguments,and you will then be prompted to choose your hardware configuration: 
./phyLinux init -p imx6 -r PD15.2.0

# Or simply run the init script and you will be prompted to choose the desired settings from a list of options
./phyLinux init 

After the configuration is set up, you can view the current settings by running:

 ./phyLinux info

Start the Build

Run the Yocto build directory setup:

MACHINE=phyboard-mira-imx6-3 source sources/poky/oe-init-build-env build

Add the the new download directory to build/conf/local.conf:

DL_DIR ?= "/opt/PHYTEC_BSPs/yocto_dl"

Accept Freescale EULA

To use Vivante GPU binaries in package 'gpu-viv-bin-mx6q' you need to accept the FreescaleEULA at '/opt/yocto/yocto_fsl/sources/meta-phytec/meta-phyimx6/recipes-graphics/gpu-viv-bin-mx6q/EULA. Please read it and if you accept it, write the following in build/conf/local.conf:


The setup is complete and you now have everything to complete a build. It is suggested that you start with PHYTEC's QT5 demo image to verify functionality before building other images. Alternate images are located in various meta layers at meta*/recipes*/images/*.bb. They can be found using the command bitbake-layers show-recipes "*-image*" in $YOCTO_DIR/build/. Note that images that have been tested with this build are listed when the build directory is set up with the oe-init-build-env script.

The following will start a build from scratch including installation of the toolchain as well as barebox, Linux kernel, and root filesystem images.

cd $YOCTO_DIR/build
MACHINE=phyboard-mira-imx6-3 bitbake phytec-qt5demo-image

Built Images

All images generated by bitbake are deployed to $YOCTO_DIR/build/deploy/images/phyboard-mira-imx6-3:

  • SD Image phytec-qt5demo-image-phyboard-mira-imx6-3.sdcard 

  • Bootloader: barebox.bin, MLO
  • Kernel: zImage
  • Kernel device tree file: zImage-imx6q-phytec-mira-rdk-nand.dtb
  • Root Filesystem: phytec-qt5demo-image-phyboard-mira-imx6-3.tar.gz

Source Locations:

  • Kernel:  $YOCTO_DIR/build/tmp-glibc/work/phyboard_mira_imx6_3-phytec-linux-gnueabi/linux-mainline/3.19.5-phy6-r2.0/git/
    • The device tree file to modify within the linux kernel source is: arch/arm/boot/dts/imx6q-phytec-mira-rdk-nand.dts
  • Barebox:  $YOCTO_DIR/build/tmp-glibc/work/phyboard_mira_imx6_3-phytec-linux-gnueabi/barebox/2015.07.0-phy1-r2.1/git/
  • Toolchain: $YOCTO_DIR/build/tmp-glibc/sysroots/x86_64-linux/usr/bin/arm-phytec-linux-gnueabi/

Build Time Optimizations

The build time will vary depending on the package selection and Host performance. Beyond the initial build, after making modifications to the BSP, a full build is not required. Use the following as a reference to take advantage of optimized build options and reduce the build time.

To rebuild Barebox:

bitbake barebox -f -c compile && bitbake barebox

To rebuild the Linux kernel:

bitbake linux-mainline -f -c compile ; bitbake linux-mainline

The Yocto project's Bitbake User Manual provides useful information regarding build options:

Customizing the BSP

We recommend you create your own layer and make changes to the existing BSP there. This will make it easier to update the BSP. Instructions and tips on creating your own layer are available here:

Appending Recipes

To modify an existing recipe in your own layer, use a bbappend file. The following is an example of modifying the barebox_2015.07.0 recipe,, located at $YOCTO_DIR/sources/meta-phytec/meta-phyimx6/recipes-bsp/barebox/

Create a recipes-bsp/barebox/ directory in your own meta-layer to place the bbappend file in. Make sure that the new file matches the .bb file name exactly. Alternatively, you may use % after the underscore in place of the specific version for portability with future versions of the recipe.

mkdir $YOCTO_DIR/sources/<YOUR_META_LAYER>/recipes-bsp/barebox/
vim $YOCTO_DIR/sources/<YOUR_META_LAYER>/recipes-bsp/barebox/barebox_%.bbappend

For information on how to write a recipe, see chapter 5.3 of the Yocto Development Manual:

Adding Packages to the build

There are various ways to add a package to the BSP. For example, packages and package groups can be added to image recipes. See the Yocto Development manual for how to customize an image:

The following instructions demonstrate how to add a package to the local build of the BSP. First, search for the corresponding recipe and which layer the recipe is in. This link is a useful tool for doing so:

If the package is in the meta-openembedded layer, the recipe is already available in your build tree. Add the following line to $YOCTO_DIR/build/conf/local.conf:

IMAGE_INSTALL_append = " <package>"

The leading whitespace between the " and the package name is necessary for the append command.


If you need to add a layer to the BSP, clone or extract it to the $YOCTO_DIR/sources/ directory. Then, modify $YOCTO_DIR/build/conf/bblayers.conf to include this new layer in BBLAYERS:

BBLAYERS += "${BSPDIR}/sources/<new_layer>"

Configuring the Kernel

The kernel configuration menu allows the user to adjust drivers and support included in a Linux Kernel build. Run the following command from the build directory:

cd $YOCTO_DIR/build
bitbake linux-mainline -c menuconfig

Then rebuild the kernel:

bitbake linux-mainline -f -c compile ; bitbake linux-mainline

To rebuild the root filesystem:

bitbake -f phytec-qt5demo-image

Customizing the Device Tree

The device tree is a data structure for describing hardware, and is a way of separating machine specific information from the kernel. For information on the device tree concept, is a good source:

Device trees for PHYTEC products consist of a board DTS file, a SOM dtsi and a carrier board dtsi. The SOM dtsi includes the processor dtsi and contains definitions for all devices that are located on the SOM, such as NAND flash. Peripherals whose signals are routed through the SOM but whose hardware is located on the carrier board are defined in the carrier board dtsi, such as MMC. The board file then enables optional nodes that were defined in the dtsi files that pertain to this specific board configuration. 

Additionally, there are separate dtsi files for various expansion boards, such as the evaluation module PEB-EVAL-01: imx6qdl-phytec-mira-peb-eval-01.dtsi. For more information on enabling expansions in barebox, see Expansion Board Settings.

To disable a peripheral such as SPI NOR Flash, change the status of the serial_flash node in arch/arm/boot/dts/imx6q-phytec-mira-rdk-nand.dts from "okay" to "disabled":

&flash {
	status = "disabled";

The kernel source directory has very good documentation and examples on what bindings are supported for specific peripherals: Documentation/devicetree/bindings/.

Creating a Bootable SD Card

The process requires an SD card reader operational under Linux to format and access the Linux partition of the card. If you do not have SD card access under Linux then copying the bootloader and mounting the root filesystem on SD/MMC card will not be possible.

  1.  Determine the SD card device name
    1. The SD card device name is of the form /dev/sd[b|c|d|e]. Run the following without and with the SD card connected:

      ls /dev/sd*
    2. The device that appeared on the call to ls with the SD card but not the call without is the SD card device.

  2. Unmount all partitions of the SD card, using the SD card device name from Step 1:

    umount /dev/sd[b|c|d|e]* 
  3. Load the sd-card image onto the SD card from the linux command line. This will format the appropriate partitions, as well as add Barebox, the kernel image, and the root filesystem to the card. 

    sudo dd if=phytec-qt5demo-image-phyboard-mira-imx6-3.sdcard of=/dev/sd[b|c|d|e] bs=1MB


If you are planning on using this SD card to flash images to NAND, you will need to create an additional partition to hold the root filesystem UBIFS image, as it is too large for the boot and filesystem partitions. To do so:

sudo fdisk /dev/sd[b|c|d|e]*
	n			New partition
	p			Primary
	3			Partition number 3
	540672		First Sector
	<enter> 		Last Sector, to end of SD card
	t			Change partition's System ID
	3			Partition 3
	c			Change to W95 FAT32 (LBA)
	w			Write partition table to disk and exit
sudo mkfs.vfat -n "data" /dev/sd[b|c|d|e]*


Once the SD card has been formatted, you may update the kernel, root filesystem, and barebox individually as well:


  1. If modifying the kernel, remove the existing Linux image and device tree binary files:

    rm /media/Boot phyboa/zImage
    rm /media/Boot phyboa/oftree
  2.  Load the new Linux kernel and device tree binary to the SD Card. Note that the default bootloader environment is configured to recognize "zImage" and "oftree" as the kernel and dts respectively:

    cp zImage /media/Boot phyboa/; sync
    cp imx6q-phytec-mira-rdk-nand.dtb /media/Boot phyboa/oftree; sync

Root Filesystem

  1. If modifying the root filesystem, remove the existing:

    sudo rm -rf /media/b22d2084-94c6-4384-afa4-941975930aaf/*
  2. Load the new filesystem to the SD Card:

    sudo tar -zxf phytec-qt5demo-image-phyboard-mira-imx6-3.tar.gz -C /media/b22d2084-94c6-4384-afa4-941975930aaf/; sync
  3. If you are planning on using this SD card to flash the root filesystem to NAND, copy the UBIFS image to the /data partition of the SD card:

    cp phytec-qt5demo-image-phyboard-mira-imx6-3.ubifs /media/data/; sync


  1. Copy the new images to the SD Card:

    sudo dd if=barebox.bin of=/dev/sd[b|c|d|e] bs=512 skip=2 seek=2 conv=fsync
  2. If you are planning on using this SD card to flash barebox to NAND, copy the barebox.bin image to the /boot partition of the SD card:

    cp barebox.bin /media/Boot\ phyboa/; sync

Boot Configurations

Selecting Boot Modes

The bootloader, one of the key software components included in the BSP, completes the required hardware initialization to download and run operating system images. The boot mode, selected from the S2 dipswitch on the Carrier Board, determines the location of the primary bootloader. Set the S2 dipswitch correspondingly: 

Boot ModeDescription
S2 = OFFBoot from NAND
S2 = ONBoot from SD1

Basic Settings

After application of power, approximately three seconds are allotted for the user to hit any key which will halt autoboot and enter Barebox.

help is a useful tool in Barebox to show available commands and usage.

Expansion Board Settings

This BSP supports enabling and disabling various expansion boards that may be used along with the carrier board via the bootloader. This functionality allows for certain pin configurations to be added or removed from the device tree without needing to recompile the kernel. Please note that not all of these may be compatible with your specific board.

  • To view the available expansion boards:

    ls /env/expansions/
    imx6qdl-mira-enable-lvds				# Enable for 10" LVDS Display AUO G104SN02-V2 with resistive touch
    imx6qdl-mira-peb-eval-01				# Enabled by default
    imx6qdl-phytec-lcd-018-peb-av-02		# Enable for Phytec PEB-AV-02 with display ETM0700G0DH6

Enable an expansion board by adding it to /env/config-expansions. Make sure to include the entire path to the file, as shown with /env/expansions/imx6qdl-mira-peb-eval-01:

edit /env/config-expansions
  • You should see something similar to the following. Barebox built with the phyBOARD-Mira i.MX6 3 configuration has the evaluation board enabled by default.

    . /env/expansions/imx6qdl-mira-peb-eval-01

Network Settings

You can check the target's network settings by running the following:

devinfo eth0

The ethaddr variable is the MAC id of the target. This is a pre-programmed value which is read from the EEPROM and matches the sticker on the SOM. To modify any of the network settings, type:

edit /env/network/eth0

You should see something similar to the following, modify the variables to specify your network configuration for ETH0:

  • ipaddr
    A dedicated IP address for the SOM. This is crucial if TFTP will be used for updating the device's images at any point.
  • netmask
    Netmask for the network: typically This is only necessary if the TFTP directory is located on another network.
  • gateway
    Gateway IP for the network. This is only necessary if the TFTP directory is located on another network.
  • serverip
    IP address of the host or another machine. serverip corresponds to where the TFTP directory, if it exists, is located.

Saving Configurations

From any of the Barebox scripts, return to the Barebox prompt by pressing CTL+D to apply changes or CTL+C to cancel. To retain changes, at the Barebox prompt save the environment.


Boot Options

The target can be booted from on-board media or from a development host via network. In our standard configuration, this BSP release loads the kernel and root filesystem from the bootsource selected in the hardware.

For booting via network, the development host is connected to the phyBOARD-Mira i.MX6 with a serial cable and via Ethernet; the embedded board boots into the bootloader, then issues a TFTP request on the network and boots the kernel from the TFTP server on the host. Then, after decompressing the kernel into RAM and starting it, the kernel mounts its root filesystem via the NFS server on the host. This method is especially useful for development purposes as it provides a quick turnaround while testing the kernel and root filesystem.

Stand-Alone NAND Boot

To use the target stand-alone, the kernel and root filesystem have to be made persistent in the on-board media of the device. This is done by default in the kit, however if the kernel and root filesystem are not available in the on-board media or you would like to update them, refer to the Flashing Images section for information on flashing images.

When set in the dipswitch (Selecting Boot Modes section), the device is configured by default to boot the kernel and mount the root filesystem from flash. By simply resetting or power cycling the board the target will boot into Linux.

The nand boot entry can also be run from the Barebox shell:

boot nand

Remote Boot

The network-remote boot variant is intended to be used during development because of the frequent need to rebuild the Linux kernel and root filesystem. TFTP and NFS accelerate the development process. Reflashing the newest kernel and root file system to the SOM after every new build would be very cumbersome and time consuming. All that is needed is an Ethernet connection and a network aware bootloader which can fetch the kernel from a TFTP server.

Restart the board and stop autoboot to go into the Barebox shell. Edit the net boot configurations to match the NFS and TFTP set up in the Development Host Setup section. 

edit env/boot/net

Modify the following variables:

  • path="/mnt/tftp/<path to linuximage and oftree relative to the tftp directory setup on the host. Ex: if the tftp directory is /var/lib/tftpboot, and the files are in /var/lib/tftpboot/phytec_mira/, then path="/mnt/tftp/phytec_mira">"
  • global.bootm.image=${path}/linuximage"
  • oftree="${path}/oftree"
  • nfsroot="<absolute path to NFS directory on your host machine. Ex: /home/<user>/nfs>"

Save the environment and run the command:

boot net

Stand-Alone SD/MMC Card Boot

The SD/MMC card boot variant is an alternative stand-alone boot option. All that is needed is a properly formatted (see the Creating a Bootable SD Card section of the Quickstart) SD/MMC card.

Restart the board and stop autoboot to go into the Barebox shell. Run the command:

boot mmc

Custom Boot

You may have custom boot requirements that are not covered by the available boot files. If this is the case you can create your own custom boot entry specifying the kernel and root filesystem location.

  • In Barebox, create your own boot entry, for example named custom:

    edit /env/boot/custom
  • Use the following template to specify the location of the Linux kernel and root filesystem. Please note that the text in <> such as <kernel_loc_bootm.image><rootfs_loc_dyn.root>, and <nfs_root_path> are intended to be replaced with user specified values.

    • <kernel_loc_bootm.image> 
      Specifies the location of the Linux kernel image
      • /dev/ - To boot the Linux kernel from NAND
      • ${path}/zImage - To boot the Linux kernel via TFTP
      • /boot/zImage - To boot the Linux kernel from SD/MMC card
    • <dts_loc_bootm.oftree> 
      Specifies the location of the device tree binary
      • /dev/ - To boot the device tree binary from NAND
      • ${path}/oftree - To boot the device tree binary via TFTP
      • /boot/oftree - To boot the device tree binary from SD/MMC card
    • <rootfs_loc_dyn.root>
      Specifies the location of the root filesystem
      • root=ubi0:root ubi.mtd=root rootfstype=ubifs - To mount the root filesystem from NAND
      • root=/dev/nfs nfsroot=$nfsroot,vers=3,udp rw  - To mount the root filesystem via NFS
      • root=/dev/mmcblk0p2 rootwait rw - To mount the root filesystem from SD/MMC card
    • <nfs_root_path>
      Only required if mounting the root filesystem from NFS. Replace with the following:
      • nfsroot="/home/${global.user}/nfsroot/${global.hostname}"

Once complete with file modifications exit the editor using CTRL+D. Save the environment:


To run your custom boot entry from the Barebox shell:

boot custom

 Default Boot

The device is configured by default to boot the kernel and mount the root filesystem from the bootsource set for Barebox in the dipswitch (Selecting Boot Modes). This default setting can be changed by adding or modifying the global.boot.default environment variable.

edit /env/init/bootsource

Comment out the if else statements which set the boot sequence depending on the Barebox bootsource, and add the global.boot.default variable to set to the desired boot source. This variable can be set to any of the entries in /env/boot. For example, to set the default boot configuration to net, global.boot.default should be set in the following way:


Exit the editor by CTRL+D and save the environment (saveenv). On a reset or power cycle the new default boot source will take affect. Similarly it will be used in the Barebox shell when executing the following:



Flashing Images

The phyBOARD-Mira i.MX6 is delivered with a pre-flashed bootloader. The following instructions for flashing images from TFTP or SD card will be useful if you want to:

  • Flash images because NAND is empty
  • Upgrade to a new release
  • Use custom built images

The images to be flashed will need to be copied to the exported TFTP directory or the /boot partition of a properly formatted SD card as described in the Creating a Bootable SD Card section of the Quickstart.

After making all required connections, power on the board and enter Barebox:

  • If flashing from TFTP, connect an Ethernet cable from the Ethernet connector  on the Carrier Board to your network hub, router, or switch.
  • If flashing from SD card, insert a correctly formatted SD card into the SD/MMC card slot connector  on the Carrier Board.
  • Connect a serial RS-232 cable from a free port on your Host PC to the connector  on the Carrier Board.
  • Start your favorite terminal software (Windows: PuTTY or TeraTerm; Linux: Minicom) on your Host PC and configure it for 115200 baud, 8 data bits, no parity, and 1 stop bit (8n1).
  • Power on your board by connecting the 5 V wall adapter to  on the Carrier Board.
  • After application of power, within approximately three seconds, hit any key to halt autoboot and enter Barebox. If an Ethernet cable is connected and the network has been configured, TFTP will automount to /mnt/tftp. If an SD card was inserted and Barebox was booted from MMC, the /boot partition will automount to /boot.

If flashing from TFTP, additional setup to configure the Barebox environment variables to meet your network environment and development host settings is required. The current network settings can be checked in /env/network/eth0.

If you need to change you network configuration, type:

edit /env/network/eth0

Edit the settings as described in the Network Settings section of the Quickstart. Save the environment and reboot the board, this will automount your tftp server at boot to /mnt/tftp.


If you would like to upgrade, have custom Barebox requirements, or are interested in seeing the version you built in action, follow the steps below: 

barebox.bin should be copied to your TFTP exported directory or the /boot partition of the SD card depending on your chosen flashing procedure.

  • Store the Barebox image into NAND Flash:

    Method: TFTP

    barebox_update -t nand /mnt/tftp/barebox.bin


    Method: SD/MMC

    barebox_update -t nand /mnt/mmc/barebox.bin

  • To restore the barebox environment in NAND Flash to the default environment:

    erase /dev/

If something goes wrong and you don’t have a bootloader anymore on your module you need to boot from an SD card into Barebox (set the DIP-switch as stated in Boot Configurations) and then do the flashing. See the Creating a Bootable SD Card section of this Quickstart for a description of how to create a bootable SD card.


Placing the kernel into NAND Flash allows booting the system without the need for the TFTP hosted kernel image. This is the most common place to put the kernel in a stand-alone application. Normally development is done using a TFTP hosted kernel image until the configuration has become more stable and is unlikely to change frequently. Once stable, the kernel image can be moved to NAND Flash. This section assumes a Linux kernel with file name linuximage is available on the exported TFTP directory or /boot partition of the SD card depending on your chosen flashing procedure.


  • Erase the area of NAND Flash reserved for the kernel image and device tree binary partitions:

    erase /dev/
    erase /dev/
  • Copy the Linux kernel from your tftp-server or SD card and store it into the NAND Flash:
    Method: TFTP

    cp /mnt/tftp/zImage /dev/
    cp /mnt/tftp/oftree /dev/

    Method: SD/MMC

    cp /mnt/mmc/zImage /dev/
    cp /mnt/mmc/oftree /dev/

Root Filesystem

Similar to the Linux kernel, placing the root filesystem into NAND Flash allows booting the system without the need for a remote connection to the NFS server. This section assumes a root filesystem of the form root.ubifs available on the exported TFTP directory or /data partition of the SD card depending on your chosen flashing procedure. Note that you should not flash Linux’s root filesystem into NAND the same way as you did with Linux kernel.

If using the /data partition of the SD card to store phytec-qt5demo-image-phyboard-mira-imx6-3.ubifs as described in Creating a Bootable SD Card, you will need to manually mount this partition in barebox:

mkdir /mnt/data
mount /dev/mmc0.2 /mnt/data/
  • Ubifs keeps erase counters within the NAND in order to be able to balance write cycles equally over all NAND sectors. So if there’s already an ubifs on your module and you want to replace it with a new one, using erase and cp will also erase these erase counters, and this should be avoided. Instead, execute the following:

    ubiformat /dev/nand0.root
    ubiattach /dev/nand0.root
    ubimkvol /dev/ubi0 root 0
  • Copy the root filesystem from your tftp-server or SD card and store it into the NAND Flash:
    Method: TFTP

    cp /mnt/tftp/phytec-qt5demo-image-phyboard-mira-imx6-3.ubifs /dev/ubi0.root

    Method: SD/MMC

    cp /mnt/data/phytec-qt5demo-image-phyboard-mira-imx6-3.ubifs /dev/ubi0.root