You are on page 1of 34

ZT595 User Manual


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/.

ZT595 User Manual SZZT ELECTRONICS


Rev. 1.0 —16 January 2017 2 of 34
ZT595 User Manual

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

ZT595 User Manual SZZT ELECTRONICS


Rev. 1.0 —16 January 2017 3 of 34
ZT595 User Manual

5.5.1 Download Application to ZT595 through TFTP Server ........................................................................................... 32


5.5.2 Download Application to ZT595 through NFS Server............................................................................................. 33
5.6 Deploy Application ....................................................................................................................................... 33
5.7 Running the Application ............................................................................................................................... 34
6.0 Appendix..................................................................................................................................................5

ZT595 User Manual SZZT ELECTRONICS


Rev. 1.0 —16 January 2017 4 of 34
ZT595 User Manual

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

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 5 of 34
ZT595 User Manual

Chapter One

ZT595 Summary

1.1 Product Features

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.

GRAPH 1.1 ZT595 DEMO PHOTO

1.2 Hardware Resources

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

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 6 of 34
ZT595 User Manual

Extended Interface 
1 20 pin GPIO interface

1.3 Software Resources

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

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 7 of 34
ZT595 User Manual

CHAPTER TWO

ZT595 Hardware Interface


This chapter introduces ZT595 hardware’s circuit functions and describes each interface signal in details.

2.1 Product Appearance

ZT595’s appearance dimensional layout is shown as below 

DIAGRAM 2.1 ZT595 APPEARANCE DIMENSIONAL LAYOUT

2.2 ZT595 Structure Layout Diagram

ZT595’s structure layout is shown in Diagram 2.2 

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 8 of 34
ZT595 User Manual

MT318 power MT318 UART

PSAM4 PSAM1

PSAM3 PSAM2

20
Pin
GPIO
SDRAM
ARM9
Nand Flash
TF CARD

USB HOST
Audio
USB Device

Power Ethernet
DBGU UART3 UART2 UART1

DIAGRAM 2.2 ZT595 STRUCTURE LAYOUT

2.3 Interface Description


ZT595’s interface layout as shown in Diagram 2.3

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 9 of 34
ZT595 User Manual

DIAGRAM 2.3 ZT595’S INTERFACE LAYOUT

2.3.1 GPIO Interface


ZT595 offers a 20 pin GPIO interface and its interface layout as shown in Diagram 2.4:

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 10 of 34
ZT595 User Manual

DIAGRAM 2.4 GPIO’S INTERFACE LAYOUT

ZT595 GPIO’s pin description as shown in Table 2.1:

TABLE 2.1 GPIO’S PIN DESCRIPTION


Pin No. Signal Type Pin No. Signal Type

1 GPC10 Output/Input 2 VCC Power


3 GPC12 Output/Input 4 GND Ground
5 GPC14 Output/Input 6 GND Ground
7 GPD2 Output/Input 8 GND Ground
9 GPD4 Output/Input 10 GND Ground
11 GPD6 Output/Input 12 GND Ground
13 GPD10 Output/Input 14 GND Ground
15 GPD12 Output/Input 16 GND Ground
17 TXD0 18 GND Ground
19 RXD0 20 GND Ground

2.3.2 Interface of TF Card


ZT595 offers TF card interface to connect it to SD/MMC card.
ZT595 TF card’s interface pin description as shown in Table 2.2:

TABLE 2.2 TF CARD’S PIN DESCRIPTION


Pin No. Signal Type
1 DAT2 Output
2 DAT3 Output
3 CMD Input
4 VDD Power
5 CLK Output
6 VSS Power
DAT0 Output
DAT1 Output

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 11 of 34
ZT595 User Manual

GND Ground
GND Ground
VDD Output
NCD_SD Output

2.3.3 USB Host Interface


USB interface is connected to ZT595’s HOST, ZT595 USB HOST’s pin description as shown in table 2.3

TABLE 2.3 USB PIN DESCRIPTION


Pin No. Signal Type
1 VBUS I/O
2 D- I/O
3 D+ I/O
4 GND Power
5 GND Power
6 GND Power

2.3.4 USB Device Interface


ZT595 offers USB Device interface to update the system, the interface is type A Mini-USB port.
ZT595 USB Device’s pin description as shown in Table 2.4:

TABLE 2.4 USB DEVICE SERIAL PIN DESCRIPTION


Pin No. Signal Type
1 VBus I/O
2 Data- I/O
3 Data I/O
4 GND POWER
5 GND POWER

2.3.5 Serial Port Interface


