ARC2310 SDK ARC2310/T2 Validator SDK Smart card terminal Technical documentation - Software Development Kit (SDK) Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se ARC2310/T2 SDK ver sio n 1.0 1 Index 2 Revision history ............................................................................................................................... 3 3 Introduction ..................................................................................................................................... 4 3.1 3.2 ARC2310 .................................................................................................................................. 4 Document version dependencies ............................................................................................ 4 4 ARC2310 System overview .............................................................................................................. 5 4.1 4.2 ARC2310 flash layout ............................................................................................................... 5 ARC2310 File system layout .................................................................................................... 6 4.2.1 Base file system layout .................................................................................................... 6 4.2.2 Layout for /usr/ directory ................................................................................................ 6 5 6 ARC2310 SSH handling .................................................................................................................... 7 Software tools ................................................................................................................................. 8 6.1 Development tool setup for the Arcontia ARC2310................................................................ 8 6.1.1 Tool chain requirements ................................................................................................. 8 6.1.2 Optional software ............................................................................................................ 8 6.1.3 Compiler setup ................................................................................................................ 8 6.2 6.3 6.4 Restore Image.......................................................................................................................... 8 Building the sample program ................................................................................................ 10 Power to the reader .............................................................................................................. 11 7 ARC2310 Linux Devices .................................................................................................................. 12 7.1 7.2 7.3 Kernel console port ............................................................................................................... 12 External RS232 port 1 ............................................................................................................ 12 RFID reader device ................................................................................................................ 12 8 Application development on ARC2310 ......................................................................................... 13 8.1 ARC2310 demo program ....................................................................................................... 13 8.1.1 Building the example ..................................................................................................... 13 8.1.2 Running the example ..................................................................................................... 14 9 Known Issues ................................................................................................................................. 15 Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 2 ARC2310/T2 SDK ver sio n 1.0 2 Revision history Release Date 1.0 2014-09-09 Description First dev kit version Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 3 ARC2310/T2 SDK ver sio n 1.0 3 Introduction 3.1 ARC2310 T2/ARC2310 3.2 Document version dependencies This document is based on software development kit version 1.0 and the following software and firmware versions. Software or firmware type Version Linux kernel ArcB ARC1300 firmware 3.10 3.7.15 G Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 4 ARC2310/T2 SDK ver sio n 1.0 4 ARC2310 System overview The ARC2310 is GNU/Linux based. The main operating system environment is provided by Busybox v1.20.1 http://www.busybox.net. 4.1 ARC2310 flash layout The flash memory is divided into several partitions for performing secure system upgrades. This table shows the details of these partitions:
Partition name Partition size Partition information DTB Uboot Kernel Root User 2 MiB 8 MiB 8 MiB 128 MiB 512 MiB Device Tree Blob Boot loader Kernel partition Root partition User partition Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 5 ARC2310/T2 SDK ver sio n 1.0 4.2 ARC2310 File system layout The file system tries to mimic common Posix based systems but there are some specific limitations because of the nature of an embedded Linux system. 4.2.1 Base file system layout The base root file system looks like this:
Dir Info Top node where the root image is mounted. Operating system binaries. Device files. Documentation files System configuration files. Mounted as a RAM disk, any changes will be lost at reboot.
/
/bin
/dev
/doc
/etc
/home User home dir. Is not used yet.
/lib Operating system libraries.
/media Unused, can be used as mnt.
/mnt
/proc
/root
/sbin
/sys
/tmp
/usr
/var Mount point directories for extra file systems. Linux proc fs. Root user home dir. Operating system binaries. Linux sysfs. Temporary dir. Mounted as an RAM disk. All content will be lost at reboot. The usr dir. This is the mounting point of the NVRAM partition. 4.2.2 Layout for /usr/ directory Dir Info
/usr/lib Operating system libraries, in this folder Arcontia Library files are stored,like Arcb and ArcT1 Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 6 ARC2310/T2 SDK ver sio n 1.0 5 ARC2310 SSH handling The Arc2310 has as default a ssh deamon running, and the device is configured for dhcp so it will receive a dynamic ip at boot. Tip1: When booting up the device for the first time, it could be convenient to use a serial cable to connect to the device. Tip2: If no serial cable is available, then on a linux system connected to the same LAN as the 2310 can be used and issue the command: sudo nmap -sP 192.168.0.0/24 | awk '/192/ { print $0; }' before and after connecting the device. The difference in the output should reveal the ip address of the device. Default credentials:
Login: root password: arcontia Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 7 ARC2310/T2 SDK ver sio n 1.0 6 Software tools 6.1 Development tool setup for the Arcontia ARC2310 The Arcontia ARC2310 is a GNU/Linux based platform. 6.1.1 Tool chain requirements Gnu/Linux based x86 PC. We recommend Ubuntu 12.04 LTS (http://www.ubuntu.com) on an x86 computer and the following examples are tested for this OS only. 6.1.2 Optional software The following software is required to build Qt based GUI applications:
sudo apt-get install qt4-designer g++
It is also possible to use Visual Studio with the Qt add-on. For more information on Qt development see http://qt.digia.com. The example project included in this SDK uses the tools provided in the Qt SDK. These utilities are also required to build the user image:
sudo apt-get install mtd-utils 6.1.3 Compiler setup The tool chain consists of GCC (Gnu Compiler Collection) version 4.4.6, QtEmbedded version 4.8.4-
arm and Arcontia Arcb3. The archive ARC2310_SDK_ver_1.0.tar.gz is located in the ToolChain directory and contains all needed software. Extract the files on the Ubuntu computer using the following commands:
cd /
sudo tar xvf <dir>/ARC2310_SDK_ver_1.0.tar.gz Setup the path to the tools:
PATH=$PATH:/opt/Arcontia/gcc-4.4.6-eglib-2.12-binutils-2.20.1-1/arm-unknown-linux-
gnueabi/bin 6.2 Restore Image To restore the software on the 2310 to factory defaults the following procedure needs to be taken. Go to the folder with the linux image. Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 8 ARC2310/T2 SDK ver sio n 1.0 cd /opt/Arcontia/ARC2310_v1.0/Image/
Start by extracting the archive. bzip2 -d arc2310-image-20140821T132712Z-696254464-0a940cafa626c639.img.bz2 This will extract the file: arc2310-image-20140821T132712Z-696254464-0a940cafa626c639.img This file should to be flashed to an sd-card. Use for example an usb-sd-card reader, and use the following command:
dd if= arc2310-image-20140821T132712Z-696254464-0a940cafa626c639.img of=/dev/sdb bs=1M conv=fsync Note: The /dev/sdb part of the command assumes that the sd-card reader is assigned to this device. This should be changed to point at the right device for your system. Note: The name of the image is created with the date of the creation, so an example of image name is: arc2310-image-20140820T143014Z-696254464-ce415d441358748e.img so the name referred to in this document might be different then what is the Image directory. After the image has been written to the sd-card, the card should be placed in the 2310. A console cable needs to be attached to the device. And the device should be rebooted. The program Putty can be used to connect to the device, choose ConnectionType : Serial, Speed:
115200 and Serial Line: COM1 Note: The Serial Line might be different depending on your computer. Refer to your device manager to find out the correct port. When the Arc2310 boots up, it will wait 3 seconds to stop the autoboot. Hit anykey to stop the autoboot. A U-boot console should open up. Issue the command:
setenv rootblks16 0x140000 This will tell uboot how big the image is. Note: The value 0x140000 specifies the amount of 512 byte blocks to copy from the sd-card. The current image is 640 Mb that equals: (640 * 1024 * 1024) / 512 = 1310720 = 0x140000H Make u-boot start the copy process by typing:
run install_firmware Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 9 ARC2310/T2 SDK ver sio n 1.0 For an image of the size 640 Mb the process takes about 8 to 10 minutes. Finally reboot the device by issuing the command:
reset 6.3 Building the sample program Go to the example folder:
cd /opt/Arcontia/ARC2310_v1.0/Example/
Uncompress the archive. tar xvf T2Demo.tar.gz Change directory to the extracted. cd T2Demo The script file generateMakefile can be used to create the Makefile. /generateMakefile Type make to start the build process. make This will produce the T2Demo executable into the build directory. cd /opt/Arcontia/ARC2310_v1.0/Example/T2Demo/build The application can now be transferred and executed on the device. scp can for example be used to transfer the application to the device. scp T2Demo root@192.168.0.31:/usr/bin Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 10 ARC2310/T2 SDK ver sio n 1.0 Note: If the application is already running on the device, the running application must be killed before the file can be overwritten. This can be done through ssh into the device and using the command killall T2Demo Note: The T2Demo is configured to start at boot, this is done in the file: /etc/init.d/T2App and is also linked in /etc/rc.d/S99T2App 6.4 Power to the reader To switch on the power to the reader chip the following commands needs to be executed on the device. echo 4 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio4/direction echo 1 > /sys/class/gpio/gpio4/value Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 11 ARC2310/T2 SDK ver sio n 1.0 7 ARC2310 Linux Devices 7.1 Kernel console port
/dev/ttyAPP3 7.2 External RS232 port 1
/dev/ttyAPP0 7.3 RFID reader device
/dev/ttyFiq4 Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 12 ARC2310/T2 SDK ver sio n 1.0 8 Application development on ARC2310 The default GUI development framework for the ARC2310 is Qt. The easiest way to get started is to use QtCreator. It is possible to use other tools such as Eclipse if desired. However, this guide does not include steps on installing Qt for Eclipse so please refer to the Qt documentation for setting up the Eclipse development environment. 8.1 ARC2310 demo program The ARC2310 device included in the development kit does not come with the T2Demo demo program pre-installed. This program demonstrates general usage of the ARC2310 hardware. The source code for the demo is included in the SDK and is located in the
/opt/Arcontia/ARC2310_v1.0/Example directory. The T2Demo is closely related to the T5Demo
(ARC1800). SAM structures and Cards used in this demo is compatible with the one used on the T5Demo. 8.1.1 Building the example Step 1. If you have not done so already, follow the instructions in Section 6.1 of this document to set up your environment. Step 2. Navigate to the desired working directory and extract the T2Demo source on the Ubuntu computer using the following commands:
tar axf /opt/Arcontia/ARC2310_v1.0/Example/T2Demo.tar.bz2 cd T2Demo Step 3. Configure the T2Demo application:
./generateMakeFile Note that the application is now configured to run on a target ARC2310 device. If instead you wish to build the application to run on an x86 computer, execute the following command:
qmake Step 4. Build the T2Demo application:
make Note: If you have compiled the code previously, and have changed the target, it may be necessary to clean the build before running make to ensure it builds for the new target:
make clean Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 13 ARC2310/T2 SDK ver sio n 1.0 8.1.2 Running the example The application is built to either run on a target ARC2310 device or to emulate a device on the host machine. See Section 8.1.1 above for more details on building for these targets. Choose the appropriate run procedure of the two below depending on your target. Option I: Running on the host machine:
Step 1. Set the LD_LIBRARY_PATH environment variable:
export LD_LIBRARY_PATH=/opt/Arcontia/ARC1300_v3.8/SDK/LibraryC++/ARCB_Libraries_3.7.15/Lib
/:/opt/Arcontia/ARC1300_v3.8/SDK/LibraryC++/ArcT1_Libraries_1.8/Lib/
Step 2. Run the build:
./build/T2Demo Option II: Running on a target ARC2310:
Step 1. Copy the application to a writable directory on the unit such as tmp:
scp build/T2Demo root@X.X.X.X:/tmp Note: Replace X.X.X.X with the correct IP-address. Note: The root account has the password arcontia as default. Step 2. Connect to the unit via SSH:
ssh root@X.X.X.X Note: Replace X.X.X.X with the correct IP-address. Note: The root account has the password arcontia as default. Step 3. Run the application:
cd /tmp/
./T2Demo Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 14 ARC2310/T2 SDK ver sio n 1.0 9 Known Issues No known issues. Lecip Ar co n t ia AB, Gr u vg at an 35A, 421 30 Vst r a Fr lu n d a, Sw ed en , Tel + 46(0)31499930 w w w .ar co n t ia.se su p p o r t @ar co n t ia.se 15