EMB-2230

From Estone Technology Wiki
Jump to: navigation, search

Technical Specification

Compilation

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

Download here

Installation

sh poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain-2.1.3.sh

Compiling Kernel

git clone -b imx_3.14.52_1.1.0_ga https://github.com/estonetechnology/imx6qdl-linux-kernel.git
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

Files require:

zImage (imx6qdl-linux-kernel/arch/arm/boot/zImage)
hio-imx6dl-emb2230.dtb (imx6qdl-linux-kernel/arch/arm/boot/dts/hio-imx6dl-emb2230.dtb)

Compiling U-boot

git clone -b imx_v2015.04_3.14.52_1.1.0_ga https://github.com/estonetechnology/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

Files require:

SPL
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 fsl-community-bsp
cd fsl-community-bsp
repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b krogoth
repo sync
cd fsl-community-bsp/sources/
git clone -b krogoth https://github.com/meta-qt5/meta-qt5.git
git clone -b krogoth https://github.com/chausieu/meta-hio.git
git clone -b krogoth git://git.yoctoproject.org/meta-mono
cd fsl-community-bsp
. ./setup-environment build
git clone https://github.com/chausieu/hio-imx6dl-iob3200-conf.git
mv hio-imx6dl-iob3200-conf/local.conf hio-imx6dl-iob3200-conf/bblayers.conf conf/
  • Compiling 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)

Flashing Image

  • Image:

Download compiled image here. The image comes with the MFG tool that requires a Windows OS system.

  • Preparation:

Set the boot switch to "2"

Emb2230-sw2.png

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

Emb2230-otg.png

Extract the MFG file and run MfgTool2.exe. The device will be recognized as HID-compliant device.
Mfgtool-2.png
Click Start to flash the image.
Mfgtool-3.png
The flashing process is done once two processing bars turned to green.
Mfgtool-4.png
Now, click Stop and Exit the tool.

  • Starting up:

Set the boot switch to "1"

Emb2230-sw1.png

Plug in the Ethernet cable and power on

Emb2230-rj45.png

Testing Unit

Bluetooth

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

Emb2230-btconfig.png

Perform a scan for Bluetooth devices

hcitool scan

Output result:

Emb2230-btscan.png

Connect to recognized device

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

Network

  • 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: 192.168.1.125 (It is various depending on the DHCP server settings)

Check connection:

# ping 192.168.1.126 (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:

# WPA-PSK/TKIP
ctrl_interface=/var/run/wpa_supplicant
network={
  ssid="your_SSID"
  scan_ssid=1
  key_mgmt=WPA-PSK
  pairwise=TKIP CCMP
  group=CCMP TKIP WEP104 WEP40
  psk="your_PASSWORD" 
}

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 192.168.1.126 (an IP address from same local network)
  • Bandwidth:


From Terminal 1:

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

From Terminal 2:

# iperf -c 192.168.1.125

The result will show the bandwidth as Mb/s as below.
Iperftest.png
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:

RS-485

Modbus.png

Configuration:
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

Transmit:

# echo "transmit test" > /dev/ttymxc2

Receive:

# cat /dev/ttymxc2

RS-232

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

GPIO

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

GPIOs

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)

RS-232

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

USBs

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.

Usbdetect.png

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

Listusb.png

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.

Sdcard.png

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:

Sdcardmount.png

To see the content:

# ls /mnt/sdcard

Listsd.png

Unmount the card before removing out:

# umount /mnt/sdcard