From Estone Technology Wiki
Jump to: navigation, search

About EMB-2230 NXP i.MX6

The EMB-2230 is a Pico-ITX (100x 72mm) industrial motherboard based on NXP i.MX6 ARM application processor. The board features a Power over Ethernet (PoE) ready Gigabit Ethernet port, on-board WiFi/BT, multiple LCD panel display interfaces support, and full set of I/Os including RS-232/485, CAN bus, digtial IO and more.

Technical Specification

Compiling EMB-2230 Image

Setup Yocto Environment

  • Please follow these instructions to setup the yocto environment before compiling the emb-2230 image

All the following steps have been tested on Ubuntu 16.04.6 LTS. An Internet connection is required to finish this tutorial.

  • Check and install update for Ubuntu by inputing the following commands to shell.
$ sudo apt-get update

Setting up the Ubuntu development host

Open a terminal on host machine(Ubuntu 16.04.6 LTS). Input the following commands to install the pre-required tools:

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo build-essential chrpath
$ sudo apt-get install libsdl1.2-dev xterm 
$ sudo apt-get install curl nano gcc-multilib gettext git lzop bc

Installing and configuring Git

$ sudo apt-get update
$ sudo apt-get install git
$ git config --global user.name "First Last"
$ git config --global user.email "first.last@company.com"

Installing SDK

SDK Download


$ cd ~/Downloads
$ sudo chmod +x poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.3.sh
$ sh poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.3.sh

- When prompted where to install SDK press Enter. SDK will automatically install in (/opt/poky/2.1.3/) Directory

- Wait for Installation to complete before moving on to next section

Directory Prep for Kernel, U-BOOT & Rootfs

- Start at ~/ directory to create a directory for emb-2230 Ex: (cd /home/user/) or (cd ~/ )

$ cd ~/
$ mkdir emb-2230
$ cd emb-2230
$ mkdir image 
$ cd ..


- The second directory created inside emb-2230 directory is to move files that will be created after compilation of Kernel, U-Boot & Rootfs

Compiling Kernel

-Start at the directory created in previous section ~/emb-2230. This will be the directory where all files will be downloaded. Ex: Kernel, U-Boot & Rootfs

$ cd ~/emb-2230
$ git clone -b imx_3.14.52_1.1.0_ga https://github.com/estonetechnology/imx6qdl-linux-kernel.git
$ cd imx6qdl-linux-kernel
$ source /opt/poky/2.1.3/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
$ export ARCH=arm
$ export CROSS_COMPILE=arm-poky-linux-gnueabi-
$ make hio-imx6dl-emb2230_defconfig 
$ make 
$ make hio-imx6dl-emb2230.dtb
$ cd imx6qdl-linux-kernel/arch/arm/boot/
$ mv -v zImage ~/emb-2230/image
$ cd dts
$ mv -v hio-imx6dl-emb2230.dtb ~/emb-2230/image 

Files Created:

File Location: imx6qdl-linux-kernel/arch/arm/boot/zImage
File Location: imx6qdl-linux-kernel/arch/arm/boot/dts/hio-imx6dl-emb2230.dtb

Compiling U-boot

Note: Go back to directory ~/emb-2230/ before next step

$ cd ~/emb-2230
$ git clone -b imx_v2015.04_3.14.52_1.1.0_ga https://github.com/estonetechnology/ppc-4510-linux-uboot
$ cd ppc-4510-linux-uboot
$ source /opt/poky/2.1.3/environment-setup-cortexa9hf-neon-poky-linux-gnueabi 
$ export ARCH=arm 
$ export CROSS_COMPILE=arm-poky-linux-gnueabi- 
$ make hio-imx6dl-board_spl_defconfig 
$ make
$ mv -v SPL ~/emb-2230/image
$ mv -v u-boot.img ~/emb-2230/image

Files Created:

File Location: /ppc-4510-linux-uboot/SPL
File Location: /ppc-4510-linux-uboot/u-boot.img

Compiling Rootfs

  • Repo utility installation:
$ mkdir ~/bin
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
  • Getting source code:
$ PATH=${PATH}:~/bin
$ mkdir emb-2230-rootfs
$ cd emb-2230-rootfs
$ repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b krogoth
$ repo sync
$ cd sources/
$ git clone -b krogoth https://github.com/meta-qt5/meta-qt5.git
$ git clone -b krogoth https://github.com/estonetechnology/meta-hio.git
$ git clone -b krogoth git://git.yoctoproject.org/meta-mono
$ cd ..
$ . ./setup-environment build