ZT595 has 5 serial port interfaces, using RS232 standard. Four of them are frequently-used serial ports and the
last one is external card reader’s serial port. The frequently-use serial port interface layout as shown in Graph
2.5, the its pin description as shown in Table 2.5. The external card reader’s power supply and interface layout
as shown in Graph 2.6 and its pin description as shown in Table 2.6.

GRAPH 2.5 FREQUENTLY-USED SERIAL PORT INTERFACE LAYOUT

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 12 of 34
ZT595 User Manual

TABLE 2.5 FREQUENTLY-USED SERIAL PORT’S PIN DESCRIPTION


Pin Number Signal Type
1
2 GND RS232
3
4 RXD RS232
5 TXD RS232
6

GRAPH 2.6 EXTERNAL CARD READER’S POWER SUPPLY AND SERIAL PORT INTERFACE LAYOUT

TABLE 2.6 EXTERNAL CARD READER’S SERIAL PORT PIN DESCRIPTION


Pin Number Signal Type
1 GND RS232
2 TXD RS232
3 RXD RS232
4

2.3.6 MT318 v3.0 Card Reader Interface


ZT595 uses MT318 v3.0 card reader by defaults, external card reader’s serial port pin description as shown in
table 2.6 and external card reader’s power supply serial pin description as shown in table 2.7.

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

2.3.7 Keypad Interface


Keypad module is integrated in ZT595. After burning images to ZT595, it will download and install the
firmware to initialize the keypad. The key values have been set before shipping, you may find the
corresponding key values of each key in Table 2.8 .

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 13 of 34
ZT595 User Manual

TABLE 2.8 ZT595 CORRESPONDING KEY VALUES


Key Key Value Key Key Value
0 0x00 SET 0x1B
1 0x01 RETURN 0x13
2 0x02 CANCEL 0x14
3 0x03 CONFIRM 0x0D
4 0x04 BACKSPACE 0x2E
5 0x05 ROUNDING 0x08
6 0x06 CASH/POINTS 0x16
7 0x07 PAGE UP 0x17
8 0x08 PAGE DOWN 0x18
9 0x09 SUM/LITRE 0x19

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 14 of 34
ZT595 User Manual

CHAPTER THREE

Hardware Test Description


This chapter introduces how to test hardware’s peripheral interface, mainly test the LCD screen, RTC, TF card,
USB interface, Audio, Serial port, MT318 V3.0 card reader and keypad. For test programs, you may find them
in the directory “System/home”.

3.1 LCD Screen Test

“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.

3.2 RTC Test

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

3.3 TF Card Interface Test

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

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 15 of 34
ZT595 User Manual

test TF
[root@ztlinux:/] umount /mnt/SD

3.4 USB Host Interface Test

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/

3.5 Audio Test

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.

3.6 Serial Port Test

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

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 16 of 34
ZT595 User Manual

[root@ztlinux:/] ./comtest 4 115200


open dev = /dev/ttyS1 baud = 115200
send [23]:UUUUUUUUUUUUUUUUUUUUUUU
read no data return
send [23]:UUUUUUUUUUUUUUUUUUUUUUU
[root@ztlinux:/]
After executing “./comtest 4 115200”, then short link UART1’s RX and TX. When the data of sending and
receiving are the same, shows that the communication serial port is running properly. Developers can test serial
port UART2, UART3 by using similar approaches.

3.7 MT318 V3.0 Card Reader Test

“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

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 17 of 34
ZT595 User Manual

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

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 18 of 34
ZT595 User Manual

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.

3.8 Keypad Test

“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

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 19 of 34
ZT595 User Manual

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.

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 20 of 34
ZT595 User Manual

Chapter Four

Update ZT595’s Image


This chapter will introduce how to update ZT595’s bootloader, kernel and Filesystem’s images.
“u-boot, kernel, filesystem” have already been written in ZT595 by default before shipping, users do not need
to update the images. Please pay attention that incorrect operation of updating the images may lead to the
system un-bootable. NAND FLASH partition is shown in Table 4.1.

TABLE 4.1 NAND FLASH PARTITION


Start Addr End Addr Size Name
0x0000 0000 0x0004 0000 0x0002 3C00 U-Boot
0x0004 0000 0x0006 0000 0x0002 0000 U-Boot Parameter
0x0006 0000 0x0020 0000 0x001D D000 Kernel
0x0046 0000 0x01F5 0240 0x01C5 0240 Filesystem

4.1 Environment Settings

4.1.1 Hardware Requirement


To update ZT595’s “u-boot, kernel and filesystem”, user needs to get RJ11-DB9 serial port cable. The
RJ11-DB9 serial port signal distribution is as shown in Table 4.2:

