You are on page 1of 77

EDK500 guide

EDK500
Copyright Zksoftware Inc 2007-2008. All rights reserved.

2.0

2008-09-01

1.0

2007-05-25

2.0

2007-08-01

3.0

2008-09-01

86-755-89602345 /89602346 /89602347 /89602348 /89602669


86-755-89602674
www.zksoftware.com
Treckle
lqs@zksoftware.com

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

1. mips-gcc3.2.3.tar.gz
2. mipsroot.tar.bz2
3. source_hv7131.tar.bz2

( zk sensor edk500)

4. Edk500-Guide-English-2.0.pdf
5. Edk500-Guide-Chinese-2.0.pdf
6. sch5000.pdf
7. helloworld.c

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

............................................................................................... 6

1.1

............................................................................................................................. 6

1.2

CPU ................................................................................................................... 7

1.3

......................................................................................................................... 9

1.5

CAMERA ........................................................................................................ 12

1.6

LCD ................................................................................................................. 13

1.7

USB0 .................................................................................................... 14

1.8

TCP/IP I2C GPIO ............................................................................................ 15

1.9

JDI .............................................................................................................. 16

1.10 SPI ................................................................................................................... 17


1.11 MMC/SD USB1 ............................................................................ 17

........................................................................................................................ 18

2.1

........................................................................................................................... 18

2.2

4M FLASH ................................................................................................................ 18

2.3

8M FLASH ................................................................................................................ 19

............................................................................................................. 20

3.1

............................................................................................................... 21

3.2 .................................................................................................................... 23
3.2.1

..................................................................................................... 23

3.2.2 Windows ......................................................................... 26


3.3

NFS ...................................................................................................... 29

3.3.1

mipsroot...................................................................................................... 29

3.3.2

NFS ............................................................................................. 29

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

3.3.3

NFS ..................................................................................................... 33

3.4

TFTP ........................................................................................................................ 37

........................................................................................................................ 40

4.1

EDK500......................................................................................................... 40

Linux server ............................................................................................................................ 41


EDK500 Target ....................................................................................................................... 41
4.2

ZEM500 ........................................................................................................ 42

4.3

................................................................................................................... 44

EDK500 ......................................................................................................... 46

..................................................................................................... 48

6.1

........................................................................................................................... 48

6.1

........................................................................................................................... 50

6.1.1

............................................................................................................... 50

6.1.2

............................................................................................................... 50

6.1.3

............................................................................................................... 51

GPIO ..................................................................................................................... 52
......................................................................................................................... 52

7.1

GPIO

7.2

GPIO .................................................................................................................. 52

7.3

GPIO ................................................................................................................ 53

......................................................................................................... 56

8.1

........................................................................................................... 56

8.2

............................................................................................... 61

8.3

................................................................................................... 63

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

8.4

................................................................................................................... 64

8.5

................................................................................................................... 65

............................................................................. 66

9.2

....................................................................................................................... 66

9.3

............................................................................................... 66

9.3.1

22 ...................................................................................................... 67

9.3.2

38 ...................................................................................................... 67

9.3.3

................................................................................................................... 67

9.4

........................................................................... 68

9.4.1

12 ...................................................................................................... 69

9.4.2

13 ...................................................................................................... 69

9.4.3

................................................................................................................... 69

9.5

................................................................... 70

........................................................................................................................ 71
................................................................................................................ 74

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide


1.1

+DC3.30.3V

<2.5W

CPU

400MHZ

MIPS32 RISC

SDRAM 16/32M bytes


FLASH

4/8M bytes NOR flash

10M/100M

USB

1 usb1.1 host, 1 usb1.1

I2C

I2C

SPI

Standard SPI port

host/device

3 1 , TTL
TFT,
CAMERA camera hv7131 ov7620 ov7660
MMC/SD MMC/SD
GPIO

6 GPIO

CS4344 Codec ,

u.are.u4000busb camera

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

CPU

1.2
1-1

CPU

RISC CPU

MIPS32 ISA Release I and II


32 32-bit general purpose registers, no shadow GPR
8-stage pipeline
Interlocked implementation
Virtual address space: 4 G-Bytes

Multiply-Divide Unit

