Revision History Document Revision Date Pages Description Version Nov ,6 , 2007 2.0a Initial release by shlee Mar,19 , 2008 2.0b Typo corrections by shlee Apr, 02, 2008 2.0c LemonIDE Windows by shlee May, 23, 2008 2.1a Added 8M Flash version by shlee June, 27, 2008 2.20 Added SNMP V1/V2/V3...
3.4 Installing to Windows Host ................3-2 3.4.1 Installing Cygwin....................3-3 3.4.2 Configuring Windows Environment Variables............. 3-4 3.4.3 Installing Toolchain ..................... 3-4 3.4.4 Installing Eddy DK Source.................. 3-5 3.5 Installing to Linux Host ..................3-6 3.5.1 Installing Toolchain ..................... 3-6 3.5.2 Installing Eddy DK Source.................. 3-6 3.6 Removing Development Environment ..............3-7...
Page 4
4.3 Compile ......................4-4 4.3.1 Compiling on Windows..................4-4 4.3.2 Compiling on Linux....................4-5 4.3.3 Compiling with LemonIDE...................4-5 4.4 Uploading and executing an application via FTP..........4-5 Chpater5. Creating Firmware ..................5-1 5.1 How to create a firmware................. 5-1 5.2 Firmware update via FTP server ..............5-4 Chpater6.
Chapter1. Introduction Chpater1. Introduction This chapter briefly 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.
Chapter1. 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..
Programmer’s Guide API reference is also included with a list of available functions for customized application programming Portview User Manual Guide for SystemBase device server management application Portview COM Port Redirector User Guide for SystemBase COM Port Redirector Manual If you need brief information on Eddy or embedded device servers in general, please visit our corporate website at http://www.sysbas.com/.
Chapter1. 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.
Chapter 2. Getting Started Chpater2. 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.
1EA , LAN cable 1EA , Power adaptor 1EA, Jumper cable 1EA, 10Pin flat cable 1EA, 16Pin flat cable 1EA , CD (SystemBase SDK, LemonIDE, compile environment, utilities, manuals) 2.3 Eddy-DK Board Locations of modules 2.3.1 NOTE 1) Only ONE Eddy module can be loaded and tested with Eddy Serial DK at a time. Do not load two or more modules simultaneously.
Chapter 2. Getting Started Description on switches 2.3.2 Reset Switch COM1 Select Switch Product Setting Switch Reset Switch 2.3.2.1. Reboots the system. Product Setting Switch 2.3.2.2. This switch is used when Eddy-CPU is mounted on the development board.to determine its behavior. Product setting switch can be adjusted to make Eddy-CPU mounted development board operate as Eddy-CPU, Eddy-S1/PIN,Eddy-S1/DB9.
Chapter 2. Getting Started (Eddy-DK-C mode is to provide RS422/485 testability to Eddy-CPU module. Eddy-CPU module within its logic supports only RS232. In order to test Eddy-CPU on RS422/485 mode, mount Eddy-CPU to development board and set Product Setting Switch to Eddy-DK-C.) COM1 Select Switch 2.3.2.3.
Chapter 2. Getting Started RXD- Receive Data - Description Upon 100Base-TX link, it lights. When the data is sent or Left Green received, it blinks. Upon 10Base-T link, it lights. When the data is sent or received, it Right Yellow blinks.
Chapter 2. Getting Started -When Eddy-CPU is mounted on the development board. COM1 & COM2 function differs based on ‘Product Setting Switch’ settings. When ‘Product Setting Switch’ is set to ‘Eddy-CPU’, COM1 & COM2 ports will operate as RS232 ports.. When ‘Product Setting Switch’...
Chapter 2. Getting Started Power Jack 2.3.3.4. Contact Polarity +5VDC ± 5%(Min. 400mA) Center Outer Ground Figure 2-2 Power connector LED Description 2.3.4 GPIO LED Power, Ready LED Debug Port LED COM2 Port LED COM1 Port LED...
Page 16
Chapter 2. Getting Started GPIO LED 2.3.4.1. GPIO ports provided by Eddy are maximum 16. Not all Eddy modules provide GPIO port. Number of port can be limited or sometimes no port is provided at all due to different characteristics of each module, such as using port for internal use.(Active High : 3.3V DC, Active Low : 0 V) Input Output...
Page 17
Chapter 2. Getting Started Power, Ready LED 2.3.4.2. Ready LED: Indicates that the system is operating normally. (Normal: LED blinks) Power LED: Indicates that the 5 V power is being supplied. (Supplying power: Red LED ON) Debug Port LED 2.3.4.3. Debug Port Transmit LED: Shows transmission status of the Debug Port.
Chapter 2. Getting Started 2.4 Hardware installation Eddy-CPU Installation 2.4.1 Place Eddy CPU module firmly on to Eddy-DK board as shown above. Connect LAN cable to the LAN port. Connect DB9 serial cable to COM 1, COM2, and Debug Port. Configure Product Setting Switch1 to Eddy-CPU mode (Please see 2.3.2.2.
Chapter 2. Getting Started Eddy-S1/PIN Installation 2.4.2 Place Eddy-S1/PIN module firmly on to Eddy-DK board as shown above. Connect LAN cable to the LAN port of Eddy-S1/PIN. Connect DB9 serial cable to COM 1. Connect Jumper cable to COM1 Select Switch After checking that the input power is 5 V, supply the power to the Eddy-DK board Check the Power LED condition to make sure the operation is normal.
Chapter 2. Getting Started 2.5 Features and functions of Eddy-DK RS232/422/485 serial interface Supports the RS232 serial interface that is most widely used in many industries. Easy and quick system integration Signal lines easily connectable via pin units. Users can program and execute their own application in GUI environment using LemonIDE. User programs can be made into firmware and executed.
Chapter 2. Getting Started Eddy Flash Memory Map 2.5.2 Start address (size) Item Description 0x10000000 (4Kbyte) BootStrap Initialize hardware and calls bootloader from flash memory to the RAM and execute the bootloader. 0x10002000 (112Kbyte) Bootloader The Eddy boot loader is stored. 0x1001E000 (1.344Mbyte) Kernel Lemonix OS kernel is stored.
Chapter 2. Getting Started Booting Eddy 2.5.4 Eddy user manual provides a step-by-step guide for booting the module. Only Eddy-DK-related topics are explained in this guide. Provide power supply to the Eddy module and connect via Telnet Default IP address: 192.168.0.223 Open your telnet client and enter Eddy’s IP address to connect.
Chapter 3. Development environment Chpater3. Development environment This chapter explains about the process of application programming and other important notes. SDK’s directory structures are as follows. Note All material regarding Eddy including documentation, reference sources and utilities are periodically updated to www.embeddedmodule.com without prior notice.
Chapter 3. Development environment Firmware directory Kernel image, file system image, and configuration image are stored. Ramdisk directory flash: Configuration information is stored. root: Information for the file system is stored. Tools directory Tools used for creating image files is stored. Directory where source codes of the applications included in Eddy are stored..
Cygwin is a virtual Linux program which enables Linux environment to be compatible on Windows hosts and LemonIDE requires Cygwin to be running on Windows host for proper operations. Run Setup.exe from SDK/Windows/Cygwin directory of the CD which is provided with Eddy DK and follow the instructions below.
Eddy. Toolchain install file, “toolchain-windows-arm-411.tgz”, can be found under SDK/Windows folder in Eddy DK’s CD. Copy this file to “C:”, C drive’s root directory, and unzip the file by executing Windows command line program “CMD” as shown below.
Installing Eddy DK Source 3.4.4 Eddy DK Source will be installed. DK Source file, “eddy_DK_2xx.tar.gz”, can be found under SDK folder in Eddy DK’s CD. Copy this file to “C:”, C drive’s root directory, and unzip the file by executing Windows command line program “CMD”...
Installing Eddy DK Source 3.5.2 Install Eddy DK’s entire source. Eddy DK Source file, “eddy_DK_2xx.tar.gz”, can be found under SDK/linux folder in Eddy DK’s CD. Install Eddy DK Source as shown below. An eddy_DK_2xx folder will be created after installation.
3.6.1 Remove folders where DK Source and Cywin is installed to remove Eddy Development Environment. Removing Linux Development Environment 3.6.2 # rm – rf eddy_DK_xx ; Removal of Eddy DK Source # rm -rf /opt/lemonix ; Removal of Eddy ToolChain...
Chapter4. Compiling Application Chpater4. Compiling Application 4.1 Source Code This manual will use a sample source code that's included in the Eddy- DK to introduce compile process. Program sources introduced here are actual codes that are used in Eddy. However some sources are not provided for the security reasons.
Page 32
Loopback test program for the serial port. portview.c Agent of Portview, which is a NMS program for windows, provided by SystemBase. tcp_broadcast.c This supports maximum of five client connection with multi TCP server function, and broadcast serial data to all client.
Chapter4. Compiling Application 4.2 Writing a Makefile In order to compile an application, Makefile should be created or modified and all compile information should be correctly defined. The following shows a Makefile of the sample program at /src/Eddy_APPs/. The figure below shows part where the environment setting values needed at compiling process are configured. It contains environment values needed when running Make command.
Chapter4. Compiling Application The figure below shows part that is executed when running make command. It shows that Hello_World is added also as an example. all : $(TARGET) udp : udp.o rm -f $@ $(CC) $(CFLAGS) $(LDFLAGS) $(IFLAGS) -o $@ $ $@.o $(LIBS) $(STRIP) $@ def : def.o rm -f $@...
Chapter4. Compiling Application 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 . . . Compiling on Linux 4.3.2 To compile a source file on Linux environment, type in “make”...
Page 36
Chapter4. Compiling Application debugging. But when Eddy is reset or restarted, the program will be lost. In order to permanently store the program, you have to create a firmware. Power on Eddy and connect via Telnet. (See Eddy User Guide for details) Eddy login: eddy Password: 99999999 # cd /tmp...
Chapter 5. Creating Firmware Chpater5. Creating Firmware In the previous chapter we explained how to make and compile application program with sample program. This chapter introduces methods to create a firmware that permanently saves the application into the Eddy module. 5.1 How to create a firmware Firmware image can be created in Eddy_DK_2xx/ramdisk folder.
Page 39
Chapter 5. Creating Firmware To create a firmware image, move to Eddy_DK_2xx/ramdisk to make changes on Makefile. Makefile resides under “Ramdisk”( /DK Source/ Ramdisk) which is registered as a project. Version information, amount of Ramdisk to be used, application information to be copied can be configured in Makefile.
Page 40
Chapter 5. Creating Firmware test -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) mv $(FW_NAME) $(FIRMWARE_DIR)/ cfg: -q -l -o $(CONFIG_NAME) -d flash -p – f ../tool/mkfs.jffs2.exe Create image of Eddy’s initial execution configuration file residing under Flash folder.
Chapter 5. Creating Firmware [shlee@localhost ramdisk]$ make install #@echo "Making ramdisk image..." ../tool/genext2fs -U -b 10240 -d root -D device_table.txt ramdisk gzip -vf9 ramdisk ramdisk: 79.9% -- replaced with ramdisk.gz test -f ramdisk.gz ../tool/mkimage -A arm -O linux -T ramdisk -C gzip -a 0 -e 0 -n eddy-fs-20a.bin -d ./ramdisk.gz eddy-fs- 20a.bin Image Name: eddy-fs-20a.bin...
Page 42
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-20a.bin local: eddy-fs-20a.bin remote: eddy-fs-20a.bin 227 Entering Passive Mode (192,168,0,223,195,50) 150 Ok to send data.
Page 43
Chapter 5. Creating Firmware In order for the updated firmware to take effect, you need to reboot the module. After rebooting you can see sample program running as shown below. Eddy login: eddy Password: # cd /sbin # ls Hello_World ifconfig nameif switch_root...
Chapter 6. Library Chpater6. 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.
Chapter 6. Library 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 –...
Page 46
Returns None Notice 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.
Page 47
Chapter 6. Library 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 void SB_ReadConfig (char *FileName, Struct SB_CONFIG *cfg); Parameter FileName File name including the path file is located.
Page 48
Memory address of shared memory Returns -1 upon failure. Notice 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.
Chapter 6. Library Returns None Notice Contols Ready LED mounted at each Eddy model. 6.5 Serial functions These functions are used to handle internal serial port and UART. SB_OpenSerial Function Opens serial port. Format int SB_OpenSerial (int Port_No); Parameter Port_No Serial port number 0: First serial port 1: Second serial port...
Page 50
Chapter 6. Library 150 BPS, 300 BPS 600 BPS 1200 BPS: 2400 BPS 4800 BPS 9600 BPS : 19200 BPS 38400 BPS : 57600 BPS 10 : 115200 BPS 11 : 230400 BPS 12 : 460800 BPS 13 : 921600 BPS X X P P S D D (8 bis binary) P P : Parity Bits 0 0 : None, 0 1 : Odd, 1 0, 1 1: Even...
Page 51
Chapter 6. Library Function Send data to the serial port. Format Void SB_SendSerial (int handle, char *data, int length); Parameter handle Handle which opened serial port or socket data Pointer of the data to be sent length Length of the data to be sent Returns None Notice...
Chapter 6. Library Bit6: RI (0:Low, 1:High) Bit7: DCD (0:Low, 1:High) Notice SB_SetRts Function Controls RTS signal line of the serial port. Format Void SB_SetRts (int handle, int value); handle Handle which opened the serial port. Parameter Value 0: off Set RTS signal to low. 1: on Set RTS signal to high.
Page 53
Chapter 6. Library own POSIX compatible standard socket API. SB_GetIp Function Reads IP address assigned to Eddy. Format Unsigned int SB_GetIp (char *interface); Parameter Interface Network interface name. “eth0” for Eddy Serial model “eth1” for Eddy WiFi model. Returns Unsigned int Read IP address and returns in unsigned int type.
Page 54
Chapter 6. Library SB_ConnectTcp Function Make connection to the server specified as TCP socket. Format SB_ConnectTcp (char *IP_Address, int Socket_No, int Wait_Sec, Int Tx_Size, int Rx_Size); Parameter IP_Address IP address to connect in string type Socket_No Socket number of the server to connect Wait_Sec Wait time for connection (in second) Tx_Size...
Page 55
Chapter 6. Library Function Waits for network connection of TCP socket handle. Format SB_AcceptTcp (int Socket_No, int wait_msec); Parameter Socket_No TCP socket handle number to wait for connection. (Return value of SB_ListenTcp) wait_msec Connection standby time (in msec) Returns -1 ~ N New handle number of connected TCP socket.
Page 56
Chapter 6. Library 0: No data was read N: Length of the data read Notice 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 Close TCP socket handle. Format SB_CloseTcp (int Handle);...
Chapter 6. Library SB_SendUdpServer Function Transmits data to UDP socket. (Server mode) Format SB_SendUdpServer (int Handle, char *Buffer, int Data_Size); Parameter Handle Handle number bound to UDP socket Buffer Buffer point where packet data to be sent is saved Data_Size Size of the buffer to send Returns None...
Page 58
Chapter 6. Library Format void SB_SetGpioMode (int GpioNo, int Mode); Parameter GpioNo GPIO port number (0 ~ 15) Mode Input/output direction 0 : Input (Senses 3.3V input voltage) 1 : Output (Controls 3.3V output voltage) Returns None Notice There are maximum of 16 GPIO ports provided by Eddy. Number of GPIO ports varies according to the model.
Chapter 6. Library Returns 0, 1 GPIO value read 0 : low (3.3V is not present at the port) 1 : high (3.3V is present at the port) Notice I/O mode (direction) of GPIO port specified in GpioNo has to be in input mode.
Page 60
Chapter 6. Library Def command. (Please see def.c) # def po <1/2/all> debug <on/off> 6-17...
Chapter 7. Eddy Software Chpater7. 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. These codes may be used as development guide when programming one’s own firmware. 7.1 Software Structure Diagram Eddy.c is the first program that is executed upon boot up.
Chapter 7. Eddy Software 7.2 Main Applications eddy.c and pinetd.c are introduced in this chapter. These two programs play the most important role in Eddy. Other applications can be divided into applications that are run and monitored by pinetd.c and applications that are manually run by users.
Chapter 8. Handling HTML & CGI Chpater8. Handling HTML & CGI This chapter describes the HTML documents and CGI modules that are used for configuration. Provided CGI source and HTML documents are used by Eddy’s default firmware. Take a look at these sources and modify them as you want.
Page 66
Chapter 8. Handling HTML & CGI 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 when the user clicks on “submit” button on HTML page. [Source abstract] value2 = cgiFormStringNoNewlines("N_IP", buff, 16); if (value2 != cgiFormEmpty) convert_address (buff, cfg.system.ip);...
Chapter 9. Appendix Chpater9. Appendix This chapter explains how to recover Eddy when flash of Eddy is damaged and it cannot be booted. 9.1 System recovery 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.
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. After power on the following messages will be printed to minicom.
Page 70
Chapter 9. Appendix 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 ; When recovering OS area install os <name of OS firmware>...
Page 71
Chapter 9. Appendix The next shows file system recovery procedure. U-Boot> install fs eddy-fs-20a.bin TFTP from server 192.168.0.220; our IP address is 192.168.0.223 Filename 'eddy-fs-20a.bin'. Load address: 0x20000000 Loading:####################################################################### ############################################################################## ############################################################################## ######done Bytes transferred = 2035463 (1f0f07 hex) Erasing sector ........................................................
Page 72
Chapter 9. Appendix Once the recovery is done, use “boot” command start booting. U-Boot> boot ## Booting image at 20000000 ... Image Name: eddy-os-20a.img Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 1112220 Bytes = 1.1 MB Load Address: 20008000 Entry Point: 20008000 Verifying Checksum ...
Chapter 9. Appendix Solving problems during recovery 9.1.3 U-Boot> install os eddy-os-20a.bin TFTP from server 192.168.0.220; our IP address is 192.168.0.223 Filename 'eddy-os-20a.bin'. Load address: 0x20000000 Loading: * When recovery is not proceeded with message shown above, check LAN connection and confirm the IP address of tftp-server PC is configured as 192.168.0.220.
Chapter 9. Appendix 9.2 Product Specifications Item Classification Specification Network LAN port 10/100Mbps RJ-45 Port * 1 GPIO LED (Active High : 3.3V DC, Active Low : 0 V) 4 (Eddy-S1/Pin) 16(Eddy-CPU) Status LED Power input 5V DC ( 400mA or higher) Hardware Power 400mA / 2 W...
Chapter 9. Appendix 9.3 Ordering information The purchase order information for Eddy-Serial products is as follows. Product Name Description Programmable embedded CPU module Eddy-CPU-4M 4MB Flash Memory Programmable embedded CPU module Eddy-CPU-8M 8MB Flash Memory RS232 pin header interface Eddy-S1/PIN 3.3 ~ 5V input voltage RS422/485 pin header interface Eddy-S1/PIN-C...
Need help?
Do you have a question about the Eddy DK and is the answer not in the manual?
Questions and answers