TABLE 4.2 SERIAL PIN DESCRIPTION


Pin No. Signal Type
1
2 GND RS232
3
4 RXD RS232
5 TXD RS232
6

4.1.2 Configuration of minicom in Linux


“Minicom” is a serial port communication tool in Linux environment, just like HyperTerminal in
Windows. It communicates with serial port devices by using minicom in Linux.
Here is the configuration of minicom in Linux environment.
1> After executing “minicom –s” and the configuration interface will be displayed.
[root@ztlinux:/] minicom –s
+-----[configuration]------+
| Filenames and paths |
| File transfer protocols |
| Serial port setup |
| Modem and dialing |

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 21 of 34
ZT595 User Manual

| Screen and keyboard |


| Save setup as dfl |
| Save setup as.. |
| Exit |
| Exit from Minicom |
+--------------------------+
2> Using the DOWN arrow key to select “serial port setup”. Press ENTER and the setup interface will be
displayed.
+-----------------------------------------------------------------------+
|A- Serial Device : /dev/ttyS0 |
| B - Lockfile Location : /var/lock |
| C - Callin Program : |
| D - Callout Program : |
|E- Bps/Par/Bits : 115200 8N1 |
| F - Hardware Flow Control : Yes |
| G - Software Flow Control : No |
| |
| Change which setting? |
Press A, setup the serial port device according to the serial port number. For example, if the serial port
number is ttyS0, then the serial device should be “/dev/ttyS0”.
Press E: set it as 115200.
Press Enter, save the settings and back to the main menu, choose “Save setup as df1”.
Save and exit.
3> Debug your device by inputting and execute the command “minicom”, such as switch. Press CTRL+A,
type Z and then press Enter if you need any assistances or want to exit during the debugging.

4.1.3 tftp Configuration based in Linux


TFTP(Trivial File Transfer Protocol) is one of the TCP/IP protocol suites to transfer simple files between
client and server, providing an easy and high-efficiency file transfer service.
ZT595 update its image through the TFTP server. Here is how to set configuration for TFTP server in
Linux.
1> Download TFTP software in Ubuntu 10.04
“tftp-hpa” is client and “tftpd-hpa” is server.
[root@ztlinux:/] sudo apt-get install tftp-hpa tftpd-hpa
2> TFTP server configuration
[root@ztlinux:/] sudo vim /etc/default/tftpd-hpa
# change the original content to
# /etc/default/tftpd-hpa
TFTP_USERNAME=”tftp”
TFTP_DIRECTORY=”/tftpboot” # server directory, needs to set permission as “777”
TFTP_ADDRESS=”0.0.0.0:69”
TFTP_OPTIONS=”-l -c -s”
3> Restart TFTP service

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 22 of 34
ZT595 User Manual

[root@ztlinux:/] sudo service tftpd-hpa restart


4> Test
[root@ztlinux:/] cd /tftpboot
[root@ztlinux:/] echo “hello tftp service”>>a.txt
[root@ztlinux:/] echo “hello tftp service, put to tftp service”>>b.txt
[root@ztlinux:/] cd /
[root@ztlinux:/] tftp localhost
[root@ztlinux:/] get a.txt
[root@ztlinux:/] put b.txt
More specific, “get” is to get file and “put” is to upload file to the TFTP service.
Copy the images “u-boot.bin”, “uImage” and “filesystem.yaffs” to “/tftpboot” after set the TFTP server
configuration in Linux environment.

4.1.4 Environment variables settings of u0-boot


After connecting with serial port and the Internet, open minicom and power on the development board to
check serial port for printing information. When it shows “Hit any key to stop autoboot:3”, please quickly
press Enter key to enter ZT595’s u-boot command line.
Hit any key to stop autoboot: 0
Mini2440 #
Mini2440 #
Then input command: printenv
Hit any key to stop autoboot: 0
Mini2440 # printenv
bootargs=noinitrd root=/dev/mtdblock2 rootfstype=yaffs2 console=ttySAC0,115200
bootcmd=nand read 0x31000000 60000 200000; bootm 0x31000000
bootdelay=2
baudrate=115200
ethaddr=08:00:3e:26:0a:5b
netmask=255.255.255.0
install-bootloader=tftp 30000000 u-boot.bin;nand erase 0 40000;nand write 300000
00 0 40000
install-kernel=tftp 30000000 uImage;nand erase 60000 200000;nand write 30000000
60000 200000
install-filesystem=tftp 30000000 filesystem.yaffs;nand erase 260000 1c50240;nand
write.yaffs 30000000 260000 1c50240
ipaddr=192.168.1.200
serverip=192.168.1.229
stdin=serial
stdout=serial
stderr=serial