Maximum issue rate of one 32x16 multiply every clock

(MDU)

Maximum issue rate of one 32x32 multiply every other clock


Minimum 2 clock cycle, maximum 34 clock cycles for divide

Memory Manager Unit

4 G-Bytes of address space

(MMU)

32/16 dual-entry full associative joint TLB plus 4 dual-entry


ITLB and 4 dual-entry DTLB respectively
7 different page size from 4Kb to 16MB supported in any entry
Support entry lock Space identifier ASID: 8 bits
Small (1K) page not implemented

Data Cache

Virtually-indexed, physically-tagged
4 way, 8-word line, alterable size: 4K, 8K, 16K bytes
LRU replacement algorithm
Write-back, write-through
16-word depth write buffer
Cache line lock not implemented

Instruction Cache

Physically-indexed, physically-tagged
4 way, 8-word line, alterable size: 4K, 8K, 16K bytes

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

LRU replacement algorithm


Cache line lock not implemented
Debug&JTAG

JTAG interface to host machine


ACC mode to accelerate JTAG memory access
Two instruction and one data breakpoint

Internal Timer

N/A

BranchTarget Buffer

Virtally-tagged

(BTB)

Up to 64 entry direct mapped


2-bit branch history maintained

Bus Interface

compliance with AHB protocol

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

1.3

1-1

EDK500

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

1.4

J1 camera

J7
1-2

J6 serial and JDI

J5

TCP/IP I2C and GPIO

EDK500 -1

10

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

J4 usb0 and serial

J8 usb1 and mmc/sd

EDK500 guide

J3

J2 camera
1-2

EDK500 -2

11

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

CAMERA

1.5

EDK500 FPC Camera J12 Camera

1-1 J1

J2

PinNumber

Signal

Port

PinNumber

Signal

Port

J1 1

GPIO67

GPIO

J1 9

CIM_D7

CAMERA

J1 2

GND

GND

J1 10

CIM_D6

CAMERA

J1 3

CIM-3.3V

POWER

J1 11

CIM_D5

CAMERA

J1 4

CIM_PCLK

CAMERA J1 12

CIM_D4

CAMERA

J1 5

CIM_HSYNC

CAMERA J1 13

CIM_D3

CAMERA

J1 6

CIM_VSYNC

CAMERA J1 14

CIM_D2

CAMERA

J1 7

I2C_SCK

I2C

J1 15

CIM_D1

CAMERA

J1 8

I2C_SDA

I2C

J1 16

CIM_D0

CAMERA

12

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

LCD

1.6

EDK500 LCD

1-2 J3

Pin Number

Signal

Port

J3 1

+5V

J3 2

LCD_D0

J3 3

Pin Number

Signal

Port

POWER J3 16

LCD_D14

LCD

LCD

J3 17

LCD_D15

LCD

LCD_D1

LCD

J3 18

LCD_VSYNC

LCD

J3 4

LCD_D2

LCD

J3 19

LCD_HSYNC

LCD

J3 5

LCD_D3

LCD

J3 20

LCD_PCLK

LCD

J3 6

LCD_D4

LCD

J3 21

LCD_DE

LCD

J3 7

LCD_D5

LCD

J3 22

GND

LCD

J3 8

LCD_D6

LCD

J3 23

GPIO60

GPIO

J3 9

LCD_D7

LCD

J3 24

GPIO61

GPIO

J3 10

LCD_D8

LCD

J3 25

GPIO62

GPIO

J3 11

LCD_D9

LCD

J3 26

GPIO63

GPIO

J3 12

LCD_D10

LCD

J3 27

GPIO64

GPIO

J3 13

LCD_D11

LCD

J3 28

GPIO65

GPIO

J3 14

LCD_D12

LCD

J3 29

PWM0

PWM

J3 15

LCD_D13

LCD

J3 30

GND

GND

13

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

USB0

1.7

5V J5 EDK500 2 USB1.1 USB


USB0 host client gpio108
USB0 host client.USB1
host.EDK500 4 TTL ttyS0ttyS1 ttyS2 ttyS3.ttyS3
modem 3.3V

1-3

J4 signal definition

Pin Number

