Beruflich Dokumente
Kultur Dokumente
Version 3.1
Date 2017-01-16
ZT595 User Manual
Version Information
Rev Date Description
01 2012-02-02 Initial version
02 2013-04-11 Modify by Zhongyu Huang
Contact Information
For more information please visit http://www.szzt.com.cn/.
MENU
ZT595 USER MANUAL .........................................................................................................1
CHAPTER ONE ZT595 SUMMARY ..............................................................................5
1.1 Product Features ............................................................................................................................................. 6
1.2 Hardware Resources ....................................................................................................................................... 6
1.3 Software Resources......................................................................................................................................... 7
CHAPRTER TWO ZT595 HARDWARE INTERFACES ..................................................................8
2.1 Product Appearance ........................................................................................................................................ 8
2.2 ZT595’s Structure Diagram ............................................................................................................................ 8
2.3 Interface Description....................................................................................................................................... 9
2.3.1 GPIO Interface......................................................................................................................................................... 10
2.3.2 TF Card Interface ..................................................................................................................................................... 11
2.3.3 USB Host Interface .................................................................................................................................................. 12
2.3.4 USB Device Interface .............................................................................................................................................. 12
2.3.5 Serial Port Interface ................................................................................................................................................. 12
2.3.6 MT318 v3.0 Cardreader Interface............................................................................................................................ 13
2.3.7 Keypad Interface...................................................................................................................................................... 13
CHAPTER THERE HARDWARE TESTS DESCRIPTION .................................................................15
3.1 LCD Screen Test ........................................................................................................................................ 15
3.2 RTC Test .................................................................................................................................................... 15
3.3 TF Card Interface Test ............................................................................................................................... 15
3.4 USB Host Interface Test .......................................................................................................................... 16
3.5 Audio Test.................................................................................................................................................. 16
3.6 Serial Port Test ........................................................................................................................................... 16
3.7 MT318 V3.0 Card Reader Test .................................................................................................................. 17
3.8 Keypad Test ............................................................................................................................................... 19
CHAPTER FOUR UPDATE ZT595'S IMAGE...........................................................................21
4.1 Environment Settings.................................................................................................................................... 21
4.1.1 Hardware Requirment .............................................................................................................................................. 21
4.1.2 Minicom Configuration in Linux ............................................................................................................................. 21
4.1.3 TFTP Environment Configuration in Linux ............................................................................................................. 22
4.1.4 Environment Variables Settings of u-boot................................................................................................................ 23
4.2 Update u-boot ............................................................................................................................................... 24
4.3 Update Linux Kernel..................................................................................................................................... 25
4.4 Update yaffs2 Filesystem.............................................................................................................................. 26
4.4.1 Update yaffs2 Filesystem thourgh TFTP Server ...................................................................................................... 26
4.4.2 Update yaffs2 filesystem through NFS Server ......................................................................................................... 27
CHAPTER FIVE COMPILE AND DEPLOY APPLICATION .........................................................29
5.1 Fast-boot System........................................................................................................................................... 29
5.2 Installation of Cross-complier Tool .............................................................................................................. 30
5.3 Application Development ............................................................................................................................. 31
5.4 Compile Application ..................................................................................................................................... 32
5.5 Download Applications to ZT595................................................................................................................. 32
Appendix
GRAPH 1.1 ZT595 DEMO PHOTO .................................................................................................................................... 6
GRAPH 2.1 ZT595 APPEARANCE DIMENSIONAL LAYOUT ................................................................................................... 8
DIAGRAM 2.2 ZT595 STRUCTURE LAYOUT ....................................................................................................................... 9
GRAPH 2.3 ZT595’S INTERFACE LAYOUT ....................................................................................................................... 10
GRAPH 2.4 GPIO’S INTERFACE LAYOUT ........................................................................................................................ 11
TABLE 2.1 GPIO’S PIN DESCRIPTION ............................................................................................................................ 11
TABLE 2.2 TF CARD’S PIN DESCRIPTION........................................................................................................................ 11
TABLE 2.3 USB PIN DESCRIPTION ................................................................................................................................. 12
TABLE 2.4 USB DEVICE SERIAL PIN DESCRIPTION ......................................................................................................... 12
GRAPH 2.5 FREQUENTLY-USED SERIAL PORT INTERFACE LAYOUT ................................................................................... 12
TABLE 2.5 FREQUENTLY-USED SERIAL PORT’S PIN DESCRIPTION .................................................................................... 13
GRAPH 2.6 EXTERNAL CARD READER’S POWER SUPPLY AND SERIAL PORT INTERFACE LAYOUT ....................................... 13
TABLE 2.6 EXTERNAL CARD READER’S SERIAL PORT PIN DESCRIPTION........................................................................... 13
TABLE 2.7 EXTERNAL CARD READER POWER SUPPLY’S SERIAL PIN DESCRIPTION ........................................................... 13
TABLE 2.8 ZT595 CORRESPONDING KEY VALUES ........................................................................................................... 14
TABLE 3.1 ZT595 CORRESPONDING SERIAL PORT NUMBER BETWEEN STRUCTURE GRAPH AND SYSTEM ........................... 16
TABLE 4.1 NAND FLASH PARTITION ............................................................................................................................. 21
TABLE 4.2 SERIAL PIN DESCRIPTION .............................................................................................................................. 21
Chapter One
ZT595 Summary
This secure payment product is called “Unattended Self-service Payment Terminal” and its basic model is
ZT595, adopting ARM chip architecture and Linux. It’s industrial-grade designed, containing control module,
display module and keypad module.
CPU
High security ARM9 series CPU, 400MHz.
Display Screen
128*64 pixels black&white LCD.
Storage
SDRAM: 64MB
NAND FLASH: 128MB
Peripheral Interfaces and other Resources:
1 100M Ethernet RJ-45 interface
4 serial port interfaces
1 TF card reader
1 USB Host 1.1 interface
1 USB device interface
1 Audio output connector
1 ZT595 external power supply interface, 12V voltage
1 card reader power supply interface, 12V voltage
1 card reader series port interface
Extended Interface
1 20 pin GPIO interface
OS Support
ZT595 software system adopts Linux2.6.30 kernel.
API for secondary development
Offering API for secondary development for developers
Dynamic library of MT318’s card reader libztcard.so
Dynamic library of LCD screen libztlcd.so
Dynamic library of keypad libztkbd.so
Dynamic library of PSAM card libztpsam.so
Common dynamic library of ZT595 libztpublic.so
Hardware test programs
To detect whether the peripheral interface and devices are working properly.
Expanded serial port test comtest
MT318 card reader test mt318_test
LCD screen test lcm6063_test
keypad test zt596_test
CHAPTER TWO
PSAM4 PSAM1
PSAM3 PSAM2
20
Pin
GPIO
SDRAM
ARM9
Nand Flash
TF CARD
USB HOST
Audio
USB Device
Power Ethernet
DBGU UART3 UART2 UART1
ZT595’s interface layout as shown in Diagram 2.3
GND Ground
GND Ground
VDD Output
NCD_SD Output
GRAPH 2.6 EXTERNAL CARD READER’S POWER SUPPLY AND SERIAL PORT INTERFACE LAYOUT
TABLE 2.7 EXTERNAL CARD READER POWER SUPPLY’S SERIAL PIN DESCRIPTION
Pin Number Signal Type
1 VCC 12V
2 VCC 12V
3 GND
4 GND
CHAPTER THREE
“lcm6063_test” is LCD screen test program stored in “System/home” and it depends on dynamic library
“libztlcd.so”.
Run the commands shown as below to test LCD screen:
[root@ztlinux:/] cd /home
[root@ztlinux:/] export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
[root@ztlinux:/] ./lcm6063_test
If there is a little penguin logo displayed on then screen, then the LCD screen is working properly.
To test the RTC, set the current time and the time format should be: Month/Day/Hour/Minute/Year. For
example: date 011409092012. Then power-off and reboot the system after saving. If the system runs based on
the exactly time settings as the one set before, then the RTC is working properly.
Run the commands shown as below to test the RTC.
[root@ztlinux:/] cd /home
[root@ztlinux:/] date 011409102012
[root@ztlinux:/] hwclock –w //save system time
[root@ztlinux:/] date //check current time of the system
Power-off and reboot the system after save&exit. If the system runs based on the exactly time settings as the
one set before, then the RTC is working properly.
[root@ztlinux:/] date //check current time of the system
Insert TF card into the card slot, the Kernel mountpoint SD’s device name should be stored in
/dev/mmchlk0p1 if the TF card is a partition. Here is how to run the test: read a file from TF card if the SD
card’s mount operation is successful. For example: there is a file named “a.c” in TF card’s root directory and
its content is a string “test TF”. Read the content from TF card by using commands, if read successfully then it
shows the TF card interface is running properly.
Run the command shown as below to test the TF card interface:
[root@ztlinux:/] cd /home
[root@ztlinux:/] mount /dev/ mmcblk0p1 /mnt/SD
[root@ztlinux:/] cat a.c
test TF
[root@ztlinux:/] umount /mnt/SD
To test the USB Host interface: insert an USB flash driver into USB Host interface, after the mount operation
is successful, create a folder in the USB flash driver and then delete it. If it works, shows that the USB Host
interface is working properly.
Run the commands shown as below to test USB Host interface:
[root@ztlinux:/] cd /home
[root@ztlinux:/] mount –t vfat /dev/sda /mnt/
[root@ztlinux:/] mkdir test
[root@ztlinux:/] ls // check the test folder in current directory.
[root@ztlinux:/] rmdir test
[root@ztlinux:/] umount /mnt/
An MP3 music has been stored in “System/home”. Connect a speaker into the audio interface and run the
commands shown as below to check wether there is a sound.
[root@ztlinux:/] cd /home
[root@ztlinux:/] madplay yiqi.mp3
If there is a sound, shows that the Audio interface is working properly.
The program “comtest” is to test serial port and stored in “System/home”. Here is the corresponding serial
port number between structure graph and system shown as Table 3.1.
TABLE 3.1 ZT595 CORRESPONDING SERIAL PORT NUMBER BETWEEN STRUCTURE DIAGRAM AND SYSTEM
Serial Port No. in ZT595’s Serial Port No. of ZT595’s
structure chart system
Mt318 UART s3c2410_serial1
DBGU s3c2410_serial0
UART1 ttyS1
UART2 ttyS2
UART3 ttyS3
Take UART1 as an example: plug RJ11-DB9 adapter into UART1( for UART1’s pin description, please check
“Diagram 2.2 ZT595’s Structure layout”), then connect RJ11-DB9 to PC by using serial crossover cable, then
run serial port tool in Linux (we use minicom here. Please check “4.1.2 Minicom Configuration in Linux ” for
more details), at last set the communication baud rate as “115200 8 N 1”.
Run the commands shown as below to test UART1 serial port.
[root@ztlinux:/] cd /home
“mt318_test” is MT318 V3.0 card reader test program stored in “System/home” and it depends on dynamic
libraries “libztcard.so” and “libztpublic.so”.
Run the commands shown as below to test MT318 V3.0 card reader.
[root@ztlinux:/] cd /home
[root@ztlinux:/] export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
[root@ztlinux:/] ./mt318_test
MT318 test start!
a: pay_cardreader_open test
c: pay_cardreader_close test
f: pay_cardreader_enable test
g: pay_cardreader_reject test
h: pay_cardreader_check test
i: mag_read_magicinfo test
j: pay_cardreader_reset test
k: pay_cardreader_poweron test
l: pay_cardreader_poweroff test
m: pay_cardreader_apdu test
r: SIM_reset test
d: SIM_power_down test
t: SIM_APDU_transmit test
Choose a to open card reader’s serial port of MT318.
please enter the code: apay_cardreader_open test
retcode =0
a: pay_cardreader_open test
c: pay_cardreader_close test
f: pay_cardreader_enable test
g: pay_cardreader_reject test
h: pay_cardreader_check test
i: mag_read_magicinfo test
j: pay_cardreader_reset test
k: pay_cardreader_poweron test
l: pay_cardreader_poweroff test
m: pay_cardreader_apdu test
r: SIM_reset test
d: SIM_power_down test
t: SIM_APDU_transmit test
Choose f to use the specified enable card. Insert card into the card reader’s interface (Note: we use general
bank magnetic stripe card in this test), the card reader will swallow the card. If the card popped up, please
check whether the card is inserted upside.
please enter the code: fpay_cardreader_enable test
retcode =0
a: pay_cardreader_open test
c: pay_cardreader_close test
f: pay_cardreader_enable test
g: pay_cardreader_reject test
h: pay_cardreader_check test
i: mag_read_magicinfo test
j: pay_cardreader_reset test
k: pay_cardreader_poweron test
l: pay_cardreader_poweroff test
m: pay_cardreader_apdu test
r: SIM_reset test
d: SIM_power_down test
t: SIM_APDU_transmit test
Choose i to read magnetic track’s information of the inserted card and print it out.
please enter the code: imag_read_magicinfo test
info=0x0 track1 = track2 =6222001718100014562=06071202639991524 track3
=996222001718100014562=15600000000000000000032639992160000060700000000
0000000000000=000000000000=0000000
a: pay_cardreader_open test
c: pay_cardreader_close test
f: pay_cardreader_enable test
g: pay_cardreader_reject test
h: pay_cardreader_check test
i: mag_read_magicinfo test
j: pay_cardreader_reset test
k: pay_cardreader_poweron test
l: pay_cardreader_poweroff test
m: pay_cardreader_apdu test
r: SIM_reset test
d: SIM_power_down test
t: SIM_APDU_transmit test
Choose h to pop up the card.
please enter the code: hpay_cardreader_check test
retcode =0
a: pay_cardreader_open test
c: pay_cardreader_close test
f: pay_cardreader_enable test
g: pay_cardreader_reject test
h: pay_cardreader_check test
i: mag_read_magicinfo test
j: pay_cardreader_reset test
k: pay_cardreader_poweron test
l: pay_cardreader_poweroff test
m: pay_cardreader_apdu test
r: SIM_reset test
d: SIM_power_down test
t: SIM_APDU_transmit test
please enter the code:
If go through all the tests successfully, the MT318 V3.0 card reader is working properly.
“ztkbd_test” is the keypad test program stored in “System/home” and it depends on dynamic libraries
“libztkbd.so” and “libztpublic.so”.
Run the commands shown as below to test the keypad.
[root@ztlinux:/] cd /home
[root@ztlinux:/] export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
[root@ztlinux:/] ./ztkbd_test
Open the device successfully //operate following by the prompt information.
Set the key
Open the keyboard sound test
Test the keyboard off key tone
Click to clear the keyboard test, press the Enter key to clear the end of the test
press key=31
press key=34
press key=37
press key=08
press key=16
press key=32
press key=35
press key=38
press key=30
press key=17
press key=33
press key=36
press key=39
press key=2E
press key=18
press key=1B
press key=13
press key=14
press key=19
press key=0D // press Enter to end key value test
Download the root key to decrypt:6F2A62CF498C0282AB903ED371564959
Download the root key to MAC:6F2A62CF498C0282AB903ED371564959
Download the master key:07F47640D92620D99B8975F29D13671A
Download the master key to decrypt:7C93CC3A6100A8CFFA0C419FE96D728B
Download MAC master key:7C93CC3A6100A8CFFA0C419FE96D728B
Master key verification(477F3FA7A9205894):477F3FA7A9205894
Download the PIN keys:E037F116920432D532018F49FBB06B7A
PIN validation key(8CBB8E4A75B4A45E):8CBB8E4A75B4A45E
Download the MAC key:E5E56104AB1C5DB9F77FD06DDA890840
Check the MAC key(A0FE15EE260DE565):A0FE15EE260DE565
After the password encryption mode test: //Entering password according to prompt,
press Enter to end.
Read the password ciphertext:
Ciphertext password:8E 19 84 94 0D CF BB F6
Decrypted password:06 12 34 56 FF FF FF FF
Passwords in clear text:06 12 26 62 A9 87 6F ED
MAC verification test
Standard results:6E65426F4EAB3773, results:6E65426F4EAB3773
[root@ztlinux:/mnt/test]
The test program will decrypt the input password to calculate the MAC after users input their passwords. If
the output result displays “6E65426F4EAB3773” which is consistent with the standard result, shows the
keypad is working properly.
Chapter Four
ZT595 takes “u-boot” as its bootloader in Linux system, u-boot is an open-source bootloader program
based on GPL, supporting multiple type processors. It is similar to PC’s BIOS but with more powerful
functions. “U-boot” supports a variety of functions, such as start the Ethernet and load all kinds of kernels to
NAND FLASH. ZT595’s u-boot supports itself updating u-boot, kernel, filesystem through the Internet.
To update ZT595’s u-boot, plug RJ11-DB9 adapter into UART0 (check Graph 2.2 ZT595 Structure
Diagram for UART0’s pin description) and connect RJ11-DB9 to the PC by using serial crossover cable.
Follow the instructions as below to update ZT595’s u-boot.
1> Run TFTP server on PC.
2> Run minicom on PC.
3> After ZT595 is powered on, check the serial information. When it shows “Hit any key to stop
autoboot:3”, please quickly press Enter key to enter ZT595.
Command line of u-boot:
Hit any key to stop autoboot: 0
Mini2440 #
Mini2440 #
4> Update Uboot through the Internet(tftp server) by the commands shown as below.
Mini2440 # run install-bootloader
dm9000 i/o: 0x18000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:00:3e:26:0a:5b
TFTP from server 192.168.1.229; our IP address is 192.168.1.200
Filename 'u-boot.bin'.
Load address: 0x30000000
Loading: T T ##########
done
Bytes transferred = 146324 (23b94 hex)
ZT595 uses standard Linux kernel, it can add or remove some features or even add some must-have
hardwares which supported by the kernel. Set configuration of kernel’s driver to generate kernel’s uImage after
complied. We provide uImage which has been regenerated after reconfiguration, user can download it to
ZT595 to use it directly.
To update ZT595’s uImage, connect RJ11-DB9 serial port cable to UART0 ( check Graph 2.2 ZT595
Structure Graph for UART0) and use serial crossover cable to connect RJ11-DB9’s serial port cable to PC.
Follow the instructions as below to update ZT595’s uImage.
1> Run TFTP server on PC.
2> Run minicom on PC.
3> After ZT595 is powered on, check serial information. When it shows “Hit any key to stop
autoboot:3”, please quickly press Enter key to enter ZT595.
Command line of u-boot:
Hit any key to stop autoboot: 0
Mini2440 #
Mini2440 #
4> Update uImage through the Internet(tftp server) by inputting the commands shown as below.
Mini2440 # run install-kernel
dm9000 i/o: 0x18000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:00:3e:26:0a:5b
TFTP from server 192.168.1.229; our IP address is 192.168.1.200
Filename 'uImage'.
Load address: 0x30000000
Loading: T #################################################################
#################################################################
####
done
Bytes transferred = 1953756 (1dcfdc hex)
Yaffs is an embedded file system that specifically designed for NAND FLASH, currently there are two
versions, including yaffs and yaffs2. The major difference between these two versions is that yaffs2 can
supports large-capacity NAND FLASH chips. ZT595 uses yaffs2 filesystem, we put ready-made yaffs2 file
system into mkyaffs2image to generate filesystem images, user can download it to ZT595 to use it directly.
If unfortunately the file system in the flash is damaged, there are many ways to update and recover it, user
can update the file system through TFTP server or NFS server on PC.
#mount all.......
# starting mdev....
******************************************
SZZT linux-2.6.30 kernel
2010-10-10
******************************************
load finish
starting pid 931, tty '/dev/s3c2410_serial0': '/bin/sh'
CHAPTER FIVE
After ZT595 is powered on, developers need to login the system if they want to do some ZT595’s system
related developments.
ZT595 offers two ways to login the system, using telnet or serial port communication tool.
1> Telnet service is enabled by default and the default IP address is 192.168.1.111 after updating the
system. Developers can use telnet terminal software to login ZT595’s system.
2> According to developers’ specific situations, they can use suitable serial port communication tool to
login the system. We use minicom in this case. Follow the instructions: plug RJ11-DB9 adapter into
UART0 and use serial crossover cable to connect it to the PC. Then run minicom and set the
communication parameter as “115200 8n 1”. After ZT595 is powered on, check the serial
information.
U-Boot 2008.10 (Jan 28 2011 - 14:49:20)
DRAM: 64 MB
Flash: 1 MB
NAND: 128 MiB
In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 0
Uncompressing Linux.............................................................
................................................................. done, booting
the kernel.
Linux version 2.6.30-ZT595 (root@ztlinux-laptop) (gcc version 3.4.1) #239 Sat Se
p 17 06:57:44 AFT 2011
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: SMDK2440…
To set up ZT595’s development platform, we recommend ubuntu 10.04 as the OS. The cross-compilation
toolchain version should be arm-linux-gcc-3.4.1.tar.bz2.
Here are the installation instructions of cross-complier tool on ubuntu 10.04 shown as below.
1> Extract arm-linux-gcc-3.4.1.tar.bz2
ubuntu 10.04 # tar –zxvf arm-linux-gcc-3.4.1.tar.bz2
ubuntu 10.04 #
It will take some time to extract the file. A folder will be created in the directory of “usr/local/folder" ,
copy the file named “arm” in it to the directory of “usr/local/”.
ubuntu 10.04 # cd usr/local/
ubuntu 10.04 # cp –rf arm /usr/local/
Now all cross-compiler assembly are in the directory of “/usr/local/arm/3.4.1/bin.”
2> Modify environment variables, adding the directory of cross-compilation toolchain into PATH (three
methods to implement it, the first one is highly recommended)
Method one modify /etc/bash.bashrc.
ubuntu 10.04 # vim /etc/bash.bashrc
Add this line at the end export PATH=$PATH:/usr/local/arm/3.4.1/bin
If you are unable to edit the file, please modify relevant file permissions by using the chmod
command
Method two modify /etc/profile
ubuntu 10.04 # vim /etc/profile
Add this line at the end: export PATH=$PATH:/usr/local/arm/3.4.1/bin, then save the file.
Method three #export PATH=$PATH:/usr/local/arm/3.4.1/bin
Note This methods only works in the current terminal which is minicom
3> To take effect immediately without restarting the device.
Method one
ZT595 SZZT ELECTRONICS
User Manual Rev. 1.0 —16 January 2017 30 of 34
ZT595 User Manual
Applications run in ARM platform. So during the development process, we use Linux host machine to
develop application and cross-compile it to generate arm-linux executable file. Then, transfer this executable
file to ZT595 through TFTP or NFS server. After that, ZT595 can run the application directly.
When developing application on ZT595, we use Ubuntu 10.04 as the Linux host machine, the editor is vi
and the cross-compilation toolchain’s version is arm-linux-gcc-3.4.1.tar.bz2. Next, we will take ZT595 LCD
screen test program as example to introduce how to call interface function in the dynamic library of
“libcm6063.so”.
Ubuntu 10.04 # vi main.c
/*
* LCM6063 Test
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> //sleep() the header file which are depended on
#include "lcm6063.h"
int main(void)
{
pay_lcd_init();
pay_lcd_cls_line(1,8);
pay_lcd_display(6,6,1,0,1,2,"SZZT");
}
When this test program ends, save and exit. Now, the ZT595 LCD screen test program has completed.
We recommend Makefile to compile the application after development. We take LCD screen test program
as example to introduce how to compile application by using Makefile. After the LCD screen test program
cross-compile, it will generate an executable file named “lcm6062_test” and it depend on the dynamic library
of “liblcm6063.so”.
Here is an example of how to write file by using Makefile :
Ubuntu 10.04 # vi Makefile
CC = arm-linux-gcc
lcm6063_test : main.c
$(CC) -g -Wall -o lcm6063_test main.c -I. -L./ -llcm6063
.PHONY : clean
clean:
rm -rf liblcm6063.so
rm -rf lcm6063_test
rm -rf *.bak
Save and exit. Execute the following command to generate “lcm6063_test” executable file.
Ubuntu 10.04 # make
Ubuntu 10.04 # ls
Ubuntu 10.04 # main.c lcm6063_test //generate executable file “lcm6063_test”
Now, ZT595 LCD screen test program has completed.
For those developers who are not familiar with Makefile, they can use cross-compilation toolchain to
compile the source file directly. For example, to generate an executable file “lcm6063_test” by cross compiling
main.c, input the commands as below to implement it.
Ubuntu 10.04 # arm-linux-gcc -g -Wall -o lcm6063_test main.c -I. -L./ -llcm6063
Ubuntu 10.04 # ls
Ubuntu 10.04 # main.c lcm6063_test //genertate executable file “lcm6063_test”
After compiling the application and generate the executable file, developer can download it to ZT595
through the Internet (TFTP or NFS server).
and copy “lcm6063_test” and “liblcm6063.so” to TFTP’s server directory “/tftpboot”. Run minicom, start the
ZT595 after it is powered on.
Input the following commands to download the application to ZT595’s specified folder.
[root@ztlinux:/] ping 192.168.1.229 //tftp server IP
PING 192.168.1.229 (192.168.1.229): 56 data bytes
64 bytes from 192.168.1.229: seq=0 ttl=128 time=5.611 ms
64 bytes from 192.168.1.229: seq=1 ttl=128 time=0.886 ms
64 bytes from 192.168.1.229: seq=2 ttl=128 time=0.865 ms
^C
--- 192.168.1.229 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
[root@ztlinux:/] tftp –l lcm6063_test liblcm6063.so –r lcm6063_test liblcm6063.so –g 192.168.1.229
[root@ztlinux:/] chmod 777 lcm6063_test liblcm6063.so //After downloaded, modify the permission
of application to make it executable
To boot automatically, we need to modify configuration files in “/etc/init.d/rcS”. We will take LCD screen
test program as example, copy “lcm6063_test” to “/yaffs/” and put “liblcm6063.so” to “/yaffs/lib”, open
“/etc/init.d/rcS”, add the following command lines at the end.
[root@ztlinux:/] vi /etc/init.d/rcS
cd /yaffs
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
./ lcm6063_test &
Save and exit, application automatically start up at boot has been already deployed.
After ZT595 is powered on, it will run the LCD screen test program “lcm6062_test” automatically and
displays the string “SZZT” on the screen.
So far, a series of operations have been introduced, including application development, application
cross-compiling, downloading application to ZT595 and implement of running it at boot automatically.
Developers can develop application according to their requirements and download it to ZT595 to run and
check it in action.