Note: From the Build choose 1 set of these 3 configurations "bblayers.conf" & "local.conf" to move to conf/ directory depending on the desired configuration

$ mv ../sources/meta-hio/conf/hio-full-cmdline-example-local.conf conf/local.conf
$ mv ../sources/meta-hio/conf/hio-full-cmdline-example-bblayers.conf conf/bblayers.conf
$ mv ../sources/meta-hio/conf/hio-qt5-fb-example-local.conf conf/local.conf
$ mv ../sources/meta-hio/conf/hio-qt5-fb-example-bblayers.conf conf/bblayers.conf
$ mv ../sources/meta-hio/conf/hio-x11-example-local.conf conf/local.conf
$ mv ../sources/meta-hio/conf/hio-x11-example-bblayers.conf conf/bblayers.conf

bitbake image

$ bitbake core-image-full-cmdline

Compiled image: core-image-full-cmdline-hio-imx6dl-iob3200.tar.bz2 (fsl-community-bsp/build/tmp/deploy/images/hio-imx6dl-iob3200/core-image-full-cmdline-hio-imx6dl-iob3200.tar.bz2)

MFGtool Image

Downloading MFG-EMB2230-V1.0

Download compiled MFG image here. This is an MFGtool image that requires a Windows OS system to install.

Flashing MFG Image

Note: Follow the steps below to successfully install and boot mfg-emb-2230-v1.0 image downloaded from section above

1. Set the boot switch to "2"

2. Connect the board to a Windows OS host using OTG cable.

3.Extract the MFG file and run MfgTool2.exe The device will be recognized as HID-compliant device.

4.Click Start to flash the image.

5. Once the image is finished flashing you will get Done in the MFG window.

6. Click Stop and Exit to exit the MFGtool.

Booting MFG Image

1. Set the boot switch to "1"

2. Plug in the Ethernet cable and power on

Qt Creator

Note: Follow the instructions below to set up, install & test the Qt Creator on EMB-2230

Testing Unit


Follow these below commands:

/home/brcm_patchram_plus -d --patchram /lib/firmware/bcm/bcm43438a1.hcd --baudrate 115200 --enable_lpm --enable_hci --no2bytes /dev/ttymxc4 & 
rfkill unblock all
hciconfig hci0 up
hciconfig -a

The screen will output a result as below


Perform a scan for Bluetooth devices

# hcitool scan

Output result:


Connect to recognized device

# hcitool cc 80:ED:2C:55:xx:xx; hcitool auth 80:ED:2C:55:xx:xx


  • Ethernet connection

Plug the network cable in, the unit will get an IP address from DHCP server.

Note: In case of failure, follow commands below:

# ifconfig eth0 up
# udhcpc

Check the IP address:

# ifconfig 

This command will show you what is the IP address.

Ex: IP address: (It is various depending on the DHCP server settings)

Check connection:

# ping (ping a host at the same network)
# ping www.habeyusa.com (It would be successful if the network connects to the Internet)
  • Wifi connection

Enable the Wifi interface:

# ifconfig wlan0 up

Scan wifi hotspots:

# iwlist wlan0 scan 

Modify the wifi configuration file according to Router Setting:

# cd /usr/share/wifi
# nano wpa_supplicant.conf

Input the SSID and the password of Router in the specified position:

  pairwise=TKIP CCMP
  group=CCMP TKIP WEP104 WEP40

Run the following command, then acquire the IP address dynamically from Router's DHCP service:

# wpa_supplicant –Dwext –iwlan0 –c ./wpa_supplicant.conf –B
# udhcpc –i wlan0

Check connection:

# ifconfig -a
# ping (an IP address from same local network)
  • Bandwidth:

From Terminal 1:

# ifconfig (Ex: IP address is
# iperf -s (to set up as a server)

From Terminal 2:

# iperf -c

The result will show the bandwidth as Mb/s as below.
Note: The bandwidth is various depending on the LAN bandwidth.

Modbus Test

Port configuration:

Emb2230 Modbus.png
Emb2230 Modbus1.png

For ports configured as picture below:



Devices need to be set up at the same settings:

Baud rate: 115200
Parity: None
Data bits: 8 bit
Stop bits: 1 bit

# stty -F /dev/ttymxc2 115200 cs8 -cstopb


# echo "transmit test" > /dev/ttymxc2


# cat /dev/ttymxc2


Read from ttymxc3

# stty -F /dev/ttymxc3 115200 raw -echo
# cat /dev/ttymxc3