Signal

Port

Pin Number

Signal

Port

J4 - 1

USB0_D0-

USB0

J4- 7

GND

GND

J4 2

USB0_D0+

USB0

J4 8

TXD0

RS232-0

J4 3

+5V

POWER

J4 9

RXD0

RS232-0

J4 4

GPIO106

GPIO

J4 10

TXD3

RS232-3

J4 5

GPIO33

GPIO

J4 11

RXD3

RS232-3

J4 6

GPIO102

GPIO

J4 12

+3.3V

POWER

14

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

TCP/IP,I2C GPIO

1.8

5V usb usb 3.3V


usb usb
5V edk500 3.3V edk500 1.8V
edk500 1.8V
1-4 J5

Pin Number

Signal

Port

Pin Number

Signal

Port

J5 1

TX+

TCP/IP

J5 11

+1.8V

POWER

J5 2

RX+

TCP/IP

J5 12

GPIO33

GPIO

J5 3

TX_

TCP/IP

J5 13

GPIO103

GPIO

J5 4

RX_

TCP/IP

J5 14

GPIO104

GPIO

J5 5

USB_D0-

USB0

J5 15

GPIO105

GPIO

J5 6

USB_D0+

USB0

J5 16

RTS3

RS232-3

J5 7

I2C_SCK

I2C

J5 17

RXD2

RS232-2

J5 8

I2C_SDA

I2C

J5 18

TXD2

RS232-2

J5 9

+5V

POWER J5 19

GPIO100

GPIO

J3 10

GND

GND

J5 20

GPIO101

GPIO

15

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

JDI

1.9

DC3.3V edk500 edk500 +3.3V


>=500mA
1-5 J6

Pin Number

Signal

Port

Pin Number

Signal

Port

J6 1

+3.3V

POWER

J6 11

TDO

JDI

J6 2

GND

GND

J6 12

GND

GND

J6 3

TRST_N

JDI

J6 13

+3.3V

POWER

J6 4

GND

JDI

J6 14

CTS3

RS232-3

J6 5

TDI

JDI

J6 15

TXD0

RS232-0

J6 6

GND

JDI

J6 16

RXD0

RS232-0

J6 7

TMS

JDI

J6 17

TXD1

RS232-1

J6 8

GND

JDI

J6 18

RXD1

RS232-1

J6 9

TCK

JDI

J6 19

TXD3

RS232-3

J6 10

RESET_N

RESET

J6 20

RXD3

RS232-3

16

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

1.10

SPI

GPIO98/GPIO99S IO SPI
1-6 J7

Pin Number

Signal

Port

Pin Number

Signal

Port

J7 - 1

SPIMCLK

SPI

J7- 5

SPIMCE2

SPI

J7 2

SPIMCE

SPI

J7 6

GPIO98

GPIO

J7 3

SPIMOSI

SPI

J7 7

GPIO99

GPIO

J7 4

SPIMISO

SPI

J7 8

GND

GND

1.11

MMC/SD usb1

AUTO1 AUTO2
1-7

J8

Pin Number

Signal

Port

Pin Number

Signal

Port

J8 - 1

USB1_D1+

USB1

J8- 8

SDDATA2

MMC

J8 2

USB1_D1-

USB1

J8 9

SDDATA3

MMC

J8 3

VCC_USB1

USB1

J8 10

SDCMD

MMC

J8 4

GND_USB1

USB1

J8 11

SDCLK

MMC

J8 5

AUTO2

Speaker J8 12

SDDATA0

MMC

J8 6

AUTO1

Speaker J8 13

SDDATA1

MMC

J8 7

nCD_SD

MMC

J8 14

NC

17

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide


2.1

Bootloaderu-boot-1.1.3
Linux celinux-2.4.20
u.are.u4000b wiegand

NFS Mips GDB

2.2

4M flash

2-1 4M flash

uboot

0xbfc00000 - 0xbfc30000 0xbfc00000 - 0xbfc20000 192/128k bytes

config

0xbfc30000 - 0xbfc40000

kernel

0xbfc40000 - 0xbfdd0000 0xbfc20000 - 0xbfdb0000 1600k bytes

jffs2

