SystemBase Eddy DK Manual

1
Eddy DK
Programmer Guide
Ver 2.5.1.1
2011.02.15

2
Revision History
Revision Date Document Version Pages Description
Feb-5-2009 2.1.0.1 All Initial release by shlee
Sep-10-2009 2.1.0.2 All Added WiFi
Oct-14-2009 2.1.0.3 11 J2 pin33 PC12 Æ PC13
J2 pin35 PC13 Æ PC12
17,18,19 J2 pin33 PC12 Æ PC13
J2 pin35 PC13 Æ PC12
Oct-22-2009 2.1.0.3
18,19
J2 pin33 J9_26 Æ J9_33
J2 pin34 J9_25 Æ J9_34
J2 pin33 J9_24 Æ J9_35
Nov-23-2009 2.1.0.3 2,4,6 Added S4M
Jun-25-2010 2.1.1.1 All Open Linux Version
Added Eddy-BT
Sep-15-2010 2.5.1.1 2,9 Added Eddy-CPU v2.5
Jan-20-2011 2.5.1.1 Added Eddy-S4M v2.5
Feb-15-2011 2.5.1.1 Added Eddy-CPU/mp v2.5

3
Table of Contents
Chapter 1. Introduction.................................................................................................................5
1.1 About this document ........................................................................................................................5
1.2 Who should read this document?....................................................................................................5
1.3 Document organization ....................................................................................................................6
1.4 Eddy-DK Related Documents ..........................................................................................................7
1.5 Technical Support ............................................................................................................................8
Chapter 2. Getting Started ...........................................................................................................9
2.1 What can you do with Eddy DK ?....................................................................................................9
2.2 Eddy-DK Package Contents ............................................................................................................9
2.3 Eddy-CPU v2.1 / v2.5.....................................................................................................................10
2.4 Eddy-DK v2.1 .................................................................................................................................27
2.5 Eddy-S4M v2.1 / v2.5.....................................................................................................................46
2.6 Eddy-S4M-DK v2.1 ........................................................................................................................58
2.7 Eddy-S4M-JiG v2.1 ........................................................................................................................68
2.8 Eddy-WiFi v2.1 ...............................................................................................................................72
2.9 Eddy-BT v2.1..................................................................................................................................74
2.10 Eddy-CPU/mp v2.5 ........................................................................................................................76
Chapter 3. Development Environment........................................................................................ 78
3.1 Source code directory structure ....................................................................................................78
3.2 Language........................................................................................................................................79
3.3 Development Environment .............................................................................................................79
3.4 Installing on Windows OS ..............................................................................................................79
3.5 Installation of Cygwin .....................................................................................................................80
3.6 Configuration of Windows Environment Variables ........................................................................82
3.7 Installation of Toolchain .................................................................................................................82
3.8 Installation of Eddy DK Source ......................................................................................................83
3.9 Installing on Linux...........................................................................................................................83
3.10 Installation of Toolchain .................................................................................................................84
3.11 Installation of Eddy DK Source ......................................................................................................84
3.12 Removing Development Environment............................................................................................85
3.13 Removing Windows Development Environment............................................................................85
3.14 Removing Linux Development Environment ..................................................................................85
Chapter 4. Compiling of Application Program ............................................................................ 86
4.1 Program Type.................................................................................................................................86
4.2 Writing Application Program ..........................................................................................................89
4.3 Writing Makefile ..............................................................................................................................89
4.4 Application Program Compile ........................................................................................................90

4
4.5 Compiling on Windows ..................................................................................................................90
4.6 Compiling on Linux.........................................................................................................................90
4.7 Compiling with LemonIDE..............................................................................................................91
4.8 Running Application on Eddy.........................................................................................................91
4.9 Uploading and Executing on Eddy ................................................................................................91
4.10 Execute a file on Booting of Eddy .................................................................................................92
Chapter 5. Creating Firmware .................................................................................................... 93
5.1 How to Create a Firmware .............................................................................................................93
5.2 Firmware Upgrade..........................................................................................................................95
Chapter 6. Library Introduction................................................................................................... 98
6.1 Introduction.....................................................................................................................................98
6.2 Makefile ..........................................................................................................................................98
6.3 System functions............................................................................................................................98
6.4 Eddy Environment Function ...........................................................................................................99
6.5 Serial functions .............................................................................................................................102
6.6 Ethernet functions ........................................................................................................................105
6.7 GPIO Functions ............................................................................................................................111
6.8 ADC Function ...............................................................................................................................118
6.9 RTC Function................................................................................................................................119
6.10 Debugging Function .....................................................................................................................120
Chapter 7. Eddy Software ........................................................................................................ 121
7.1 Software Structure Diagram.........................................................................................................121
7.2 Main Applications .........................................................................................................................122
7.3 eddy.c Application........................................................................................................................122
7.4 Pinetd.c Application .....................................................................................................................122
7.5 Other Applications........................................................................................................................122
Chapter 8. Handling HTML & CGI ............................................................................................ 123
8.1 WEB Configuration .......................................................................................................................123
8.2 Example of HTML Code...............................................................................................................123
8.3 Example CGI Code.......................................................................................................................125
Chapter 9. Appendix ................................................................................................................ 127
9.1 System recovery via Bootloader ..................................................................................................127
9.2 System recovery via USB.............................................................................................................132
9.3 Product Specification ...................................................................................................................141
9.4 Ordering Infomation......................................................................................................................147

