Page 2
Axiomtek does not make any commitment to update the information in this manual. Axiomtek reserves the right to change or revise this document and/or product at any time without notice. No part of this document may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of Axiomtek Co., Ltd.
Page 3
Table of Contents Disclaimers ..................... ii Chapter 1 Introduction ..........1 Specifications ..................2 Chapter 2 Getting Started ........... 5 Connecting the IFB122 ............... 5 2.1.1 Serial Console ..................... 7 2.1.2 SSH over Ethernet ..................9 How to Develop a Sample Program ..........11 2.2.1...
Page 4
U-Boot for IFB122 ................48 5.2.1 Booting the System with an NFS Filesystem ..........48 5.2.2 Booting the System from eMMC (IFB122 default) ........49 5.2.3 Booting the Rescue System from eMMC ..........49 Appendix Frequently Asked Questions ..... 51...
Din-rail mounting allows for easy installation into control This user’s manual is for the embedded Linux preinstalled in IFB122. The embedded Linux is derived from Linux Yocto Board Support Package, which is based on Linux Kernel 3.14.52 and our hardware patches to suit IFB122.
Page 7
IFB122 Linux User’s Manual Daemons Telnetd: Telnet server daemon FTPD: FTP server daemon Utilities Telnet: Telnet client program FTP: FTP client program TFTP: Trivial File Transfer Protocol client Packages Busybox(1.23.1): Small collection of standard Linux command-line utilities ...
Page 8
IFB122 Linux User’s Manual Relay Set relay high or low. All specifications and images are subject to change without notice.. http://www.axiomtek.com/Default.aspx?MenuId=Products&FunctionId=Prod uctView&ItemId=17865&upcat=134 Note 2. Command definition: Command Definition Example => setenv ipaddr 192.168.1.103 => U-Boot Meaning: U-Boot setenv ipaddr 192.168.1.103...
IFB122 Linux User’s Manual Chapter 2 Getting Started Connecting the IFB122 The power Please check you power as below: 1. DC input range 9~48V DC Terminal Block DC Signal Name Power+ Power- Console Port For user setting with debug. You can find TB10 pins for console port as below table.
Page 10
You can connect the IFB122 to personal computer (PC) in two ways: Serial RS-232 console SSH over Ethernet Please download below data from Axiomtek’s website as below list if you have the demand. Note BSP support package. http://www.axiomtek.com/Default.aspx?MenuId=Products&Funct ionId=gSearch&keyword=IFB122...
Data bits: 8 Stop bit: 1 Flow Control: None Here we use PuTTY to setup and link to the IFB122. Learn how to do it with these step by step instructions: Open PuTTY and choose ‘Serial’ as the connection type.
Page 12
IFB122 Linux User’s Manual The Bootloader default booting system from eMMC. If connection is established successfully, you should see the following image. To login, please enter ‘root’ (without password). Getting Started...
IFB122 Linux User’s Manual 2.1.2 SSH over Ethernet Now, we are going to connect the IFB122 to PC over Ethernet. The following illustrations ® show how to do it under Windows and Linux environment. IFB122 LAN2 default IP address is 192.168.0.254.
Page 14
IFB122 Linux User’s Manual To login IFB122, please enter ‘root’ (with no password). For Linux users: Open terminal and keyin ‘ssh’ command. ~$ ssh -l root 192.168.0.254 After the connection is established successfully. Getting Started...
IFB122 Linux User’s Manual How to Develop a Sample Program In this section, learn how to develop a sample program for IFB122 with the following step by step instructions. The sample program is named ‘hello.c’. 1. To Create a directory for IFB122 BSP ()(IFB122-Linux-bsp-x.x.x.tar.gz); related to...
Page 16
IFB122 Linux User’s Manual Copy the toolchain script to home directory. i686 for 32-bit machines or x86_64 for 64-bit machines. Execute the toolchain script and press Enter to install to default directory. 32-bit machines: ~$ bash poky-glibc-i686-meta-toolchain-cortexa7hf-vfp-neon-toolchain-1.8.1.sh 64-bit machines: ~$bash poky-glibc-x86_64-meta-toolchain-cortexa7hf-vfp-neon-toolchain-1.8.1.sh Check the directory.
IFB122 Linux User’s Manual 2.2.2 Setting Up the Cross-Development Environment Before you can develop using the cross-toolchain, you need to set up the cross-development environment, and then you can find this script in the directory you chose for installation. 1. To set up cross-toolchain environment.
If it is successful, you can see the information as below ~$ file hello How to Put and Run a Sample Program In this section, we provide 3 methods showing how to put the ‘hello’ program into IFB122 and execute it. 2.3.1 Via FTP The IFB122 system has a built-in FTP server.
Page 19
~$ ftp 192.168.0.254 (username ‘root’ without password) Upload “hello” program to IFB122 from your host PC ftp> put hello 5. If the operation is successful on IFB122, you can see ‘hello’ program on IFB122’s /home/root directory. To change file permission for executable on IFB122.
IFB122 Linux User’s Manual 2.3.2 Via USB Flash Drive Another method of putting ‘hello’ program into IFB122 is via USB flash drive. Please follow the instructions below. IFB122 supports storage format FAT32 /FAT/EXT2/EXT3/EXT4 From the host PC, copy ‘hello’ program to USB flash drive.
Via TFTP Originally the Host Development System Installation already has TFTP server installed. You can put the ‘hello’ program into IFB122 via TFTP. Please follow the instructions below. Refer to section 5.1.1 step 4. Install and configure TFTP server for install and setup your TFTP: To copy “hello”...
IFB122 Linux User’s Manual How to Recovery System In this section, we provide 2 methods showing you how to recovery IFB122 system to default. 2.4.1 Via run_rescue System Script (under Linux System) There is a recovery script in /etc folder on IFB122 Embedded Linux system. If you want to recovery your system to factory default settings, you can follow the instructions.
Create a folder name “update” If you only want to update kernel without root filesystem, then you just need to rename the new kernel file to ‘zImage’ and dtb file to ‘ax-rsb-imx6ul-ifb122.dtb’ then put into the update folder. Getting Started...
Page 24
If you want to update kernel and root filesystem, and then put this three file into update folder. If Axiomtek provide other apps or tools to install, create a tools folder under update folder for upgrading and installing. Attach USB flash drive to IFB122.
Page 25
IFB122 Linux User’s Manual Run the run_rescue shell script. ~# /etc/run_rescue During this update procedure, four custom LEDs will blink like marquee. Until procedure finish, the system will reboot again automatically, and system status LED from blinking to always on.
IFB122 Linux User’s Manual How to use MFG tool to download image We show you how to use MFG tool to download bin image to the IFB122 system. Before using the MFG tool, you have to change the IFB122 JP1 boot mode (default emmc boot) to OTG serial downloader mode.
Page 27
IFB122 Linux User’s Manual 5. After burning has completed, the status will change to “Done” as below. For detailed information about MFG tool, please refer to “Manufacturing Tool V2 Quick Start Guide.docx” in the “Document\V2” directory. Getting Started...
Page 28
IFB122 Linux User’s Manual This page is intentionally left blank. Getting Started...
The internal RTC time is read from i.MX processor internal RTC. Note that this time value is not saved, when system power is removed. Read internal RTC time with the following command on IFB122: ~# hwclock -r --rtc=/dev/rtc1 The Embedded Linux...
Function: wdt_driver_test.out Description: When <sleep> parameters is more than <timeout> parameters, watchdog timer will be trigger Note: IFB122 has been enabled for default setting, and the default parameters is 10 5 0 Commands example: ~# wdt 10 5 0 & 3.1.6 Adjusting System Time Manually set up the system time.
FTP is a standard network protocol used to transfer files from one host to another host over TCP-based network. The IFB122 comes with a built-in FTP server. Section 2.1 shows the steps to put ‘hello’ program to IFB122 via FTP.
IFB122 Linux User’s Manual NFS – Network File System 3.2.3 NFS enables you to export a directory on an NFS server and mount that directory on remote client machine as if it were a local file system. Using NFS on target machine, we can have access to a huge number of files, libraries, and utilities during development and debugging, as well as booting up kernel.
Page 33
IFB122 Linux User’s Manual 1.2 If your 4G module is Sierra MC7304, you can follow the instructions as below. Please execute script for internet connection. ~# /etp/ppp/ppp-sierra-on When you execute script, you may find the information as below. You can execute command ,ifconfig to examine PPP0 connection.
Page 34
IFB122 Linux User’s Manual 2 3G / 4G module connection to the Internet with wvdial Tool 2.1 If your 3G module is Quectel UC20, you can follow the instructions as below. To create a wvdial config ~# vi /etc/wvdial.conf Please enter your information as below.
Page 35
IFB122 Linux User’s Manual PPP0 will be shown after successful connection. 2.2 If your 4G module is Sierra MC7304, you can follow the instructions as below. To create a wvdial config ~# vi /etc/wvdial.conf Please enter your information as below.
IFB122 Linux User’s Manual PPP0 will be shown after successful connection. 3.2.5 How to use Wi-Fi module (Optional) If your Wi-Fi module is WPER-172GN, you can follow the instructions as below. Editor /etc/wpa_supplicant.conf file ~# vi /etc/wpa_supplicant.conf Enter your router,s SSID and Password If the setting is successful, it will automatically connect after reboot.
With these API functions, users can more easily design their own software. This chapter includes detailed description of each API function and step-by-step code samples showing how it works. librsb10x API Functions The IFB122 BSP includes ‘librsb10x.so’ shared library for users to access I/O and read back system information. This...
Page 38
IFB122 Linux User’s Manual COM sample code: COM receive #include <stdio.h> #include <termios.h> //header contains the definitions used by the terminal I/O interfaces #include <unistd.h> //read() write() close() #include <fcntl.h> #include <string.h> //Serial port defines and variables: #define SERIAL_BAUDRATE B9600 #define SERIAL_DEVICE "/dev/ttyUSB0"...
Page 39
IFB122 Linux User’s Manual printf("res=%d buf=%s\n", serial_read_ret, serial_buffer_recv); if (serial_buffer_recv[0] == '@') break; serial_read_ret = close(serial_fd); //Close the serial port printf("Serial port closed.\n"); return 0; COM send: #include <stdio.h> #include <termios.h> //header contains the definitions used by the terminal I/O interfaces #include <unistd.h>...
Page 40
IFB122 Linux User’s Manual Programming Guide...
Page 41
IFB122 Linux User’s Manual int len = strlen(serial_buffer_send); serial_buffer_send[len] = 0x0d; // stick a <CR> after the command serial_buffer_send[len+1] = 0x00; // terminate the string properly serial_write_ret = write(serial_fd,serial_buffer_send,strlen(serial_buffer_send)); if(serial_write_ret < 0) printf("Sent to serial port fail\n"); else printf("Sent to serial port = %s\n",serial_buffer_send);...
Page 43
IFB122 Linux User’s Manual Function: Control_LED () Function int Control_LED(int num,int enable); Description Set LED enable or disable Arguments Num : LED number,default as 1 ~ 4 Enable : enable or disable led 0: disable 1: enable Return 0: No error.
Page 44
IFB122 Linux User’s Manual Function: Control_WDT () Function int Control_WDT(int timeout,int sleep_time,int test); Description Set WDT Function Arguments timeout : value in seconds to cause wdt timeout/reset sleep_time : value in seconds to service the wdt test : 0 – service wdt with ioctl(), 1 – with write() Return 0: No error.
PC. You can refer to Chapter 5 Board Support Package. Set up the cross-development environment on your host PC. ~$ source /opt/poky/1.8.1/environment-setup-cortexa7hf-vfp-neon-poky-linux-gnueabi To compile and build demo program for IFB122, please do: Change to your project directory. ~$ cd project/IFB122-LINUX-bsp-1.0.0/AxTools Extract driver source to your project directory.
IFB122 Linux User’s Manual Build the demo program. ~$ make You should have example programs such as open_comport, diotest, and commode. 4.2.2 Run demo program Refer to section 2.3 for detailed information. Programming Guide...
IFB122 Linux User’s Manual Then restart the TFTP server. ~$ sudo /etc/init.d/xinetd restart Install and configure NFS server: ~$ sudo aptitude -y install nfs-common nfs-kernel-server portmap To configure nfs server, add lines to /etc/exports as follows: /tools/rootfs *(rw,sync,no_root_squash) ~$ sudo vi /etc/exports Create a symbolic link to root filesystem which your build.
Page 49
IFB122 Linux User’s Manual ~$ repo sync Clone Finish Extract Axiomtek’s Yocto BSP source ~$ tar -xvf ../IFB122-LINUX-bsp-1.0.0/Yocto\ patches/meta-axiomtek-2.5.0.tar.gz -C sources Check meta-axiomtek Update bblayers.conf ~$ vi fsl-community-bsp/sources/base/conf/bblayers.conf And add this line after ${BSPDIR}/sources/meta-fsl-demos \ ${BSPDIR}/sources/meta-axiomtek \ Board Support Package (BSP)
Page 50
IFB122 Linux User’s Manual First build Choose your board ~$ DISTRO=poky MACHINE=rsb101 EULA=1 source fsl-setup-release.sh -b build Start to build image ~$ bitbake axl-image-base After build image finish, you can find the file path. The file path: project/fsl-community-bsp/build/tmp/deploy/images/rsb101 Board Support Package (BSP)
Page 51
IFB122 Linux User’s Manual 5.1.3 Build and Install user’s Yocto Toolchain We have provided Yocto Toolchain in IFB122 BSP. However, if you want to build your toolchain by Yocto development, you can follow the instructions on host PC: Change to Yocto development directory.
IFB122 Linux User’s Manual U-Boot for IFB122 5.2.1 Booting the System with an NFS Filesystem By default, U-Boot is configured to boot from eMMC. To boot from NFS, first you must set some configurations. Press any key to break from the boot progress and set configurations.
IFB122 Linux User’s Manual 5.2.2 Booting the System from eMMC (IFB122 default) => run bootcmd 5.2.3 Booting the Rescue System from eMMC If the Embedded Linux system was broken to boot, you can recovery Linux system on u-boot through rescue mode.
Page 54
IFB122 Linux User’s Manual This page is intentionally left blank. Board Support Package (BSP)
IFB122 Linux User’s Manual Appendix Frequently Asked Questions Q1. When I use toolchain to compile, I can’t find “ include” file. A1: Refer to section 2.3 for detailed information 2.2.2 Setting up the Cross-Development Environment For example: $CC hello.c -o hello Q2.
Page 56
IFB122 Linux User’s Manual 3. To check if your RS232 port jumper. Q3. Why can’t transfer the file to FTP、TFTP、NFS after following the instructions, or disconnect. A3: To check your firewall been blocked in your host PC or router. Frequently Asked Questions...
Need help?
Do you have a question about the IFB122 and is the answer not in the manual?
Questions and answers