0xbfdd0000 - 0xc0000000 0xbfdb0000 - 0xc0000000 2368k bytes

18

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

64k bytes

EDK500 guide

8M flash

2.3

2-2 8M flash

jffs2

0xbf80000 0xbfc0000

0xbf80000 0xbfc0000

4096k bytes

uboot

0xbfc00000 - 0xbfc30000 0xbfc00000 - 0xbfc20000 192/128k bytes

config

0xbfc30000 - 0xbfc40000

kernel

0xbfc40000 - 0xbfdd0000 0xbfc20000 - 0xbfdb0000 1600k bytes

jffs2

0xbfdd0000 - 0xc0000000 0xbfdb0000 - 0xc0000000 2368k bytes

64k bytes

jffs2 jffs2
/mnt/mtdblock 4M bytes flash 2.3M bytes
8M bytes flash 4M bytes

jffs2 jffs2

2.3+4=6.3M bytes.jffs2 0.3M bytes


4M flash 2.3-0.3=2.0M bytes;8M flash
6.3-0.3*2=5.7M bytes

19

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide


EDK
Linux

EDK EDK
EDK
NFS TFTP

mips-gcc

NFS
Linux NFS

NFS EDK
uboot

TFTP

3-1

20

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

3.1

CPU PC CPU PC

MIPS
MIPS mips-gcc3.2.3.tar.bz2
Linux
MIPS

mips-gcc3.2.3.tar.gz
/opt

PATH

PATH

PATH

PATH .base_profile
PATH

21

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" F


www.fineprint.com.cn

EDK500 guide

echo $PATH
mips-gcc bin-set

helloworld.c

22

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" F


www.fineprint.com.cn

EDK500 guide

3.2

3.2.1 root
Linux MINICOM
MINICOM
minicom

2 3

Linux minicom minicom

Linux

ttyS0 ttyS1
minicom minicom s minicom
23

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" M


www.fineprint.com.cn

EDK500 guide

enter

A Linux 2) ttyS0
ttyS1 enter

24

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

F G NO
enter

E minicom EDK
115200 8 1
IQ enter
enter minicom Save setup as df1 enter

Minicom minicom
25

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

EDK PC

3.2.2

Windows

Linux Minicom
Windows
Windows
Windows >> >

26

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

11520081
27

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

28

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

NFS root

3.3

NFS Network FileSystem


NFS
Linux NFS NFS
NFS
NFS
NFS
mountNFS
3.3.1 mipsroot
NFS EDK
mipsroot.tar.bz2
Linux

mipsroot
ROOT

3.3.2

NFS

Linux NFS nfs-utils portmap


nfs-utils rpc.nfsd rpc.mountd NFS daemons
documents NFS
portmap port number PID
29

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

NFS portmap
portmap NFS

rpm qa []

NFS

2 3

portmap
2
3

portmap NFS rpm


rpm ivh []

portmap

nfs

/etc/exports NFS
30

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" M


www.fineprint.com.cn

EDK500 guide

/etc/exports NFS

[]

[ IP]

( 1, 2, 3)

portmap NFS

portmap

nfs

NFS NFS

IP

NFS

NFS
Linux

31

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

NFS

NFS
i.

expor s
exportfs []

/etc/exportfs

3-1 exportfs

-r

/etc/exportfs

-v

export

ii.

showmount
showmount [] hostname
3-2 showmount

-a

-e

hostname /etc/exports

1 Linux
NFS
# iptables -F
2 Linux RedHat Fedora
SeLinux
/etc/sysconfig/selinux

32

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" w


www.fineprint.com.cn

EDK500 guide

3.3.3

NFS

NFS EDK
EDK NFS EDK
uboot EDK IP
IP NFS
TCP/IP Linux EDK
33

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

Hit any key to stop autoboot:

enter 3 uboot
uboot

IP 192.168.1.29 NFS
NFS /opt/mipsrootEDK IP 192.168.1.207
34

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

FPRINT # printenv
FPRINT # setenv ipaddr 192.168.1.207
FPRINT # setenv serverip 192.168.1.29
FPRINT#

setenv bootargs root=/dev/nfs

mem=16M console=ttyS2,115200n8