Send from ttymxc3

# stty -F /dev/ttymxc3 115200 raw -echo
# echo Hello World > /dev/ttymxc3


Port configures as GPIO

Emb2230 gpio mod.png

Connect pin 1, 2:

Terminal 1:

# cd /sys/class/gpio
# echo 116 > export
# echo "out" > gpio116/direction
# echo 1 > gpio116/value
# echo 0 > gpio116/value

Terminal 2:

# cd /sys/class/gpio
# echo 114 > export
# echo "in" > gpio114/direction
# cat gpio114/value (read echo 1)
# cat gpio114/value (read echo 0)

40-pin Header Test

Emb2230 40pin.png


Emb2230 gpio.png

Loopback method is used to test these pins.

Pin 21, 22:

Terminal 1:

# cd /sys/class/gpio
# echo 117 > export
# echo "out" > gpio117/direction
# echo 1 > gpio117/value
# echo 0 > gpio117/value

Terminal 2:

# cd /sys/class/gpio
# echo 93 > export
# echo "in" > gpio93/direction
# cat gpio93/value (read the echo 1)
# cat gpio93/value (read the echo 0)

Pin 23, 24:

Terminal 1:

# cd /sys/class/gpio
# echo 118 > export
# echo "out" > gpio118/direction
# echo 1 > gpio118/value
# echo 0 > gpio118/value

Terminal 2:

# cd /sys/class/gpio
# echo 5 > export
# echo "in" > gpio5/direction
# cat gpio5/value (read the echo 1)
# cat gpio5/value (read the echo 0)

Pin 25, 26:

Terminal 1:

# cd /sys/class/gpio
# echo 119 > export
# echo "out" > gpio119/direction
# echo 1 > gpio119/value
# echo 0 > gpio119/value

Terminal 2:

# cd /sys/class/gpio
# echo 6 > export
# echo "in" > gpio6/direction
# cat gpio6/value (read the echo 1)
# cat gpio6/value (read the echo 0)

Pin 27, 28:

Terminal 1:

# cd /sys/class/gpio
# echo 120 > export
# echo "out" > gpio120/direction
# echo 1 > gpio120/value
# echo 0 > gpio120/value

Terminal 2:

# cd /sys/class/gpio
# echo 111 > export
# echo "in" > gpio111/direction
# cat gpio111/value (read the echo 1)
# cat gpio111/value (read the echo 0)

Pin 29, 30:

Terminal 1:

# cd /sys/class/gpio
# echo 92 > export
# echo "out" > gpio92/direction
# echo 1 > gpio92/value
# echo 0 > gpio92/value

Terminal 2:

# cd /sys/class/gpio
# echo 110 > export
# echo "in" > gpio110/direction
# cat gpio110/value (read the echo 1)
# cat gpio110/value (read the echo 0)


Connect pin 39, 40:

Send from ttymxc0:

Terminal 1:

# stty -F /dev/ttymxc0 115200 raw -echo
# echo "hello" > /dev/ttymxc0

Terminal 2:

Read from ttymxc0:

# stty -F /dev/ttymxc0 115200 raw -echo
# cat /dev/ttymxc0


When a USB is connected, it will be detected automatically and a message will be printed in the console screen.

Ex: Screen below is shown when a USB flash drive connected.


To access to the usb flash drive, it must firstly be mounted.

# mkdir /mnt/usb
# mount /dev/sda1 /mnt/usb

Now, access to the usb drive content:

# ls /mnt/usb


To unplug the usb flash drive, it should firstly be unmounted:

# umount /mnt/usb

Note: Repeat this method for another USB ports.

SD Card

When a SD card is inserted, it will be recognized automatically and a message will show in the console as below.


To test the card to see if it is usable:

# mkdir /mnt/sdcard
# mount /dev/mmcblk0p1 /mnt/sdcard

Check to see if it is mounted:


To see the content: https://blog.csdn.net/htmlxx/article/details/18228305

# ls /mnt/sdcard


Unmount the card before removing out:

# umount /mnt/sdcard

LCD test

Connect LCD(CM12232-30)to RS232


eg:Send command from ttymxc0 to control LCD backlight switch

Terminal 1:

# stty -F /dev/ttymxc0 9600 raw -echo
# echo -en '\xC1\x00\xAA\xD0' > /dev/ttymxc3 

Note:The 00 Close the backlight, If you change it to FF, you will turn the backlight on


Note: Other LCD control instructions can refer to the LCD specification