AXIOMTEK rBOX630-FL Software User Manual

rBOX630-FL
Linux Software User’s Manual
ii
This manual has been carefully checked and believed to contain accurate information. Axiomtek Co., Ltd. assumes no responsibility for any infringements of patents or any third partys rights, and any liability arising from such use.
Axiomtek does not warrant or assume any legal liability or responsibility for the accuracy, completeness or usefulness of any information in this document. 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.
Trademarks Acknowledgments
Axiomtek is a trademark of Axiomtek Co., Ltd. Windows® is a trademark of Microsoft Corporation.
Other brand names and trademarks are the properties and registered brands of their respective owners.
Copyright 2016 Axiomtek Co., Ltd.
All Rights Reserved April 2016, Version A2 Printed in Taiwan
iii
Table of Contents
Disclaimers ..................................................................................................... ii
Chapter 1 Introduction ............................................. 1
1.1 Specifications ...................................................................................... 2
Chapter 2 Getting Started ....................................... 5
2.1 Connecting the rBOX630 .................................................................... 5
2.1.1 Serial Console ............................................................................................. 6
2.1.2 SSH over Ethernet ...................................................................................... 8
2.2 How to Develop a Sample Program ................................................. 10
2.2.1 Install Yocto Toolchain ............................................................................... 10
2.2.2 Setting Up the Cross-Development Environment ...................................... 11
2.2.3 Write and Compile Sample Program .......................................................... 11
2.3 How to Put and Run a Sample Program .......................................... 12
2.3.1 Via FTP (Default disable) .......................................................................... 12
2.3.2 Via USB Flash Drive .................................................................................. 13
2.3.3 Via TFTP ................................................................................................... 14
Chapter 3 The Embedded Linux ............................ 15
3.1 Embedded Linux Image Managing .................................................. 15
3.1.1 System Version ......................................................................................... 15
3.1.2 System Time .............................................................................................. 15
3.1.3 Internal RTC Time ..................................................................................... 15
3.1.4 External RTC Time .................................................................................... 16
3.1.5 Adjusting System Time .............................................................................. 16
3.2 Networking ......................................................................................... 17
3.2.1 FTP – File Transfer Protocol ..................................................................... 17
3.2.2 TFTP – Trivial File Transfer Protocol ......................................................... 17
3.2.3 NFS – Network File System ...................................................................... 17
Chapter 4 Programming Guide .............................. 19
4.1 librb217 API Functions ..................................................................... 19
4.2 librb217 API Examples ...................................................................... 24
4.2.1 Get Board ID and Power Status ................................................................ 24
4.2.2 COM Port Configuration ............................................................................ 24
4.2.3 Watchdog Timer ........................................................................................ 25
4.2.4 Digital Input and Output............................................................................. 26
4.2.5 LEDs Control ............................................................................................. 26
4.3 CAN Bus ............................................................................................. 27
iv
4.4 Compile Demo Program ................................................................... 29
4.4.1 Install Yocto Toolchain ............................................................................... 29
4.4.2 Run demo program ................................................................................... 29
Chapter 5 Board Support Package (BSP) .............. 31
5.1 Host Development System Installation ........................................... 31
5.1.1 Install Host System .................................................................................... 31
5.1.2 Install Yocto development ......................................................................... 32
5.1.3 Build and Install Yocto toolchain ................................................................ 33
5.2 U-Boot for rBOX630 .......................................................................... 34
5.2.1 Booting the System with an NFS Filesystem ............................................ 34
5.2.2 Booting the System from eMMC (rBOX630 default) .............................. 35
5.2.3 Booting the System from SD CARD .......................................................... 35
5.3 Additional Information ...................................................................... 36
5.3.1 Create a Bootable SD CARD for rBOX630 ............................................... 36
rBOX630 Linux
Introduction 1
Chapter 1
Introduction
The extreme compact rBOX630 supports the low power RISC-based module (iMX6) processor with extended temperature range of -40°C to +70°C for using in wide range operating environments. Multiple built-in serial ports, high-speed LANs and USB 2.0 ports enable fast and efficient data computation, communication and acquisition. Its digital I/O feature provides users with the convenience of digital devices connection. Besides, the industrial grade IP40-rated rBOX630 meets Safety Agency requirements and has passed heavy industrial CE and FCC testing.
This users manual is for the embedded Linux preinstalled in rBOX630. The embedded Linux is derived from Linux Yocto Board Support Package, which is based on Linux Kernel 3.0.35 and our hardware patches to suit rBOX630.
Software structure
The preinstalled embedded Linux image is located in eMMC Flash memory which is partitioned and formatted to accommodate boot loader, kernel and root filesystem. It follows standard Linux architecture to allow user to easily develop and deploy application software that follows Portable Operating System Interface (POSIX).
To facilitate user program in monitoring and controlling I/O device such as DIO, CAN, Watchdog Timer, the rBOX630 includes librb217.so shared library.
In addition to ext3 and ext4 file system, this embedded Linux kernel is compiled with support for NFS, including server-side, client-side functionality and Root file system on NFS. Using an NFS root mount we have several advantages such as:
The root file system is not size-restricted by the devices storage like Flash memory. Change made to application files during development is immediately available to the
target device.
For connectivity, this image includes most popular internet protocols, some servers and utilities not only making it easy for downloading/uploading files (Linux kernel, application program) or for debugging, but also communicating to outside world via Ethernet, WiFi and 3G.
For the convenience of manipulating embedded Linux, this image includes lots of popular packages such as busybox, udev, etc.
rBOX630 Linux
2 Introduction
1.1 Specifications
OS: Linux
Kernel: 3.0.35 (with Freescale and Axiomtek hardware modified patch)
Support Protocol Types
ICMP. TCP/IP. UDP, DHCP, Telnet, HTTP, HTTPS, SSL, SMTP, ARP, NTP, DNS, PPP, PPPoE,
FTP, TFTP, NFS.
Shell
Bash
File system
NFS, ext3, ext4
Daemons
Telnetd: Telnet server daemon FTPD: FTP server daemon
rBOX630 Linux
Introduction 3
Utilities
Telnet: Telnet client program FTP: FTP client program TFTP: Trivial File Transfer Protocol client
Packages
busybox: Small collection of standard Linux command-line utilities udev: A device manager for Linux kernel dosfstools : Utilities for making and checking MS-DOS FAT file system e2fsprogs: A set of utilities for maintaining the ext2, ext3 and ext4 file systems ethtool: A Linux command for displaying or modifying the Network Interface
Controller (NIC) parameters
i2c-tools : A heterogeneous set of I2C tools for Linux procps : Utilities to report on the state of the system, including the states of running
processes, amount of memory
wireless-tools: A package of Linux commands (simple text-based utilities/tools)
intended to support and facilitate the configuration of wireless devices using the Linux Wireless Extension
Development Environment
Host OS/ development OS: Ubuntu 14.04 LTS Toolchain/ cross compiler: ARM, gcc-4.8.1 (Yocto project 1.5.4 Dora)
HWs Lib (Hardwares Library)
WiFi (Optional)
- Detect signal strength
- Set AP connection
- Set web, wpa, wpa2
- Support search AP
Digital I/O
- Read digital input
- Write digital output
CAN
- Support open/write/read/close functions
3G
- Set number connection
- Support user name/password
- Detect signal strength
GPS
- Detect signal strength
- Support satellite positioning
Watch Dog Timer
- Enable
- Clean
- Set timer
COM
- RS-232/422/485 mode setting
Note
All specifications and images are subject to change without notice.
rBOX630 Linux
4 Introduction
This page is intentionally left blank.
rBOX630 Linux
Getting Started 5
Chapter 2
Getting Started
2.1 Connecting the rBOX630
You can connect the rBOX630 to personal computer (PC) in two ways:
Serial RS-232 console SSH over Ethernet
Note
Please download below data from Axiomteks website as below list if you have the
demand.
- BSP support package.
http://www.axiomtek.com/products/ViewProduct.asp?view=8947
rBOX630 Linux
6 Getting Started
2.1.1 Serial Console
The serial console is a convenient interface for connecting rBOX630 to PC. First of all, it is very important to make sure that your desktop connects to rBOX630 by console cable. Please set the system as follows:
Baudrate: 115200 bps Parity: None Data bits: 8 Stop bit: 1 Flow Control: None
Here we use PuTTY to setup and link to the rBOX630. Learn how to do it with these step by step instructions:
1. Open PuTTY and choose Serial as the connection type.
2. Configure the serial port correctly (see image below). Click Open and power on the rBOX630.
rBOX630 Linux
Getting Started 7
3. The Bootloader default booting system setup to SD Card, If you dont have bootable SD Card and want boot from eMMC, Try type this command on u-boot.
4. If connection is established successfully, you should see the following image.
5. To login, please enter root (with no password).
rBOX630 Linux
8 Getting Started
2.1.2 SSH over Ethernet
Now, we are going to connect the rBOX630 to PC over Ethernet. The following illustrations show how to do it under Windows® and Linux environment.
Note: rBOX630 LAN2 default IP address is 192.168.0.254. For Windows
®
users:
1. Here we also use PuTTY to setup and link. Open PuTTY and choose SSH as the connection type. Then set the IP address to 192.168.0.254 and click Open.
2. If connection is established successfully, you should see the following image.
rBOX630 Linux
Getting Started 9
3. To login rBOX630, please enter root (with no password).
For Linux users:
1. Open terminal and keyin ssh command.
2. After the connection is established successfully.
Loading...
+ 29 hidden pages