ip=192.168.1.207 nfsroot=192.168.1.29:/opt/mipsroot rw
FPRINT # saveenv
FPRINT # reset
reset

35

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

uboot
printenv
setenv
saveenv
askenv
reset CPU

EDK IP 192.168.1.166
IP 192.168.1.44NFS /opt/mipsroot
Linux
uboot

36

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" w


www.fineprint.com.cn

EDK500 guide

3.4

TFTP root
TFTP TFTP

Linux TFTP
TFTP tftptftpd xinetd xinetd
Linux tftp tftpd
TFTP Linux xinetd
TFTP
1 TFTP

tftp tftpd
2
3

xinetd
2
3

2 Linux TFTP

37

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" M


www.fineprint.com.cn

EDK500 guide

portmap

tftp

tftp-server

3 /etc/xinetd.d/ tp TFTP

/tftpboot /tftpboot tftpboot

38

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" M


www.fineprint.com.cn

EDK500 guide

/tftpboot

/tftpboot drwxrwxrwx

TFTP

TFTP
4 TFTP

/opt helloworld.c /tftpboot

/tftpboot opt.ini
Linux
TFTP
# iptables F
39

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" w


www.fineprint.com.cn

EDK500 guide


4.1

EDK500
EDK500 EDK500 NFS

flash uboot,config,kernel
jffs2 EDK500 linux
mipsrootmipsroot mipsroot.tar.bz2 liunx
linux root
EDK500 mipsel-gcc
linux EDK500
mipsroot/mnt/ mipsroot

main mipsroot/mnt/mtdblock
EDK500
Liunx mipsroot DEK500
EDK500 2 telnet minicom
root,
mipsroot/mnt 2 mtdblock removable,mtdblock
mtdblock removable
u

40

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

5V

TCP/IP
RS232/Cons

4-1

EDK500

+5
TCP/IP
RS23

4-2

Linux server

EDK500 Target

NFS server

NFS client

Tftp server

Tftp client

Telnet client

Telnet server

EDK500

41

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

linux 2
linux
EDK500

1 - linux
# cd /opt/mipsroot/mnt/source_hv7131
# make zem500
#cp main /opt/mipsroot/mnt/mtdblock/

2 - EDK500
# cd /mnt/mtdblock
# killall main

# ./main

4-3

4.2

ZEM500
EDK500

ZEM500 ZEM500 EDK500


ZEM500 EDK500 Linux

ZEM500 jffs2 EDK500


jffs2 Linux
ZEM500 ramdisk kernel EDK500 ramdisk
liunx .
42

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

ZEM500 flash jffs2 /mnt/mtdblock

flash jffs2 /mnt/mtdblock


auto.sh linux

/mnt/mtdblock
2
1 tp
tftpboot ZEM500
root,solokey/mnt/mtdblock tftp

ZEM500 , tftpboot
main
#cd
#tftp

/mnt/mtdblock
-r

main

-g

192.168.1.44

2 u
u u ZEM500 ZEM500

#mount
#cp

/dev/sda1

/mnt/removable

-- u

/mnt/removable/main /mnt/mtdblock

-- main ZEM500

ZEM500

ZEM500 /mnt/mtdblock

43

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

auto.sh

---

main

---

hz2.dat

---

libzkfp.so.3.5.1 ---
LANGUAGE.S ---
LANGUAGE.E ---
options.cfg

---

oplog.dat

---

template.dat

---
---

udata.dat
user.dat

---

transaction.dat

---

sms.dat

---

0.wav 1.wav 2.wav.3.wav 4.wav 5.wav 6.wav. 7.wav 8.wav 9.wav beep.wav
---

4.3

1.

3.1

2.

3.2

3.

NFS 3.3

4.

TFTP 3.4

44

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

5.

mipsroot/mnt/
# cp /media/disk/source_hv7131.tar.bz2 /opt/mipsroot/mnt/
# cd /opt/mipsroot/mnt/
# tar -jxvf source_hv7131.tar.bz2

6.

4-1 .

7.

linux NFS-server

linux NFS-server
mtdblock mipsroot/mnt

8.

9.

linux linux