Environment size: 601/131068 bytes

Set host IP and server IP address before updating u-boot.

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 23 of 34
ZT595 User Manual

Mini2440 # setenv ipaddr 192.168.1.200 //set host IP


Mini2440 # setenv serverip 192.168.1.229 //set server IP
Mini2440 # saveenv //save and exit
After setting the environment variables, execute #ping 192.168.1.229(server IP address) to check whether
u-boot’s network is connected. If it shows “Host 192.168.1.229 is alive”, then the network is connected.
Mini2440 # ping 192.168.1.229
dm9000 i/o: 0x18000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:00:3e:26:0a:5b
host 192.168.1.229 is alive
Mini2440 #
Now, the environment variables have been set successfully, the next step is to update the ZT595’s images
by using TFTP service.

4.2 Update u-boot

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)

NAND erase: device 0 offset 0x0, size 0x40000

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 24 of 34
ZT595 User Manual

Erasing at 0x20000 -- 100% complete.


OK

NAND write: device 0 offset 0x0, size 0x40000


Writing at 0x20000 -- 100% is complete. 262144 bytes written: OK
Mini2440 #
5> Once the download is completed, the program will automatically write uboot from SDRAM to
NAND FLASH to update the Uboot.

4.3 Update Linux Kernel

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)

NAND erase: device 0 offset 0x60000, size 0x200000


Erasing at 0x240000 -- 100% complete.
OK

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 25 of 34
ZT595 User Manual

NAND write: device 0 offset 0x60000, size 0x200000


Writing at 0x240000 -- 100% is complete. 2097152 bytes written: OK
5> Once the download is completed, the program will automatically write uImage from SDRAM to NAND
FLASH to update the uImage.

4.4 Update yaffs2 Filesystem

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.

4.4.1 Update yaffs2 file system through TFTP Server


To update ZT595’s filesystem, plug RJ11-DB9 adapter into UART0 ( check Graph 2.2 ZT595 Structure
diagram for UART0’s pin description) and use serial crossover cable to connect RJ11-DB9 to PC.
Follow the instructions as below to update ZT595’s filesystem.
4> Run TFTP server on PC.
5> Run minicom on PC.
6> After ZT595 is powered on, check serial information. When it shows “Hit any key to stop
autoboot:3”, please press Enter key quickly to enter ZT595.
Command line of u-boot:
Hit any key to stop autoboot: 0
Mini2440 #
Mini2440 #
1> Update filesystem by inputting the commands shown as below through the Internet(TFTP server).
Mini2440 # run install-filesystem
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 'filesystem.yaffs'.
Load address: 0x30000000
Loading: T T ###
#############################################################
#################################################################
……
#################################################################
###################################
done
Bytes transferred = 9092160 (8abc40 hex)

NAND erase: device 0 offset 0x260000, size 0x1c50240

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 26 of 34
ZT595 User Manual

Erasing at 0x1ea0000 -- 100% complete.


OK

NAND write: device 0 offset 0x260000, size 0x1c50240


Writing at 0x1dc0000 -- 100% is complete. 28788736 bytes written: OK
2> Once the download is completed, the program will automatically write filesystem from SDRAM to
NAND FLASH to update the filesystem.

Please refer to “4.4.2 Update filesystem through NFS server” to update it if the downloading
file system is larger that 60M.

4.4.2 Update yaffs2 filesystem through NFS server


After installing NFS to the host server and boot ZT595, please input the commands shown as below to
update special filesystem to the NAND FLASH.
1> After ZT595 is powered on, check serial information. When it shows “Hit any key to stop
autoboot:3”, please quickly press Space key to enter uboot’s command-line.
Hit any key to stop autoboot: 0
Mini2440 #
Mini2440 #
2> Input the command as below to mount NFS filesystem when ZT595 system starts. (Note: IP address of
the NFS server and ZT595 device must on the same network segment).
Hit any key to stop autoboot: 0
Mini2440 # setenv bootargs noinitrd console=ttySAC0,115200 init=/linuxrc root=/dev/nfs
nfsroot=192.168.1.229:/home/nfs/
ip=192.168.1.111:192.168.1.229:192.168.1.1:255.255.255.0::eth0:off
Mini2440 # saveenv
3> Power off and turn on to restart ZT595, the system will mount NFS filesystem and into the system
terminal. Input commands shown as below to help NFS filesystem to update yaffs2 filesystem.
[root@ztlinux:/] flash_eraseall /dev/mtd2 //erase the filesystem partition
[root@ztlinux:/] mount -t yaffs2 /dev/mtdblock2 /mnt
[root@ztlinux:/] tar xzvf rootfs.tar.bz2 -C /mnt
[root@ztlinux:/] umount /mnt
4> Install yaffs2 filesystem, power off and turn on to restart ZT595, check serial information. When it
shows “Hit any key to stop autoboot:3”, please quickly press Space key to enter uboot’s commnad-line.
Please input the commands shown as below to mount yaffs filesystem.
Hit any key to stop autoboot: 0
Mini2440 # setenv bootargs root=/dev/mtdblock2 rootfstype=yaffs console=ttySAC0,
115200 noinitrd
Mini2440 # saveenv
5> Power off and turn on to restart ZT595, the system will mount yaffs2 filesystem when it starts. After
login the system, information will be displayed on screen shown as below.

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 27 of 34
ZT595 User Manual

