advertisement
1
Eddy DK
Programmer Guide
Ver 2.1.0.3
2009. 10.22
2
Revision History
Revision Date
Feb-5-2009
Sep-10-2009
Oct-14-2009
Oct-22-2009
Nov-23-2009
Document Version Pages
2.1.0.1 All
2.1.0.2 All
2.1.0.3 11
17,18,19
2.1.0.3
18,19
2.1.0.3 2,4,6
Description
Initial release by shlee
Added WiFi
J2 pin33 PC12
PC13
J2 pin35 PC13
PC12
J2 pin33 PC12
PC13
J2 pin35 PC13
PC12
J2 pin33 J9_26
J9_33
J2 pin34 J9_25
J9_34
J2 pin33 J9_24
J9_35
Added S4M
Table of Contents
3
4
Chapter 1. Introduction
Chapter 1. Introduction
This chapter explains about this manual and introduces the related documents and support.
1.1 About this document
This manual explains about how a programmer can develop a customized application for Eddy module and how this application can be uploaded and executed on the module. To help programmers with this work, information on
Eddy's operating system and API functions for convenient source writing is supplied.
After reading this document, a programmer can write his or her own application and execute it on the module.
1.2 Who should read this document?
This document is designed for programmers who wish to develop a new application using Eddy DK. It is strongly recommended that the programmer read this document before starting any programming work. If you are an administrator or an end user who just needs to apply the module into practical applications, you do not need to read this document. User's Guide will be helpful in that case. This manual deals with the complete process of writing source codes and making a firmware that can be uploaded and executed on Eddy module.
5
Chapter 1. Introduction
1.3 Document organization
Chapter 1. Introduction is a preface with general information and introductory notices.
Chapter 2. Getting Started gives brief information needed before starting programming work.
Chapter 3. Writing Application explains about the process of writing a customized application and related work..
Chapter 4. Compiling Application deals with the process of compiling your application with Makefile.
Chapter 5. Creating Firmware helps you converting a compiled application into a firmware that can be accepted by
Eddy module.
Chapter 6. Library explains about the library and API functions you can use while programming and application.
Chapter 7. Eddy Software shows how to implement simple TCP/IP and serial routines using example source codes that are included in the development kit.
Chapter 8. Handling HTML & CGI provides a guide for integrating your own applications with Eddy's web interface.
Chapter 9. Appendix provides programming notes and a list of default utilities.
6
Chapter 1. Introduction
1.4 Eddy-DK Related Documents
The following table summarizes documents included in the Eddy-DK document set.
Document Name Description
User Guide
Programmer’s Guide
Integration, configuration, and management of Eddy for the administrator
Programmer’s application development guide, including in-depth approach to compiling, linking, and creating firmware
API reference is also included with a list of available functions for customized application programming
LemonIDE Manual
Guide for primary function of each tool contained in LemonIDE on
Windows and Linux.
Portview User Manual
Guide for SystemBase device server management application
Portview
COM Port Redirector User
Manual
Guide for SystemBase COM Port Redirector
TestView User Manual
Guide for TestView application for testing Eddy serial port and lan port.
If you need brief information on Eddy or embedded device servers in general, please visit our corporate website at http://www.sysbas.com/. You can view and/or download documents related to Eddy as well as latest software and firmware updates. Available resources are as follows:
Document Name Description
Eddy-CPU Spec Sheet Specifications for Eddy CPU and DK board.
Eddy-S4M Spec Sheet Eddy-S4M spec description
Eddy-WiFi Spec Sheet
LemonIDE Spec Sheet
Eddy-WiFi module spec description integrated development environment description
7
Chapter 1. Introduction
Lemonix Spec Sheet Lemonix RTOS description
Eddy White Paper
An introductory reading for anyone new to embedded device server.
Deals with background, history, market environment, and technology
All documents are updated promptly, so check for the recent document update. The contents in these documents are subject to change without any notice in advance.
8
Chapter 1. Introduction
1.5 Technical Support
There are three ways you can get a technical support from SystemBase.
First, visit our website http://www.sysbas.com/ and go to ‘Technical Support’ menu. There you can read FAQ and ask your own question as well.
Second, you can e-mail our technical support team. The mail address is [email protected]. Any kind of inquiries, requests, and comments are welcome.
Finally, you can call us at the customer center for immediate support. Our technical support team will kindly help you get over with the problem.
The number to call is 82-2-855-0501 (Extension number 225). Do not forget to dial the extension number after getting a welcome message.
Copyright 2007 SystemBase Co., Ltd. All rights reserved.
Homepage: http://www.sysbas.com/
Tel: +82-2-855-0501
Fax: +82-2-855-0580
1601, DaeRyung Post Tower 1, 212-8, Guro-dong, Guro-gu, Seoul, Korea
9
Chapter 2. Getting Started
Chapter 2. Getting Started
This chapter explains about packaging and installation, and discusses key features of Eddy-DK.
2.1 What can you do with Eddy DK ?
Eddy DK is designed to help programmers to develop a customized application that can be applied to
Eddy module easier and faster. It has been a time-consuming and burdensome work to port an operating system and develop an application on a new hardware. Eddy module and Software
Development Kit makes this work easy.
Eddy DK is different with other device servers in which it can run customized applications. Users can upload most existing socket/serial communication applications that are running on the Linux environment. This openness allows users to apply wide variety of functions into the module with relatively less restrictions.
Eddy DK supports IDE (LemonIDE) and SDK environment to help programmers to execute their own applications on the module. Programmers can easily write applications using the Linux environment, with the help of SDK and example source codes. Cross-compiler running on the standard Linux environment helps your applications to run on the Eddy module. Embedded Linux on Eddy can provide stable and rapid environment for your applications.
2.2 Eddy-DK Package Contents
Eddy-DK includes Eddy module.
Eddy-DK package contains as follows. Make sure following contents are included in the Eddy Serial
DK Package.
- Case of Eddy-DK (Eddy-CPU v2.1 1ea, Eddy-DK v2.1board 1ea)
- Case of Eddy-S4M-DK (Eddy-S4M v2.1 1ea, Eddy-S4M-DK board 1ea, (Option : Eddy-S4M-JIG))
- 1EA , Serial cable
- 1EA , LAN cable
- 1EA, USB A to B Cable
- 1EA , Power adaptor
- 1EA , CD (SystemBase SDK, LemonIDE, compile environment, utilities, manuals)
10
Chapter 2. Getting Started
2.3 Eddy-CPU v2.1
11
Chapter 2. Getting Started
Eddy-CPU v2.1 Pin Assignment
J1 J2
Pin Signal Name Pin Signal Name Pin Signal Name Pin Signal Name
7
9
11
1
3
5
13
PA5
PC5
PC21
HDMA
HDPA
PC26
2
4
5
8
10
12
PC4 (RDY#) 14
PA4
PC19
PC23
NC
DDM
DDP
PC16
(nRESET)
1
3
5
7
9
11
13
A15
A13
A11
A9
A7
A5
A3
2
4
5
8
10
12
14
A14
A12
A10
A8
A6
A4
A2
15 ICE_NTRST 16
17 TDO 18
19
21
23
TDI
3.3V
3.3V
20
22
24
RTCK
TMS
TCK
GND
GND
15
17
19
21
23
25 PB29 (CTS1) 26 PB28 (RTS1) 25
A1
PC9
FPG
GND
GND
D7
16
18
20
22
24
26
A0
NWE
NRD
3.3V
3.3V
D6
27 PB6 (TXD1) 28 PB7 (RXD1) 27
29 A20 30 A19 29
31 LAN_Speed 32 LAN_lLink 31
33 LAN_RX- 34 LAN_RX+ 33
D5
D3
D1
PC13
28
30
D4
D2
32 D0
34 JTAGSEL
35 LAN_TX- 36 LAN_TX+ 35 PC12 36 NC
J3 J4
Pin Signal Name Pin Signal Name Pin Signal Name Pin Signal Name
1 PID0 2 PID1 1 PB12 2 PB13
3
5
7
9
11
13
15
PID2
PID4
PC14
PC18
PC20
PA22
PB8
4
5
8
PID3
GND
PC17
3
5
7
10 PC8 (RTS3) 9
12 PC10 (CTS3) 11
14 PC15 (IRQ1) 13
16 PB9 (RXD2) 15
17
19
21
PB10 18 PB11(RXD3) 17
PC0 20 PC1 (AD1) 19
PC2 22 PC3 (AD3) 21
23 PB14 (DRXD) 24 PB15 (DTXD) 23
25 GND 26 GND 25
27 BMS 28 NRST 27
29 PB23 / DCD0 30 PB5 / RXD0 29
31
33
PB4 / TXD0 32 PB24 / DTR0
PB22 / DSR0 34 PB26 / RTS0
31
33
A16
A17
D8
D10
D12
D14
TWD
PB30
PB0
PB1
4
5
8
PB2
PB3
10
12
BHDM 14
BHDP 16
18
20
22
24
26
28
30
NANDOE
NANDWE
NC
32
34
36
PB31
PC22
PB16
PB17
PB18
PB19
PB20
PB21
A18
D9
D11
D13
D15
TCK
NAND_CLE /
A22
NAND_ALE /
A21
NC 35 PB27 / CTS0 36 PB25 / RI0 35
12
Chapter 2. Getting Started
12
13
14
15
16
17
18
Pin
1
2
3
4
J5
Signal Name
PB0
PB1
PB2
PB3
5
6
3.3V
3.3V
7 BHDM, USB Host Data(-)
8 BHDP, USB Host Data(+)
9 PA31 / TXD4
10
11
PA30 / RXD4
NRST
Pin
1
2
3
4
5
6
7
8
9
10
GND
GND
PA9 / WPID0
PC6 / WPID1
PC7 / WPID2
NC
NC
J1 Specifications
11
12
13
14
15
16
21
23
25
27
29
31
33
35
7
9
11
13
15
17
19
J1
Pin Signal Name Pin Signal Name
1
3
5
PA5
PC5
PC21
2
4
5
PA4
PC19
PC23
HDMA
HDPA
PC26
TDO
TDI
8
10
12
PC4 (RDY#) 14 PC16 (nRESET)
ICE_NTRST 16
18
20
NC
DDM
DDP
RTCK
TMS
TCK
3.3V
3.3V
22
24
PB29 (CTS1) 26
PB6 (TXD1) 28
A20 30
LAN_Speed 32
LAN_RX- 34
LAN_TX- 36
GND
GND
PB28 (RTS1)
PB7 (RXD1)
A19
LAN_lLink
LAN_RX+
LAN_TX+
J6
Signal Name
NC
NC
3.3V
3.3V
PC25 / BT_Factory
PB10 / TXD3
PB11 / RXD3
PC8 / RTS3
PC10 / CTS3
PC24 / BT_MODE
NRST
GND
GND
NC
NC
NC
13
14
Chapter 2. Getting Started
2
3
4
5
6
7
8
9
10
11
12
13
J1 Pin Description
Pin No
1
14
Name
PA5
PA4
PC5
PC19
PC21
PC23
HDMA
NC
HDPA
DDM
PC26
DDP
PC4
(RDY#)
PC16
(nRESET)
J10_2
J10_3
J10_4
J10_5
J10_6
J10_7
J10_8
J10_9
J10_10
J10_11
J10_12
J10_13
DK v2.1
Pin No
J10_1
J10_14
Expansion
Header Pin No
J4_2
J4_1
J4_12
J4_24
J4_26
J4_28
J1_27
--
J1_29
-
-
-
J4_11
J4_21
Peripheral A : CTS2
Peripheral B : MCBD1
Peripheral A : RTS2
Peripheral B : MCDB2
Peripheral A : A24
Peripheral B : SPI1_NPCS1
Peripheral A : A24
Peripheral B : SPI1_NPCS2
Peripheral A : D21
Peripheral B : EF100
Peripheral A : D23
D26
Eddy-DK v2,1 : RDY#(OUT)
Peripheral A : A23
Peripheral B : SPI1_NPCS2
Eddy-DK v2,1 : nRESET#(IN)
Description
UART #2 Clear to Send Signal
Disabled.
Data Flash connected with SPI0 is used for Eddy-CPU v2.1. For this reason SPI0 and MCDB0, MCDB3, and MCCDB signals, multiplexing, cannot be used, thus Multimedia Card Slot B is disabled.
UART #2 Request to Send Signal
Disabled.
External Address Bus
SPI1(Serial Peripheral Interface) Peripheral Chip Select 1
Multimedia Card Slot B Data
SPI1(Serial Peripheral Interface) Peripheral Chip Select 2
External Data bus
Ethernet(WAN) Force 100Mbit/sec.
External Data Bus
USB Host Port A Data -
Not Connect
USB Host Port A Data +
USB Device Port Data -
External Data Bus
USB Device Port Data +
Ready signal. Output signal for CPU operation status
External Address Bus
SPI1(Serial Peripheral Interface) Peripheral Chip Select 2
Polling Input signal continually from External Reset key, implement as below with checking the constant time of "Low."
Less than 5 seconds: General reset function.
15
Chapter 2. Getting Started
19
20
21
22
15
16
17
18
23
24
25
26
27
28
ICE_NTRST J10_15
RTCK J10_16
TDO
TMS
J10_17
J10_18
TDI
TCK
3.3V
GND
J10_19
J10_20
3.3V
GND
PB29 J10_25
PB28
PB6
PB7
J10_26
J10_27
J10_28
29
30
A20
A19
J10-29
J10_30
J2_30
J2_29
J2_7
J2_8
J1_31
J1_32
J7_3
J7_11
J7_13
J7_7
J7_5
J7_9
Peripheral A : D16
Peripheral B : SPI0_NPCS2
More than 5 seconds: Factory Default function.
External Data Bus
Disabled
SPI0_SPCK, SPI0_MISO, and SPI0_MOSI signals for SPI0 are disabled as they are not connected externally.
ICE Test Reset Signal
Return Test Clock
Test Data Out
Test Mode Select
Test Data In
Test Clock
3.0V to 3.6V power input
Ground
Peripheral A : CTS1
Peripheral B : ISI_VSYNC
Peripheral A : RTS1
Peripheral B : ISI_PCK (IN)
Peripheral A : TXD1
Peripheral B : TCLK1
Peripheral A : RXD11
Peripheral B : TCLK2
Address Bus
3.0V to 3.6V power input
Ground
USART1 Clear To Send
Image Sensor Vertical Synchronization
USART1 Request To Send
Image Sensor Pixel Clock Provided by the Image Sensor
USART1 Transmit Data
Timer Counter ch1 External CLK IN
USART1 Receive Data
Timer Counter ch2 External CLK IN
Address Bus
Address Bus
Ethernet 10/100 (Auto MDI/MDIX)
16
Chapter 2. Getting Started
31 LED_Speed J10_31 -
Speed
10Base-T
100Base-TX
Pin State
H
L
LAN connection speed
LED Definition
OFF
ON
LAN connection status
LED Definition Link/Activity Pin State
32
33
34
35
LED_Link
LAN_RX-
LAN_RX+
LAN_TX-
J10_32
J10_33
J10_34
J10_35
-
-
-
-
No Link
Link
H
L
OFF
ON
Activity Toggle Blinking
CPU 내부 Ethernet PHY(WAN)의 Physical receive or transmit signal (- differential)
CPU 내부 Ethernet PHY(WAN)의 Physical receive or transmit signal (+ differential)
Physical transmit of CPU Internal Ethernet PHY(WAN) or receive signal (- differential)
36 LAN_TX+ J10_36 - Physical transmit of CPU Internal Ethernet PHY(WAN) or receive signal (+ differential)
J2 Specifications
Connect USB cable to J1 while the jumper is connected to J2, so that applications can be compiled, linked, created, and uploaded to the Eddy-CPU module. (Please refer to
Programmer Guide for more information.)
J2
Pin Signal Name Pin Signal Name
7
9
11
1
3
5
A15
A13
A11
A9
A7
A5
2
4
5
8
10
12
A14
A12
A10
A8
A6
A4
17
Chapter 2. Getting Started
27
29
31
33
35
13
15
17
19
21
23
25
A3
A1
PC9
FPG
GND
GND
D7
D5
D3
D1
PC13
PC12
14
16
18
20
22
24
26
28
30
32
34
36
A2
A0
NWE
NRD
3.3V
3.3V
D6
D4
D2
D0
JTAGSEL
NC
J2 Pin Description
Pin No Name
1~16 A[15:0]
17
18
19
20
21, 23
22, 24
PC9
NEW
FPG
NRD
GND
3.3V
DK v2.1
Pin No
J9_1
-J9_16
J9_17
J9_18
J9_19
J9_20
Expansion
Header Pin No
Description
J3_4-J3_20
J4_14
J1_21
-
External Address Bus 0-15 (0 at reset)
DK is directly connected with CPU and external connecter (J3) is connected by buffer.
Peripheral A : NCS5
Peripheral B : TIOB0
External device Chip Select 5.
256MB memory area addressable, active low
Timer Counter ch0 I/O Line B
External device Write Enable signal, active low
For Flash Programming
You can program Data Flash in Eddy CPU v2.1 via USB. Refer to 2.4.2.3 S6:NAND Flash & Data
Flash Chip Select for further information.
J1_23 External device Read Enable signal, active low
Ground
3.0V to 3.6V power input
18
Chapter 2. Getting Started
25~32
33
34
35
D[7:0]
PC13
JTAGSEL
PC12
J9_25
- J3_32
J9_33
J9_34
J9_35
J3_29 - J3_36
J4_18
-
J4_17
External Data Bus 0-7
DK is directly connected with CPU and external connecter (J3) is connected by buffer. You should enable PC13(NCS6 : Chip Select 6) for working buffer, if you reset, it becomes Pulled-up input.
Edd-DK v2.1 : NCS6
Peripheral A : FIQ
Peripheral B : NCS6
Data Bus connected with external header can be used when NCS6 is enabled.
Fast Interrupt Input
External device Chip Select 6
256MB memory area addressable, active low
JTAG boundary scan can be used by connecting pin34 and 36(J14 connection). This pin should not be connected when using ICE (In-Circuit Emulator) or in normal operation status.
Peripheral A : IRQ0
Peripheral B : NCS7
Not Connect
External Interrupt Input 0
External device Chip Select 7.
256MB memory area addressable, active low
36
J3 Specifications
NC
7
9
11
13
15
J3
Pin Signal Name Pin Signal Name
1 PID0 2 PID1
3
5
PID2
PID4
4
5
PID3
GND
PC14
PC18
PC20
PA22
PB8
8
10
12
14
16
PC17
PC8 (RTS3)
PC10 (CTS3)
PC15 (IRQ1)
PB9 (RXD2)
19
Chapter 2. Getting Started
17
19
21
PB10
PC0
PC2
18
20
22
23 PB14 (DRXD) 24
25 GND 26
27 BMS 28
29 PB23 / DCD0 30
31 PB4 / TXD0 32
33 PB22 / DSR0 34
35 PB27 / CTS0 36
PB11(RXD3)
PC1 (AD1)
PC3 (AD3)
PB15 (DTXD)
GND
NRST
PB5 / RXD0
PB24 / DTR0
PB26 / RTS0
PB25 / RI0
J3 Pin Description
Pin No Name
1-5
6,25,26
7
PID[4:0]
GND
PC14
8
9
10
PC17
PC18
PC8
DK v2.1
Pin No
J8_1
~J8_5
Expansion
Header Pin
No
-
J8_7
J8_8
J8_9
J8_10
J4_19
J4_22
J4_23
J4_13
Description
Peripheral A : NCS3
Peripheral B : IRQ2
Peripheral A : D17
Peripheral B :
SPI0_NPCS3
Peripheral A : D18
Peripheral B :
SPI1_NPCS1
Peripheral A : NCS4
Peripheral B : RTS3
Product ID only used by the manufacturer.
Please do not work on these pins.
Ground
External Device Chip Select 3
External Interrupt Input 2
External Data Bus
Disabled
External Data Bus
SPI1(Serial Peripheral Interface) Peripheral Chip Select 1
External Device Chip Select 4
USART3 Request to Send
20
Chapter 2. Getting Started
11
19
20
21
12
13
14
15
16
17
18
22
23
24
27
28
J8_11
J8_12
J8_13
J8_14
J8_15
J8_16
J8_17
J8_18
J8_19
J8_20
J8_21
J8_22
J8_23
J8_24
J8_27
J8_28
PC20
PC10
PA22
PC15
PB8
PB9
PB10
PB11
PC0
PC1
PC2
PC3
PB14
PB15
BMS
NRST
J4_25
J4_15
-
J4_20
J2_9
J2_10
J2_11
J2_12
J4_7
J4_8
J4_9
J4_10
J2_15
J2_16
-
J1_20
Peripheral A : D20
Peripheral B :
SPI1_NPCS3
Peripheral A : A25
Peripheral B : CTS3
Peripheral A : NWAIT
Peripheral B : IRQ1
Peripheral A : TXD2
Peripheral A : RXD2
Peripheral A : TXD3
Peripheral B : ISI_D8
Peripheral A : RXD3
External Data Bus
SPI1(Serial Peripheral Interface) Peripheral Chip Select 3
External Address Bus
USART3 Clear to Send
Digital I/O Input 4
External Wait Signal Input
External Interrupt Input 2
UART2 Transmit Data
UART2 Receive Data
UART3 Transmit Data
Image Sensor Data 8
UART3 Receive Data
Peripheral B : ISI_D9
Peripheral A : AD0
Peripheral B : SCK3
Peripheral A : AD1
Peripheral B : PCK0
Peripheral A : AD2
Peripheral B : PCK1
Peripheral A : AD3
Peripheral B :
SPI1_NPCS3
Image Sensor Data 9
Analog to Digital Converter Input Ch0
USART3 Serial Clock
Analog to Digital Converter Input Ch1
Programmable Clock Output 0
Analog to Digital Converter Input Ch2
Programmable Clock Output 1
Analog to Digital Converter Input Ch3
SPI1(Serial Peripheral Interface) Peripheral Chip Select 3
Peripheral A : DRXD
Peripheral A : DTXD
Debug Receive Data
Debug Transmit Data
Boot Mode Select signal
BMS = 1, Boot on Embedded ROM
BMS = 0, Boot on External Memory
External device Reset signal, active low signal
21
Chapter 2. Getting Started
34
35
36
29
30
31
32
33
PB23
PB5
PB4
PB24
PB22
PB26
PB27
PB25
J8_29
J8_30
J8_31
J8_32
J8_33
J8_34
J8_35
J8_36
J4_28
J2_6
J2_5
J2_25
J2_23
J2_27
J2_28
J2_26
Peripheral A : DCD0
Peripheral B : ISI_D3
Peripheral A : RXD0
Peripheral A : TXD0
Peripheral A : DTR0
Peripheral B : ISI_D4
Peripheral A : DSR0
Peripheral B : ISI_D2
Peripheral A : RTS0
Peripheral B : ISI_D6
Peripheral A : CTS0
Peripheral B : ISI_D7
Peripheral A : RI0
Peripheral B : ISI_D5
USART0 Data Carrier Detection
Image Sensor Data 3
USART0 Receive Data
USART0 Transmit Data
USART0 Data Terminal Ready
Image Sensor Data 4
USART0 Data Set Ready
Image Sensor Data 2
USART0 Request To Send
Image Sensor Data 6
USART0 Clear To Send
Image Sensor Data 7
USART0 Ring Indicator
Image Sensor Data 5
22
Chapter 2. Getting Started
J4 Specifications
29
31
33
35
21
23
25
27
11
13
15
17
19
J4
Pin Signal Name Pin Signal Name
1 PB12 2 PB13
3
5
7
9
PB30
PB0
PB1
PB2
4
5
8
10
PB31
PC22
PB16
PB17
PB3
BHDM
BHDP
A16
A17
12
14
16
18
20
PB18
PB19
PB20
PB21
A18
D8
D10
D12
D14
22
24
26
28
D9
D11
D13
D15
TWD 30 TCK
NANDOE 32 NAND_CLE / A22
NANDWE 34 NAND_ALE / A21
NC 36 NC
23
Chapter 2. Getting Started
J4 Pin Description
Pin No Name
3
4
5
1
2
6
7
8
9
10
11
PB12
PB13
PB30
PB31
PB0
PC22
PB1
PB16
PB2
PB17
PB3
DK v2.1
Pin No
J11_1
J11_2
J11_3
J11_4
J11_5
J11_6
J11_7
J11_8
J11_9
J11_10
J11_11
Expansion
Header Pin
No
J2_17
J2_18
J2_31
J2_32
J2_2
J4_27
J2_3
J2_17
J2_4
J2_18
J2_5
Peripheral A : TXD5
Peripheral B : ISI_D10
Peripheral A : RXD5
Peripheral B : ISI_D11
Peripheral A : PCK0
Peripheral B :
ISI_HSYNC
Peripheral A : PCK1
Peripheral A :
SPI1_MISO
Peripheral B : TIOA3
Peripheral A : D22
Peripheral B : TCLK5
Peripheral A :
SPI1_MOSI
Peripheral B : TIOB3
Peripheral A : TK0
Peripheral B : TCLK3
Peripheral A :
SPI1_SPCK
Peripheral B : ISI_D3
Peripheral A : TF0
Peripheral B : TCLK4
Peripheral A :
SPI1_NPCS0
Description
USART5 Transmit Data
Image Sensor Data 10
USART5 Receive Data
Image Sensor Data 11
Programmable Clock Output 0
Image Sensor Horizontal Synchronization
Programmable Clock Output 1
SPI1(Serial Peripheral Interface) Master In Slave Out
Timer Counter ch3 I/O Line A
Timer Counter ch5 External CLK IN
Timer Counter ch3 I/O Line B
SSC Transmit Clock
Timer Counter ch3 External CLK IN
SPI1(Serial Peripheral Interface) Serial Clock
Image Sensor Data 3
SSC Transmit Frame Sync
Timer Counter ch4 External CLK IN
SPI1(Serial Peripheral Interface) Peripheral Chip Select 0
24
Chapter 2. Getting Started
16
17
18
19
20
12
13
14
15
21-28
PB18
HDMB
PB19
HDPB
PB20
A16
PB21
A17
A18
D[8:15]
J11_12
J11_13
J11_14
J11_15
J11_16
J11_17
J11_18
J11_19
J11_20
J11_21
~J11_28
29
30
31
32
33
34
35,36
TWD
TWCK
J11_29
J11_30
NANDOE J11_31
A22 J11_32
NANDWE J11_33
A21
NC
J11_34
J3_28
~J3_21
J4_3
J4_4
-
J1_29
-
J1_30
J2_19
J1_28
J2_20
J1_30
J2_21
J3_3
J2_22
J3_2
J3_1
Peripheral B : TIOA5
Peripheral A : TD0
Peripheral B : TIOB4
Peripheral A : RD0
Peripheral B : TIOB5
Peripheral A : RK0
Peripheral B : ISI_D0
Peripheral A : RF0
Peripheral B : ISI_D1
Timer Counter ch5 I/O Line A
SSC Transmit Data
Timer Counter ch4 I/O Line B
USB Device Port Data -
SSC Receive Data
Timer Counter ch5 I/O Line B
USB Device Port Data +
SSC Receive Clock
Image Sensor Data 0
External Address Bus
SSC Receive Frame Sync
Image Sensor Data 1
External Address Bus
External Data Bus 8-15
DK is directly connected with CPU and external connecter (J3) is connected by buffer.
PC13(NCS6 : Chip Select 6) should be enabled for working buffer, if it is reset, it work as Pulled-up input.
Two-wire Serial Data. This pin cannot be used for GPIO.
Two-wire Serial Data. This pin cannot be used for GPIO.
NAND Flash Output Enable
Address Bus
DK is directly connected with CPU and external connecter (J3) is connected by buffer.
NAND Flash Write Enable
Address Bus
Not Connect
Chapter 3. Development
Environment
2.4 Eddy-DK v2.1
2.4.1 Modules’Locations
NOTE:
Ensure that the input power supply for Eddy Serial DK is from 9V to 48V with 500 mA (or higher).
2.4.2 Switch Description
25
Chapter 3. Development
Environment
2.4.2.1. S1~S4: Digital In Select
It is possible to select the Distal Input mode with this switch (S1 ~ S4). In order to use VCC Common
Mode, switch down, and to use GNC Common Mode switch up refer to below feature.
This below schematic is just for reference, So you should make you own schematic with the current and voltage that you want.
Common Input Setting (Switch S1~S4)
MODE Switch 설명
Eddy DK v2.1
UP
Isolated Input
Signal(Source)
1.1K
GND
Comm on
4.7K
COM
(GND)
Com m on GND
Eddy DK v2.1
Down EXTERNAL POWER
1.1K
VCC
Comm on
4.7K
Isolated Input
Signal(SINK)
Com m on VCC
2.4.2.2. S5: ADC Select
You can choice the GPIO and ADC function with this switch. In order to use the ADC device, you should switch off. And In order to use the GPIO function, you should switch on.
ON
ON
SW Off : ADC mode
SW ON : GPIO mode
1
PIN name Fuction Discription I/O
PC0 ADC0 Temp. Sensor Input(LM50), RN: U22 IN
26
Environment
PC1
Chapter 3. Development
ADC1 Lux. Sensor Input(BH1600), RN: U26 IN
PC2 ADC2 Temp. Sensor Input(TMP300), RN: U24 IN
PC3 ADC3 N/A IN
* RN = Reference Number
2.4.2.3. S6: NAND Flash & Data Flash Chip Select
This switch is Nand Flash & Data Flash Chip select switch. This switch is needed in firmware
Programming.
ON
ON
1 2
Flash Programming & Booting device Selection
Switch
No 1
Switch
No 2
OFF OFF
Operation descriotion
For Flash Programming
This setting is needed in firmware Programming. refer to 9.2 System recovery via USB
OFF ON Boot from Data Flash.
ON OFF Boot from Nand Flash
ON ON
Boot from Data Flash or Nand Flash which have bootloader. if Both devices have the bootloader, algorithm in CPU select the bootloader of Data Flash.
(Reference : CPU Datasheet 13 장 AT91SAM9260 Boot Program)
2.4.2.4. S7:UART Select
In order to test Serial Port, UART Select Switches are pulled down. It means that UARTs in CPU are connected to Serial Port. If switches are pulled up, GPIO Ports are enabled and LEDs are controlled by GPIO Ports. And if Switch No.6 is pulled up, GPIO ports are connected with the Expansion
Headers.
ON
ON
1 2 3 4 5 6
27
Chapter 3. Development
Environment
Serial Port & LED
Switch
Bank
Switch
No
S7
1
2
3
4
5
Down Position(OFF)
Serial Port Test
UART#0 TEST
UART#0 의 TXD, RXD, RTS, CTS signals are connected with UART#0
RS232 driver IC.
UART#0 TEST
UART#0 의 DTR, DSR, DCD, RI signals are connected with UART#0 RS232 driver IC.
UART#1 TEST
UART#1 의 TXD, RXD, RTS, CTS signals are connected with UART#1
RS232 driver IC.
UART#2 TEST
UART#2 의 TXD, RXD, RTS, CTS signals are connected with UART#2
RS422/485 driver IC.
UART#3 TEST
UART#3 의 TXD, RXD, RTS, CTS signals are connected with UART#3
RS422/485 driver IC.
6
For Serial Port & GPIO Test
Serial Port and GPIO LED of DK board are enabled.
UP Position(ON)
GPIO TEST (High : LED On)
GPIO (PB4, PB5, PB26, PB27) ports are connected with the GPIO LED of DK board and disconnected with the
UART#0 RS232 driver IC.
GPIO (PB24, PB22, PB23, PB25) ports are connected with the GPIO LED of DK board and disconnected with the
UART#0 RS232 driver IC.
GPIO (PB6, PB7, PB28, PB29) ports are connected with the GPIO LED of DK board and disconnected with the
UART#1 RS232 driver IC.
GPIO (PB8, PB9, PA4, PA5) ports are connected with the GPIO LED of DK board and disconnected with the
UART#2 RS422/485 driver IC.
GPIO (PB10, PB11, PC8, PC10) ports are connected with the GPIO LED of DK board and disconnected with the
UART#3 RS422/485 driver IC.
Connect to Expansion Header
UART#0~#3 and GPIO LEDs are disconnected with the Eddy-CPU board and directly connected with the
Expansion Header(J2, J4)
2.4.2.5. S8:COM3 & S9: COM4 Select
COM Port #3 and COM Port #4 set the RS422/RS485 mode.
ON
ON
1 2 3
COM PORT#3, #4 settings
Switch
Bank
S8
Port#3
Switch
No
1
4
Down Position(OFF)
RS485 Half-Duplex mode
UP Position(ON)
RS422 Full-Duplex mode
28
Chapter 3. Development
Environment
2
3
4
RS422(RX enabled)
RS485 echo-mode
RS422 Termination Resistor not connected
RS485 Termination Resistor not connected
RS485 non echo-mode
RS422 Termination Resistor
Connected
RS422 Termination Resistor
Connected
1 RS485 Half-Duplex mode RS422 Full-Duplex mode
S9
Port#4
2
3
4
RS422(RX enabled)
RS485 echo-mode
RS422 Termination Resistor not connected
RS485 Termination Resistor not connected
RS485 non echo-mode
RS422 Termination Resistor
Connected
RS422 Termination Resistor
Connected
2.4.2.6. SW1~SW16: Key Pad
Key Pad of DK board are consisted with the 4x4 matrix. GPIOs are set to Input mode to read the Key value. and Key 2, 4, 6, 8 also have the ▲(UP), ▼(DN), ◀(LEFT), ▶(RIGHT) direction function for
LCD menu.
P10-P17 4x4 Key matrix I/O
PB20 First Row line IN
PB21
PB30
PB31
PC20
PC21
Second Row line
Third Row line
Forth Row line
First Column line from left
Second Column line from left
PC22 Third Column line from left
PC23
2.4.2.7. SW17: Power
Fourth Column line from left
In order to power up, pull up this switch.
IN
IN
IN
IN
IN
IN
IN
29
Chapter 3. Development
Environment
2.4.2.8. Reset1: Reset
Pin name
PC16
Function nRESET
Discription
Polling Input signal continually from External Reset key, implement as below with checking the constant time of "Low."
Less than 5 seconds: General reset function.
More than 5 seconds: Factory Default function.
I/O
IN
2.4.3 LED Description
2.4.3.1. GPIO LED
Eddy-CPU v2.1 supports Max 56 GPIO ports. DK board has 20 GPIO LEDs of all GPIO to test. This
GPIO LEDs are controlled by UART select switches.(refer to 2.4.2.4 UART Select )
PIN name Function Discription I/O
PC10 CTS3 UART #3 Clear to Send I
PC8
PB11
PB10
RTS3
RXD3
TXD3
UART #3 Request to Send
UART #3 Receive Data
UART #3 Transmit Data
O
I
O
30
Chapter 3. Development
Environment
PA5 CTS2 UART #2 Cleat to Send I
PA4
PB9
PB8
RTS2
RXD2
TXD2
UART #2 Request to Send
UART #2 Receive Data
UART #2 Transmit Data
O
I
O
PB29
PB28
PB7
PB6
PB25
PB23
PB22
PB24
PB27
PB26
CTS1
RTS1
RXD1
TXD1
RI0
DCD0
DSR
DTR0
CTS0
RTS0
UART #1 Cleat to Send
UART #1 Request to Send
UART #1 Receive Data
UART #1 Transmit Data
UART #0 Ring Indicator
UART #0 Data Carrier Detection
UART #0 Data Set Ready
UART #0 Data Terminal Ready
UART #0 Clear to Send
UART #0 Request to Send
PB5 RXD0 UART #0 Receive Data I
PB4 TXD0 UART #0 Transmit Data
41.2 DC Characteristics
Symbol Parameter Conditions
PA0-PA31 PB0-PB31
PC0-PC3
Min
Io Output Current
PC4 - PC31 in 3.3V range
PC4 - PC31 in 1.8V range
* Eddy DK v2.1 has 3.3V range, so PC4-PC31 PIO is set to 2mA.
(Refer to CPU Datasheet의 41.2 DC characteristics )
2.4.3.2. Power, Ready LED
Typ Max Units
16
2*
4
O
System Ready (RDY): Indicates that the system is operating normally. (Normal: LED blinks)
Power (PWR): Indicates that the 5 V power is being supplied. (Supplying power: Red LED ON)
2.4.3.3. Debug Port LED
DTXD (Debug Port Transmit Dta LED) : Shows transmission status of the Debug Port.
DRXD (Debug Port Receive Data LED) : Shows reception status of the Debug Port. mA
I
O
I
O
I
I
O
I
I
O
31
Chapter 3. Development
Environment
2.4.3.4. COM Port 1 LED
COM Port 1 Transmit LED : Shows transmission status of COM1 Port.
COM Port 1 Receive LED : Shows reception status of COM1 Port.
2.4.3.5. COM Port 2 LED
COM Port 2 Transmit LED : Shows transmission status of COM2 Port.
COM Port 2 Receive LED : Shows reception status of COM2 Port.
2.4.3.6. COM Port 3 LED
COM Port 3 Transmit LED : Shows transmission status of COM3 Port.
COM Port 3 Receive LED : Shows reception status of COM3 Port.
2.4.3.7. COM Port 4 LED
2.4.4
COM Port 4 Transmit LED : Shows transmission status of COM4 Port.
COM Port 4 Receive LED : Shows reception status of COM4 Port.
External Device Interface Description
32
Environment
Chapter 3. Development
2.4.4.1. WAN & LAN Interface
WAN & LAN Port automatically recognizes Cross/ Direct.(auto MDIX)
Pin Signal
1
2
3
6
TXD+
TXD-
RXD+
RXD-
Description
Transmit Data +
Transmit Data -
Receive Data +
Receive Data -
LED
Left Green
Description
Upon 100BaseT link, it lights
Upon 10BaseT link, it off
Right Yellow
Default Lights, When the data is sent or received, it blinks.
33
Chapter 3. Development
Environment
2.4.4.2. COM Port 1 & COM Port 2
RS232
Pin
1
2
3
4
5
6
7
8
Signal
DCD
RXD
TXD
DTR
GND
DSR
RTS
CTS
9 RI
2.4.4.3. COM Port 3 & COM Port 4
Description
Data Carrier Detection (Input) (COM Port 1 only)
Receive Data (Input)
Transmit Data (Output)
Data Terminal Ready (Output) (COM Port 1 only)
Ground
Data Set Ready (input) (COM Port 1 only)
Request to Send (Output)
Clear to Send (Input)
Ring Indicator (Input)
34
RS422 Full Duplex
Pin
1
2
3
4
5
Signal Description
TXD+ Transmit differential data positive (Output)
TXD- Transmit differential data negative (Output)
GND Ground
RXD+ Receive differential data positive (Input)
RXD- Receive differential data negative (input)
Chapter 3. Development
Environment
RS485 Half Duplex
Pin
1
2
2.4.4.4. Debug Port
Signal Description
TRX+ Transmit/Receive differential data positive
TRX- Transmit/Receive differential data negative
You can check debug message or status information with debug port.
Environment Setting
Debug port is configured as follows so user has to set his or her PC serial port connected to debug port as follows.
Speed: 115200 bps
Data bit: 8 bit
Parity bit: Non Parity
Stop bit: 1 bit
2.4.4.5. Power Jack
Contact
Center (D : 2mm)
Outer (D: 6.5mm)
Polarity
9-48VDC
Ground
35
Chapter 3. Development
Environment
2.4.5 Internal Device Description
2.4.5.1. EEPROM
Eddy-DK v2.1 has the AT25160, 2Kx8bit SPI EEPROM.
2.4.5.2. LCD Module
Graphic LCD Module (PowerTIP PG12864LRU-JCNH11Q and I2C-Bus I/O Expander IC PCA9539)
Signal Name Function Description I/O
P[00:07] Data bits
Used for data transfer between the CPU and the LCD module.
I/O
P10 /CS1 Chip enable for D2 (Segment 1 to 64) IN
P11
P12
P13
/CS2
R/W
D/ I
Chip enable for D3 (Segment 65 to 128)
R/W signal input is used to select the read /write mode
High = Read mode, Low = Write mode
Register selection input
High = Data register
Low = Instruction register (for write)
Busy flag address counter (for read)
IN
IN
IN
36
Chapter 3. Development
Environment
P14 E
2.4.5.3. 16bit I2C Bus GPIO
Start enable signal to read or write the data. IN
This 16-bit I2C Bus GPIO (PCA9539) provides general-purpose remote I/O expansion.
Slave address of this chip is set to 0x74 in DK board. and Address can be changed with A1,A0 address input from 0x74 to 0x77.
16-bit I/O is used to Digital Input/Output as below, and this is connected with the Expansion Header also. If you use for GPIO, it is possible to configure individually.
Function Description I/O
P00-P07 DIO Output, Connected with DO[0:7]
P07
P10-P17
P10
P11
P12
P13
P14
P15
P16
P17
P00
P01
P02
P03
P04
P05
P06
DIO output, DO0
DIO output, DO1
DIO output, DO2
DIO output, DO3
DIO output, DO4
DIO output, DO5
DIO output, DO6
DIO output, DO7
DIO Intput, Connected with DI[0:7]
DIO Input, DI0
DIO Input, DI1
DIO Input, DI2
DIO Input, DI3
DIO Input, DI4
DIO Input, DI5
DIO Input, DI6
DIO Input, DI7
2.4.5.4. RTC
/INT Connected with PB16 of Eddy-CPU
- DS1340 (Dallas, I2C interface)
- 12.5pF load capacitance crystal must be used. (Refer to Crystal Spec below)
- Do not use another RTC Chip.
- Backup Battery: CR2032 (235mAh) Lithium Battery.
37
OUT
IN
OUT
Chapter 3. Development
Environment
DS1340 Crystal Specifications
Parameter Symbol
Normal Frequency
Series Resistance
Load Capacitance fo
ESR
CL
2.4.5.5. Temp Sensor
MIN TYP
32.768
12.5
MAX
45,60
Units
KHz
KΩ pF
AD0(PC0)에 National LM50
2.4.5.6. Light Sensor
BH1600FVC (Rohm)
The Output voltage is caculated as below
Viout = 0.6 x10-6 x Ev x R1
Where, Viout = IOUT output voltage [V]
Ev = lilluminance of the ALS(Ambient Light Sensor) surface [lx]
R1 = IOUT output resistor [Ω]
2.4.5.7. NAND Flash
- 256MB, 8bit Flash (Samsung K9F2G08U0A-PCB0)
- Chip Select #3 used, Address range : 0x4000_0000~0x4FFF_FFFF.
Eddy-
CPUv2.1
Signal Name
Function Discription
A22 CLE
COMMAND LATCH ENABLE
The CLE input controls the activating path for commands sent to the command register.
I/O
OUT
38
Chapter 3. Development
Environment
A21
NANDOE
NANDWE
ALE
ADDRESS LATCH ENABLE
The ALE input controls the activating path for address to the internal address registers.
OUT
NANDOE data-out control OUT
NANDWE controls writes to the I/O port OUT
PC14(NCS3) NANDCS device selection control OUT
PC17
D[0:7]
RDYBSY
(R/B)
DATA bits
READY/BUSY OUTPUT
The R/B output indicates the status of the device operation. When low, it indicates that a program, erase or random read operation is in process and returns to high state upon completion. It is an open drain output and does not float to high-z condition when the chip is deselected or when outputs are disabled.
DATA INPUTS/OUTPUTS
The I/O pins are used to input command, address and data, and to output data during read operations. The I/O pins float to high-z when the chip is deselected or when the outputs are disabled.
2.4.5.8. Ethernet Controller (WAN Port)
IN
I/O
- Davicom DM9000B Ethernet Controller
- 16 bit mode set.
- EECS pin should be connected with pull-up resistor to use link/speed LED.
- RJ45 Transformer Center Tap is powered by DM9000B AVDD18.
Eddy-CPU v2.1
Signal Name
DM9000B
Signal Name
Description
PC12/NCS7
PC15/IRQ1
A2
CSN
INTRN
CMD
Chip Select #7
Address : 0x8000 0000-0x8FFF FFFF
Interrupt depend on EECK(pin20) setting.
1 : INT pin low active
0 : INT pin high active
EECK is not connected in DK board, so Interrupt is acted with active high.
Command Type
When high, Data port
When low, INDEX port
D[0:15] Data Bus 16-bit mode
I/O
OUT
IN
OUT
I/O
39
Chapter 3. Development
Environment
2.5 Eddy-S4M v2.1
Eddy-S4M is a high-performance mini PCI type embedded module which include ATMEL
AT91SAM9260-CJ porcessor 32MB SDRAM, 8MB DataFlash, 10/100Base-T Ethernet port, Serial 4
Channel, RTC with Battery, minroSD, 4ch ADC, temperature sensor, max 34 programmable GPIO pins. Eddy-S4M is 59.75 x 61.8mm size. If using Eddy-S4M-JIG board, user could develop their customized device without other H/W development, which minimizing time and cost to develop.
Referring Example code and Evaluation Kit circuit allow developer to design device they want.
40
Environment
Chapter 3. Development
2.5.1
Signal Pin
1 JTAG_TDI
Key
2 JTAG_TMS
3 JTAG_TCK
7 LAN_RX+
9 LAN_RX-
11 LAN_Speed
13 P3_RX-
15 GND
17 P3_RX+
19 3.3V
21 P3_TX+
5.1 miniPCI Card Type III Connector Pinout (J5)
Pin Signal
2 JTAG_TDO
Key
4 JTAG_RTCK
6 ICE_NTRST
8 LAN_TX+
10 LAN_TX-
12 LAN_LINK
14 RDY#
16 NC
18 NC
20 DCD0
22 DTR0
Pin
63 3.3V
65 PB16
67 PB18
69 GND
71 PB20
73 PB30
75 PC0
77 GND
79 PC2
81 PC5
83 GND
85 PC10
Signal
41
Pin
64 PB13
66 PB17
68 PB19
70 3.3V
72 PB21
74 GND
76 PB31
78 PC1
80 PC3
82 GND
84 PC9
86 PC12
Signal
Chapter 3. Development
Environment
23 GND
25 P3_TX-
27 GND
29 P4_RX+
31 3.3V
33 P4_RX-
35 P4_TX+
37 GND
39 P4_TX-
41 DEBUG_TxD
43 DEBUG_RxD
45 PA5
47 PA22
49 GND
51 PA30
53 NC
55 GND
57 PB0
59 PB2
61 PB12
24 3.3V
26 nRESET
28 3.3V
30 RxD0#
32 GND
34 RTS0
36 TxD0#
38 CTS0
40 3.3V
42 DSR0
44 RI0
46 RxD1#
48 RTS1
50 GND
52 TxD1#
54 CTS1
56 NRST
58 PB1
60 PB3
62 GND
2.5.2 Connector Pinout of Boards
2.5.2.1. ICE and JTAG
87 PC13
89 3.3V
91 PC15
93 PC18
95 PC24
97 NC
99 I2C_TWCK
101 GND
103 DDM
105 DM2
107 DM3
109 DM4
111 SDDATA0
113 SDDATA2
115 SDCMD
117 SDCDN
119 JTAG_SEL
121 NC
123 NC
88 3.3V
90 PC14
92 PC17
94 PC19
96 PC20
98 PC25
100 I2C_TWD
102 GND
104 DDP
106 DP2
108 DP3
110 DP4
112 SDDATA1
114 GND
116 SDDATA3
118 SDCLK
120 SDWP
122 BMS
124 3.3V
S4M
Pin No
(124)
1
2
3
4
5
6
119
Name
TDI
TDO
TMS
RTCK
TCK
NTRST
JTAGSEL
S4M-JIG
Pin HDR
(46*2)
-
-
-
-
-
-
-
S4M-DK
Pin HDR
(46*2)
-
-
-
-
-
-
-
Description
Test Data IN
Test Data Out
Test Mode Select
Return Test Clock
Test Clock
Test Reset
JTAG boundary scan can be used by connecting J3.
This pin should not be connected when using ICE (In-Circuit
Emulator) or in normal operation status.
2.5.2.2. Ethernet signal from or to PHYceiver
S4M
Pin No
(124)
7
8
9
Name
LAN_RX+
LAN_TX+
LAN_RX-
S4M-JIG
Pin HDR
(46*2)
S4M-
DK
Pin Description
HDR
(46*2)
J5 pin2 J7 Pn2 Ethernet PHY Physical receive or transmit signal (+ differential) in CPU
J5 pin1 J7 Pin1 Ethernet PHY Physical receive or transmit signal (- differential) in CPU
J5 pin3 J7 pin3 Ethernet PHY Physical receive or transmit signal (+ differential) in CPU
42
S4M
Pin No
(124)
Chapter 3. Development
Environment
10 LAN_TX- J5 pin4 J7 pin4 Ethernet PHY Physical receive or transmit signal (- differential) in CPU
LAN connection status LED
Link/Activity Pin State LED Definition
11 LAN_Speed J5 pin6 J7 pin6
No Link
Link
Activity
H
L
Toggle
OFF
ON
Blinking
Link/Activity Pin State
12 LAN_Link J5 pin5 J7 pin5
No Link
Link
Activity
H
L
Toggle
2.5.2.3. Serial (RS232 & COMBO) and PIOA (Peripheral I/O Controller A)
LED Definition
OFF
ON
Blinking
Name
S4M-JIG
Pin HDR
(46*2)
S4M-DK
Pin HDR
(46*2)
Description
13
14
17
20
21
22
25
26
29
30
P2_RX-
RDY#
P2_RX+
DCD0
P2_TX+
DTR0
P2_TX- nRESET
P3_RX+
RxD0#
J4 pin20
J4 pin45
J4 pin19
J4 pin9
J4 pin17
J4 pin7
J4 pin18
J4 pin46
J4 pin23
J4 pin4
J6 pin20
J6 pin45
J6 pin19
J6 pin9
J6 pin17
J6 pin7
J6 pin18
J6 pin46
J6 pin23
J6 pin4
COM port #3 Receive differential data negative (Input)
RS422/485 inverting receiver input of Eddy-S4M module
Indicate state of CPU ( normal : blinking)
COM port #3 Receive differential data positive (Input)
RS422/485 Noninverting receiver input of Eddy-S4M module
COM port #1 Data Carrier Detection signal
RS232 receiver input of Eddy-S4M module
COM port #3 Transmit differential data positive (Output)
RS422/485 Noninverting driver ouput of Eddy-S4M module
COM port #1 Data Terminal Ready signal
RS232 driver output of Eddy-S4M module
COM port #3 Transmit differential data negative (Output)
RS422/485 inverting driver ouput of Eddy-S4M module
Reset Input. In S/W, continuously check the interval of ‚LOW‛ when polling input signal from external Reset Key.
Under 5sec : Normal reset function
Over 5sec : Factory Default function
COM port #4 Receive differential data negative (Input)
RS422/485 Noninverting receiver input in Eddy-S4M module
COM port #1 Receive Data signal
RS232 receiver input in Eddy-S4M module
43
33
34
35
36
38
39
41
42
43
44
45
46
47
48
51
52
54
56
Environment
Chapter 3. Development
P3_RX-
RTS0
P3_TX+
TxD0#
CTS0
P3_TX-
DTxD#
DSR0
DRxD
RI0
PA5
RxD1#
PA22
RTS1
PA30
TxD1#
CTS1
J4 pin24
J4 pin5
J4 pin21
J4 pin3
J4 pin6
J4 pin22
J4 pin1
J4 pin8
J4 pin2
J4 pin8
J5 pin7
J4 pin12
J5 pin8
J4 pin13
J5 pin9
J4 pin11
J4 pin14
J5 pin46
J6 pin24
J6 pin5
J6 pin21
J6 pin3
J6 pin6
J6 pin22
J6 pin1
J6 pin8
J6 pin2
J6 pin8
J7 pin7
J6 pin12
J7 pin8
J6 pin13
J7 pin9
J6 pin11
J6 pin14
J7 pin46
COM port #4 Receive differential data negative (Input)
RS422/485 inverting receiver input in Eddy-S4M module
COM port #1 Request To Send signal
RS232 driver output in Eddy-S4M module
COM port #4 Transmit differential data positive (Output)
RS422/485 Noninverting driver ouput in Eddy-S4M module
COM port #1 Transmit Data signal
RS232 driver output in Eddy-S4M module
COM port #1 Request to Send signal
RS232 receiver input in Eddy-S4M module
COM port #4 Transmit differential data negative(Output)
RS422/485 inverting driver ouput in Eddy-S4M module
Transmit Data signal of Debug Port
RS232 driver output in Eddy-S4M module
COM port #1 Data Set Ready signal
RS232 receiver input in Eddy-S4M module
Receive Data signal of Debug Port
RS232 receiver input in Eddy-S4M module
COM port #1 Ring Indicator signal
RS232 receiver input in Eddy-S4M module
Only used for GPIO
COM port #1 Receive Data signal
RS232 receiver input in Eddy-S4M module
Only used for GPIO
COM port #1 Request to Send signal
RS232 driver output in Eddy-S4M module
Only used for GPIO
COM port #1 Request to Send signal
RS232 driver output in Eddy-S4M module
COM port #1 Request to Send signal
RS232 receiver input in Eddy-S4M module
External device Reset output signal (active low) NRST
44
72
73
Chapter 3. Development
Environment
2.5.2.4. PIOB and PIOC (Peripheral I/O Controller B/C)
S4M
Pin No
(124)
Name
S4M-JIG
Pin HDR
(46*2)
S4M-DK
Pin HDR
(46*2)
Description
57 PB0 J5 pin11 J7 pin11
Peripheral A : SPI1_MISO
SPI1(Serial Peripheral Interface)
Master In Slave Out
Peripheral B : TIOA3 Timer Counter ch3 I/O Line A
SPI1(Serial Peripheral Interface)
Master Out Slave In
58 PB1 J5 pin12 J7 pin12
Peripheral A : SPI1_MOSI
Peripheral B : TIOB3 Timer Counter ch3 I/O Line B
59
60
PB2
PB3
J5 pin13
J5 pin14
J7 pin13
J7 pin14
Peripheral A : SPI1_SPCK
Peripheral A : SPI1_NPCS0
Peripheral B : TIOA5
SPI1(Serial Peripheral Interface) Serial
Clock
SPI1(Serial Peripheral Interface)
Peripheral Chip Select 0
Timer Counter ch5 I/O Line A
61 PB12 J5 pin17 J7 pin17 Peripheral A : TXD5 USART5 Transmit Data
64 PB13
65
66
67
68
71
PB16
PB17
PB18
PB19
PB20
J5 pin18
J5 pin119 J7 pin119
J5 pin20
J5 pin21
J5 pin22
J7 pin18
J7 pin20
J7 pin21
J7 pin22
Peripheral A : RXD5
Peripheral A : TK0
Peripheral B : TCLK3
Peripheral A : TF0
Peripheral B : TCLK4
Peripheral A : TD0
Peripheral B : TIOB4
Peripheral A : RD0
Peripheral B : TIOB5
J5 pin23 J7 pin23 Peripheral A : RK0
USART5 Receive Data
SSC Transmit Clock
Timer Counter ch3 External CLK IN
SSC Transmit Frame Sync
Timer Counter ch4 External CLK IN
SSC Transmit Data
Timer Counter ch4 I/O Line B
SSC Receive Data
Timer Counter ch5 I/O Line B
SSC Receive Clock
PB21
PB30
J5 pin24 J7 pin24 Peripheral A : RF0
J5 pin25 J7 pin25 Peripheral A : PCK0
SSC Receive Frame Sync
Programmable Clock Output 0
75
76
PC0
PB31
J5 pin27
J5 pin26
J7 pin27
J7 pin26
Peripheral A : AD0
Peripheral A : PCK1
Analog to Digital Converter Input Ch0
Programmable Clock Output 1
45
Chapter 3. Development
Environment
78
79
80
81
PC1
PC2
PC3
PC5
J5 pin28
J5 pin29
J5 pin30
J5 pin33
J7 pin28
J7 pin29
J7 pin30
J7 pin33
Peripheral A : AD1
Peripheral B : PCK0
Peripheral A : AD2
Peripheral B : PCK1
Peripheral A : AD3
Peripheral B : SPI1_NPCS3
Peripheral B : SPI1_NPCS1
Analog to Digital Converter Input Ch1
Programmable Clock Output 0
Analog to Digital Converter Input Ch2
Programmable Clock Output 1
Analog to Digital Converter Input Ch3
SPI1(Serial Peripheral Interface)
Peripheral Chip Select 3
SPI1(Serial Peripheral Interface)
Peripheral Chip Select 1
84
85
86
87
90
91
92
PC9
PC10
PC12
PC13
PC14
PC15
PC17
J5 pin34
J5 pin35
J5 pin36
J5 pin37
J5 pin38
J5 pin39
J5 pin40
J7 pin34
J7 pin35
J7 pin36
J7 pin37
J7 pin38
J7 pin39
J7 pin40
Only GPIO
Only GPIO
Only GPIO
Only GPIO
Only GPIO
Only GPIO
Only GPIO
93
94
PC18
PC19
J5 pin41
J5 pin42
J7 pin41
J7 pin42
Peripheral B : SPI1_NPCS1
Peripheral B : SPI1_NPCS2
SPI1(Serial Peripheral Interface)
Peripheral Chip Select 1
SPI1(Serial Peripheral Interface)
Peripheral Chip Select 2
95 PC24 J5 pin44 J7 pin44 Only GPIO
96 PC20 J5 pin43 J7 pin43 Peripheral B : SPI1_NPCS3
SPI1(Serial Peripheral Interface)
Peripheral Chip Select 3
98 PC25 J5 pin45 J7 pin45
2.5.2.5. Two Wire Interface
S4M
Pin No
(124)
Name
Only GPIO
S4M-JIG
Pin HDR
(46*2)
S4M-DK
Pin HDR
(46*2)
Description
99
100
I2C_TWCK
I2C_TWD
J4 pin43
J4 pin44
J6 pin43
J6 pin44
Two-wire Serial Clock.
This can be used GPIO pin unless RTC function is used.
Two-wire Serial Data. This can be used GPIO pin unless
RTC function is used.
46
112
113
115
116
117
118
120
S4M
Pin No
(124)
111
S4M
Pin No
(124)
103
104
Chapter 3. Development
Environment
2.5.2.6. Universal Serial Bus
Name
DDM
DDP
S4M-JIG
Pin HDR
(46*2)
J4 pin25
J4 pin26
S4M-DK
Pin HDR
(46*2)
J6 pin25
J6 pin26
Description
105
106
107
108
109
110
DM2
DP2
DM3
DP3
DM4
DP4
J4 pin27
J4 pin27
J4 pin29
J4 pin30
J4 pin33
J4 pin34
J6 pin27
J6 pin27
J6 pin29
J6 pin30
J6 pin33
J6 pin34
USB Device Port Data –
USB Device Port Data +
USB Port2 Data –. Connected to DSPORT2 of GL850A
USB 2.0 Hub Controller.
USB Port2 Data +. Connected to DSPORT2 of GL850A
USB 2.0 Hub Controller.
USB Port3 Data –. Connected to DSPORT2 of GL850A
USB 2.0 Hub Controller.
USB Port3 Data +. Connected to DSPORT2 of GL850A
USB 2.0 Hub Controller.
USB Port4 Data -. Connected to DSPORT2 of GL850A
USB 2.0 Hub Controller.
USB Port4 Data +. Connected to DSPORT2 of GL850A
USB 2.0 Hub Controller.
2.5.2.7. Multimedia Card Interface
122
Name
SDDATA0
SDDATA1
SDDATA2
SDCMD
SDDATA3
SDCDN
SDCLK
SDWP
BMS
S4M-JIG
Pin HDR
(46*2)
J4 pin35
J4 pin36
J4 pin37
J4 pin38
J4 pin39
J4 pin40
J4 pin41
J4 pin42
-
S4M-DK
Pin HDR
(46*2)
J6 pin35
J6 pin36
J6 pin37
J6 pin38
J6 pin39
J6 pin40
J6 pin41
J6 pin42
-
Description
SD Data0
SD Data1
SD Data2
SD command
SD Data3
SD card detect
SD Clock
SD Write Protect
Boot Mode Select signal
BMS = 1, Boot on Embedded ROM
BMS = 0, Boot on External Memory
47
Chapter 3. Development
Environment
2.5.2.8. etc
S4M
Pin No
(124)
Name
S4M-JIG
Pin HDR
(46*2)
16, 18, 53,
97,
121, 123
15, 23, 27,
32, 37, 49,
50, 55, 62,
69, 74, 77,
82, 83, 101,
102, 114
NC
GND
J5 pin10
J4: 31,32
J5: 31,32
19, 24, 28,
31, 40, 63,
3.3V J4: 15,16
70, 88, 89,
124
2.5.3 Switch Operation
ON
ON
S4M-DK
Pin HDR
(46*2)
J5 pin10
J6: 31,32
J7: 31,32
J6: 15,16
Description
No Connection
Ground
3.0 to 3.6V power input
1
Switch No 1
OFF
Operation descriotion
For Flash Programming
Store firmware image to Flash memory through USB Device. (Only via Window Host). For more information, please refer to chapter 9, system recovery.
ON Normal booting via Eddy-S4M v2.1 Data Flash
2.5.4
2.5.5
LED Operation
System Ready (RDY): Indicate normal state of system (Normal: blinking)
Ethernet
Since there is KSZ8041NL PHY in Eddy-S4M module, when integrating Ethernet, just connect
RJ45 in which transformer located
48
Chapter 3. Development
Environment
WARNING : When you use RJ45 which has transformer in its internal circuit, it is possible to each product doesn’t have equal PIN spec. Therefore, you must confirm PIN number
Bellow is KSZ8041NL functions
• Fully compliant to IEEE 802.3u Standard
• Supports MDI/MDI-X auto crossover (Auto-MDI)
• MII interface support
• RMII interface support with external 50MHz system clock
• ESD rating (6kV)
• Built-in 1.8V regulator for core
• Available in 32-pin (5mm x 5mm) MLF
® package
2.5.6 RTC
- We used D1340 which is connected I2C interface.
- In DS1340, you must use crystal of load capacitance = 12.5pF (Refer to bellow Crystal spec)
- You have to confirm Crystal spec because some RTC Chips have different spec
- We used CR2032 (235mAh) Lithium with Backup Battery
DS1340 Crystal Specifications
Parameter Symbol MIN TYP MAX Units
32.768
12.5
45,60
KHz
KΩ pF
2.5.7
Normal Frequency
Series Resistance fo
ESR
Load Capacitance CL
Temp Sensor we used LM50(National) to AD0(PC0)
49
Chapter 3. Development
Environment
2.6 Eddy-S4M-DK v2.1
2.6.1
Eddy-S4M DK is Development Kit supporting programmer can easily materialize and test their application.
Switch and Connector explanation
2.6.1.1. S2 : GPIO Input Configuration
After configure PB0-PB4 to input, you can confirm whether the input value is changing with dip switch control.
50
Chapter 3. Development
Environment
Switch No
1
2
PB0 Value
PB0 input value
3
4
PB0 input value
PB0 input value
2.6.1.2. S3,4 : Terminal Resistor selection
Down Position(OFF)
Low
Low
Low
Low
UP Position(ON)
High
High
High
High
ON
ON
Pin Signal
1 DTxD
3
5
7
TxD0#
RTS0
DTR0
9 DCD0
11 TxD1#
13 RTS1
15 3.3V
17 P3_TX+
19 P3_RX+
21 P4_TX+
23 P4_RX+
25 DDM
27 DM2
51
1 2
COM Port #3 and COM Port #4 is Combo port which support RS422/RS485 interface. Terminal resistors in each port are configured by switch upon each Terminal Block.
Switch No Down Position(OFF) UP Position(ON)
1 RS422 Termination Resistor not connected RS422 Termination Resistor Connected
2
1
RS485 Termination Resistor not connected
RS422 Termination Resistor not connected
2 RS485 Termination Resistor not connected
2.6.1.3. J6,J7 : JIG Board connector(Socket)
RS422 Termination Resistor Connected
RS422 Termination Resistor Connected
RS422 Termination Resistor Connected
J6 J7
20
22
24
26
28
Pin Signal
2 DRxD
4
6
8
10
12
14
RxD0#
CTS0
DSR0
RI0
RxD1#
CTS1
16 3.3V
18 P3_TX-
P3_RX-
P4_TX-
P4_RX-
DDP
DP2
19
21
23
25
27
Pin Signal
1 LAN_RX+
3
5
7
9
11
13
LAN_RX-
LAN_Speed
PA5
PA30
PB0
PB2
15 5V
17 PB12
PB16
PB18
PB20
PB30
PC0
20
22
24
26
28
Pin Signal
2 LAN_TX+
4
6
8
10
12
14
LAN_TX-
LAN_LINK
PA22
NC
PB1
PB3
16 5V
18 PB13
PB17
PB19
PB21
PB31
PC1
Environment
29 DM3
31 GND
33 DM4
35 SDDATA0
37 SDDATA2
39 SDCMD
41 SDCDN
43 TWCK
Chapter 3. Development
30
32
34
36
38
40
42
44
DP3
GND
DP4
SDDATA1
SDDATA3
SDCLK
SDWP
TWD
29
31
33
35
37
39
41
43
PC2
GND
PC5
PC10
PC13
PC15
PC18
PC20
30
32
34
36
38
40
42
44
PC3
GND
PC9
PC12
PC14
PC17
PC19
PC24
45 PC25 46 NRST(OUT) 45 RDY# 46
2.6.1.4. U7 : Light Sensor nRESET(IN)
Bellow is comparison between luminance and out current. We used BH1600FVC (Rohm)
The Output voltage is caculated as below
Viout = 0.6 x10-6 x Ev x R1
Where, Viout = IOUT output voltage [V]
Ev = lilluminance of the ALS(Ambient Light Sensor) surface [lx]
R1 = IOUT output resistor [Ω]
52
Chapter 3. Development
Environment
2.6.2 Interface Explanation
2.6.2.1. Power, Ready LED
System Ready (RDY): Indicate normal state of system (Normal: blinking)
Power (PWR): indicate Power is inserted (RED LED ON state)
2.6.2.2. Serial Port LED
Operation description
Pin Name
Debug Port
COM Port 1
(RS232)
COM Port 2
(RS232)
COM Port 3
(RS422/RS485)
Signal Name
TxD
RxD
TxD
RxD
TxD
RxD
TxD
Descriotion
Debug Port Tx LED
Debug Port Rx LED
COM Port1 Tx LED
COM Port1 Rx LED
COM Port2 Tx LED
COM Port2 Rx LED
If RS422 is COM Port3 Tx LED
If RS485 is Tx/Rx Common LED
53
Chapter 3. Development
Environment
COM Port 4
(RS422/RS485)
RxD
TxD
RxD
If RS422 is COM Port3 Rx LED
If RS485 is LED Off (Not Used)
If RS422 is COM Port4 Tx LED
If RS485 is Tx/Rx Common LED
If RS422 is COM Port4 Rx LED
If RS485 is LED Off (Not Used)
2.6.2.3. GPIO LED
15
16
22
23
24
25
26
27
28
29
17
18
19
20
21
30
31
32
Eddy-S4M Provide max 34ea GPIO port.
No Pin Name
1
2
3
PC25
PC24
PC20
Descriotion
GPIO Only
GPIO Only
GPIO or SPI1_NPCS3
4
5
6
PC19
PC18
PC17
GPIO or SPI1_NPCS2
GPIO or SPI1_NPCS1
GPIO Only
7
8
9
PC15
PC14
PC13
GPIO Only
GPIO Only
GPIO Only
10
11
12
13
14
PC12
PC10
PC9
PC5
PC3
GPIO Only
GPIO Only
GPIO Only
GPIO or SPI1_NPCS1
GPIO or AD3 or SPI1_NPCS3
PC2
PC1
PC0
PB31
PB30
PB21
PB20
PB19
PB18
PB17
PB16
PB13
PB12
PB3
PB2
PB1
PB0
PA30
GPIO or AD2 or PCK0
GPIO or AD1 or PCK0
GPIO or AD0
GPIO or PCK1
GPIO or PCK0
GPIO or RF0
GPIO or RK0
GPIO or RTD0 or TIOB5
GPIO or TD0 or TIOB4
GPIO or TF0 or TCLK4
GPIO or RxD5 or TCLK3
GPIO or RxD5
GPIO or TxD5
GPIO or SPI1_NPCS0 or TIOA5
GPIO or SPI1_SPCK
GPIO or SPI1_MOSI or TIOB3
GPIO or SPI1_MISO or TIOA3
GPIO Only
54
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
Chapter 3. Development
Environment
33
34
PA22
PA5
GPIO Only
GPIO Only
I/O
I/O
PIO line has high-drive current capable so that can drive about 16mA except PC4-PC31(2mA).
(41.2 DC characteristics of CPU Datasheet, Refer to bellow)
AT91SAM9260 DC Characteristics
Symbol Parameter Conditions Min Typ Max Units
16
I o
Output Current
PA0-PA31 PB0-PB31
PC0-PC3
PC4 - PC31 in 3.3V range
PC4 - PC31 in 1.8V range
* Since Eddy-S4M v2.1 is 3.3V range, PC4-PC31 PIO can drive 2mA.
2.6.2.4. J10 : Ethernet
2*
4 mA
Since there is KSZ8041NL PHY in Eddy-S4M module, when integrating Ethernet, just connect
RJ45 in which transformer located
WARNING : When you use RJ45 which has transformer in its internal circuit, it is possible to each product doesn’t have equal PIN spec. Therefore, you must confirm PIN number
Bellow is KSZ8041NL functions
• Fully compliant to IEEE 802.3u Standard
• Supports MDI/MDI-X auto crossover (Auto-MDI)
• MII interface support
• RMII interface support with external 50MHz system clock
• ESD rating (6kV)
• Built-in 1.8V regulator for core
• Available in 32-pin (5mm x 5mm) MLF
® package
Pin Signal
1
Description
TXD+ Physical transmit or receive signal (+ differential)
2
3
TXD- Physical transmit or receive signal (- differential)
RXD+ Physical transmit or receive signal (+ differential)
6
LED
RXD- Physical transmit or receive signal (- differential)
Description
55
Environment
Chapter 3. Development
Left Green
Right Yellow
LAN Connection Speed
Speed
Pin
State
10Base-T H
100Base-TX L
LAN Connection Status
Speed
Pin
State
No Link
Link
Activity
LED Definition
OFF
ON
LED Definition
H
L
OFF
ON
Toggle Blinking
2.6.2.5. J17, 18 : COM Port 1 & Port 2
56
RS232
4
5
6
7
Pin
1
2
3
Signal
DCD
RXD
TXD
DTR
GND
DSR
RTS
Description
Data Carrier Detection (Input) (COM Port 1 only)
Receive Data (Input)
Transmit Data (Output)
Data Terminal Ready (Output) (COM Port 1 only)
Ground
Data Set Ready (input) (COM Port 1 only)
Request to Send (Output)
8 CTS Clear to Send (Input)
9 RI Ring Indicator (Input)
* COM Port 2 provide only TxD, RxD, RTS, CTS signal.
Chapter 3. Development
Environment
2.6.2.6. J13, 14 : COM Port 3 & Port 4
RS422 Full Duplex
Pin
1
2
3
4
5
RS485 Half Duplex
Pin
1
Signal
TXD+
Description
Transmit differential data positive (Output)
TXD- Transmit differential data negative (Output)
GND Ground
RXD+ Receive differential data positive (Input)
RXD- Receive differential data negative (input)
Signal Description
TRX+ Transmit/Receive differential data positive
2 TRX- Transmit/Receive differential data negative
J15 : Debug Port
You can confirm debug massage and information of state through debug port.
57
Environment Configuration
Chapter 3. Development
Environment
Debug port is configured like below so that you must change serial port (connected with debug port) configuration like bellow.
- Speed : 115200 bps
- Data bit : 8 bit
- Parity bit : Non Parity
- Stop bit : 1 bit
- Flow control : none
2.6.2.7. S1 : Power Jack
Contact
Center (D : 2mm)
Outer (D: 6.5mm)
Polarity
5VDC
Ground
GPIO Connector pinout
Pin Signal Pin
1
3
PA5
PA30
5
7
PB0
PB2
9 PB12
11 PB16
13 PB18
15 3.3V
17 PB20
19 PB30
21 PC0
23 PC2
25 PC5
14
16
18
20
22
24
26
2
4
6
8
10
12
Signal
PB19
3.3V
PB21
PB31
PC1
PC3
PC9
PA22
NC
PB1
PB3
PB13
PB17
58
Chapter 3. Development
Environment
27 PC10
29 PC13
31 GND
33 PC15
35 PC18
37 PC20
39 PC25
41 RDY#
43 TWCK
34
36
38
28
30
32
40
42
44
PC12
PC14
GND
PC17
PC19
PC24 nRESET(IN)
NRST(OUT)
TWD
2.7 Eddy-S4M-JiG v2.1
Eddy-S4M JIG board is test board which enable of user to integrate and test their application with
Eddy-S4M. JIG board include mini connector for joining Eddy-S4M, Ethernet RJ45, USB Host, Power,
Reset Switch, and providing connectors to all Eddy-S4M functions.
59
Environment
Chapter 3. Development
2.7.1 J6 : Power Jack
Contact
Center (D : 2mm)
Outer (D: 6.5mm)
Polarity
5VDC
Ground
2.7.2 J1 : Ethernet
Since there is KSZ8041NL PHY in Eddy-S4M module, when integrating Ethernet, just connect
RJ45 in which transformer located
WARNING : When you use RJ45 which has transformer in its internal circuit, it is possible to each product doesn’t have equal PIN spec. Therefore, you must confirm PIN number
Bellow is KSZ8041NL functions
• Fully compliant to IEEE 802.3u Standard
• Supports MDI/MDI-X auto crossover (Auto-MDI)
• MII interface support
• RMII interface support with external 50MHz system clock
• ESD rating (6kV)
• Built-in 1.8V regulator for core
• Available in 32-pin (5mm x 5mm) MLF
® package
Pin Signal
1
Description
TXD+ Physical transmit or receive signal (+ differential)
2
3
TXD- Physical transmit or receive signal (- differential)
RXD+ Physical transmit or receive signal (+ differential)
6
LED
Left Green
RXD- Physical transmit or receive signal (- differential)
Description
LAN Connection Speed
Speed
Pin
State
LED Definition
10Base-T H
100Base-TX L
OFF
ON
60
Chapter 3. Development
Environment
Right Yellow
LAN Connection Status
Speed
Pin
State
No Link
Link
Activity
LED Definition
H
L
OFF
ON
Toggle Blinking
2.7.3 J2 : USB Host
J2 is connected to USB HUB ControllerEddy-S4M in Eddy-S4M. Bellow is its PIN spec
61
PC16 nRESET
2.7.4 RESET switch
Pin Definition Description
Polling Input signal continually from External Reset key, implement as below with checking the constant time of "Low."
Less than 5 seconds: General reset function.
More than 5 second: Factory Default function.
I/O
IN
Chapter 3. Development
Environment
2.7.5
J4
J4, 5 : Expansion Header
Provide most function of eddy-S4M with pin connector.
You can confirm the function with direct conjunction to Eddy-S4M-DK
.
J5
Pin Signal
1 DTxD
3
5
7
TxD0#
RTS0
DTR0
9 DCD0
11 TxD1#
13 RTS1
15 3.3V
17 P3_TX+
19 P3_RX+
21 P4_TX+
23 P4_RX+
25 DDM
27 DM2
29 DM3
31 GND
33 DM4
35 SDDATA0
37 SDDATA2
39 SDCMD
41 SDCDN
43 TWCK
45 RDY#
32
34
36
38
40
42
44
46
24
26
28
30
Pin Signal
2
4
6
8
10
12
14
16
18
DRxD
RxD0#
CTS0
DSR0
RI0
RxD1#
CTS1
3.3V
P3_TX-
20 P3_RX-
22 P4_TX-
P4_RX-
DDP
DP2
DP3
GND
DP4
SDDATA1
SDDATA3
SDCLK
SDWP
TWD nRESET(IN)
31
33
35
37
39
41
43
45
23
25
27
29
Pin Signal
1
3
5
7
9
11
13
15
17
LAN_RX+
LAN_RX-
LAN_Speed
PA5
PA30
PB0
PB2
5V
PB12
19 PB16
21 PB18
PB20
PB30
PC0
PC2
GND
PC5
PC10
PC13
PC15
PC18
PC20
PC25
32
34
36
38
40
42
44
46
24
26
28
30
Pin Signal
2
4
6
8
10
12
14
16
18
LAN_TX+
LAN_TX-
LAN_LINK
PA22
NC
PB1
PB3
5V
PB13
20 PB17
22 PB19
PB21
PB31
PC1
PC3
GND
PC9
PC12
PC14
PC17
PC19
PC24
NRST(OUT)
62
Environment
Chapter 3. Development
Chapter 3. Development Environment
This chapter explains the process of application programming and other important notes.
SDK’s directory structures are as follows.
Note
All material related to Eddy including documentation, reference sources and utilities are periodically updated to www.embeddedmodule.com without prior notice. Please visit and download latest updates from the site.
3.1 Source code directory structure
firmware ramdisk root include
Eddy_APPs SB_APIs
Filesystem_2.1.x, x src tools
Open Source
Busybox
.
.
Dropbear snmp vsftpd web
Firmware Directory
Boot Loader, kernel, filesystem, image are stored.
Ramdisk Directory
Filesystem images are created here
root: Lemonix Filesystem for Filesystem is stored.
Tools Directory
Tools used for creating image files is stored.
Src Directory
Source codes of applicatons in Eddy are stored.
Please refer Chapter4. Compiling Application for the detail description of src directory. cgi htdocs
63
Chapter 3. Development
Environment
Eddy-APPs folder contains the source code of the basic application.
Other folders contain open sources for Eddy applications.
3.2 Language
Eddy-DK application should be composed with C language. All example source codes provided are composed in C language. You can use more than one source file if you are using C programming
Language. If you are familiar with programming with ANSI C, there will be no difficulties creating applications for Eddy.
3.3 Development Environment
Eddy DK requires Windows or Linux host system.
Officially supported OSs are as follows.
Windows
Windows XP SP2
Windows 2000
Windows 2003
Linux
Red Hat 9.0
Fedora Core 4, 5, 6
SUSE Linux Enterprise Server 10.2
Ubuntu Linux 6.x, 7.x
Debian Linuv 4.0
CentOS 4.5
Asianux edition 3
3.4 Installing on Windows OS
This chapter will describe how to install Eddy Development Environment on Windows host.
The explanation of this manual based on Windows XP.
To establish Eddy ’ s integrated development environment, LemonIDE, please refer to
‚LemonIDE_User_Guide‛ for further instructions.
3.5 Installation of Cygwin
To execute LemonIDE on Windows hosts, some of libraries from Linux system are required.
Cygwin is the virtual Linux program which enables Linux environment to be compatible on Windows hosts. It needs to be installed on the system in order to use LemonIDE.
Run ‚Setup.exe" file from SDK/Windows/Cygwin directory on the CD which is provided with Eddy
DK and follow the instructions below;
64
Environment
Chapter 3. Development
Select ‚Install from Local Directory‛ and click ‚Next‛.
65
Environment
Chapter 3. Development
Select installation directory as ‚c:\cygwin‛.
Select the folder which Cygwin Package is, which is
‚SDK\Windows\cygwin‛ on provided DK
CD.
Select the package to install.
Only select ‚Devel‛ as left picture.
Make sure the option changed to ‚Install‛ from ‚Default:.
66
Chapter 3. Development
Environment
3.6 Configuration of Windows Environment Variables
Path should be added in order to refer required Eddy libraries in Windows environment.
Select ‚Desktop‛
‚My Computer‛ Right click ‚Properties‛ select ‚Advanced‛ tab
click ‚Environment Variables‛.
Select Path from System Variable and add the following line on the very beginning.
c:\cygwin\bin;
3.7 Installation of Toolchain
Toolchain compiles source codes composed on Windows environment and make it executable on the target, Eddy. Eddy. Toolchain installation file, ‚toolchain-windows-arm-411.tgz‛, can be found under SDK/Windows folder in Eddy DK’s CD. Copy the file to the root directory of ‚C:‛, and unzip the file from Windows command line as below.
Toolchain should be installed to ‚c:\cygwin\opt\lemonix\cdt‛.
Note that the command is case-sensitive.
3.8 Installation of Eddy DK Source
Install Eddy DK Source. DK Source file, ‚filesystem_2.1.x.x.tar.gz‛, can be found under SDK folder of Eddy DK’s CD. Copy the file to the root directory of ‚C:‛, and unzip the file from Windows command line as below.
DK Source should be installed to c:\eddy_DK_2xx‛.
67
Chapter 3. Development
Environment
Note that the command is case sensitive.
3.9 Installing on Linux
This chapter will describe how to install Eddy Development Environment on Linux host.
The explanation of this manual based on Fedora Core 5.
To establish Eddy ’ s integrated development environment, LemonIDE, please refer to
‚LemonIDE_User_Guide‛ for further instructions.
3.10 Installation of Toolchain
Toolchain compiles source codes composed on Linux environment and make it executable on the target, Eddy. Toolchain install file, ‚lemonide_linux_10x.tar.gz‛, can be found under SDK/linux folder in Eddy DK’s CD. Toolchain should be installed to /opt/lemonix.
Note that the command is case sensitive.
Note
Carry out all install procedures under the super user privileges.
Example below assumes that CDROM is mounted on /mnt/cdrom
If CDROM is mounted on a different location, path displayed below will bear difference.
# cd /
# tar -zxvf /mnt/cdrom/SDK/linux/lemonide*.tar.gz -C /
68
Chapter 3. Development
Environment
3.11 Installation of Eddy DK Source
Install the entire source of Eddy DK. Eddy DK Source file, ‚Filesystem_2.1.x.x.tar.gz‛, can be found under SDK folder on Eddy DK’s CD.
Install Eddy DK Source as shown below. The eddy_DK_2xx folder will be created after the installation.
# pwd
/home/shlee
# tar -zxvf filesystem_2.1.x.x.tar.gz
Unzip the file. If Eddy_DK_2xx folder is created, the installation is completed. The below shows the contents of Eddy_DK_2xx folder.
[root@localhost eddy-DK_2xx]# ls -al
Total 32 drwxr-xr-x 6 shlee work 4096 Nov 26 14:43 . drwxrwxr-- 26 shlee work 4096 Nov 30 21:25 .. drwxr-xr-x 4 shlee work 4096 Noc 26 14:46 src
-rwxr-xr-x 1 shlee work 2822 Nov 26 14:43 Env.sh
-rwxr-xr-x 1 shlee work 171 Nov 26 14:43 Make.check drwxr-xr-x 2 shlee work 4096 Nov 29 17:50 firmware drwxr-xr-x 5 shlee work 4096 Nov 29 17:50 ramdisk drwxr-xr-x 4 shlee work 4096 Nov 26 14:47 tool
3.12 Removing Development Environment
Development Environment can be removed by simply deleting the folder where installed files are located.
3.13 Removing Windows Development Environment
Delete the folders where DK Source and Cywin are installed.
3.14 Removing Linux Development Environment
# rm –rf filesystem_2.1.x.x
# rm -rf /opt/Lemonix
; Removal of Eddy DK Source
; Removal of Eddy ToolChain
69
Chapter 4. Compiling of
Application Program
Chapter 4. Compiling of Application Program
4.1 Program Type
This chapter explains how to compose application program, load to Eddy to execute and store it to flash memory of Eddy as a firmware.
The source codes provided are actual codes containing on the product. Some of codes are not provided due to a security reason. Program sources can be divided into two categories, Open
Source and Application Source.
Open sources can be found under the ‚scr‛ folder.
The contents are as follows;
Folder Name Description busybox-1.5.0 dropbear-0.50 gdbserver mtd-util openssl-0.9.7c
Linux Utility containing basic commands for the shell
SSH (Secure Shell) Server
Remote debugging program for LemonIDE
(Only executable file provided.)
Management program for Mtd matrixssl-1-8-3 thttpd-2.25b vsftpd-2.0.5/
OpenSSL Library (SSL type)
Matrixssl program (SSL type)
HTTP Server
FTP Server ddns-1.8 ethtool-6 netkit-ftp-0.18 target-agent net-snmp-5.4.1
Iptables-1.3.7
RT73
Wireless_tools.29
DDNS Server
Ethernet based network testing program ftp client
Program helps to upload, download and execute user’s programs, linked with LemonIDE. The source code not provided.
SNMP V1/V2/V3 program
Bridge program for NAT function of LAN port
WiFi Device Driver
Wireless support Tool Applications
70
Chapter 4. Compiling of
Application Program udp.c wifi.c rt-test.c testdk.c test_gpio_led.c test_gpio_pin.c test_adc.c test_sio.c test_rtc.c test_dio.c test_keypad.c test_nand.c test_mmc.c test_lcd.c test_spi_eeprom.c
/include
/SB_APIs
/web
Please refer various source codes under the Eddy_APPs folder when composing new application programs.
The program sources under the Eddy_APPs folder are the original source codes make Eddy works.
The below is a list of source files located on the Eddy_APPs folder.
File name Description def.c eddy.c
Eddy Setting Program
Program which is first executed after booting of Eddy. This program makes Eddy to operate as configured setting. pinetd.c tcp_client.c tcp_server.c
Highest hierarchy of Eddy program; it executes and monitors the programs of lower hierarchy.
Program connects to a server and exchanges data between a serial port and a socket.
Stand ready program exchanges data between the serial port and the socket.
Updating Program for Firmware upgrade.c ddns_agent.c detect.c loopback.c portview.c
Program which gives Eddy IP information to DDNS server
Program linked with the portview detector.
(Refer the portview manual for the details.)
Loopback test program for the serial port.
Agent of Portview, which is a NMS program for windows, provided by SystemBase. tcp_broadcast.c tcp_multiplex.c
Multi TCP server function supports maximum of five client connections, and broadcast serial data to all client.
Multi TCP server function supports maximum of five client connections, and transfer serial data to each client.
UDP server and client program exchanges data between UDP socket and a serial port.
WiFi management Program.
Delay Time Testing Program
Eddy-CPU/S4M Interface Testing program.
GPIO LED Testing Program
GPIO Pin Testing Program
ADC (Analog Disgital Converter) Testing Program
Serial Port Testing Program
RTC (Real Time Clock) Testing Program
DIO (Digital Input Output) Testing Program
Key Pad Testing Program
NAND Flash Testing Program
SD Memory Testing Program
LCD Testing Program
EEPROM Testing Program connected to SPI Interface
Directory for Header files for applications
Directory for Exclusive Libraries for Eddy
CGI sources and htm codes for Eddy are located
71
Chapter 4. Compiling of
Application Program
4.2 Writing Application Program
This chapter shows how to write an application program for Eddy.
First, create a ‚hello_world.c‛ file under the ‚scr/Eddy_APPs‛ directody.
#include <stdio.h>
int main()
{
While (1)
{
printf("hello world !!!\n");
sleep (1);
}
}
4.3 Writing Makefile
To compile an application program, compile information of the application program has to be registered on the Eddyy_APPs/Makefile directory. The below is description of ‚Makefile‛ under directory of src/Eddy_APPs/.
The picture blow shows the environment setting area for an application program compile.
Add a name under the ‚TARGET‛ highlighted as red, and register to the compile environment.
TARGET = eddy pinetd def ddns_agent \ upgrade portview upgradetftp detect \ tcp_server tcp_client tcp_multiplex tcp_broadcast \ udp rt_test hello_world udp : udp.o rm -f $@
$(CC) $(CFLAGS) $(LDFLAGS) $(IFLAGS) -o $@ $ [email protected] $(LIBS)
$(STRIP) $@
Hello_World : Hello_World.o
Rm -f $@
$(CC) $(CFLAGS) $(LDFLAGS) $(IFLAGS) -o $@ $ [email protected]
$(STRIP) $@
72
Chapter 4. Compiling of
Application Program
4.4 Application Program Compile
Compile the application program to execute on Eddy after registering the compile environment to the
‚Makefile‛.
4.5 Compiling on Windows
Enter ‚make‛ command through cmd(command prompt) on the directory where ‚Makefile‛ is located. As shown below, if a compile is successfully completed, execution file named
‚Hello_World‛ would be created. Of course, as this file was cross-compiled, it can not run on
Windows environment. Upload this file to Eddy using a FTP to execute the file on Eddy, (Files uploaded with FTPs will not permanently saved on Eddy.).
This will be further explained on the next chapter, Chpater 5 Creating Firmware.
C:\eddy_DK_2xx[\src/Eddy_APPs> make hello_world
/opt/lemonix/cdt/bin/arm-linux-gcc -O2 -g -Wall -Wno-nonnull -c -o Hello_World.o Hello_World.c
/opt/lemonix/cdt/bin/arm-linux-gcc -L/opt/lemonix/cdt/lib -L/opt/lemonix/cdt/bin Hello_World.o -o
Hello_World
C:\eddy_DK_2xx[\src/Eddy_APPs>
C:\eddy_DK_2xx[\src/Eddy_APPs> ls
Hello_world SB_APIs def.c eddy kt.c pinetd portview.o tcp_client.c tcp_client tcp_multiplex.o . . .
4.6 Compiling on Linux
To compile a source file on Linux environment, enter ‚make‛ command on the directory where
‚Makefile‛ is located. As shown below, if a compile is successfully completed, execution file named Hello_World would be created. Of course, as this file was cross-compiled, it can not run on
Linux environment. Upload this file to Eddy using a FTP to execute the file on Eddy, (Files uploaded with FTPs will not permanently saved on Eddy.).
This will be further explained on the next chapter, Chpater 5 Creating Firmware.
[shlee@localhost Eddy_APPs]$ make hello_world
/opt/lemonix/cdt/bin/arm-linux-gcc -O2 -g -Wall -Wno-nonnull -c -o hello_world.o hello_world.c
/opt/lemonix/cdt/bin/arm-linux-gcc -L/opt/lemonix/cdt/lib -L/opt/lemonix/cdt/bin hello_world.o
…………
[shlee@localhost Eddy_APPs]$ ls
Hello_World* SB_APIs/ def.c* eddy* kt.c pinetd* portview.o server* tcp_client* tcp_multiplex.o tcps* upgrade* . . .
73
Chapter 4. Compiling of
Application Program
4.7 Compiling with LemonIDE
LemonIDE is an IDE(Integrated Development Environment) based on Eclipse platform and provides an intuitive GUI interface. LemonIDE can be used in both Windows and Linux environments. Source coding, compile, remote debugging and creating a firmware image can be all carried out with
LemonIDE.
Refer to ‚LemonIDE_User_Guide‛ for detailed information.
4.8 Running Application on Eddy
To run an application on Eddy, there are several methods. First method is to convert an application as a firmware and loads it into the flash memory area and execute. However, this method is not recommended for developing phase of application, since it is time consuming task. Second method is to load and execution file of an application to RAM type file system by using the FTP Server on
Eddy DK, and execute it from there. This method is suitable for developing phase of application; however the application loaded to Eddy will be deleted when the power is disconnected.
The LemonIDE integrated developing environment provides advanced solution. LemonIDE debugging tool supports the direct transmission of compiled applications to Eddy. By using this tool, the user can execute and check the result instantly on site.
If you wish to use LemonIDE, please refer to ‚LemonIDE_User_Guide‛.
4.9 Uploading and Executing on Eddy
Connect to Eddy by using FTP.
ID and password for FTP server are same as the one using with telnet connection.
The example below shows how to upload an example file, ‚hello_world‛, to /tmp folder of Eddy on
Linux using FTP.
When uploading a file, ‚bin‛ command must be entered first for binary mode.
For uploading enter ‚put <file name> on the command line.
[shlee@localhost Eddy_APPs]$ ftp 192.168.0.223
Name (192.168.0.223:shlee): eddy
331 Please specify the password.
Password:
230 Login successful. ftp> cd /tmp ftp> bin ftp> put hello_world
8914 bytes sent in 0.00027 seconds (3.3e+04 Kbytes/s) ftp> bye
[shlee@localhost Eddy_APPs]$
On Windows environment, use FTP program of Windows on the Command Prompt.
When the transmission is completed, a user can check the file using Telnet terminal connected Eddy.
The file is executable using ‚chmod‛ command; however the mode has to be switched to
74
Chapter 4. Compiling of
Application Program executable.
After switching to Executable Mode, execute the file by entering ‚/hello_world‛.
To terminate a program, press ‚Ctr‛ and ‚C‛ key simultaneously.
# ls hello_world thttpd.pid
#
# chmod 777 hello_world
# login.id utmp . . .
# ./hello_world
Welcome to Eddy !
Welcome to Eddy !
Welcome to Eddy !
Welcome to Eddy ! thttpd.log login.pw
4.10 Execute a file on Booting of Eddy
If auto running is not necessary, you can skip this section.
If the application is successfully executed on Eddy, make a firmware image and load to Flash memory of Eddy to execute on booting.
Register the application to ‚pinetd.c‛ on the directory of Eddy_APPS.
//<=================================================================
// Here User Application Launching !!
// -----------------------------------------------------------------------------------
//
// ex) Task_Launch ("/sbin/hello", argument);
// | |
// | +---- Integer argument
// +--------------- Application name with path
//
//=================================================================>
Task_Launch ("/sbin/hello_world", 0); signal(SIGCHLD, sig_chld);
If ‚printed.c‛ is modified, a user must re-compile it by executing ‚make pinetd‛ as above example of section 4.4.
75
Chapter 5.
Creating Firmware
Chapter 5. Creating Firmware
On the previous chapter, we explained how to make and compile application program with sample program. This chapter introduces methods to create a firmware which permanently saves the application into the Eddy module and apply it to hardware of Eddy.
5.1 How to Create a Firmware
Firmware image can be created on filesystem_2.1.x.x/ramdisk folder.
Modify ‚Makefile‛ on filesystem_2.1.x.x/ramdisk directory to create a firmware image.
Version info, required Ramdisk amount and desired application to copy can be set up on the
‚Makefile‛.
(NOTE)
Provided DK Sources are Linux based. Some commands are not executable on Windows environment. To prevent this problem, a suffix, ‚exe‛, has to be added for some utilities after file name as shown below.
../tool/genext2fs
../tool/genext2fs
.exe
../tool/mkimage
../tool/mkimage
.exe
IMAGE=ramdisk
FW_NAME = eddy-fs-2.1.x.x.bin
Name and Version Info of Firmware
Image
FIRMWARE_DIR = ../firmware
Directory to store created firmware install:
#@echo "Making ramdisk image..."
#$(TOOL) -b 8192 -d root -D device_table.txt ramdisk
#../tool/genext2fs -U -b 5110 -d root -D device_table.txt ramdisk
#../tool/genext2fs -U -b 7158 -d root -D device_table.txt ramdisk
#../tool/mkcramfs -q -D device_table.txt root ramdisk
./tool/genext2fs.exe
-U -b 10240 -N 1024 -d root -D device_table.txt ramdisk
Make size of Ramdisk to 10,240 K and register the device of Eddy/dev as indicated on
Devide_table.txt. gzip -vf9 ramdisk est -f ramdisk.gz
./tool/mkimage.exe
-A arm -O linux -T ramdisk -C gzip -a 0 -e 0 -n $(FW_NAME) d ./ramdisk.gz
$(FW_NAME) test -f $(FW_NAME)
76
Chapter 5.
Creating Firmware mv $(FW_NAME) $(FIRMWARE_DIR)/ release:
Register the desired application to the directory for copying to
Eddy cp -f ../src/Eddy_APPs/hello_world root/sbin cp -f ../src/Eddy_APPs/eddy root/sbin cp -f ../src/Eddy_APPs/com_redirect root/sbin cp -f ../src/Eddy_APPs/tcp_server root/sbin cp -f ../src/Eddy_APPs/tcp_client root/sbin cp -f ../src/Eddy_APPs/tcp_broadcast root/sbin cp -f ../src/busybox-1.5.0/busybox root/bin cp -f ../src/dropbear-0.50/dropbear root/usr/local/sbin cp -f ../src/dropbear-0.50/dropbearkey root/usr/local/sbin cp -f ../src/ethtool-6/ethtool root/usr/local/sbin cp -f ../src/net-snmp-5.4.1/agent/snmpd root/usr/local/sbin
List of task on the ‚Makefile‛ options are as follows;
Make release ; Copy modules registered on the release to Ramdisk area.
Make install ; Create a Filesystem to a firmware image for using on Eddy.
If the modification of ‚Makefile‛ is completed, execute ‚make release and ‚make install‛ in turns and create a Firmware image.
Created firmware is stored on the ‚FIRMWARE_DIR‛ directory stated on the ‚Makefile‛.
On Windows, use cmd(command prompt) to carry out procedures explained on Linux.
[shlee@localhost ramdisk]$ make release
.
.
[shlee@localhost ramdisk]$ make install
.
.
[shlee@localhost ramdisk]$ ls ../firmware
-rwxr-xr-x -----------------------------------------eddy-bl-2.1.x.x.bin
-rwxr-xr-x -----------------------------------------eddy-bs-2.1.x.x.bin
-rwxr-xr-x -----------------------------------------eddy-os-2.1.x.x.bin
-rwxr-xr-x ----------------------------------------eddy-fs-2.1.x.x.bin
.
.
Makefile options are as follows.
Make release
Make cfg
Make install
; copy module in release to ramdisk area
; create firmware image of Eddy enviromental files in ramdisk/flash
; create a firmware image of Eddy’s Filesystem
If changes to Makefile are complete, use ‚make install‛ command to create firmware image.
77
Chapter 5.
Creating Firmware
Firmware will be created in ‚FIRMWARE_DIR‛ directory defined in Makefile.
On Windows, use cmd(command prompt) to carry out procedures explained on Linux.
[shlee@localhost ramdisk]$ make release
.
.
.
.
[shlee@localhost ramdisk]$ make install
.
.
[shlee@localhost ramdisk]$ ls ../firmware
-rwxr-xr-x -----------------------------------------eddy-bl-2.1.x.x.bin
-rwxr-xr-x -----------------------------------------eddy-bs-2.1.x.x.bin
-rwxr-xr-x -----------------------------------------eddy-os-2.1.x.x.bin
-rwxr-xr-x ----------------------------------------eddy-fs-2.1.x.x.bin
As shown in the picture above, a new firmware file ‚eddy-fs-2.1.x.x.bin‛ has been created. Now you have to upload the firmware image to Eddy via Web or FTP, save it to Eddy’s flash memory, and reset Eddy. Then Eddy will run as the loaded firmware settings.
5.2 Firmware Upgrade
Upload created firmware file to Eddy and save on the Flash Memory.
Eddy provides four ways of upgrading method.
FTP
Web Browser
Upload a firmware image using FTP program, and execute the upgrade command to save it to the Flash memory using Telnet.
Connect to Web server of Eddy and save a firmware to the Flash memory.
Boot Loader
Please refer Eddy_User_Guide for detail information.
Use the boot loader which operates on booting to save a firmware through the debugging port of Eddy DK board.
Please refer ‚the chapter 9: System Recovery‛ for detail.
USB
Use USB client port of Eddy DK board to upload a firmware.
Please refer ‚the chapter 9: System Recovery‛ for detail.
This section explains how to upload a firmware using a FTP.
On Windows, FTP can be used in cmd(command prompt) to carry out upload process.
Upload the created firmware, ‚eddy-fs-2.1.x.x.bin‛, to the /tmp directory of Eddy, using an FTP.
78
Chapter 5.
Creating Firmware
[shlee@localhost firmware]$ ftp 192.168.0.223
Connected to 192.168.0.223.
Name (192.168.0.223:shlee): eddy
331 Please specify the password.
Password:
230 Login successful. ftp> cd /tmp
250 Directory successfully changed. ftp> bin
200 Switching to Binary mode. ftp> put eddy-fs-2.1.x.x.bin
local: eddy-fs-2.1.x.x.bin remote: eddy-fs-2.1.x.x.bin
227 Entering Passive Mode (192,168,0,223,195,50)
150 Ok to send data.
226 File receive OK.
2104287 bytes sent in 0.47 seconds (4.3e+03 Kbytes/s) ftp> bye
221 Goodbye.
[shlee@localhost firmware]$
Use Telnet to check ‚eddy-fs-2.1.x.x.bin‛ file is in the /tmp directory.
Use ‚upgrade eddy-fs-2.1.x.x.bin‛ command to update the firmware.
# pwd
/tmp
# ls eddy-fs-2.1.x.x.bin eddy-fs-2.1.x.x.bin
#
# upgrade eddy-fs-2.1.x.x.bin
FileSystem Erase ... 2388341 Bytes
FileSystem Write ... eddy-fs-2.1.x.x.bin, 2388341 Bytes
2388341 (2388341 bytes)
Flash Write OK
Flash Verify OK
…
In order for the updated firmware to take effect, you need to reboot the module.
After rebooting you can see the sample program running using Telnet program as shown below.
79
Chapter 5.
Creating Firmware
Eddy login: eddy
Password:
# cd /sbin
# ls hello_world ifconfig nameif switch_root com_redirect ifdown pinetd sysctl
…
# ps -ef
PID USER COMMAND
1 root init
.
.
2 root [posix_cpu_timer]
3 root [softirq-high/0] xx root /sbin/hello_world 1
Execution result of application program only output to the console port of Eddy. The console is a debug port of Eddy DK board and only execution result of application program is generated.
The result can be seen on a computer screen using a serial emulator program such as hyper-terminal on Windows by connecting the debug port to PC and setting communication speed to 115K, None, 8,
1.
Welcome to Eddy !
Welcome to Eddy !
Welcome to Eddy !
Welcome to Eddy !
Welcome to Eddy !
Welcome to Eddy !
Welcome to Eddy !
80
Introduction
Chapter 6. Library
Chapter 6. Library Introduction
This chapter introduces useful libraries and API functions that are applicable with Eddy-Serial DK.
6.1 Introduction
All the functions introduced in this chapter are all APIs included in SB_APIs.a of
/src/Eddy_APPs/SB_APIs directory. You also need to mention this library in the Makefile. All sample source codes accompanied with Eddy-DK use this library, and you can see the source codes and
Makefile for more information.
6.2 Makefile
Library is in /src/Eddy_APPs/SB_APIs/ directory, as a form of SB_API.a.
You need to specify in the Makefile in order to use this library, so please refer to the Makefile inside
/src/Eddy_APPs/ folder.
6.3 System functions
Timer and delay functions needed for making application program.
SB_SetPriority
Function Specifies priority level of task.
Format
Parameter
Void SB_SetPriority (int Priority_Level);
Priority_level Low (1) ~ High (99)
Returns
Notice
SB_GetTick
None
Configures the priority level of task execution to the system.
The lowest level is 1, whereas the highest level is 99.
It is recommended to set level below 50; and when a certain task’s level is set above 50, that task will be executed prior to others, possibly affecting other tasks’ operation.
81
Chapter 6. Library
Introduction
Function Returns time measured after Eddy has been booted in msec.
Format Unsigned long SB_GetTick (Void);
Parameter None
Returns 0 ~ 4,294,967,295
Notice Returned value is system tick counter in msec unit.
After it reaches the maximum value 0xffffffff of unsigned long type, it starts from zero again - which is about period of 50 days.
SB_msleep
Function
Format
Parameter
Returns
Notice
SB_AliveTime
Function
Delays in msec unit. void SB_msleep (int msec); msec Configure delay time in msec unit. none
Delays in exact msec unit.
Format
Parameter
Returns
Notice
*day
*hour
*min
*sec
None
Returns time measured after Eddy has been booted in day, hour, minute, and second. void SB_AliveTime (int *day, int *hour, int *min, int *sec);
Days Eddy has been operationg (0 ~ )
Hour (0 ~ 23)
Minute (0 ~ 59)
Second (0 ~ 59)
6.4 Eddy Environment Function
Environment functions related with Eddy File System which gives information such as Eddy’s version, environment configuration, version, etc.
SB_GetVersion
Function Reads version of O/S, file system, and bootloader ported to Eddy in string type.
82
Chapter 6. Library
Introduction
Format void SB_GetVersion (int type, char *version);
Parameter
Returns
Notice type
Version
None
Specifies the version function reads.
‘B’: Eddy’s bootloader version
‘K’: Eddy’s O/S version
‘F’: Eddy’s file system version
Pointer where version information string will be stored.
Version information will be read like ‚1.0a.‛
BootLoader and O/S will be provided by SystemBase; therefore these cannot be changed. In case file system is programmed by the user, the version can be set by the user.
When the parameter type other than ‘B’ ,’K’, ‘F’ are called, the function will return ‚0.00‛ as version information.
SB_ReadConfig
Function Reads Eddy’s operating environment configuration file.
Format
Parameter
Returns
Notice void SB_ReadConfig (char *FileName, char *Dest, int Size);
FileName
*Dest
File name that includes the path of the file to be read.
Pointer to the buffer in which the configuration file will be stored.
The size of the file to be read. Size
Error Code Returns 1 if succeeded, -1 if failed.
Configuration file in Eddy is stored in /etc, /flash. Configuration changes made through web or telent is stored here and all Eddy applications operates with respect to configuration files here.
SB_WriteConfig
Function Saves Eddy’s operating environment configuration information into file.
Format
Parameter void SB_WriteConfig (char *FileName, char *Source, int Size);
FileName
Source
File name that includes path of the file to be written.
Pointer to the struct buffer in which the configuration information is saved.
Size of the struct to be written.
Return 1 if succeeded, -1 if failed. Returns
Notice
Size
Error Code
SB_GetSharedMemory
83
Chapter 6. Library
Introduction
Function Reads pointer to registered shared memory.
Format void *SB_GetSharedMemory (int Key_ID, int Buffer_Size);
Parameter
Returns
Notice
Key_ID ID of registered shared menory
Buffer_Size Size of shared memory used
*buffer_address Memory address of shared memory
Returns -1 upon failure.
Portview is Windows application developed by SystemBase which can remotely monitor Eddy’s operating condition. In contrast, SNMP server, which provides basically same function as Portview, is industry’s standard monitoring protocol S/W developed by 3Com, Cysco, etc. and sold in hundreds of thousands of U.S. dollars.
To be compatible with both of the applications, each application in Eddy uses shared memory to store information and send the information to
Portview and SNMP.
Note that PortView and SNMP Agent has to be set in the environment configuration.
SB_SetSharedMemory
Function Requests shared memory to be used and reads memory pointer.
Format
Parameter
Returns
Notice void *SB_SetSharedMemory (int Key_ID, int Buffer_Size);
Key_ID ID of shared memory to be registered
Buffer_Size Size of shared memory to be used
*buffer_address Memory address of shared memory
Returns -1 upon failure.
In Eddy, this function is used for PortView and SNMP agent.
User can use this function to access shared memory for other purpose.
6.5 Serial functions
These functions are used to handle internal serial port and UART.
SB_OpenSerial
Function Opens serial port.
Format
Parameter int SB_OpenSerial (int Port_No);
Port_No Serial port number
0: First serial port
1: Second serial port
84
Introduction
Chapter 6. Library
Returns
Notice
-1 ~ N
(Only available for Eddy-CPU, Eddy-DK)
Opened serial port handle
-1: Open error
N: Opened serial port handle
Eddy provides maximum two serial ports; however for normal model where Eddy-CPU is mounted, Eddy only provides one serial port.
DK board has two on-board serial ports. User can use both of the serial ports if the user sets DIP switch on DK board to make it recognized as
Eddy-CPU or Eddy-DK.
SB_InitSerial
Function
Format
Parameter
Initialize data communication configuration of serial port.
Void SB_InitSerial (int Handle, char Speed, char LCR, char Flow);
Handle
Speed
Serial port handle acquired from OpenSerial
Baud rate
0 : 150 BPS,
2 : 600 BPS
4 : 2400 BPS
6 : 9600 BPS
8 : 38400 BPS
10 : 115200 BPS
12 : 460800 BPS
1 : 300 BPS
3 : 1200 BPS:
5 : 4800 BPS
7 : 19200 BPS
9 : 57600 BPS
11 : 230400 BPS
13 : 921600 BPS
LCR X X P P S D D (8 bit binary)
P P : Parity Bits
0 0 : None, 0 1 : Odd, 1 0, 1 1: Even
S : Stop Bits
0 : 1 bits, 1 : 2 bits
D D : Data Bits
0 0 : 5 bits, 0 1 : 6 bits
1 0 : 7 bits, 1 1 : 8 bits
FlowControl Types of flow control
0: no flow control
None
1: RTS/CTS flow control
2: Xon/Xoff flow contorl
Returns
Notice
SB_SendSerial
Function Send data to the serial port.
85
Chapter 6. Library
Introduction
Format Void SB_SendSerial (int handle, char *data, int length);
Parameter
Returns
Notice handle data length
Handle to serial port or socket
Pointer to the data to be sent
Length of the data to be sent
None
When the transmit buffer is full, this function will retry up to 10 time in
20 msec period; it will return after transmission is completed.
SB_ReadSerial
Function
Format
Parameter
Returns
Notice
Reads data from the serial port. int SB_ReadSerial (int handle, char *data, int length, int wait_msec); handle data length wait_msec
Handle to serial port.
Buffer pointer where the read data will be saved.
Size(length) of the buffer memory
Time the function will wait for next received data after
0 ~ n reading from read buffer.
Size of the read data
When wait_msec is set to 0 this function will only read data from serial receive buffer; when set larger than 0, it will read data from serial receive buffer, wait for time specified in msec unit, and then continue reading data from serial port as one packet.
The maximum size of the data is same as buffer’s size, i.e. length.
You can use value obtained from SB_GetDelaySerial function or value manually calculated for wait_msec.
SB_GetMsr
Function
Format
Parameter
Returns
Notice
Reads MSR register value from serial port
Char SB_GetMsr (int handle); handle
Value
Handle to serial port.
MSR Register 값
Bit 7 6 5 4 3 2 1 0
Bit0: CTS change
Bit1: DSR change
Bit2: RI change
Bit3: DCD change
Bit4: CTS (0:Low, 1:High)
Bit5: DSR (0:Low, 1:High)
Bit6: RI (0:Low, 1:High)
Bit7: DCD (0:Low, 1:High)
86
Chapter 6. Library
Introduction
SB_SetRts
Function
Format
Parameter
Controls RTS signal line of the serial port.
Void SB_SetRts (int handle, int value); handle
Value
None
Handle to serial port.
0: off Set RTS signal to low.
1: on Set RTS signal to high.
Returns
Notice
SB_SetDtr
Function
Format
Parameter
Returns
Notice
Controls DTR signal line of the serial port.
Void SB_SetDtr (int handle, int value); handle
Value
None
Handle to serial port.
0: off Set DTR signal to low.
1: on Set DTR signal to high.
6.6 Ethernet functions
These functions deal with the network-related information of Eddy.
These functions are optimized socket API for Eddy, and user can use other API for development by using his or her own POSIX compatible standard socket API.
SB_GetIp
Function Reads IP address assigned to Eddy.
Format
Parameter
Returns
Notice
Unsigned int SB_GetIp (char *interface);
Interface Network interface name.
‚eth0‛ for WAN port.
‚eth1‛ for LAN port.
Unsigned int returns IP address in unsigned int type.
Note that the function returns operating IP address, not the IP address configured in Eddy. When Eddy is operating as a DHCP Client, this function read network IP address assigned from DHCP server.
Please see below for transforming IP address into string type.
87
Chapter 6. Library
Introduction struct in_addr addr; addr.s_addr = SB_GetIp (); printf ("IP Address : %s ", inet_ntoa(addr));
SB_GetMask
Function
Format
Reads subnet mask address assigned to Eddy.
Unsigned int SB_GetMack (char *interface);
Parameter
Returns
Notice
SB_GetGateway
Interface Interface name to be read
‚eth0‛ for WAN port.
‚eth1‛ for LAN port.
Unsigned int Returns mask address in unsigned int type
Please see SB_GetIp also
Function Reads gate address assigned to Eddy.
Format
Parameter
Returns
Notice
SB_ConnectTcp
Function
Unsigned int SB_SetGeteway(void);
None
Unsinged int Returns gate address in unsigned int type
Please see SB_GetIp also
Format
Parameter
Returns
Notice
Make connection to the server specified as TCP socket.
Int SB_ConnectTcp (char *IP_Address, int Socket_No, int Wait_Sec, int Tx_Size, int Rx_Size);
IP_Address
Socket_No
Wait_Sec
IP address to connect in string type
Socket number of the server to connect
Wait time for connection (in seconds)
Tx_Size
Rx_Size
-1 ~ N
Tx buffer size of the socket (in K bytes)
Rx buffer size of the socket (in K bytes)
Handle number of the connected socket
-1: Connection failure
N: Handle number to the connected socket
If the connection is not made, the function t will try to re-connect for time specified in wait_sec and return.
Tx,Rx_Size are size of the socket buffer size. These can be set from 1 to
64.
If it is set to number smaller than 1, size will 4kbytes as default; number larger than 64 will set size of the buffer to 64kbytes as default.
88
Chapter 6. Library
Introduction
SB_ListenTcp
Function
Format
Parameter
Returns
Notice
Wait for connection to TCP socket
Int SB_ListenTcp (int Socket_No, Int Tx_Size, int Rx_Size);
Socket_No
Tx_Bytes
Rx_Bytes
-1 ~ N
TCP socket number to wait for connection
Tx buffer size of the socket (in K bytes)
Rx buffer size of the socket (in K bytes)
Handle number of the TCP socket waiting for connection
-1: Socket connection waiting failure
N: Handle number of the TCP socket waiting for connection
As a non-blocking function, this function requests connection and returns without waiting for connection. SB_AcceptTcp will handle waiting for connection.
Tx,Rx_Size are size of the socket buffer size. These can be set from 1 to
64.
If it is set to number smaller than 1, size will 4kbytes as default; number larger than 64 will set size of the buffer to 64kbytes as default.
SB_AcceptTcp
Function
Format
Parameter
Returns
Notice
Waits for network connection of TCP socket handle.
Int SB_AcceptTcp (int Socket_No, int wait_msec);
Socket_No wait_msec
-1 ~ N
TCP socket handle number to wait for connection.
(Return value of SB_ListenTcp)
Connection standby time (in msec)
New handle number of connected TCP socket.
-1: Socket error
0: Waiting for connection
N: New handle number of connected TCP socket.
When new handle number is given after connection is made, previous handle that has been waiting will be closed inside this function.
SB_AcceptTcpMulti
Function
Format
Grants network multiple connection of TCP socket handle waiting for connection.
Int SB_AcceptTcpMulti (int Socket_No, int wait_msec);
89
Chapter 6. Library
Introduction
Parameter
Returns
Notice
Socket_No wait_msec
-1 ~ N
TCP socket handle number waiting for connection.
(Return value of SB_ListenTcp)
Connection standby time (in msec)
New handle number of connected TCP socket.
-1: Socket error
0: Waiting for connection
N: New handle number of connected TCP socket.
When new handle number is given after connection is made, it will not close previous handle waiting for connection, granting maximum of 1024 socket connection.
SB_ReadTcp
Function Read data from connected TCP socket.
Format
Parameter
Returns
Notice
Int SB_ReadTcp (int Handle, char *Buffer, int Buffer_Size);
Handle
Buffer
Buffer_Size
-1 ~ N
Handle number of connected TCP socket
Buffer point where packet data to be read will be saved
Size of the buffer to save
Size of the data read.
-1: Socket error
0: No data was read
N: Length of the data read
When return code is -1, it means the connection is lost with the client so user has to close TCP socket handle.
SB_CloseTcp
Function
Format
Parameter
Returns
Notice
Close TCP socket handle.
Int SB_CloseTcp (int Handle);
Handle
None
TCP socket handle number to close
This function shuts down socket handle to finish communication and closes.
SB_BindUdp
Function
Format
Parameter
Returns
Binds UDP socket.
Int SB_BindUdp (int Socket_No);
Socket_No
Handle
UDP socket number to bind
Handle number bound to UDP socket
90
Chapter 6. Library
Introduction
-1: Bind failure
N: Handle number bound to UDP socket
Notice
SB_ReadUdp
Function
Format
Parameter
Returns
Notice
Reads data transmitted to UDP socket bound in network.
Int SB_ReadUdp (int Handle, char *Buffer, int Buffer_Size);
Handle
Buffer
Buffer_Size
-1 ~ N
Handle number bound to UDP socket
Buffer point where packet data to be read will be saved
Size of the buffer to save
Size of the data read.
-1: Socket error
0: No data was read
N: Length of the data read
When client sends data to bound UDP socket, this function remembers client’s IP address and socket number for SB_SendUdpServer to use.
SB_SendUdpServer
Function Transmits data to UDP socket. (Server mode)
Format
Parameter
Returns
Notice
Int SB_SendUdpServer (int Handle, char *Buffer, int Data_Size);
Handle
Buffer
Data_Size
Handle number bound to UDP socket
Buffer point where packet data to be sent is saved
Size of the buffer to send
None
This function can be called after confirming client’s network information by sending data to UDP socket bound to Eddy from network; that is, user has to call SB_ReadUdp first.
When data transmission has to be made first, user has to use
SB_SendUdpClient function.
SB_SendUdpClient
Function Transmit data to UDP socket (Client mode)
Format
Parameter
Int SB_SendUdpClient (int Handle, char *Buffer, int Data_Size,
Char *IP_Address, int Socket_No);
Handle Handle number bound to UDP socket.
Buffer Buffer point where packet data to be sent is saved.
91
Chapter 6. Library
Introduction
Returns
Notice
Data_Size
IP_Address
Socket_No
None
Size of the buffer to send.
IP address to send data to.
Socket number to send data to.
This function can be used when user already knows destination network information to send data to using UDP socket.
When data transmission has to be made first, user has to use
SB_SendUdpClient function..
6.7 GPIO Functions
GPIO functions control up to 56 GPIO ports provided by Eddy-CPU, 34 GPIO ports provided by
Eddy-S4M
They can spot 3.3V power or control writes with individual GPIO port.
Pins provided by Eddy CPU/S4M are public pins that can be used to control other devices and are not used solely for GPIO.
Eddy CPU/S4M provides 32 signal lines as 3 port groups; Port A, B, C.
Each port in Port A, B, C can be configured to be used as device or GPIO. They can be configured in
Web.
Please refer to sample source ‘ testdk.c
’ in Eddy_Apps directory for precise usage.
Eddy-CPU GPIO Table
92
The Yellow parts can all be used as GPIO ports if they are not used as devices.
Section
S0 ~ S3
Debug
Description
Serial Port 1 ~ 4
Debug Port
Number of Ports
20
2
Chapter 6. Library
Introduction
Reset
Rdy
ADC
LAN
EEPROM
Reset
Ready LED
Analog Digital Converter
LAN Port
SPI (EEPROM)
NAND
KEY
*
NAND Flash
Key Pad
GPIO & User Peripheral
Eddy-S4M GPIO Table
1
1
4
2
4
2
8
12
93
Section Description
ADC Analog Digital Converter
Number of GPIO
2
* GPIO & User Peripheral 32
Each port in Port A, B, C can be shown as 32 GPIO ports. So GPIO ports are shown as each bit in 4 byte int variable in program. struct eddy_gpio {
Unsigned int value [3];
Port A, B, C
Unsigned int mode [3];
Port A, B, C
Unsigned int pullup [3];
// Read/write value for each GPIO channel in
// Configure read/write for each GPIO channel in
// Pullup/Pulldown when configuring write
// for each GPIO channel in Port A, B, C
// Whether to use GPIO for each GPIO channel Unsigned int enable [3]; in Port A, B, C
};
Chapter 6. Library
Introduction enable: 0
disable (Do not use as GPIO), 1 Enable (use as GPIO) mode: 0
Set as input mode,, 1 Set as output mode value: 0
Read/Write status is set to Low, 1 Read/Write status is set to High pullup: 0
pulldown, 1 pullup
SETGPIOINIT
Function
Format
Parameter
Returns
Notice
Initializes ports that will be used as GPIO after boot. void ioctl(int fd, SETGPIOINIT, struct *gpio_struct); fd gpio_struct
Handle to GPIO device(‚/dev/eddy_gpio‛)
Pointer to the struct which stores GPIO table value in
/etc/eddy_gpio.cfg with GPIO configuration file registered in Web configuration. struct gpio_struct {
unsigned int value[3];
unsigned int mode[3];
unsigned int pullup[3]; unsigned int enable[3]; };
None
Eddy-CPU provides maximum GPIO ports of 56.
Eddy-S4M provides maximum GPIO ports of 34.
That is when using only WAN and when devices such as serial ports,
ADC, Rese, RDY LED… are used, number of available GPIO ports decreases.
This command initializes available GPIO ports leaving the devices that are registered in configuration in Pinetd.c after boot so users don’t have use this command. When used, users need to be careful.
For instance, if a serial port is enabled through web configuration and
Eddy is rebooted, the port acts as a serial port, not a GPIO port. But when this port is forced to be used as GPIO port with this command, the application that uses this serial port will not operate properly.
SETGPIOMOD_LM
Function
Format
Sets Read/Write direction for all Port A, B, C void ioctl(int fd, SETGPIOMOD_LM, int *mode[3]);
94
Chapter 6. Library
Introduction
Parameter
Returns
Notice fd mode
Handle to GPIO device(‚/dev/eddy_gpio‛)
Pointer to the buffer that stores ‚mode‛ value for
Port A, B, C.
Bit value 0 means input, 1 means output.
None
Any value is ok for bits that are not set to be used GPIO
GETGPIOMOD_LM
Function Reads Read/Write direction for all Port A, B, C
Format
Parameter void ioctl(int fd, GETGPIOMOD_LM, int *mode[3]); fd mode
Handle to GPIO device(‚/dev/eddy_gpio‛)
Pointer to the buffer that will store the ‚mode‛ value of Port A, B, C
Returns
Notice
SETGPIOVAL_LM
None
Function
Format
Sets output value when Port A, B, C are all in output mode. void ioctl(int fd, SETGPIOVAL_LM, int *value[3]);
Parameter
Returns
Notice
GETGPIOVAL_LM fd mode
Handle to GPIO device(‚/dev/eddy_gpio‛)
Pointer to the buffer that stores the ‚value‛ value of Port A, B, C.
Bit value 0 means Low, 1 means High.
None
Any value is ok for bits that are not set to be used GPIO
Function Reads Read/Write status value for Port A, B, C
Format
Parameter void ioctl(int fd, GETGPIOVAL_LM, int *mode[3]); fd mode
Handle to GPIO device(‚/dev/eddy_gpio‛)
Pointer to the buffer that will store the ‚value‛ value of Port A, B, C
Returns
Notice
SETGPIOPUL_LM
None
95
Chapter 6. Library
Introduction
Function Sets pullup value when Port A, B, C are all in input mode.
Format void ioctl(int fd, SETGPIOVAL_LM, int *value[3]);
Parameter
Returns
Notice
GETGPIOPUL_LM fd mode
Handle to GPIO device(‚/dev/eddy_gpio‛)
Pointer to the buffer that stores the ‚pullup‛ value of Port A, B, C.
Bit value 0 means Pulldown, 1 means Pullup.
None
Any value is ok for bits that are not set to be used GPIO
Function Reads Read/Write status value for Port A, B, C
Format void ioctl(int fd, GETGPIOVAL_LM, int *mode[3]);
Parameter fd mode
Handle to GPIO device(‚/dev/eddy_gpio‛)
Pointer to the buffer that will store the ‚pullup‛ value of Port A, B, C
Returns
Notice
None
SETGPIOMOD_LA
SETGPIOMOD_LB
SETGPIOMOD_LC
Function Sets Read/Write direction for one of Port A, B, C
Format void ioctl(int fd, SETGPIOMOD_L?, int *mode[3]);
Parameter
Returns
Notice fd mode
None
Handle to GPIO device(‚/dev/eddy_gpio‛)
Pointer to the buffer that stores ‚mode‛ value.
Bit value 0 means input, 1 means output.
Any value is ok for bits that are not set to be used GPIO
GETGPIOMOD_LA
GETGPIOMOD_LB
GETGPIOMOD_LC
Function Reads Read/Write direction for one of Port A, B, C
Format
Parameter void ioctl(int fd, GETGPIOMOD_L?, int *mode[3]); fd Handle to GPIO device(‚/dev/eddy_gpio‛)
96
Chapter 6. Library
Introduction mode Pointer to the buffer that will store the ‚mode‛ value.
Returns
Notice
SETGPIOVAL_LA
SETGPIOVAL_LB
SETGPIOVAL_LC
Function
None
Sets output value when Port is in output mode.
Format void ioctl(int fd, SETGPIOVAL_L?, int *value[3]);
Parameter
Returns
Notice
GETGPIOVAL_LA
GETGPIOVAL_LB
GETGPIOVAL_LC
Function fd mode
Handle to GPIO device(‚/dev/eddy_gpio‛)
Pointer to the buffer that stores the ‚value‛ value.
Bit value 0 means Low, 1 means High.
None
Any value is ok for bits that are not set to be used GPIO
Reads Read/Write status value for one of Port A, B, C
Format void ioctl(int fd, GETGPIOVAL_L?, int *mode[3]);
Parameter fd mode
Handle to GPIO device(‚/dev/eddy_gpio‛)
Pointer to the buffer that will store the ‚value‛ value.
Returns
Notice
None
SETGPIOPUL_LA
SETGPIOPUL_LB
SETGPIOPUL_LC
Function Sets pullup value when Port is in input mode.
Format
Parameter
Returns
Notice void ioctl(int fd, SETGPIOVAL_L?, int *value[3]); fd mode
Handle to GPIO device(‚/dev/eddy_gpio‛)
Pointer to the buffer that stores the ‚pullup‛ value.
Bit value 0 means Pulldown, 1 means Pullup.
None
Any value is ok for bits that are not set to be used GPIO
97
Chapter 6. Library
Introduction
GETGPIOPUL_LA
GETGPIOPUL_LB
GETGPIOPUL_LC
Function Reads Read/Write status value for one of Port A, B, C
Format
Parameter
Returns
Notice void ioctl(int fd, GETGPIOVAL_L?, int *mode[3]); fd mode
None
Handle to GPIO device(‚/dev/eddy_gpio‛)
Pointer to the buffer that will store the ‚pullup‛ value.
6.8 ADC Function
Eddy CPU provides 4 channels of ADC(Analog Digital Converter).
Eddy DK board has temperature and illumination sensor for testing and the status of the sensors can be checked in real time with ADC.
Sample program ‚ Eddy_Apps/test_adc.c
‛ uses ADC interface so users can refer to this source for developing programs.
ADCSETCHANNEL
Function Configures whether to use 4 channels of ADC device or not.
Format
Parameter
Returns
Notice void ioctl(int fd, ADCSETCHANNEL, int *channel); fd mode
None
Handle to ADC device(‚/dev/adc‛)
Pointer to the buffer that stores channel configuration
X X X X X X X X (bits)
| | | |----- channel 1 (temperature sensor)
| | |--------- channel 2 (illumination sensor)
| |------------- channel 3 (future use)
|----------------- channel 4 (future use)
ADCGETVALUE
Function
Format
Parameter
Reads operation status of 4channels of ADC device void ioctl(int fd, ADCGETVALUE, struct adc_struct *channels); fd mode
Handle to ADC device(‚/dev/adc‛)
Pointer to the buffer that will store channel operation status
98
Chapter 6. Library
Introduction
Returns
Notice
None
Struct adc_value {
int ch1_value;
int ch2_value;
int ch3_value;
int ch4_value;
};
6.9 RTC Function
Eddy CPU provides separate RTC(Real Time Clock) in DK.
Date and time can be configured through program or with Date and rdate provided by Busybox.
Sample program ‚Eddy_Apps/test_rtc.c‛ uses RTC device so users can refer to this source for developing programs.
RTC_SET_TIME
Function Configures date and time in RTC device
Format
Parameter void ioctl(int fd, RTC_SET_TIME, struct tm *tm); fd tm
None
Handle to RTC device(‚/dev/rtc0‛)
Pointer to struct that stores date and time to be configured. Compatible with struct tm for Linux standard time interface.
Returns
Notice
RTC_RD_TIME
Function Reads date and time from RTC device
Format
Parameter
Returns
Notice void ioctl(int fd, RTC_RD_TIME, struct tm *tm); fd tm
None
Handle to RTC device(‚/dev/rtc0‛)
Pointer to struct that will store date and time read.
Compatible with struct tm for Linux standard time interface.
6.10 Debugging Function
Eddy can debug operating condition of each application via Telnet in real time.
The following functions are used to print debug log message to Telnet window when SB_DEBUG of
99
Chapter 6. Library
Introduction each application is set ON.
SB_LogDataPrint
Function Print each byte of data in hex or ascii code.
Format
Parameter
Returns
Notice void SB_LogDataPrint (char *RTx, char *buff, int data_len);
*RTx
*Buff
Data_len
Description message of data
Buffer address of data to be printed is saved/
Size of data.
None
Prints messages to telnet which logged in first.
The message include Eddy’s tick counter of 1msec unit and printed in following form.
SB_LogDataPrint (‚Send‛, ‚\t12345\n‛, 8);
[191020202] Send 8 = 08,1,2,3,4,5,0d,0a
-------------- ------- ------ -----------------------
Tick Counter RTx data_Len buff
Debugging of each application in Eddy can be configured as follows by using Def command. (Please see def.c)
# def po <1/2/all> debug <on/off>
SB_LogMsgPrint
Function Prints in the same format as Printf.
Format
Parameter
Returns
Notice void SB_LogMsgPrint (const char *Format, . . . );
*Format Format of Printf
None
Prints messages to telnet which logged in first.
The message include Eddy’s tick counter of 1msec unit and printed in following form.
SB_LogMsgPrint (‚%s means Real-Time\n‛, ‚Eddy‛);
[191020202] Eddy means Real-Tile
Debugging of each application in Eddy can be configured as follows by using Def command. (Please see def.c)
# def po <1/2/all> debug <on/off>
100
Eddy Software
Chapter 7.
Chapter 7. Eddy Software
This chapter explains software structure ported to Eddy-DK.
Source codes for all application except Com_redirect, gdbserver, tae, SB_APIs library are disclosed.
All disclosed source codes may be used as development guide when programming a firmware.
7.1 Software Structure Diagram
Eddy.c is the first program to be executed upon the booting. Environment Configure Information configured either by web or def.c is loaded next.
All provided Eddy applications developed by using libraries explained on Chapter 6.
101
Eddy Software
Chapter 7.
7.2 Main Applications
This section explains the most important aspects of Eddy, eddy.c and pinetd.c.
Applications other than these two can be divided into monitoring applications executed by pinetd.c and user applications manually executed by users. Please refer ‚4.1 Source Code‛ for brief explanation of functions of each application.
7.3 eddy.c Application
Program runs the first after Eddy is booted, it reads the environment configuration saved under /flash folder.
This initializes network with configuration information , and runs various daemon program.
If environment file is not present on /flash, it will reset the environment configuration to factory setting.
7.4 Pinetd.c Application
It is a daemon program with the highest hierarchy of Eddy run by Eddy.c, which monitors lower processor.
It periodically monitors the Reset Switch to detect a factory reset request.
7.5 Other Applications
The list of applications runs according to the defined protocol of each serial port: tcp_server, tcp_client, com_redirect, tcp_broadcast, tcp_multiplex, udp (udp_server/client)
The list of applications runs to handle external network service independently to serial ports: portview, detect, ddns_agent
The list of applications can be manually run using telnet.
Def, upgrade, loopback,
The list of applications to test Eddy DK v2.1 board and a device: test_sio, test_dio, test_lcd, test_keypad, test_spi_eeprom, test_nand, test_sd, test_adc, test_gpio_pin, test_gpio_led
102
HTML & CGI
Chapter 8. Handling
Chapter 8. Handling HTML & CGI
This chapter describes the CGI module for the environment configuration used by HTML files and
HTML codes. Provided CGI source and HTML documents are used as Eddy’s default firmware, and it is modifiable as needed.
8.1 WEB Configuration
HTML sources for Eddy are located on src/Eddy_APPs/web/htdocs.
CGI sources containing information for HTML is located on src/Eddy_APPs/web/cgi. getagent.c
It reads environment configuration file of /etc folder and transfers configuration value to the HTML page to show the information on the web browser. setagent.c
It reads configuration value modified by a user on the HTML page and saves the value to a temporary environment configuration file on /etc.
8.2 Example of HTML Code
The following example shows a part of main.html source.
Coding is executed with values handed over from the CGI and linked symbols, due to the coding cannot be done on a HTML using variables like on the C language.
Shown in red below are symbol link which transfers value from getagent.c.
(network.html 소스 요약)
<tr bgcolor="#FFFFFF">
<td class="content">IP Address</td>
<td class="content"><input type="text" size="16" maxlength="16" name ="N_IP " value="[v ,n_ip ]" >
<tr bgcolor="#FFFFFF">
<td class="content">Subnet Mask</td>
<td class="content"><input type="text" size="16" maxlength="16" name=" N_MASK " value="[v, n_mask ]" >
<tr bgcolor="#FFFFFF">
<td class="content">Gateway</td>
<td class="content"><input type="text" size="16" maxlength="16" name=" N_GW " value="[v, n_gw ]" >
<tr bgcolor="#FFFFFF">
103
Chapter 8. Handling
HTML & CGI
<td class="content">DNS</td>
<td class="content"><input type="text" size="16" maxlength="16" name=" N_DNS " value="[v, n_dns ]"
>
<tr bgcolor="#FFFFFF">
<td class="content">Telnet Service</td>
<td class="content"><select name=" N_TELNET ">
<option [v, n_telnet_di ] value="0">Disable</option>
<option [v, n_telnet_en ] value="1">Enable</option>
</select>
<tr bgcolor="#FFFFFF">
<td class="content">Telnet Service</td>
<td class="content"><select name=" N_WEB ">
<option [v, n_web_di ] value="0">Disable</option>
<option [v , n_web_en ] value="1">Enable</option>
</select>
As shown above there are name and value parts for each record to link with CGI.
Name stores information modified by user in HTML, so that it can save modified value when a user click on the submit button on the lower part of HTML page. Value reads value to getagent.c to display on HTML page and let user to modify the value as needed.
8.3 Example CGI Code
Eddy-Serial DK has two CGI programs: getagent.cgi and setagent.cgi.
‚getagent.c‛ reads an environment configuration file on /etc/ folder to HTML document , and
‚setagent.c‛ saves user-modified information on the HTML document back the environment file on
/etc/folder and saves it to flash/, so the user-modified environment configuration is stored.
The following example shows processing part of getagent.c to display configuration value to HTML page as the example above.
[Source Summary]
if (cgiFormStringNoNewlines(" N_IP ", buff, 16) == cgiFormNotFound)
{ sprintf(buff, cfg.system.ip[1],cfg.system.ip[2],cfg.system.ip[3]);
"%d.%d.%d.%d",cfg.system.ip[0], listPutf(list, " n_ip ", buff);
}
else listPutf(list, " n_ip ", buff);
if (cgiFormStringNoNewlines(" N_MASK ", buff, 16) == cgiFormNotFound)
{ sprintf(buff, "%d.%d.%d.%d",cfg.system.mask[0], cfg.system.mask[1], cfg.system.mask[2],cfg.system.mask[3]);
104
Chapter 8. Handling
HTML & CGI
}
else listPutf(list, " n_mask ", buff); listPutf(list, " n_mask ", buff);
if (cgiFormStringNoNewlines(" N_GW ", buff, 16) == cgiFormNotFound)
{ sprintf(buff, "%d.%d.%d.%d", cfg.system.gateway[0], cfg.system.gateway[1], cfg.system.gateway[2],cfg.system.gateway[3]); listPutf(list, " n_gw ", buff);
}
else listPutf(list, " n_gw ", buff); if (cgiFormStringNoNewlines(" N_DNS ", buff, 16) == cgiFormNotFound)
{ sprintf(buff, "%d.%d.%d.%d",cfg.system.dns[0], cfg.system.dns[1], cfg.system.dns[2],cfg.system.dns[3]); listPutf(list, " n_dns ", buff);
} else listPutf(list, " n_dns ", buff); cgiFormInteger ("N_TELNET ", &value, cfg.system.telnet_server); if (value == 1)
{ listPutf(list, " n_telnet_di ", ""); listPutf(list, " n_telnet_en ", "selected");
} else
{ listPutf(list, "n_telnet_di ", "selected"); listPutf(list, " n_telnet_en ", "");
} cgiFormInteger(" N_WEB ", &value, cfg.system.web_server); if (value == 1)
{ listPutf(list, " n_web_di ", ""); listPutf(list, "n_web_en ", "selected");
}
else
{ listPutf(list, " n_web_di ", "selected"); listPutf(list, " n_web_en ", "");
}
The following shows processing part of setagent.c to save user-modified configuration value.
105
Chapter 8. Handling
HTML & CGI
[Source abstract] value2 = cgiFormStringNoNewlines(" N_IP ", buff, 16); if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.ip); value2 = cgiFormStringNoNewlines(" N_MASK ", buff, 16); if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.mask); value2 = cgiFormStringNoNewlines(" N_GW ", buff, 16); if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.gateway); value2 = cgiFormStringNoNewlines(" N_DNS ", buff, 16); if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.dns); cgiFormInteger(" N_TELNET ", &value, cfg.system.telnet_server); cfg.system.telnet_server = value; cgiFormInteger(" N_WEB ", &value, cfg.system.web_server); cfg.system.web_server = value;
106
9. Appendix
Chapter
Chapter 9. Appendix
This chapter explains how to recover Eddy when flash of Eddy is damaged and it cannot be booted.
9.1 System recovery via Bootloader
Even if the flash in the user area has been damaged, it does not affect system booting. But if the system continuously reboots due to user program failure, or if the system is inaccessible as a result of wrong IP setting, you have to change the system to factory default status.
You can reload firmware from bootloader to change the system to default status. In order to do this,
TFTP server has to be installed at the computer with Linux environment.
Note:
Once the bootloader is damaged, it cannot be recovered. Therefore user should not use command other than ones provided from manual.
9.1.1 Installing TFTP in Linux environment
The following explains how to recover system with bootloader in Fedora core 5 operating system.
If you are using other operating system, you will need tftp-server and xinetd daemon compatible with that operating system.
First check to make sure tftp-server is installed.
If you don’t install tftp-server, you should install.
After install tftp-server, move provided firmware (firmware folder in SDK folder) to tftpboot folder
(usually /tftpboot folder in Fedora core 5).
107
Chapter
9. Appendix
9.1.2 Hardware Install and Recovery
Connect LAN port of computer and that of DK board using LAN cable.
Connect debug port and computer’s serial cable using serial cross cable and use minicom to connect to computer’s serial port. Configure computer’s serial port setting to 115200 bps, 8 data bit, No parity,
1 stop bit and power on Eddy DK.
108
After power on the following messages will be printed to minicom.
When these are printed, press enter to enter into bootloader. The below image shows status after entering bootloader.
NAND: 256 MB
Macb0: Autonegotiation complete
Macb0: link up, 100 Mbps full-duplex (lpa: 0x45e1)
Hit any key to stop autoboot: 0
U-Boot>
U-Boot>
You can recover by copying OS, firmware, and config image to flash memory in bootloader.
To upgrade OS, firmware, and config image file, you have to configure Eddy’s virtual IP address and
TFTP server’s IP address in bootloader.
You can use ‚printenv‛ command to check the current configuration of Eddy and TFTP server’s
IP address configured in bootloader.
Chapter
9. Appendix
U-Boot> printenv
.
. ethaddr=00:05:F4:11:22:33
Config_Size=10000 stdin=serial stdout=serial stderr=serial
OS_Size==20000000 filesize=1f0f07 fileaddr=20000000 netmask=255.255.255.0 ipaddr=192.168.0.223
.
. serverip=192.168.0.220
FileSystem_Size=0
U-Boot>
IP Address of Eddy
IP Address of TFTP server
To change Eddy’s temporary IP address and TFTP server’s IP address proceed as follows.
U-Boot> setenv serverip <TFTP server IP address>
U-Boot> setenv ipaddr <Eddy IP address>
U-Boot>
Once the IP information is confirmed start recovery. install bootloader <name of bootloader firmware> ; When recovering bootloader area
(Note: If the bootloader was damaged, it could not be recovered.) install os <name of OS firmware> ; When recovering OS area install fs <name of File System firmware> ; When recovering File System area
109
Chapter
9. Appendix
Proceed as follows and it will recover by downloading image file from TFTP server configured.
The next shows OS recovery procedure.
U-Boot> install os eddy-os-2.1.x.x.bin
TFTP from server 192.168.0.220; our IP address is 192.168.0.223
Filename 'eddy-os-2.1.x.x.bin'.
Load address: 0x20000000
Loading:##########################################################################
######################################################## done
Bytes transferred = 1112284 (10f8dc hex)
.
.
U-Boot>
.
The next shows file system recovery procedure.
U-Boot> install fs eddy-fs-2.1.x.x.bin
TFTP from server 192.168.0.220; our IP address is 192.168.0.223
Filename 'eddy-fs-2.1.x.x.bin'.
Load address: 0x20000000
Loading:##########################################################################
#################################################################################
##############################################################################don e
Bytes transferred = 2035463 (1f0f07 hex)
.
.
U-Boot>
.
Once the recovery is done, use ‚boot‛ command start booting.
U-Boot> boot
9.1.3 Solving problems during recovery
U-Boot> install os eddy-os-21.1.x.x.bin
TFTP from server 192.168.0.220; our IP address is 192.168.0.223
Filename 'eddy-os-21.1.x.x.bin'.
Load address: 0x20000000
Loading: ………………
When recovery is not proceeded with message shown above, check WAN connection and confirm
110
Chapter
9. Appendix the IP address of tftp-server PC is configured as 192.168.0.220. (This server IP address is just example, so it can be differ with user tftp-server PC IP address)
U-Boot> install fs eddy-fs-2.1.x.x.bin
TFTP from server 192.168.0.220; our IP address is 192.168.0.223
Filename 'eddy-fs-2.1.x.x.bin'.
Load address: 0x20000000
Loading
TFTP error: 'File not found' (1)
Starting again
When recovery is not proceeded with message shown above, check firmware version information or name is correct. The red name above has to be same with firmware name of PC with tftp-server installed.
U-Boot> install os eddy-os-21.x.x.bin
TFTP from server 192.168.0.220; our IP address is 192.168.0.223
Filename 'eddy-os-2.1.x.x.bin'.
Load address: 0x20000000
Loading: TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT#TTT#
When recovery is not proceeded with message shown above, it means there is product with same
MAC address or IP in the network. Check whether there are other Eddy products in the same network.
111
Chapter
9. Appendix
9.2 System recovery via USB
Even if the flash in the user area has been damaged, it does not affect system booting. But if the system continuously reboots due to user program failure, or if the system is inaccessible as a result of wrong IP setting, you have to change the system to factory default status.
You can reload firmware via USB to change the system to default status.
9.2.1 Firmware Upgrade Utility Program
The AT91 ISP can be downloaded from the ATMEL Web site at the following URL: http://www.atmel.com/dyn/resources/prod_documents/Install%20AT91-ISP%20v1.12.exe
If the URL does not work properly,
Go to the ATMEL homepage www.atmel.com
Click Product > Microcontrollers > AT91SAM 32-bit ARM-based Microcontrollers > Tools & Software
> Evaluation Kit > AT91SAM9260-EK > AT91-ISP.exe (v1.12 current release)
9.2.2 Installing Upgrade Utility Program
The AT91 ISP can be downloaded from the ATMEL Web site at the following URL: http://www.atmel.com/dyn/resources/prod_documents/Install%20AT91-ISP%20v1.12.exe
If the URL does not work properly,
Double-click ‚AT91-ISP.exe‛ file and begin the installation process, then click Next.
112
Chapter
9. Appendix
On the splash screen, click I Agree.
On the splash screen, click Next.
Browse to the following directory, then click Next.
C:\Program Files\
ATMEL Corporation\AT91-ISP v1.12
113
Click Install.
Click Next.
9. Appendix
Chapter
If you want to create Shortcuts, check Desktop or Quick Launch Bar, then click Next
Check Reboot now then click Finish.
After system reboot, copy the‚isp-extram-at91sam9260.bin‛ file from CD to the following directory:
C:\Program Files\ATMEL Corporation\
AT91-ISP v1.12\SAM-BA v2.8\lib\
AT91SAM9260-EK
After installing the ‚AT91-ISP.exe‛ file, prepare to install the Eddy-DK/S4M-DK board driver.
9.2.3 Installing Eddy DK/S4M Board Driver
To detect the Eddy-DK/S4M-DK board via USB you need to install the Eddy-DK/S4M-DK board driver for Windows as follows.
1) Turn off Eddy-DK/S4M board.
2) Connect USB cable to both the Eddy-DK/S4M-DK board and PC.
3) Set USB as a standby mode by pulling the right side switch down from the S6 dip switch on the Eddy-DK board. (Eddy-S4M board
S1 dip switch)
114
9. Appendix
Chapter
4) Turn on Eddy-DK/S4M-DK board.
5) If Eddy-DK/S4M-DK board is recognize on your PC, maybe a dialogue box will be pop-up for installing new hardware. Choose the recommended mode install the software automatically then click Next.
6) Click Continue Anyway to proceed with installation.
7) Complete the found task. Click Finish to successfully install the driver.
8) Pull up both of S6 Dip switch on Eddy DK v2.1 board (Eddy-S4M S1 dip switch)
9.2.4 Preparing Firmware Files & Utilities
Prepare firmware files and flash writing utility programs as follows.
1) Copy usb_recovery_xxx.zip file to any directory (e.g. C:\SystemBase\USB_recovery) from SDK\Windows\USB_recovery directory in Eddy DK CD. (Refer to the Eddy official community site http://www.embeddedmodule.com)
2) Among files extracted copy isp-extram-at91sam9260.bin file to the below directory.
C:/Program Files/ATMEL Corporation/AT91-ISP v1.12/SAM-BA v2.8/lib/AT91SAM9260-EK
3) Among files extracted copy below listed files to the firmware directory in DK source code directory.
115
Chapter
9. Appendix eddy-bl-2.1.x.x.bin (Boot Loader) eddy-bs-2.1.x.x.bin (Boot Strap File Name) eddy-os-2.1.x.x.bin (Kernel File Name) eddy-fs-2.1.x.x.bin (File System File Name)
4) Among files extracted Eddy_burning_DataFlash.bat file performs transferring firmware to Eddy-DK/S4M-DK board by executing a TCL file then creates a log file.
In this file eddy-bl-2.1.x.x.bin file name should be same with the name of the file copied. sam-ba.exe \usb\ARM0 AT91SAM9260-EK Eddy_burning_DataFlash.tcl
./ eddybl-2.1.x.x.bin
> logfile.log notepad logfile.log
5) Among files extracted Eddy_burning_DataFlash.tcl file performs transferring firmware to Eddy DK v2.1 board. In this file eddy-bs-2.1.x.x.bin, eddy-os-2.1.x.x.bin, and eddy-fs-2.1.x.x.bin file names should be same with the names of the files copied.
…
#################################################################
###
# Main script: Load the linux demo in DataFlash,
# Update the environment variables
#################################################################
### array set df_mapping {
bootstrapFileName " eddy-bs-X.X.X.X.bin
"
kernelFileName " eddy-os-X.X.X.X.bin
"
filesystemFileName " eddy-fs-X.X.X.X.bin
"
9.2.5 Firmware Upgrade
1) Turn off Eddy-DK/S4M-DK board.
2) Connect USB cable to both the Eddy-DK/S4M-DK board and PC.
3) Set USB as a standby mode by pulling the right side switch down from the S6 dip switch on the Eddy-DK board. (Eddy-S4M board
S1 dip switch)
4) Turn on Eddy-DK/S4M board.
5) After 5 seconds change flash writing mode by pulling up both of S6 Dip switch on
Eddy-DK board.
(Eddy-S4M board
S1 dip switch)
116
Chapter
9. Appendix
6) Start upgrade by double-clicking Eddy_burning_DataFlash.bat file. You need to wait some time for seeing the log file after executing the batch file.
7) With the successful log message as below you can check the result of the upgrade.
If you cannot see the successful log message, you can refer to next chapter to fix the problem.
… u-boot file: eddy-bl-2.1.0.1.bin
…
GENERIC::SendFile ./eddy-bs-2.1.0.1.bin at address 0x0
…
GENERIC::SendFile eddy-os-2.1.0.1.bin at address 0x3FF00
…
-I- === Load the linux file system ===
-I- Send File eddy-fs-2.1.0.1.bin at address 0x0025D580
GENERIC::SendFile eddy-fs-2.1.0.1.bin at address 0x25D580
8) With the successful log message, confirm whether the new firmware works properly or not by rebooting Eddy DK v2.1 board.
9.2.6 Solving problems during Firmware Upgrade
1) If you use firmware file name wrongly, log file will pop up as below.In this case, you should check whether the file names of firmware copied is same with the firmware names in Eddy_burning_DataFlash.bat or Eddy_burning_DataFlash.tcl files.
… script file : Eddy_burning_DataFlash.tcl u-boot file: eddy-bl-2.1.0.1.bin
-E- Script File Eddy_burning_DataFlash.tcl returned error : could not read "eddy-bl-
2.1.0.1.bin": no such file or directory - could not read "eddy-bl-2.1.0.1.bin": no such file or directory
while executing
"file size $ubootFileName"
invoked from within
2) If your PC connects to Eddy-DK/S4M-DK board wrongly, log file will pop up as below. In this case, you need to check the connection.
117
Chapter
9. Appendix
-I- Waiting ...
-E- Connection \usb\ARM0 not found
-E- Connection list : COM2 COM3 COM4 COM5
3) If you get as below log file, you need to check the S6 dip switch. It should be pulled up. or S1 dip switch is Eddy-S4M
…
-I- Loading applet isp-dataflash-at91sam9260.bin at address 0x20000000
-E- Script File Eddy_burning_DataFlash.tcl returned error : Error Initializing DataFlash
Applet (Can't detect known device) - Error Initializing DataFlash Applet (Can't detect known device)
while executing
"error "Error Initializing DataFlash Applet ($dummy_err)""
(procedure "DATAFLASH::Init" line 13)
invoked from within
"DATAFLASH::Init 1 "
9.3 Product Specification
9.3.1 Eddy CPU v2.1 Specifications
Item
Hwrdware
Network
Classification
CPU
Memory
External I/F
Ethernet I/F
UARTs
USB 2.0 FS
ADC
TWI(I2C)
SPI
GPIO
Power Input
Dimensions
Weight
Protocol
Specification
ARM926EJ-S (210 MHz)
8MB Data Flash, 32 MB SDRAM
19 Bit / 16 Bit Data Bus
10/100 Base-T Auto MDI/MDIX
4 Port, Support up to 921.6 Kbps
(1 : Full Signal, 2,3,4, : RxD, TxD, RTS, CTS only)
2 Host /1 Device Port, 2.0 FS (12Mbps)
4-Channel 10 Bit ADC
Master, Multi-Master and Slave Mode
8- to 16-bit Programmable Data Length
Four External Peripheral Chip Selects
Max. 56 Programmable I/O Pins
3.3 V (200 mA Max)
25 x 48.5 x 6.2 mm
8.3 g
TCP, UDP, Telnet, ICMP, DHCP, TFTP, HTTP, SNMP 1&2,
SSH, SSL
118
Chapter
9. Appendix
Item
Software
Environmental
Classification
Ethernet
Network
Connection
O/S
Mgt Tools
Uploads
Specification
10/100Mbps MAC / PHY
Static IP, DHCP
Lemonix Real Time Linux
SNMP, Web, PortView
TFTP, FTP, Web
Dev Tools
Operating
Temp
LemonIDE & SDK
-40 ~ 85 ℃
Storage Temp -60 ~ 150 ℃
Humidity 5 ~ 95% Non-Condensing
Approvals
CE Class A,
FCC Class A,
RoHS compliant
9.3.2 Eddy DK v2.1 Specificatons
Classification Specification
NAND Flash 256MB, 8bit I/F
SD Card
Connector
USB Connector
Push Type, Up to 16 GB
MMC / SD Card / MC supported
1 x Device
2 x HOST, Dual-Port
128 x 64 Dots Matrix Structure LCD Module
KEY 4 x 4 Matrix
Battery Holder 3V Lithium Battery, 235 mAh
LED Power, Ready, 20 Programmable IO, Console & Serial TxD, RxD
I2C Interface 16bit I2C BUS GPIO
SPI Interface 2 Kbit EEPROM
MCI Interface SD Card, MMC Socket
ADC Interface Temp / Light Sensor
Digital I/O
Switch
8 Port Input, 8 Port Output
- Serial or GPIO Select
- RS422/485 Select
- DIO : Common VCC or GND Select
- Programming
Jumper Switch Boot Mode Select, JTAG Select
119
Chapter
9. Appendix
Classification Specification
Serial Port
2 x RS232 DB9 Male
2 x RS422/485 Terminal Block
(RS422 & RS485 Selected by S/W)
Console Port DB9 Male
LAN Port 2 x RJ45
ICE Port Used for Flash Programming
Reset Button Factory Default & Warm Boot
Input Power
Dimensions
9-48VDC
240 x 180 mm
9.3.3 Eddy-S4M v2.1 Specifcatons
Hardware
Classification
CPU
Memory
Ethernet MC/PHY
Serials
USB 2.0 FS
RTC
Battery Holder
ADC
Specification
ARM9260B-CJ (210 MHz)
AT45DB642D, 8MB Data Flash
IS42S16160B, 32 MB SDRAM
10/100 Base-T MAC
KSZ8041NLi PHYceiver Auto MDI/MDIX
Port 0,1 : RS232 (DB9 male)
Port 0 : Full Signal
Port 1 : TxD, RxD, RTS, CTS only
Port 2,3 : COMBO (Terminal Block 5pin)
* COMBO : RS422/RS485 is S/W selectable
3 Host /1 Device Port, 2.0 FS (12Mbps)
Extension Port using GL850A USB Hub chip
Real Time Clock, RTC DS1340U-33+
Connected to I2C I/F
CR1220(38mAh) 3V Lithium Battery
4-Channel 10 Bit ADC
TWI(I2C)
SPI
MCI
GPIO
Master, Multi-Master and Slave Mode
8 to 16-bit Programmable Data Length
Four External Peripheral Chip Selects
SD Spec V2.0 [SDHC], MMC Spec V4.2 support
USB to SD Controller , 16GB, 12Mbits/s
Max. 34 Programmable I/O Pins
LED
Protocol
Ready LED
TCP, UDP, Telnet, ICMP, DHCP, TFTP, HTTP,
SNMP1&2, SSH, SSL
Software
Network
Connection
O/S
Mgt Tools
Uploads
Static IP, DHCP
Lemonix Real Time Linux
SNMP, Web, PortView
TFTP, FTP, Web
120
Chapter
9. Appendix
Physical characteristics
Environment
Classification
Dev Tools
Power Input
Dimensions
Weight
Operating Temp
Storage Temp
Humidity
Specification
LemonIDE & SDK
3.3 V (200mA Max)
59.75 x 61.80 x 4 mm
15 g
-40 ~ 85°C
-66 ~ 150°C
5 ~ 95% Non-Condensing
CE Class A,
FCC Class A,
RoHS compliant
9.3.4 Eddy-S4M-DK v2.1 Specifcatons
Classification
Serial Port
SD Card Connector
MCI Interface
ADC Interface
Specification
2 x RS232 DB9 Male
2 x RS422/485 5pin Terminal Block (S/W Selectable & with Auto toggle)
Push Type, Up to 16 GB
MMC / SD Card / MC supported
SD Card, MMC Socket
Light Sensor
USB Connector 1 x Device, 2 x HOST, Dual-Port
LAN Port
Console Port
Switch
RJ45 with transformer
DB9 Male
Power ON/Off switch
Serial RS422/485 Termination resistor configuration switch
Input switch for testing GPIO (Off : Low, ON : High)
RDY, Power, 34 Programmable IO, Console & Serial TxD, RxD LED
Used for downloading code and single-stepping through programs
LED
JTAG Port
Reset Button
Factory Default & Warm Boot
(If you posh more than 5, active Factory default)
JIG connection socket
2 2x23pin socket, which connect JIG board to confirm problems
Expansion Header 2x22pin Header, used to test GPIO of Eddy-S4M
Input Power 5 VDC
Dimensions 160 x 120 mm
121
Chapter
9. Appendix
9.3.5 Eddy-S4M-JIG v2.1 Specifcatons
Classification Specification
USB Connector USB HOST
9.3.6
LAN Port
Reset Button
RJ45
Factory Default & Warm Boot
Expansion Header
2 2x23pin, used to connect most functions of S4M to externalS4M
Input Power
Dimensions
5 VDC
70 x 105 mm
Eddy-WiFi v2.1 Specifcatons
Classification Specification
Standard 802.11a, 802.11b, 802.11g
Modulation
Frequency Band
802.11a/g: OFDM
802.11b: CCK,DQPSK, DBPSK
802.11a:
US: UNI-Band 5.15~5.35GHz
EU: UNI-Band 5.15~5.35GHz
UNI-Band 5.47~5.725GHz
802.11b/g:
ISM band 2.4GHz ~ 2.4884GHz
802.11a: 12 dBm
802.11g: 14 dBm Output Power
802.11b: 17 dBm
802.11a/g: -68m @54Mbps 8% PER
RX sensitivity
Security
802.11b: -85dBm @11Mbps 8% PER
WEP 64/128, WPA, WPA2
Working distance 60 - 120m, depending on surrounding environment
Data Rate
802.11b : 11, 5.5, 2, 1 Mbps
802.11a/g
54, 48, 36, 24,18,12,11, 9, 6, 5.5, 2 , 1 Mbps
Power consumption TX : 450mA, RX : 300mA
Host interface USB2.0
Antenna
Antenna Cable
Dimension
Operating Temp
ANT 2.4Ghz, 2DB RP-SMA Female
RF 100mm SMA B/H
54 x 25 x 6mm
0 ~ 55°C
Humidity 5 ~ 90% Non-Condensing
Operating Voltages 3.3V±5%
122
Chapter
9. Appendix
Classification
Weight
Approvals
Specification
10g
CE Class A, FCC Class A, RoHS Compliant
9.4 Ordering Infomation
Product
Eddy-CPU
Eddy-DK
Eddy-S4M
Eddy-S4M-DK
Eddy-S4M-JIG
Eddy-WiFi
Version
2.1
2.1
2.1
2.1
2.1
2.1
Descriotion
Embedded CPU Module
Eddy V2.1 Development Kit
Embedded CPU Module (Mini PCI Type)
Eddy-S4M v2.1 Development Kit
Eddy-S4M v2.1 JIG Board
802.11 a/b/g WiFi Module
123
advertisement
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Related manuals
advertisement
Table of contents
- 5 Introduction
- 5 About this document
- 5 Who should read this document?
- 6 Document organization
- 7 Eddy-DK Related Documents
- 9 Technical Support
- 10 Getting Started
- 10 What can you do with Eddy DK ?
- 10 Eddy-DK Package Contents
- 11 Eddy-CPU v2.1
- 25 Eddy-DK v2.1
- 25 Modules’Locations
- 25 Switch Description
- 26 S1~S4: Digital In Select
- 26 S5: ADC Select
- 27 S6: NAND Flash & Data Flash Chip Select
- 27 S7:UART Select
- 28 S8:COM3 & S9: COM4 Select
- 29 SW1~SW16: Key Pad
- 29 SW17: Power
- 30 Reset1: Reset
- 30 LED Description
- 30 GPIO LED
- 31 Power, Ready LED
- 31 Debug Port LED
- 32 COM Port 1 LED
- 32 COM Port 2 LED
- 32 COM Port 3 LED
- 32 COM Port 4 LED
- 32 External Device Interface Description
- 33 WAN & LAN Interface
- 34 COM Port 1 & COM Port 2
- 34 COM Port 3 & COM Port 4
- 35 Debug Port
- 35 Power Jack
- 36 Internal Device Description
- 36 EEPROM
- 36 LCD Module
- 37 16bit I2C Bus GPIO
- 37 RTC
- 38 Temp Sensor
- 38 Light Sensor
- 38 NAND Flash
- 39 Ethernet Controller (WAN Port)
- 40 Eddy-S4M v2.1
- 41 5.1 miniPCI Card Type III Connector Pinout (J5)
- 42 Connector Pinout of Boards
- 42 ICE and JTAG
- 42 Ethernet signal from or to PHYceiver
- 43 Serial (RS232 & COMBO) and PIOA (Peripheral I/O Controller A)
- 45 PIOB and PIOC (Peripheral I/O Controller B/C)
- 46 Two Wire Interface
- 47 Universal Serial Bus
- 47 Multimedia Card Interface
- 48 etc
- 48 Switch Operation
- 48 LED Operation
- 48 Ethernet
- 49 RTC
- 49 Temp Sensor
- 50 Eddy-S4M-DK v2.1
- 50 Switch and Connector explanation
- 50 S2 : GPIO Input Configuration
- 51 S3,4 : Terminal Resistor selection
- 51 J6,J7 : JIG Board connector(Socket)
- 52 U7 : Light Sensor
- 53 Interface Explanation
- 53 Power, Ready LED
- 53 Serial Port LED
- 54 GPIO LED
- 55 J10 : Ethernet
- 56 J17, 18 : COM Port 1 & Port 2
- 57 J13, 14 : COM Port 3 & Port 4
- 58 S1 : Power Jack
- 59 Eddy-S4M-JiG v2.1
- 60 J6 : Power Jack
- 60 J1 : Ethernet
- 61 J2 : USB Host
- 61 RESET switch
- 62 J4, 5 : Expansion Header
- 63 Development Environment
- 63 Source code directory structure
- 64 Language
- 64 Development Environment
- 64 Installing on Windows OS
- 64 Installation of Cygwin
- 67 Configuration of Windows Environment Variables
- 67 Installation of Toolchain
- 67 Installation of Eddy DK Source
- 68 Installing on Linux
- 68 Installation of Toolchain
- 69 Installation of Eddy DK Source
- 69 Removing Development Environment
- 69 Removing Windows Development Environment
- 69 Removing Linux Development Environment
- 70 Compiling of Application Program
- 70 Program Type
- 72 Writing Application Program
- 72 Writing Makefile
- 73 Application Program Compile
- 73 Compiling on Windows
- 73 Compiling on Linux
- 74 Compiling with LemonIDE
- 74 Running Application on Eddy
- 74 Uploading and Executing on Eddy
- 75 Execute a file on Booting of Eddy
- 76 Creating Firmware
- 76 How to Create a Firmware
- 78 Firmware Upgrade
- 81 Library Introduction
- 81 Introduction
- 81 Makefile
- 81 System functions
- 82 Eddy Environment Function
- 84 Serial functions
- 87 Ethernet functions
- 92 GPIO Functions
- 98 ADC Function
- 99 RTC Function
- 99 Debugging Function
- 101 Eddy Software
- 101 Software Structure Diagram
- 102 Main Applications
- 102 eddy.c Application
- 102 Pinetd.c Application
- 102 Other Applications
- 103 Handling HTML & CGI
- 103 WEB Configuration
- 103 Example of HTML Code
- 104 Example CGI Code
- 107 Appendix
- 107 System recovery via Bootloader
- 107 Installing TFTP in Linux environment
- 108 Hardware Install and Recovery
- 110 Solving problems during recovery
- 112 System recovery via USB
- 112 Firmware Upgrade Utility Program
- 112 Installing Upgrade Utility Program
- 114 Installing Eddy DK/S4M Board Driver
- 115 Preparing Firmware Files & Utilities
- 116 Firmware Upgrade
- 117 Solving problems during Firmware Upgrade
- 118 Product Specification
- 118 Eddy CPU v2.1 Specifications
- 119 Eddy DK v2.1 Specificatons
- 120 Eddy-S4M v2.1 Specifcatons
- 121 Eddy-S4M-DK v2.1 Specifcatons
- 122 Eddy-S4M-JIG v2.1 Specifcatons
- 122 Eddy-WiFi v2.1 Specifcatons
- 123 Ordering Infomation