10. # cd /opt/mipsroot/mnt/source_hv7131/
11. # vi main.c

---,

12. # make

--- main

13. # cp main

/opt/mipsroot/mnt/mtdblock/

--- main mtdblock

14. EDK500
15. telnet 192.168.1.166

--- Edk500

16. :root
17. EDK500
# cd

/mnt/mtdblock

# killall
# ./main

main

---
---

45

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

EDK500

Finger
RS232 Chip
EDK500
Module

RS485 Chip
TCP/IP
USB

TTL23

Wiegand

USB

TCP/IP

Controlle

LCD
Wiegand

RS485

MCU

RS23

Other

Keypad

5-1 EDK500

Edk500
edk500
edk500

46

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

Finger
TFT LCD
MMC/SD
Speaker
Other Units
RS232 Chip

EDK500
Module

RS485 Chip

TCP/IP
USB
TTL23
Wiegand
Wiegan

USB BUS

Keypad

TCP/IP

Controller

RS485

Other Units

RS23

MCU

5-2 EDK500

Edk500 SD card
edk500
edk500

47

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

6.1

edk500

5000-1.pdf.
edk500 J5 J6 J5 J6 edk500

EDK500 4 ttyS0
ttyS1 ttyS2 mifare ttyS3 PC

DEK500 EDK500 TCP/IP


RS232

USB wigand

EDK500 ttyS0 EDK500

48

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

49

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

6.1

edk500 1.5 1.16

6.1.1

6-1

Edk500

6.1.2

6-2

Edk500

50

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

6.1.3

6-3

Edk500

51

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

GPIO
7.1

gpio

#define RS485_SEND

33

#define ZK_SENSOR_INT

67

#define IO_GREEN_LED

104

// LED green

#define IO_RED_LED

105

// LED red

#define IO_WIEGAND_OUT_D0

100

//wiegand out

#define IO_WIEGAND_OUT_D1

101

//wiegand out

7.2

gpio 33
gpio 60

//RS485EN

gpio

//RS485 enable
//connect to tft port

gpio 61

//connect to tft port

gpio 62

//connect to tft port

gpio 63

//connect to tft port

gpio 64

//connect to tft port

gpio 65

//connect to tft port

gpio 95

//TFT backlight enable

gpio 96

//system led

gpio 98
52

//with SPI port

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

gpio 99

//with SPI port

gpio 102

//nc, connect to J4

gpio 106

//nc, connect to J4

gpio 100

//wiegand output

gpio 101

//wiegand output

gpio 103

//nc ,connect to J5

gpio 104

//LED green

gpio 105

//LED red

gpio 107

//voice enable and disenable

gpio 108

//switch usb host to client

7.3

GPIO

__gpio_as_output(n)
gpio n
n 0 - 127
gpio.h

__gpio_as_input(n)
gpio n
n 0 - 127
53

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

gpio.h

__gpio_set_pin(n)
gpio n 1
n 0 127
gpio.h . gpio n

__gpio_clear_pin(n)
gpio n 0
n 0 127
gpio.h . gpio n

unsigned int __gpio_get_pin(unsigned int n)


gpio n
n 0 127
gpio.h . gpio n

gpio n

BOOL ARCA_IO_Init(void)
gpio gpio

arca.c gpio
54

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

void ARCA_IO_Free(void)
gpio

arca.c

55

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide


8.1

void InitSensor(int LeftLine, int TopLine, int Width, int Height, int FPReaderOpt)

int LeftLine
int TopLine
int Width
int Height
int FPReaderOpt

sensor.c

int CaptureSensor(char *Buffer, BOOL Sign, PSensorBufInfo SensorBufInfo)

char Buffer
2*150*1024
BOOL Sign 0
PsensorBufInfo SensorBufInfo
sensor.h
: sensor.c

56

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

BIOKEY_API HANDLE BIOKEY_INIT(int License, WORD *isize, BYTE *Params,


BYTE *Buffer, int ImageFlag)
/

int License Sensor


WORD *isize 22 FPBaseInit
options.cfg, sensor.c options.cfg
FPBaseInit options.cfg
isize options.cfg
gOptions isize sensor
uru4000b, 6

gOptions.OimageWidth