#mount all.......
# starting mdev....
******************************************
SZZT linux-2.6.30 kernel
2010-10-10

******************************************
load finish
starting pid 931, tty '/dev/s3c2410_serial0': '/bin/sh'

Processing /etc/profile......-sh: USER: not found


Done!
[root@ztlinux:/] ls
bin home lost+found sbin usr
dev lib mnt sys var
etc linuxrc proc tmp yaffs
[root@ztlinux:/]
6> Now, the yaffs2 filesystem has been updated successfully through the NFS server.

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 28 of 34
ZT595 User Manual

CHAPTER FIVE

Compile and Deploy Application

5.1 Fast-boot System

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

NAND read: device 0 offset 0x60000, size 0x200000


2097152 bytes read: OK
## Booting kernel from Legacy Image at 31000000 ...
Image Name: Linux-2.6.30-ZT595
Created: 2011-09-17 2:28:06 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1953692 Bytes = 1.9 MB

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 29 of 34
ZT595 User Manual

Load Address: 30008000


Entry Point: 30008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

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…

5.2 Installation of cross-complier Tool

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

ubuntu 10.04 # source /root/.bashrc


Method two 
ubuntu 10.04 # source /etc/profile
4> Check whether the directory has been added into PATH.
ubuntu 10.04 # echo $PATH
If it shows “/usr/local/arm/bin”, then the cross-compilation toolchain’s directory has already been added
into PATH. Now, the cross-compilation environment has been set.
5> Check whether installation completes successfully.
If installation completes successfully , the above command line will show arm-linux-gcc information and
its version.
Ubuntu 10.04 # arm-linux-gcc –v
Reading specs from /usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/specs
Configured with: /work/crosstool-0.27/build/arm-linux/gcc-3.4.1-glibc-2.3.2/gcc-3.4.1/configure
--target=arm-linux --host=i686-host_pc-linux-gnu --prefix=/usr/local/arm/3.4.1
--with-headers=/usr/local/arm/3.4.1/arm-linux/include
--with-local-prefix=/usr/local/arm/3.4.1/arm-linux --disable-nls --enable-threads=posix
--enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared
--enable-c99 --enable-long-long
Thread model: posix
Gcc version 3.4.1

5.3 Application Development

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();

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 31 of 34
ZT595 User Manual

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.

5.4 Compile Application

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”

5.5 Download Application to ZT595

After compiling the application and generate the executable file, developer can download it to ZT595
through the Internet (TFTP or NFS server).

5.5.1 Download application to ZT595 through TFTP server


For TFTP server environment configuration, please refer to “4.1.3 TFTP environment configuration in
Linux”. Copy application to the folder of server directory “/tftpboot” after completing the environment setup.
In this case, we take LCD screen test program as example, download the test program through TFTP server

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 32 of 34
ZT595 User Manual

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

5.5.2 Download application to ZT595 through NFS server


The Host IP should be 192.168.1.229 after installing the NFS and the shared file folder is “/home/nfs”.
Here is how to download application through NFS. We will take LCD screen test program as example, copy
“lcm6063_test” and “liblcm6063.so” to NFS server directory/home/nfs”. 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 //NFS 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:/] mount –t nfs –o intr,nolock,rsize=1024,wsize=1024 192.168.1.123:/home/nfs
/mnt
//mount the shared file folder “/home/nfs” to “/mnt”
[root@ztlinux:/] cp /mnt/ lcm6063_test liblcm6063.so /home //copy application to ZT595
[root@ztlinux:/] umount /mnt

5.6 Deploy Application

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

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 33 of 34
ZT595 User Manual

./ lcm6063_test &
Save and exit, application automatically start up at boot has been already deployed.

5.7 Running the Application

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.

ZT595 SZZT ELECTRONICS


User Manual Rev. 1.0 —16 January 2017 34 of 34

You might also like