Eddy DK Programmer Guide
5
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.

Eddy DK Programmer Guide
6
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.

Eddy DK Programmer Guide
7
1.4 Eddy-DK Related Documents
The following table summarizes documents included in the Eddy-DK document set.
Document Name Description
User Guide Integration, configuration, and management of Eddy for the
administrator
Programmer’s Guide
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 Eddy-WiFi module spec description
Eddy-BT Spec Sheet Eddy-BT module spec description
LemonIDE Spec Sheet integrated development environment 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.

Eddy DK Programmer Guide
8
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

Eddy DK Programmer Guide
9
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/v2.5 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)

Eddy DK Programmer Guide
10
2.3 Eddy-CPU v2.1 / v2.5

Eddy DK Programmer Guide
11
Eddy-CPU v2.1/v2.5 Pin Assignment
J1 J2
Pin Signal Name Pin Signal Name Pin Signal Name Pin Signal Name
1 PA5 2 PA4 1 A15 2 A14
3 PC5 4 PC19 3 A13 4 A12
5 PC21 5 PC23 5 A11 5 A10
7 HDMA 8 NC 7 A9 8 A8
9 HDPA 10 DDM 9 A7 10 A6
11 PC26 12 DDP 11 A5 12 A4
13 PC4 (RDY#) 14 PC16 13 A3 14 A2
15 ICE_NTRST 16 RTCK 15 A1 16 A0
17 TDO 18 TMS 17 PC9 18 NWE
19 TDI 20 TCK 19 FPG 20 NRD
21 3.3V 22 GND 21 GND 22 3.3V
23 3.3V 24 GND 23 GND 24 3.3V
25 PB29 (CTS1) 26 PB28 (RTS1) 25 D7 26 D6
27 PB6 (TXD1) 28 PB7 (RXD1) 27 D5 28 D4
29 A20 30 A19 29 D3 30 D2
31 LAN_Speed 32 LAN_lLink 31 D1 32 D0
33 LAN_RX- 34 LAN_RX+ 33 PC13 34 JTAGSEL
35 LAN_TX- 36 LAN_TX+ 35 PC12 36 NC

Eddy DK Programmer Guide
12
J3 J4
Pin Signal Name Pin Signal Name Pin Signal Name Pin Signal Name
1 PID0 2 PID1 1 PB12 2 PB13
3 PID2 4 PID3 3 PB30 4 PB31
5 PID4 5 GND 5 PB0 5 PC22
7 PC14 8 PC17 7 PB1 8 PB16
9 PC18 10 PC8 (RTS3) 9 PB2 10 PB17
11 PC20 12 PC10 (CTS3) 11 PB3 12 PB18
13 PA22 14 PC15 (IRQ1) 13 BHDM 14 PB19
15 PB8 16 PB9 (RXD2) 15 BHDP 16 PB20
17 PB10 18 PB11(RXD3) 17 A16 18 PB21
19 PC0 20 PC1 (AD1) 19 A17 20 A18
21 PC2 22 PC3 (AD3) 21 D8 22 D9
23 PB14 (DRXD) 24 PB15 (DTXD) 23 D10 24 D11
25 GND 26 GND 25 D12 26 D13
27 BMS 28 NRST 27 D14 28 D15
29 PB23 / DCD0 30 PB5 / RXD0 29 TWD 30 TCK
31 PB4 / TXD0 32 PB24 / DTR0 31 NANDOE 32 NAND_CLE /
A22
33 PB22 / DSR0 34 PB26 / RTS0 33 NANDWE 34 NAND_ALE /
A21
35 PB27 / CTS0 36 PB25 / RI0 35 NC 36 NC
J5 J6
Pin Signal Name Pin Signal Name
1 PB0
2 PB1 1 NC
3 PB2 2 NC
4 PB3 3 3.3V
5 3.3V 4 3.3V
6 3.3V 5 PC25 / BT_Factory
7 BHDM, USB Host Data(-) 6 PB10 / TXD3
8 BHDP, USB Host Data(+) 7 PB11 / RXD3
9 PA31 / TXD4 8 PC8 / RTS3
10 PA30 / RXD4 9 PC10 / CTS3
11 NRST 10 PC24 / BT_MODE
12 GND 11 NRST
13 GND 12 GND
14 PA9 / WPID0 13 GND
15 PC6 / WPID1 14 NC
16 PC7 / WPID2 15 NC
17 NC 16 NC
18 NC

Eddy DK Programmer Guide
13
J1 Specifications
J1
Pin Signal Name Pin Signal Name
1 PA5 2 PA4
3 PC5 4 PC19
5 PC21 5 PC23
7 HDMA 8 NC
9 HDPA 10 DDM
11 PC26 12 DDP
13 PC4 (RDY#) 14 PC16 (nRESET)
15 ICE_NTRST 16 RTCK
17 TDO 18 TMS
19 TDI 20 TCK
21 3.3V 22 GND
23 3.3V 24 GND
25 PB29 (CTS1) 26 PB28 (RTS1)
27 PB6 (TXD1) 28 PB7 (RXD1)
29 A20 30 A19
31 LAN_Speed 32 LAN_lLink
33 LAN_RX- 34 LAN_RX+
35 LAN_TX- 36 LAN_TX+

Eddy DK Programmer Guide
14
J1 Pin Description
Pin No Name DK v2.1
Pin No
Expansion
Header Pin No Description
Peripheral A : CTS2 UART #2 Clear to Send Signal
1 PA5 J10_1 J4_2 Peripheral B : MCBD1
Disabled.
Data Flash connected with SPI0 is used for Eddy-CPU v2.1/v2.5. For
this reason SPI0 and MCDB0, MCDB3, and MCCDB signals,
multiplexing, cannot be used, thus Multimedia Card Slot B is disabled.
Peripheral A : RTS2 UART #2 Request to Send Signal
2 PA4 J10_2 J4_1 Peripheral B : MCDB2 Disabled.
Peripheral A : A24 External Address Bus
3 PC5 J10_3 J4_12 Peripheral B : SPI1_NPCS1 SPI1(Serial Peripheral Interface) Peripheral Chip Select 1
Peripheral A : A24 Multimedia Card Slot B Data
4 PC19 J10_4 J4_24 Peripheral B : SPI1_NPCS2 SPI1(Serial Peripheral Interface) Peripheral Chip Select 2
Peripheral A : D21 External Data bus
5 PC21 J10_5 J4_26 Peripheral B : EF100 Ethernet(WAN) Force 100Mbit/sec.
6 PC23 J10_6 J4_28 Peripheral A : D23 External Data Bus
7 HDMA J10_7 J1_27 USB Host Port A Data -
8 NC J10_8 -- Not Connect
9 HDPA J10_9 J1_29 USB Host Port A Data +
10 DDM J10_10 - USB Device Port Data -
11 PC26 J10_11 - D26 External Data Bus
12 DDP J10_12 - USB Device Port Data +
Eddy-DK v2,1 : RDY#(OUT) Ready signal. Output signal for CPU operation status
Peripheral A : A23 External Address Bus
13 PC4
(RDY#) J10_13 J4_11
Peripheral B : SPI1_NPCS2 SPI1(Serial Peripheral Interface) Peripheral Chip Select 2
14 PC16
(nRESET) J10_14 J4_21 Eddy-DK v2,1 : nRESET#(IN) 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.

Eddy DK Programmer Guide
15
More than 5 seconds: Factory Default function.
Peripheral A : D16 External Data Bus
Peripheral B : SPI0_NPCS2
Disabled
SPI0_SPCK, SPI0_MISO, and SPI0_MOSI signals for SPI0 are disabled
as they are not connected externally.
15 ICE_NTRST J10_15 J7_3 ICE Test Reset Signal
16 RTCK J10_16 J7_11 Return Test Clock
17 TDO J10_17 J7_13 Test Data Out
18 TMS J10_18 J7_7 Test Mode Select
19 TDI J10_19 J7_5 Test Data In
20 TCK J10_20 J7_9 Test Clock
21 3.3V 3.0V to 3.6V power input
22 GND Ground
23 3.3V 3.0V to 3.6V power input
24 GND Ground
Peripheral A : CTS1 USART1 Clear To Send
25 PB29 J10_25 J2_30 Peripheral B : ISI_VSYNC Image Sensor Vertical Synchronization
Peripheral A : RTS1 USART1 Request To Send
26 PB28 J10_26 J2_29 Peripheral B : ISI_PCK (IN) Image Sensor Pixel Clock Provided by the Image Sensor
Peripheral A : TXD1 USART1 Transmit Data
27 PB6 J10_27 J2_7 Peripheral B : TCLK1 Timer Counter ch1 External CLK IN
Peripheral A : RXD11 USART1 Receive Data
28 PB7 J10_28 J2_8 Peripheral B : TCLK2 Timer Counter ch2 External CLK IN
Address Bus
29 A20 J10-29 J1_31 Address Bus
30 A19 J10_30 J1_32 Address Bus
Ethernet 10/100 (Auto MDI/MDIX)

Eddy DK Programmer Guide
16
31 LED_Speed J10_31 -
LAN connection speed
Speed Pin State LED Definition
10Base-T H OFF
100Base-TX L ON
32 LED_Link J10_32 -
LAN connection status
Link/Activity Pin State LED Definition
No Link H OFF
Link L ON
Activity Toggle Blinking
33 LAN_RX- J10_33 - CPU 내부 Ethernet PHY(WAN)의 Physical receive or transmit signal (- differential)
34 LAN_RX+ J10_34 - CPU 내부 Ethernet PHY(WAN)의 Physical receive or transmit signal (+ differential)
35 LAN_TX- J10_35 - 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)

Eddy DK Programmer Guide
17
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
1 A15 2 A14
3 A13 4 A12
5 A11 5 A10
7 A9 8 A8
9 A7 10 A6
11 A5 12 A4
13 A3 14 A2
15 A1 16 A0
17 PC9 18 NWE
19 FPG 20 NRD
21 GND 22 3.3V
23 GND 24 3.3V
25 D7 26 D6
27 D5 28 D4
29 D3 30 D2
31 D1 32 D0
33 PC13 34 JTAGSEL
35 PC12 36 NC

Eddy DK Programmer Guide
18
J2 Pin Description
Pin No Name DK v2.1
Pin No
Expansion
Header Pin No Description
1~16 A[15:0] J9_1
-J9_16 J3_4-J3_20 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 External device Chip Select 5.
256MB memory area addressable, active low
17 PC9 J9_17 J4_14
Peripheral B : TIOB0 Timer Counter ch0 I/O Line B
18 NEW J9_18 J1_21 External device Write Enable signal, active low
19 FPG J9_19 -
For Flash Programming
You can program Data Flash in Eddy CPU v2.1/v2.5 via USB. Refer to 2.4.2.3 S6:NAND Flash &
Data Flash Chip Select for further information.
20 NRD J9_20 J1_23 External device Read Enable signal, active low
21, 23 GND Ground
22, 24 3.3V 3.0V to 3.6V power input
25~32 D[7:0] J9_25
- J3_32 J3_29 - J3_36
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 Data Bus connected with external header can be used when NCS6
is enabled.
Peripheral A : FIQ Fast Interrupt Input
33 PC13 J9_33 J4_18
Peripheral B : NCS6 External device Chip Select 6
256MB memory area addressable, active low
34 JTAGSEL J9_34 - 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.
35 PC12 J9_35 J4_17 Peripheral A : IRQ0 External Interrupt Input 0

Eddy DK Programmer Guide
19
Peripheral B : NCS7 External device Chip Select 7.
256MB memory area addressable, active low
36 NC Not Connect

Eddy DK Programmer Guide
20
J3 Specifications
J3
Pin Signal Name Pin Signal Name
1 PID0 2 PID1
3 PID2 4 PID3
5 PID4 5 GND
7 PC14 8 PC17
9 PC18 10 PC8 (RTS3)
11 PC20 12 PC10 (CTS3)
13 PA22 14 PC15 (IRQ1)
15 PB8 16 PB9 (RXD2)
17 PB10 18 PB11(RXD3)
19 PC0 20 PC1 (AD1)
21 PC2 22 PC3 (AD3)
23 PB14 (DRXD) 24 PB15 (DTXD)
25 GND 26 GND
27 BMS 28 NRST
29 PB23 / DCD0 30 PB5 / RXD0
31 PB4 / TXD0 32 PB24 / DTR0
33 PB22 / DSR0 34 PB26 / RTS0
35 PB27 / CTS0 36 PB25 / RI0
Table of contents
Other SystemBase Microcontroller manuals
Popular Microcontroller manuals by other brands

Microchip Technology
Microchip Technology PIC18LF67K40 manual

NXP Semiconductors
NXP Semiconductors AN11268 Quick start up guide

Samsung
Samsung S3F84B8 user manual

Texas Instruments
Texas Instruments CC2531 user guide

sparkfun
sparkfun Tinker Kit Experiment Guide

Cypress
Cypress Universal CapSense CY3280-22x45 Guide