gOptions.OimageHeightgOptions.ZF_WIDTHgOptions.ZF_HEIGHT
gOptions.CPY[0]gOptions.CPX[2] 6 uru4000b
InitSensor
BYTE *Params 8 FPBaseInit
BYTE *Buffer 2*1024*1024 1N

Int ImageFlag 0x80


zkfp.h

57

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

BIOKEY_API int BIOKEY_MATCHINGPARAM(HANDLE Handle,

int speed, int

threshold)

HANDLE Handle BIOKEY_API HANDLE BIOKEY_INIT

int speed 0-1- IDENTIFYSPEED


IDENTIFYSPEED sensor.h
int threshold 0 100 35
zkfp.h

BIOKEY_API

int

BIOKEY_SETNOISETHRESHOLD(HANDLE

Handle,

int

NoiseValue, int MinMinutiae, int MaxTempLen, int ExtractScaleDPI)

HANDLE Handle BIOKEY_API HANDLE BIOKEY_INIT

int NoiseValue
int MinMinutiae
int MaxTempLen
int ExtractScaleDPI 500
zkfp.h

58

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

BIOKEY_API int BIOKEY_EXTRACT(HANDLE Handle, BYTE* PixelsBuffer,


BYTE *Template, int PurposeMode)
Template

i.

HANDLE Handle BIOKEY_API HANDLE BIOKEY_INIT

BYTE *PixelsBuffer
Int PurposeMode 0 1 1N 2
11

ii.

BYTE *Template Template

600-1024
zkfp.h
0

BIOKEY_API

int

BIOKEY_GENTEMPLATE(HANDLE

Handle,

BYTE

*Templates[], int TmpCount, BYTE *GTemplate);


TmpCount

i.

59

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

HANDLE Handle BIOKEY_API HANDLE BIOKEY_INIT

BYTE *Templates[] TmpCount


Int TmpCount 3
ii.

BYTE *GTemplate Gtemplate


zkfp.h

BIOKEY_API int BIOKEY_VERIFY(HANDLE Handle,

BYTE *Template1,

BYTE *Template2);

HANDLE Handle BIOKEY_API HANDLE BIOKEY_INIT

BYTE *Template1 1
BYTE *Template2 2
zkfp.h
0 100
35

60

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

8.2

BIOKEY_API int BIOKEY_DB_ADD(HANDLE Handle,

int TID, int TempLength,

BYTE *Template)
BIOKEY_API HANDLE
BIOKEY_INIT 1N

i.

HANDLE Handle BIOKEY_API HANDLE BIOKEY_INIT

Int TID
Int TempLength
BYTE *Template
zkfp.h
1 0

IOKEY_API int BIOKEY_DB_DEL(HANDLE Handle,

int TID)

HANDLE Handle BIOKEY_API HANDLE BIOKEY_INIT

Int TID
zkfp.h
1 0
61

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

BIOKEY_API int BIOKEY_IDENTIFYTEMP(HANDLE Handle, BYTE *Template,


int *TID, int *Score)

i.

HANDLE Handle BIOKEY_API HANDLE


BIOKEY_INIT
BYTE *Template

ii.

int *TID
int *Score
Template TID NULL

62

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

8.3

BIOKEY_INIT
BIOKEY_MATCHINGPARAM
BIOKEY_SETNOISETHRESHOLD

63

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

8.4

BIOKEY_EXTRACT

BIOKEY_GENTEMPLATE

BIOKEY_DB_ADD

64

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

8.5

BIOKEY_EXTRACT

BIOKEY_VERIFY

1 N

BIOKEY_IDENTIFYTEMP

65

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide


0.1

ZEM500

ZEM500
3 12
3

9.2
Header:

0X5353

Command :

~Command:

CheckSum:

9.3

22 38

66

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

22
9.3.1

22

HEADER(2B)+Command(1B)+~Command(1B)+Data[0](1B)+Date[1](1B)
+Date[16](1B)+CheckSum(1B).
22 17 Data[0]~Data[16]

9.3.2

38

HEADER(2B)+Command(1B)+~Command(1B)+Data[0](1B)+Date[1](1B)
+Date[32](1B)+CheckSum(1B).
38 33 Data[0]~Data[32]

9.3.3

Command=2:

LCD

Command=3:

Data[0]=0, Date[0]>0,

Data[0]*20ms
Command=4:

Data[0]=0, Data[0]>0, Data[0]*40ms

Command=107: Data[0]=0:Data[0]>0:
Command=110:

Command=106: Data[0]*40ms;
Data[1]*1s; Data[2]0Data[2]
1Data[2]
Command=58:

RS232 Data[0]=0xff:0RS232;

Command=221: Data[0]0xff 0
Command=56:

Data[0]0xff 0

67

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

Command=214: Wiegand Data[0]>Data[0]>


Data[0]> 0XFF: 0
Command=11:

LCD16 Data[0]Data[1]Data[16]

Command=12:

LCD16 Data[0]Data[1]Data[16]

Command=13:

LCD32 Data[0]Data[1]Data[32]

Command=20:

Command=21:

RTC Data[0]Data[6]

Command=22:

Command=30:

Command=32:

Command=33:

LCD

Command=108:

9.4

12 13
13 7 8
0

68

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

9.4.1

12

HEADER(2B)+Command(1B)+~Command(1B)+Data[0](1B)+Date[1](1B)
+Date[6](1B)+CheckSum(1B).
7 Data[0]~Data[6]
12

9.4.2

13

HEADER(2B)+Command(1B)+~Command(1B)+Data[0](1B)+Date[1](1B)
+Date[7](1B)+CheckSum(1B).
8 Data[0]~Data[7]

9.4.3

Command=22:

Data[0]Data[6]

Command=33:

LCD Data[0]LCD Data[1]

LCD Data[2]: LCD


Command=50:

Wiegand Data[0]Data[2]3

Wiegand Data[3]Data[6] 0
Command=110: Data[0]

DOOR_SENSOR_OPEN 4

DOOR_SENSOR_CLOSE5DOOR_SENSOR_BREAK1DOOR_BREAK
3DOOR_BUTTON2

Command=215: Wiegand Data[0]Data[7]Wiegand
13
69

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

Command=1:

Data[0]

Command=111: Data[0] 3
012
Command=20:

9.5

0XA5 0XA5,

70

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

1 rpm
root
i.

Linux
rpm qa []

ii.

Linux
rpm ivh []

2 vi

vi []
vi
i.

ii.

ESC

iii.

71

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

f1-1 vi

f1-2 vi

72

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

3 service
root
i.

service

ii.

[] start

service

iii.

[] stop

service
4 tar

[] restart

tar [] [] []
e.g. tar cvzf main.tgz main.gz auto.sh
f1-3 tar

gzip x

bzip2 x

f1-4 Linux

.gz

gunzip

gunzip main.gz

.tar.gz / .gz

tar xvzf

tar xvzf main.tgz

.tar.bz2

tar jvxf

tar jvxf res.bz2

73

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

1 * is needed by **
Linux
needed by
nfs-utils

nfs-utils-lib

2 NFS
NFS

i.

f2-1

portmap rpcinfo p portmap


portmap
rpcinfo: can't contact portmapper:
RPC: Remote system error - Connection refused
NFS

ii.

f2-2

NFS NFS exportfs


74

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

exportfs
/etc/exports
NFS Starting NFS mountd

iii.

[FAILED]

f2-3

rpcinfo -p mountd

PORTMAP rpm -qa|grep portmap

3 EDK PC OK EDK
eth0: Ethernet Link offline!

i.

EDK
EDK

ii.

75

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

f2-4

Linux /mnt/mtdblock/ main

iii.

f2-4

EDK uboot

uboot Linux NFS a.


76

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

EDK500 guide

/etc/exports EDK EDK


IP b.

iv.

f2-5

EDK uboot

uboot Linux NFS

4 TFTP
TFTP put Error code 0: Permission

i.

denied
/tftpboot chmod 777 R /tftpboot
telnet EDK put

ii.

/tftpboot root

77

Edk500 development guide verision 2.0


Copyright Zksoftware Inc 2007-2008. All rights reserved.

PDF "pdfFactory Pro" www.fineprint.com.cn

You might also like