| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
ZiLOG TCP/IP Software Suite Programmer's Guide RM000806-0804
Top Searches for this datasheeteZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide RM000806-0804 ZiLOG Worldwide Headquarters Race Street Jose, 95126 Telephone: 408.558.8500 Fax: 408.558.8300 www.ZiLOG.com This publication subject replacement later edition. determine whether later edition exists, request copies publications, contact: ZiLOG Worldwide Headquarters Race Street Jose, 95126 Telephone: 408.558.8500 Fax: 408.558.8300 www.ZiLOG.com Document Disclaimer ZiLOG registered trademark ZiLOG Inc. United States other countries. other products and/or service names mentioned herein trademarks companies with which they associated. ©2004 ZiLOG, Inc. rights reserved. Information this publication concerning devices, applications, technology described intended suggest possible uses superseded. ZiLOG, INC. DOES ASSUME LIABILITY PROVIDE REPRESENTATION ACCURACY INFORMATION, DEVICES, TECHNOLOGY DESCRIBED THIS DOCUMENT. ZiLOG ALSO DOES ASSUME LIABILITY INTELLECTUAL PROPERTY INFRINGEMENT RELATED MANNER INFORMATION, DEVICES, TECHNOLOGY DESCRIBED HEREIN OTHERWISE. Devices sold ZiLOG, Inc. covered warranty limitation liability provisions appearing ZiLOG, Inc. Terms Conditions Sale. ZiLOG, Inc. makes warranty merchantability fitness purpose Except with express written approval ZiLOG, information, devices, technology critical components life support systems authorized. licenses conveyed, implicitly otherwise, this document under intellectual property rights. RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Table Contents List Figures List Tables Manual Objectives About This Manual Intended Audience Organization Related Software Releases Conventions Safeguards Trademarks Online Information Overview System Features Software Getting Started with System Requirements Installing Software Connecting Hardware Running Sample Application Creating Project Working with Flash-Based Projects Resource Usage Hardware Resources Optional Hardware Resources Overview Operating System Fundamentals Operating System Components RM000806-0804 Table Contents eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Process State Transitions Real-Time Characteristics Protocol Overview HTTP Server Overview Understanding Webserver Pages Understanding Webservers Computer Systems Understanding Webservers Embedded Systems Configuration Hardware Configuration eZ80_HW_Config.c ipw_ez80.c net_conf.c modem.c serial_conf.c Operating System Configuration shell_conf.c sys_conf.c tty_conf.c Network Configuration arp_conf.c bootinfo.c dgram_conf.c emac_conf.c igmp_conf.c ip_conf.c ppp_conf.c snmib.c snmp_conf.c tcp_conf.c ssl_conf.c Build Options Table Contents RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Libraries Linker Directives Stack Configuration Initialization Ram_boot.asm Flash_boot.asm Boot_xxx.asm Boot.asm Nulluser Using HTTP HTTP Application Protocols http_init Function Functions Building Pages .101 TFTP .103 SMTP .103 TELNET .105 BOOTP .106 DHCP .106 .107 IGMP .108 TIMEP .110 timed_738_init .110 .110 .113 Overview .114 Initializing Server .120 Creating x.509 Certificates .123 SSL2 Cipher Suite .127 Creating Connection .128 RM000806-0804 Table Contents eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual HTTPS Server Serial Ports Shell SNMP Create Custom Ethernet Driver Ethernet Driver Overview EMAC Driver Package Implementing Ethernet Driver Reference. Kernel APIs Process Manipulation Functions Semaphore Functions Mailbox Messaging Functions Message Port Functions Miscellaneous Functions Kernel Macros Device Driver APIs Networking APIs Functions Functions HTTP Functions Run-Time Library Functions Shell Command Reference Index Table Contents RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide List Figures Figure Figure Figure Figure Figure Figure Protocol Stack Software Block Diagram XINU Process States Symmetric Cipher Encryption Decryption .117 Asymmetric Cipher Encryption Decryption .118 Internet Options Window .133 Security Alert Warning Message .134 RM000806-0804 List Figures eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual viii List Figures RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide List Tables Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Protocol Layers Modemchat Scripts Libraries HTTP Request Methods HTTP Reply Response Codes Page Filename Extensions .102 Default Addresses Protocol .113 SSL2 Cipher Algorithms .128 ASN1-Supported Primitive Data Types .144 Groups .183 Interfaces .183 Process Manipulation Functions .185 Semaphore Functions .213 Mailbox Messaging Functions .230 Message Port Functions .237 Utility Functions .258 Kernel Macros .295 Device Driver APIs .316 Stack User Interfaces .342 Datagram Services .343 Services .359 HTTP Method Requests .379 HTTP Functions .384 Library Routines .387 Shell Commands .395 RM000806-0804 List Tables eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual List Tables RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Manual Objectives This manual describes architecture application programming interface (API) ZiLOG TCP/IP Software Suite (ZTP), which features TCP/IP software libraries version XINU operating system ZiLOG's libraries require minimal memory transform devices into efficient embedded webservers. About This Manual ZiLOG recommends that user read understand everything this manual before using this product develop code. However, recognize that there different styles learning. Therefore, this manual designed used either procedural manual reference guide important data. Intended Audience This document written ZiLOG customers experienced working with microprocessors understand networking fundamentals. Organization This Programmer's Guide divided into several sections, starting with introduction section concluding with reference material. Each section details specific topic about product. Overview Presents overview operating system, network protocols, system resources required ZTP. RM000806-0804 About This Manual eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Configuration Contains information describing setup configuration ZTP. Using Explains develop applications using software suite XINU Operating System. Reference Describes programming interface kernel, networking module, time library functions. Shell Command Reference Describes shell interface monitoring functions. Related Software Releases Please ZiLOG website latest release updates this manual. Conventions following assumptions conventions adopted provide clarity ease use: Courier Typeface Commands, code lines fragments, bits, equations, hexadecimal addresses, various executable items distinguished from general text Courier typeface. Hexadecimal Values Hexadecimal values designated lowercase appear Courier typeface. Related Software Releases RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Example: STAT F8h. Asterisks asterisk preceding parameter denotes parameter pointer. Software Release Versions Software release versions manual represented <version>, where <version> denotes current release software available ZiLOG.com. Example: demo_htm.c file located following directory: .\ZTP<version>\website. Safeguards important that users understand following safety terms, which defined here. Caution: Means procedure file become corrupted user does follow directions. Warning: Means procedure cause injury death user does follow directions. Trademarks eZ80® registered trademark ZiLOG, Inc. eZ80Acclaim!is trademark ZiLOG, Inc. Online Information Please visit ZiLOG's website for: Product information eZ80Acclaim!microprocessors microcontrollers RM000806-0804 Manual Objectives eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Online copies eZ80Acclaim!documentation Source license information Online Information RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Overview ZiLOG TCP/IP Software Suite (ZTP) includes preemptive, multitasking kernel that based XINU operating system. contains libraries that implement embedded TCP/IP stack. Applications Programming Interface (API) allows programmers using member eZ80® family microprocessors/controllers rapidly develop Internet-ready applications with minimal effort. Because common members eZ80® family, applications targeting processor easily ported other eZ80® device. System Features Compact, preemptive multitasking, multithreaded kernel with InterProcess Communications Support (IPC) soft real-time attributes Complete TCP/IP stack physical layer implementation Compatible with members eZ80® family Implementation following standard network protocols: HTTP DHCP ICMP TFTP IGMP SMTP TIMEP Telnet SNMP RARP Interoperable with RFC-compliant TCP/IP Network Protocol implementations provide seamless connectivity HTML Compiler translation easy website integration layer TCP/IP services RM000806-0804 System Features eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Ethernet driver CrystalScan 8900A, RealTek 8019AS, eZ80F91 integrated EMACs serial driver high-level hides protocol details from user accelerate application development Final stack size link/time configurable determined protocols included build Application demonstrations Software software visualized planes. first plane represents XINU operating system Plane), second plane represents embedded TCP/IP protocol stack (Stack Plane). Modules Stack Plane typically require services Plane ensure that they coexist with other applications that compete processor. Plane includes Scheduler, Memory Manager, Interprocess Communications services. These components described Overview. TCP/IP protocol stack architecture shown Figure Also shown Figure locations where user's application interface (these blocks shown color teal). Table shows full name protocol layers. Many TCP/IP application protocols designed using client-server model. Therefore, Table also indicates whether implements Client Server each application protocols shown Figure Protocols that implement Transport, Network, Datalink layers typically operate peer-to-peer mode, requiring both client component server component allow interoperability. These protocols designated Peer Table Software RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide brief introduction protocol layers provided Protocol Overview section page Global Plane Operating System Software Stack Plane User DHCP TELNET SMTP HTTP User TIMEP BOOTP IGMP User Application Serial Driver GPIO UART0 UART1 RARP DATALINK User USER APPLICATION HTTPS APPLICATION TFTP SNMP User TRANSPORT ICMP NETWORK Ethernet Driver EMAC PHYSICAL Figure Protocol Stack Software Block Diagram Table Protocol Layers Client, Server, Peer Peer Client Client Server Peer Peer Peer Peer Peer Protocol DHCP HTTP ICMP IGMP RARP Full Name Address Resolution Protocol Dynamic Host Configuration Protocol Domain Name Server Hyper Text Transfer Protocol Internet Control Message Protocol Internet Group Management Protocol Internet Protocol Point-to-Point Protocol Reverse Address Resolution Protocol RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Table Protocol Layers (Continued) Client, Server, Peer Client Server Server Peer Server Client Client Peer Protocol SMTP SNMP Telnet TFTP TIMEP Full Name Simple Mail Transfer Protocol Simple Network Management Protocol Secure Socket Layer Protocol Transmission Control Protocol Telnet Trivial File Transfer Protocol Time Protocol User Datagram Protocol also provides software drive hardware used TCP/IP connections. This hardware comprises SERIAL1 (UART1) connections Ethernet Media Access Controller (EMAC) Ethernet connections. Getting Started with This section describes ZiLOG Developer Studio Integrated Development Environment (ZDS IDE) with ZiLOG's ZPAK Debug Interface Tool when working with projects. host runs software, which used compile debug software entire eZ80® family processors. After completes building your project, uses ZPAK Debug Tool send data target eZ80® development module. During interactive debug sessions, also uses ZPAK send commands target obtain status information. Getting Started with RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Please refer ZiLOG Developer Studio User Manual eZ80Acclaim! Products (UM0144) complete description IDE. System Requirements Developing user software with requires IBM-compatible running Windows Second Edition, Windows 2000, Windows Windows host memory requirements minimum processor speed, please refer ZiLOG Developer Studio User Manual eZ80Acclaim! products (UM0144). Installing Software Before developing applications with must install both ZTP. included each eZ80® development kits. most recent version available download Note: Downloading either package requires license key. License keys available within each eZ80® development kit. License keys contained eZ80F91 Development Kit. Connecting Hardware After both packages installed, connect host eZ80® Development Platform. host communicates with target using ZPAK Debug Interface Tool. Please refer ZPAK Debug Interface Tool Product User Guide (PUG0015) included with your eZ80® development details. complete example next section, necessary attach Ethernet cable eZ80® Development Platform described User Manual contained each eZ80® development kit. must also connect serial cable between console port eZ80® Develop- RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual ment Platform running terminal application such Hyperterminal. This serves console displaying interface sending commands system. default, configures serial link used console 57600 bps, parity, data bits, stop bit, flow control. Running Sample Application After completing software installation connecting hardware, immediately create simple embedded webserver. Demo project that included installation following steps below. Launch IDE. From File Menu, select Open Project. Open Project dialog displayed. Navigate folder where installed. Demo folder contained within directory, open AcclaimDemo.pro file target eZ80Acclaim!MPUs MCUs (eZ80L92, eZ80190, eZ80F91, eZ80F92, eZ80F93). Select configuration from Active Configuration pulldown menu that matches your eZ80® development hardware. example, using eZ80F91 Development Kit, select eZ80F91 configuration. From Build menu, select Rebuild All. Observe Build Status window ensure that project builds without errors. From Build Debug menu, select cause begin downloading project target eZ80® development module ZPAK debug tool. After download completed, project starts running target. Observe address displayed console project initializes. This address four-octet dotted decimal number (for example, 192.168.1.1). Running Sample Application RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide connected same segment eZ80® Development Platform running webserver demonstration, open browser enter address observed previous step URL. After entering URL, home page embedded website displayed. Creating Project simplest create project copy existing sample projects into folder modify suit your requirements. Please refer ZiLOG Developer Studio User Manual eZ80Acclaim! Products (UM0144) information about remove files from project well description advanced features tool. Information about configuring found Configuration section this document. Working with Flash-Based Projects When create Flash-based project, necessary load flash image into target device. This done with Integrated Flash Loader utility target-based Flash Loader utility. information about using these tools please refer ZiLOG Developer Studio User Manual eZ80Acclaim! Products (UM0144) and/or appropriate Flash Loader Product User Guide your eZ80Acclaim!product. Resource Usage This section describes hardware resources used when running member eZ80® family microprocessors. complete description hardware resources available particular eZ80® Development Platform, please refer User Manual included with your specific eZ80® development kit. RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual hardware resource consumption modified altering values within configuration files. details, please refer Configuration section page Hardware Resources projects require following resources regardless specific eZ80® development being used. Programmable Timer default, uses Timer internal system timer. This timer used Scheduler control preemptive task-switching between processes. your application requires Timer purposes, move system timer different hardware timer. details, please refer Configuration section page Memory When build application using ZTP, variables manipulate your application well variables libraries) require some amount static RAM. determine amount static required your application, examine file generated when links your project. addition static RAM, consumes memory time processes created those processes request memory from Memory Manager. This memory called dynamic RAM. very difficult determine dynamic requirements your project because exact amount dynamic required system dependent upon factors that typically outside your control. example, reception some frames from Ethernet driver cause protocol module allocate buffer time process this data, then create process take additional action. Therefore, dynamic memory requirements your project vary over time depend upon system conditions. Hardware Resources RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Even though difficult accurately determine amount dynamic memory required your application, limit amount that allowed when satisfying dynamic memory requests. adjust this limitation, modify ram_blocks array. description eZ80_HW_Config.c file page details. Note: poorly cease operating runs dynamic memory. Therefore, ZiLOG recommends including descriptors physical memory ram_blocks array. Finally, some members eZ80® family, such eZ80190 device, include internal SRAM. some cases, uses internal SRAM contain tables required processing interrupts. Interrupt System Because always requires programmable timer, also requires interrupt system active target eZ80® development module. sample applications include code activate initialize interrupt system each eZ80® development modules. However, your final application involves custom hardware design, necessary modify even replace this code. Optional Hardware Resources Depending configure ZTP, following resources required: Flash Memory sample applications, when change active configuration Flash, targets least part project Flash memory. This Flash memory either internal external. Please refer ZiLOG Developer Studio User Manual eZ80Acclaim! Products (UM0144) information about configuring project Flash memory. RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Ethernet Controller default, sample projects include Ethernet libraries (CS8900A.lib, RT8019AS.lib, F91_emac.lib). Depending physical hardware connection, more interrupt vectors and/or GPIO pins required. Please refer User Manual included with eZ80® development using understand resources that Ethernet controller requires. Note: drivers sample projects included with already configured properly access resources associated with supported Ethernet controllers. your final application requires customer hardware layout, possible default drivers modifying some configuration files. Configuration section page more information. Serial Port default, sample projects included with Serial Port implement console. However, this modified, even disabled. Serial Port Demo projects included Serial Port either connect external modem connect serial cable directly another PPP-enabled device. does Serial Port projects that PPP. GPIO Pins Some GPIO pins eZ80® family processors multiplexed alternate functions. example, pins Port used normal GPIO pins. Alternatively, they also configured alternate function pins connected UART1 each eZ80® device. GPIO configuration accomplished eZ80_HW_Config.c file. sample projects included with include comments that describe each being used. Optional Hardware Resources RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Watch-Dog Timer does require Watch-Dog Timer. However, there flag ipw_ez80.c configuration file that specifies whether should reset Watch-Dog Timer every time system functions KE_EnterISR KE_ExitISR called. turn this feature calling watchdog_init(), must either supply reset handler. Overview Operating System Fundamentals Operating systems typically term process describe machineexecutable image program environment created which that image executes. minimum, this environment consists address space OS-dependent control blocks. Some operating systems virtual memory system that prevents errant process from corrupting address space other processes. effect, these operating systems prevent processes from accessing resources that they own, such memory. Therefore, multiple processes share information, they must usually employ operating systems' interprocess communication mechanisms, such shared memory blocks, message queues, semaphores. When program designed, tasks that must performed coded sequential blocks instructions logically broken down into smaller tasks that operating system schedule independently. advantage latter approach that subtask blocks (for example, operating system stops running task until some event occurs), possible that other tasks within process continue perform work. former approach, sequential steps blocked, entire process temporarily stops running until event occurs. RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Depending operating system, programmer create separate process each these tasks create separate threads execution within single process perform each task. Each thread runs same environment process that created it.Therefore, threads within process access same address space communicate with each other manner programmer chooses, including operating system's mechanisms. However, threads different processes must mechanisms communicate. keep operating system compact, combines concept threads processes. addition, operating system only maintains address space that directly maps system's physical memory. Therefore, regarded operating system that only supports process allows multiple threads created within that single process. Conversely, regarded operating system that supports multiple processes, each which contain only single thread. Note: Although first interpretation closest general operating system concepts, this document predominantly uses term process describe operating system's basic unit scheduling even though each these processes share same address space control blocks. most cases, terms process thread interchangeable ZTP. Operating System Components Processes ZTP, every process contains private context area that contains runtime stack register set. Because there only processor system, only process actively running given time. When operating system stops running process resume another, must save current state context area first process restore state second process from context area. This process referred context switch. Operating System Components RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide When process created, creating process assigns priority created process.This information also maintained process' context area. addition, operating system assigns tracks state each process executes. When process requests services from state change, even preempted operating system higher-priority process.The combination process priority current state main factors Scheduler uses determine when process allowed CPU. Scheduler Scheduler responsible determining when process access CPU. Conceptually, Scheduler places each process three lists: Current list, Ready list Blocked list. Because there only processor system, Current list only contain single process identifier (PID). This process that currently active CPU. Ready list contains PIDs processes system that ready execute once they access CPU. Processes Blocked list prevented from accessing because they waiting some event that allows them transition Ready list. example, currently-executing process requests access semaphore (see description KE_SemAcquire process manipulation function page 227), that semaphore signalled state, then current process moved Blocked list until semaphore signalled some other process. This situation causes Scheduler choose processes Ready list become current process. When semaphore that first process waiting eventually signalled, operating system changes state process Ready moves process from Blocked list Ready list. Scheduler maintains Ready list prioritized order.That when process added Ready list, appended Ready list, instead inserted into Ready list according priority. Processes that possess higher numerical priority value occur RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual before processes with lower numerical priority value Ready list. process being added Ready list contains priority that exactly equal some other process(es) Ready list, inserted list after final process that priority. When current process longer able continue executing, Scheduler must decide which gains control processor. algorithm Scheduler uses make this decision very simple. scheduler merely transitions process front Ready list Current list. Through methods processes added Ready list, processes with high numeric priority before processes with numerically lower priorities. Processes that contain same priority execute round-robin order. preemptive system. Therefore, each process allotted maximum finite duration time during which permitted Current process. This duration referred system quantum process time slice. default, this value (See description ipw_ez80.c file page details this value changed). process does call mechanism that causes block before time slice expires, operating system forcibly transitions that process Ready list after time slice expires. important understand Scheduler operates, impact application design. example, consider design high-priority process that never yields calling mechanism that causes process block. After process's time slice expires, moves process Ready list. this process maintains priority greater than other processes system, placed beginning Ready list. Therefore, when Scheduler chooses next process run, forced select this same process. result, other processes system prevented from becoming current process, resulting system hanging. Please refer Kernel APIs section page information about functions used manipulate process behavior affect scheduling. Operating System Components RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide These functions are: create, resume, suspend, kill, sleep, sleep10, sleep100, unsleep, getpid, chprio, getprio. Memory Manager Memory Manager assumes control memory within ram_blocks array that used static memory (that holding application data). This memory region referred heap. Your application request memory time calling getmem function. When your application longer requires dynamic memory, should call freemem return allocated memory heap other processes. Caution: system runs dynamic memory heap, system functions poorly some cases even crash. shell command determine amount dynamic memory remaining system. Interprocess Communication This section introduces each synchronization interprocess communication mechanisms. These mechanisms allow processes share information synchronize their operation. Semaphore Conceptually, semaphore object containing counter, queue PIDs currently waiting this semaphore. When semaphore created (see description KE_SemCreate semaphore function page 216), caller sets initial count value, queue waiting processes empty. Every time process calls wait function, semaphore count decremented resulting semaphore count negative, then calling process placed Blocked list Scheduler resumes execution another process. effect, added queue processes associated with this semaphore. Otherwise, resulting count after wait call positive, control immediately returned caller. RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Every time process calls signal semaphore function, semaphore count increases resulting semaphore count less than equal zero, process beginning queue processes waiting semaphore transitioned Ready list. Scheduler then called determine which process should given control CPU. signalled process maintains priority strictly greater than that signalling process, becomes current process context switch performed. Otherwise, process that called signal continues executing current process. also possible process call signaln increase semaphore count value greater than effect, processes that waiting semaphore transitioned ready state. fewer than processes waiting semaphore, only those waiting processes transitioned Ready list. After appropriate number process transitioned, Scheduler called determine which process should given control CPU. Please refer Semaphore Functions section page more information about using semaphores. Mailbox portion private context area allocated every process mailbox. mailbox used contain message sent another process. process only retrieve messages from mailbox-it cannot retrieve messages from mailboxes belonging other processes. Additionally, mailbox contain only single message. ZTP, message scalar object. This object arbitrary 24-bit value. message only pertains process that sends message, process that receives it.The message counter, pointer, time stamp, anything else appropriate your application. send message mailbox another process, call send API. mailbox process which sending message already contains message, send function returns error. Operating System Components RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide retrieve message from private mailbox, process calls receive function. mailbox contains message, control immediately returned caller, along with message. However, mailbox does contain message, process transitioned Blocked list until message sent some other process. Please refer Mailbox Messaging Functions section page additional information. Message Port message port similar mailbox that allows processes exchange messages. However, there several important differences. message port private object. process system place message message port, other process remove message from message port. Therefore, producing consuming processes must familiar with message port being used exchange. This port returned when message port created (see description KE_PortCreate message port function page 240). addition, pcreate call defines maximum number messages that placed message port. That unlike mailbox, message port contain arbitrary number messages. send message message port, psend called. remove message from message port, preceive must called. operating system uses semaphores synchronize access message port. Conceptually, message port viewed finitelength queue. Messages added queue removed from beginning queue. queue protected producer semaphore. initial value this producer semaphore matches size message port specified call pcreate. front queue protected consumer semaphore, initial value which zero (that message port contains messages). Every time process sends message message port, must first acquire producer semaphore. (The acquires this semaphore auto- RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual matically part psend API). resulting count producer semaphore negative, then message port full message cannot added port. this case, calling process blocks producer semaphore. message port full, then adding message port causes consumer semaphore count increase Each time process attempts remove message from message port, must first acquire consumer semaphore. consumer semaphore count less than equal zero, there messages message port caller blocks until producing process sends message message port. However, consumer semaphore count positive, then control immediately returned process that called preceive, along with message from beginning port. Each time message removed from message port, automatically signals producer semaphore allow first process that blocked producer semaphore message message port. Please refer Message Port Functions reference page more information about using message ports. Process State Transitions diagram Figure helpful toward understanding events that cause process change states. Ready Current states directly related Scheduler's Ready Current lists. Blocked list comprised processes other states. Process State Transitions RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Sleeping Wake-up Sleep Send Receiving Receive Signal Waiting Wait Reschedule Ready Reschedule Current Suspend Suspended Suspend Resume Create Figure XINU Process States Real-Time Characteristics certain degree, real-time subjective term that largely dependent upon your application. system said real-time able respond events produce results that satisfy timing requirements environment. only must information processed correctly, there also critical element time which, which, during which RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual information must available. degree which system tolerate timing violations used classify system hard real time, opposed soft real time. hard real-time system, timing violations simply option. soft real-time systems, timing violations inappropriate, tolerated. understand distinction, consider hypothetical example laser beam used reshape cornea human during corrective surgery. beam must precisely positioned, must fire exact duration time, must react miniscule movements they occur. system controlling this beam exhibits hard real-time requirements. Activating beam early, late, incorrect duration result permanent damage patient's eye, therefore unacceptable. Contrast example above with highway toll booth system that photographs analyzes license plates automobiles, they pass certain position, calculate toll levied against vehicle's owner.The system required correctly identify license plates when vehicles travelling normal highway speeds least length apart. Although undesirable system violate timing requirements, occasional loss toll presents much more acceptable error than previous example. With this understanding, unsuitable environment where hard real-time response required. exhibits many aspects hard realtime systems such preemptive multitasking, prioritized tasks, multithreaded interrupt latency, fast context-switching times, deterministic thread-scheduling policy. However, there absolute guarantee that system always able meet statistically-observed timing. above does imply that cannot used real-time environment. However, application developer should consider following items when deciding meets requirements application. Real-Time Characteristics RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide timing characterizations dependent upon hardware configuration application (system clock speed, memory access time, mode configuration, etc.). Some operating system functions require varying amounts processing time depending state system. example, memory allocation requests take longer heap becomes fragmented. Although context-switching times order tens microseconds (depending hardware configuration), should multiple interrupts occur while system switching contexts even immediately after context switch performed before instruction context executed), switching time become unbound. best real-time response likely achieved inside highpriority cost preventing other ISRs from executing. This situation result loss data. current version targets interrupt latency maskable interrupt less than while processing moderate levels traffic both Ethernet interfaces (for RAMbased projects running eZ80F91 Development Platform MHz). Therefore, developer expect typically start executing within event occurring. However, ZiLOG does guarantee that this latency never exceeded. example, interrupt handlers execute long-running error recovery paths certain device errors detected. Please section Interrupt System page more information interrupt latency. RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Protocol Overview TCP/IP most popular networking standards, used number devices from mainframes tiny embedded devices. Although Transmission Control Protocol (TCP) Internet Protocol (IP) main protocols TCP/IP protocol stack, complete suite include many other protocols (such UDP, SMTP, TFTP, SNMP, etc.). TCP/IP implementations vary widely size, from stacks that occupy megabytes essential functionality packaged tens kilobytes. includes aTCP/IP stack optimized ZiLOG processors along with user interfaces where appropriate, shown Figure provides developers clean straightforward mechanism choosing protocol they require, cuts down size requirements only what actually used. also provides further size reduction allowing optimization table sizes internal some stack elements. supports networking over Ethernet connections dial-up lines, designed help application developer quickly deploy ZiLOG products Internet-based systems using minimal code data memory. features HTML-to-C Compiler help build web-based applications. While this manual intended primer TCP/IP protocols, this section briefly describes each TCP/IP stack elements. next section, titled Using page describes them. more information, consult many TCP/IP tutorials books that available. HTTP HyperText Transfer Protocol standard protocol used transferring information between hosts over TCP/IP-based networks, most common being Internet. HTTP often referred World Wide protocol because manipulates interconnected information around globe. Each piece Protocol Overview RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide information ultimately retrieved from HTTP server operating host with access required piece(s) information. HTTP server manages multiple connections simultaneously. HTTP client-server protocol. client host initiates transfer contacting server host. most common HTTP client browser, such Microsoft Internet Explorer Netscape Navigator. browser, referred client, issues HTTP requests access information from webserver. server must operating before browser initiates request. Generally, most browsers designed make multiple simultaneous connections retrieve multiple pieces information about page. those pieces information different servers than browser communicates with multiple servers same time. TFTP Trivial File Transfer Protocol less-complex version FTP. Similar FTP, TFTP protocol allows clients read write files from/to TFTP server. However, TFTP lacks command ability authenticate clients. TFTP designed work with datagram protocols (such UDP) that offer reliable data delivery.Therefore, TFTP utilizes time-out retransmit mechanism ensure data transfer. these characteristics allow TFTP require less resources than FTP. SMTP Simple Mail Transfer Protocol specifies details electronic mail exchange between hosts (computers). hosts acts SMTP server other acts SMTP client.The SMTP client contacts SMTP sever when must send mail message (arbitrary information) user another host. SMTP uses make exchange. protocol consists simple ASCII text commands, sent between sending receiving hosts, that determine identification readiness each host. validity email address(es) involved exchange usually verified before transferring mail messages. RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Telnet Telnet protocol allows user access host using remote terminal. When connection established, user communicate host using console screen keyboard terminal directly connected host. result, Telnet client access shell commands available remote host. Telnet uses connect host, provides mechanism negotiate different options, such character selection half- full-duplex operation. BOOTP Bootstrap Protocol allows host determine address during system startup. used client machines that either ROM-based diskless. format messages, both requests replies, same. BOOTP uses transfer protocol message transmission, client hardware address client identification, limitedbroadcast address destination message. BOOTP requires that network administrator maintain configuration file that maps addresses each host. DHCP Dynamic Host Configuration Protocol extension BOOTP. offers everything that BOOTP offers, addition assigns addresses dynamically each host without maintenance configuration file network administrator. network administrator supplies addresses that used dynamic assignment. also allows some hosts given specific static address, performed BOOTP. addition, DHCP allows other server addresses specified, such name servers gateways. DHCP works well environments where hosts mobile, cases where there limited number addresses that must shared between multiple hosts that required constantly connected network. Protocol Overview RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Domain Name Server system distributed database system across Internet used human readable domain names into addresses. client host requiring translation domain name must know address least Domain Name Server. uses transfer Domain Name Server formatted messages. client sends request known server. server cannot translate domain name into address, becomes client makes request another server. server translate domain name, resulting translation sent back original host client. after number requests, domain name cannot translated, client receives error message. TIMEP Time Protocol allows client obtain date time from host TIMEP server. motivation this protocol arises from fact that systems incorporate date/time clock, subject occasional human machine error. TIMEP uses access network server. time servers makes possible quickly confirm correct system's time conducting brief poll several independent sites network. server unable determine time, either refuses connection closes without sending data. official time number seconds since midnight, January 1900 GMT. This baseline time origin serves until year 2036. SNMP Simple Network Management Protocol provides network managers capability manage entities TCP/IP network. example, SNMP used restart routers reconfigure routes. SNMP runs application level operates Client-Server paradigm. command structure follows Fetch-Store model that controls simple data items particular operation. SNMP Agent server) controls database objects. Each object contains unique identifier. SNMP RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual management entity client) retrieve objects from this database and/ modify values objects database. result, higher level user interface developed that uses SNMP protocol query status control operation remote devices manipulating objects database. Transmission Control Protocol provides reliable, flow-controlled, end-to-end, stream service between machines using mechanism communication. operates even datagrams delayed, duplicated, lost, delivered order, delivered with corrupted truncated data. layer uses port numbers identify many application protocols that over Secure Sockets Layer protocol adds security features such authentication, privacy (encryption) data integrity basic data transfer. includes (version 2.0) server that used with protocol. With ZTP, using easy using TCP-the same commands used create connection transfer data used create connection transfer encrypted data. also includes HTTPS server that used transfer encrypted pages client browser. User Datagram Protocol provides connectionless communication between application programs. Using UDP, program machine send receive datagrams from program another machine. Communication with quite simple. with TCP, uses port numbers identify many application protocols that over Unlike TCP, protocol does offer reliable data delivery, does provide flow-control. Protocol Overview RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Internet Protocol central switching point protocol software. sends receives blocks data called datagrams from network interface well upper-layer protocols. transmits datagrams from sources destinations, where sources destinations hosts identified fixed-length addresses. selection path between these addresses called routing. Internet Protocol also divides long datagrams, necessary, into manageable chunks transmission through small packet networks. module manages fragmenting reassembling packets. ICMP Internet Control Message Protocol part layer. ICMP communicates error messages other conditions that require attention. ICMP also used ping applications determine whether remote host active not. IGMP Internet Group Management Protocol used routers hosts communicate group membership information multicasting. uses datagrams communicate this information. Multicasting allows transmission datagram hosts that form single multicast membership group. multicasting makes possible members group separate physical networks. Membership multicast group dynamic. host join leave membership time, well being member more than group. Address Resolution Protocol binds high-level, addresses lowlevel, hardware addresses. Address binding software forms boundary between higher layers protocol software, which only addresses, lower layers device driver software, which only hardware addresses. RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual When sending datagram, network interface routine calls bind high-level protocol address address) corresponding hardware address. returns binding, which network interface routines encapsulate transmit packet. maintains table keep track entries. also manages request packets that arrive from network resolution. cannot resolve address, broadcasts request packet containing address question. module machine with address question replies with hardware address, updates cache both machines. size cache fixed, entries overwrite entries after reaching maximum number table entries. RARP Reverse Address Resolution Protocol provides mechanism host obtain address startup. host obtains RARP response with address from network server sending server RARP request using network broadcast address physical address identification. server required maintain hardware addresses addresses. Point-to-Point Protocol full-duplex protocol that provides communication between computers using serial interface (synchronous asynchronous). These computers typically personal computers equipped with modems connected phone line server. With PPP, users with computers home remote offices connect site's network. used Internet Protocol (IP) framing serial connection. Communications over point-to-point link established sending Link Control Protocol (LCP) packets configure test data link. After link established, peer authenticated. also uses Network Control Protocol (NCP) choose configure Protocol Overview RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide more Network Layer protocols. When each chosen Network Layer protocols configured, datagrams from each Network Layer protocol sent over link. While link provides data error detection, while higher-layer protocols responsible error recovery. link remains configured communication until explicit packets close down link, until external event occurs inactivity timer expires network administrator intervenes). HTTP Server Overview Because designed embedded system, there differences with compared webserver that runs mainframe computer system. Understanding Webserver Pages understand functions, must first understand webservers operate architecture. When user browses worldwide web, pages that viewed typically fall under categories: Static HTML pages Dynamic HTML pages Static HTML pages pages that change. example, website devoted historical monument. pages display photos monument description monument's history. pages viewed same manner everyone. Conversely, dynamic HTML pages change their content based user feedback other external events. prime example search engine. page viewed result performing search changes depending data entered into form. RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Online banking offers another example. Some banks allow each customer view, among other things, balance checking account. every customer carries same balance, views same page. These pages must generated dynamically using input received from user (name password) external sources (balance reported bank's computers). Understanding Webservers Computer Systems static HTML page collection information that typically resides server's file system. When browser requests static page, HTTP server retrieves requested information sends browser. changes occur, same information sent every user requesting that page. Dynamic pages cannot saved files because their content changes. Dynamic content created variety means, most common Computer Gateway Interface (CGI) scripts. scripts programs that, when executed, generate HTML based information sent from browser and/or external sources. Static pages easy create because they change. Dynamic pages more difficult create because HTML page generated time. Understanding Webservers Embedded Systems Embedded systems typically contain file system. They cannot save static pages separate files. saves static page string characters within program. When user requests this static page, sends this character string back browser rather than read from file. lack file system also means that embedded systems cannot save scripts separate programs. Instead saving scripts separate programs, uses function calls, collectively called functions. When function called, Understanding Webservers Computer Systems RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide generates HTML page that sent browser. this function call that programmer writes code read temperature sensor generate page that displays temperature reading user. also these function calls that programmer writes code read information sent form from browser. Based information form, programmer adjust thermostat, turn motor, Static pages dynamic pages operate similarly software. static page, webserver reads character string sends back user. dynamic page, webserver calls function, which produces content page. events that occur within function calls makes dynamic pages more powerful (and complex). RM000806-0804 Overview eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Understanding Webservers Embedded Systems RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Configuration This section describes elements that user-configurable. When running sample projects included with install package, options preconfigured work with each ZiLOG's eZ80® development kits. information this section primarily intended developers must port sample projects custom hardware platforms must tailor projects particular application. There several facets configuration: Hardware configuration configuration Network configuration Build options Hardware Configuration This section discusses files that conf directory that optionally included project files modify hardware configuration. hardware configuration files include: eZ80_HW_Config.c ipw_ez80.c net_conf.c modem.c serial_conf.c RM000806-0804 Hardware Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual eZ80_HW_Config.c eZ80_HW_Config.c file primary file used describe physical hardware configuration target platform. file organized according devices eZ80® family. There multiple #ifdef selections that contain configurations eZ80® Development Platform. Each #ifdef form: #ifdef EVB_XXX where stands evaluation board identifies target eZ80® development module included with each kit. example, #ifdef EVB_F91 hardware configuration used with eZ80F91 Development Module. target development module identified Project Settings menu option General within list box. each platform, eZ80_HW_Config.c file specifies settings for: Chip Select configuration configuration Internal configuration GPIO configuration Mode configuration Address configuration Chip Select Configuration. Chip Select Registers configured using cs_config array. Each element array used program corresponding Chip Select register target processor. elements ordered CS0, CS1, CS2, CS3. Each element within array CS_CONFIG_S structure, values which programmed into corresponding Chip Select Lower Bound, Upper Bound, eZ80_HW_Config.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Control Registers. example, must configure with lower bound 000000h, upper bound 07FFFFh, control register zero-wait-state memory device, second element cs_config array specified {0x00, 0x07, CSCTL_0_WAIT_STATES CSCTL_MEMORY_ACCESS CSCTL_ENABLE_CS}, Please Chip Select section respective eZ80 Product Specification more information about these registers. Macros used setting Chip Select Control registers found _ez80.h include file. CS_CONFIG_S structure defined ipw_ez80.h include file. Note: chip select configuration must match information supplied project file. example, configured memory device, portion memory window defined Upper Lower Bound registers either becomes part address spaces your project. This information entered Target Project Settings menu. uses this information determine what parts your project loaded into various areas address space. Configuration. After configuring chip selects, decide much physically available assigned Memory Manager. This assignment accomplished specifying entries ram_blocks array. Each element array RAM_BLOCK_S structure (see ipw_ez80.h file located ez80_inc directory) that specifies address first last bytes within contiguous memory region. example, suppose your custom hardware platform uses memory some memory mapped devices. setting Lower Bound register 18h, Upper Bound register setting 27h, then controls memory address range 180000h- RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual 27FFFFh. However, upper this memory range used memory-mapped I/O, this region must included memory controlled Memory Manager. Therefore, define entry ram_blocks array such 0x180000, 0x26FFFF Note: include multiple entries ram_blocks array physically contiguous blocks memory. your hardware platform contains block address range 100000h-17FFFFh another block range 180000h-1FFFFFh, make entries ram_blocks array because Memory Manager fails interpret these memory ranges properly. contiguous memory blocks should combined into single entry (for example, 100000h-1FFFFFh). Additionally, entries must sorted ascending order. These settings must match settings specified Target within Project Settings dialog null entry {0,0} required array indicate that more entries follow. Internal Configuration. Some members eZ80® family include internal memory (RAM and/or Flash). These devices contain control register that used enable internal block(s) address register used specify upper bits 24-bit address, where internal mapped. Please refer Random Access Memory section within appropriate eZ80® Product Specification more information about these registers. enables internal depending setting Internal_Ram variable within eZ80_HW_Config.c file. This variable type INTERNAL_RAM_S (please refer ipw_ez80.h file located ez80_inc directory) holds byte-sized values. first value programmed into Control Register second value programmed into Address Register. eZ80_HW_Config.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Note: Internal block(s) usually located fixed offsets within page. Additionally, case eZ80F91 device, internal EMAC memory must enabled integrated Ethernet controller cannot function properly. other members eZ80® family (such eZ80190, eZ80F92, eZ80F93), often uses internal contain interrupt vector tables because they must appear first address space. Please refer appropriate section eZ80_HW_Config.c file information about internal used within each target device. Internal required either operation alternate special functions added Memory Manager including entry ram_blocks array describe amount free internal RAM. Internal Flash Configuration. Some members eZ80® family include internal memory (RAM and/or Flash). These devices contain control register that used enable internal Flash address register used specify upper bits 24-bit address, where internal Flash mapped. Please refer Flash Memory section within appropriate eZ80® Product Specification (available download from www.zilog.com) more information about these registers. enables internal Flash depending setting Internal_Flash variable within eZ80_HW_Config.c file. This variable type INTERNAL_FLASH_S (please refer ipw_ez80.h file located ez80_inc directory) holds byte-sized values. first value programmed into Flash Control Register second value programmed into Flash Address Register. GPIO Configuration. GPIO Registers configured using GPIO_config array GPIO_CONFIG_S structures. sample GPIO_config array shown below: GPIO_CONFIG_S GPIO_config[ MAX_GPIO_PORTS RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual {0xFF, {0xFF, {0x00, {0xFC, 0xFF, 0xFF, 0xFF, 0xEF, ALT1 0x00, 0x00, 0x00, 0x10, ALT2 0x00}, 0x00}, 0xFF}, 0x13} Settings Settings Settings Settings Port Port Port Port Each element array contains settings GPIO port. elements ordered Port Port Port PortD. Each array element GPIO_CONFIG_S structure (please refer ipw_ez80.h file located ez80_inc directory) values which programmed into corresponding GPIO port's Date Register (DR), Data Direction Register (DDR), Alternate Register (ALT1) Alternate Register (ALT2), respectively. Please General-Purpose Input/ Output section appropriate eZ80 Product Specification more information about these registers. above example, ports follows: Port Port Port Mode Mode Mode (Input) (Input) (Alternate function Modem UART) (Alternate function Console UART) (Input) (Interrupt-active High) (Input) Port D[1:0] Mode Port D[3:2] Mode Port D[4] Mode Port D[7:5] Mode Note: every member eZ80® family includes Port When specifying GPIO configuration these devices, first element array Port eZ80_HW_Config.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide configures GPIO registers exactly time during system initialization. After this initial programming, does modify GPIO settings until next time stack initialized. Therefore, important accidentally disturb GPIO configuration. particular, aware that reading GPIO port's data register does return most recent value written register. Instead, returns current sampling pins. incorrect write code such PD_DR 04h; long assume that read matches last write data register. must access most recent value written GPIO Data Register, store this value variable unless pins specified outputs. Mode Configuration. Mode registers configured using cs_bus_mode values which programmed into Mode Control Register corresponding chip select. This data structure does need initialized included your project target device does include Chip Select Mode Control registers. sample cs_bus_mode configuration shown below: const BYTE cs_bus_mode[MAX_CHIP_SELECTS] CSBM_CTL_INTEL_MODE CSBM_CTL_2_EZ80_CLOCKS, CSBM_CTL_EZ80_MODE CSBM_CTL_1_EZ80_CLOCKS, CSBM_CTL_INTEL_MODE CSBM_CTL_1_EZ80_CLOCKS, CSBM_CTL_INTEL_MODE CSBM_CTL_4_EZ80_CLOCKS Address Configuration. When initializes Ethernet controller, passes driver pointer (p_mac_addr) memory location containing 48-bit address used network. Typically, this value stored Flash memory. example, mem- RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual address 003FFAh contains 6-byte (48-bit) address, following: BYTE p_mac_addr (BYTE 0x003FFA; explicitly define address use: const BYTE my_mac_addr[EP_ALEN] {0x00, 0x90, 0x23, 0x00, 0x0F, 0x91}; BYTE p_mac_addr my_mac_addr; ipw_ez80.c ipw_ez80.c file specifies additional hardware configuration options settings some stack components. This configuration file allows configuration/selection following: Master clock XINU system timer interrupt vector EMAC address interrupt vector Watch-dog timer DHCP usage Minimum stack size UART usage interrupt vectors address Console Connection Delay EMAC Polling effect change, modify value controlling variable, rebuild entire project. value masterclock variable must match oscillator frequency target eZ80® device. sample projects included ipw_ez80.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide with this variable value appropriate each eZ80® development modules. requires programmable reload timer operate system timer. Timer selection determined value xinu_prtc variable. default, this variable TMR0. Other values that used (TMR1, TMR2, TMR3, TMR4, TM5). Note: members eZ80® family include same number hardware timers. change XINU system timer, also necessary change value xinu_prtc_iv variable. This variable contains value interrupt vector associated with selected timer. default value this variable IV_TMR0. Other values that used IV_TMR1, IV_TMR2, IV_TMR3, IV_TMR4, IV_TMR5. configures timer generate interrupt every This interval used drive internal timings. result, required calculate appropriate value program into timer reload registers based value master clock variable particular eZ80® device being used. requirement different members eZ80® family including different timer prescaler constants. This b_initial_prtc_divisor variable contains numeric value timer's smallest prescaler. example, smallest timer prescaler value eZ80190 device value b_initial_prtc_divisor variable eZ80190 projects However, other devices such eZ80F91, smallest prescaler preemptive multitasking operating system. Therefore, after maximum interval time (called quantum time slice), operating system preempts currently executing task perform context switch another task. maximum duration time slice controlled xinu_quantum variable. This variable holds count maximum number system timer interrupts over which process allowed current process. default value this variable which means default time slice value this variable changed, keep mind that shorter time slice means that RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual operating system must perform context switches more often, resulting more operating system overhead. Longer time slices affect process' responsiveness system events. Each process allocated private stack when process created. parameters upon creation process stack size that process. stack size specified create call smaller than system-defined minimum stack size, then automatically uses system-defined minimum stack size that process. Otherwise, requested size used. xinu_min_stack variable allows user this minimum stack size. stack small, run-time failures occur. stack large, dynamic memory wasted. does require Watch-Dog Timer. However, choose enable Watch-Dog Timer, change default value xinu_uses_wdt variable from FALSE TRUE. result, writes first reset value (A5h) Watch-Dog Timer Reset Register whenever KE_EnterISR called. Similarly, second reset value (5Ah) written Watch-Dog Timer Reset Register every time KE_ExitISR called. either program Watch-Dog Control Register manually within your application call ZTP-supplied watchdog_init function. latter function sets watch-dog time-out period 227. more information, please refer Reference page 183, watchdog_init, Device Driver APIs, KE_ExitISR functions. Information about Watch-Dog Timer found appropriate eZ80 Product Specification target device. Some members eZ80® family require external Ethernet controllers. ZTP-supplied drivers these controllers assume that device connected eZ80® device external space. p_emac_base variable contains base address external Ethernet controller. eZ80F91 Development Module, integrated Ethernet controller used, thereby making value p_emac_base variable irrelevant. Additionally, external Ethernet controllers, GPIO pins typically used interrupt request line that device. Depending hardware design your target application, ipw_ez80.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide necessary change value xinu_eth_irq variable. This variable contains interrupt vector number corresponding GPIO used connect external Ethernet controller's interrupt request line. example, eZ80L92 Development Module uses interrupt request signal from CS8900A device. Note: CS8900A device experience intermittent interrupt failures when operated 8-bit mode. That under heavy network loads, CS8900A device occasionally stops generating interrupts. result, network activity come halt. prevent this situation from occurring, stack includes patch that counts many CS8900A interrupts have occurred over certain interval time. patch determines that CS8900 interrupts have occurred over this interval, calls CS8900A interrupt handler query interrupt status register CS8900A device. effect, this instance simulates CS8900A interrupt request. result reading interrupt status register, device again able generate interrupts 8-bit mode until next failure occurs. This patch contained CS8900 EMAC driver; frequency which patch executed controlled value b_poll_emac variable. this variable FALSE patch code never executed. value b_poll_emac nonzero, patch executed every b_poll_emac seconds. default, b_poll_emac variable TRUE configurations using CS8900A device. result, patch code executes every second. value b_poll_emac variable ignored configurations which CS8900A device used. Note: value b_poll_emac variable ignored configurations which CS8900A device used. When initializes TCP/IP stack over Ethernet interface, either static parameters contained Bootrecord structure, search DHCP server that dynamically assigns TCP/ stack parameters. enable DHCP, b_use_dhcp variable TRUE. static values specified Bootrecord structure, RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual b_use_dhcp variable FALSE. number attempts obtain address from DHCP server bootp_tries variable (see description netconfig.c file Network Configuration section page 54). b_xinu_uses_uart0 b_xinu_uses_uart1 parameters allow user specify whether allowed UARTs. either these parameters TRUE, uses respective UART. either parameter FALSE, does respective UART. result FALSE setting, UART available other purposes. When configured interrupts, necessary instruct stack which interrupt vectors associated with each UART (because this information depends which eZ80® device being targeted). variables used identify UART interrupt vectors b_uart0_iv b_uart1_iv. example, eZ80190 device, UART interrupts routed through corresponding device. Therefore, b_uart0_iv IV_UZI0. contrast, eZ80F91 device includes separate interrupt vectors UARTS. Therefore, b_uart0_iv IV_UART0. Please refer appropriate eZ80 Product Specification more information. default, uses UART0 console. Therefore, value consoledev variable address SERIAL0 variable (the device driver controlling UART0). change console another device (for example, SERIAL1) change value this variable address corresponding device choose console your application, consoledev variable should address NULLDEV device this case, should also b_xinu_uses_uart0 variable FALSE. Note: only devices that ZiLOG recommends console are: SERIAL0, SERIAL1, NULLDEV. max_tcp_resends variable controls maximum number times retry sending packet. number retries exceeds this num- ipw_ez80.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide ber, connection disconnected SYSERR message returned either read write function. ppp_connect_delay variable used control time delay seconds) that modem code waits after detecting signal before attempting send commands modem. This variable only applicable corresponding serial port configured RTS/CTS flow control. ShellPrompt variable specifies character string that precedes character that appears prompt displayed console shell. default prompt used console "ZTP modified changing text referenced ShellPrompt variable. TelnetPrompt variable specifies character string that precedes character that appears prompt displayed Telnet shell. default Telnet prompt "ZTP modified changing text referenced TelnetPrompt variable. net_conf.c net_conf.c file contains table nif[n]. size this table controls maximum number network interfaces. entry required nif[n] each network interface that configured system. addition network interfaces associated with hardware, such Ethernet PPP, entry must exist local network interface that used internally ZTP. insufficient entries provided, some network interfaces fail configure. Configure value reflect number hardware interfaces plus one. Note: time publication this document, should always second configurable parameter net_conf.c file value bootp_retries variable. This variable specifies number times that BOOTP/DHCP attempts solicit response from server containing parameters that local node network. After mak- RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual request, BOOTP/DHCP client waits responses before reissuing request. listening period doubles each time request reissued. first wait period seconds, next occur seconds, then seconds, Therefore, bootp_tries value BOOTP/DHCP client waits seconds response. After bootp_tries have been exhausted final timeout period elapsed, uses parameters contained Bootrecord structure main.c file Demo projects. modem.c modem.c file strictly speaking, configuration file. contains executable code that called parse entries modemchat scripts. These scripts define interaction between layer device connected Serial Port1. There nothing this file that user configure, should user change contents. However, advanced programmer plans modify interaction between software stack modem rewrite modem function this file. serial_conf.c Each member eZ80® family contains UARTs that operate different baud rates configured different word lengths. default, uses UART0 console UART1 connections. serial_conf.c file contains array (list) serialparam structures. Each structure specifies baud rate, number data stop bits, parity setting, ZTP-specific flags corresponding UART. baud rate, data bits, stop bits parameters numeric values. Parity should PAREVEN, PARODD, PARNONE specify even parity, parity, parity, respectively. list ZTP-specific flags found serial.h file. these flags, perform bitwise more following values: modem.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide SERSET_DTR_ON. This flag directs serial driver assert signal whenever corresponding serial device (UART) open. SERSET_RTSCTS. This flag directs RTS/CTS flow control over serial link. SERSET_DTRDSR. This flag currently used ZTP. SERSET_XONXOFF. This flag currently used ZTP. SERSET_ONLCR. This flag directs convert each outgoing newline character (for example, into line carriage return (for example, \r\n). This setting required some terminal emulators ensure that console output displays properly. This construct should used with PPP. SERSET_SYNC. This flag directs synchronous routine transfer data over serial ports. Synchronous requires poll underlying UART hardware instead using interrupts. This polling instance very inefficient usually results many lost characters. ZiLOG does recommend this setting. SERSET_IGNHUP. When serial driver detects loss valid Carrier Detect signal, assumes that remote serial connection disconnected physical link. result, automatically closes underlying serial device, effectively terminating serial communications. Including this flag serparams structure causes ignore loss valid Carrier Detect signal. example, configure UART 57600 bps, data bits, stop bit, parity, specify SERSET_ONLCR SERSET_IGNHUP flags, corresponding entry serparams array {57600, PARNONE, SERSET_ONLCR SERSET_IGNHUP} Note: able keep with incoming serial data baud rates greater than 57600 used. RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Operating System Configuration following configuration files used tailor configuration operating system. shell_conf.c sys_conf.c tty_conf.c These files located conf directory, described below. shell_conf.c This file contains defaultcmds array, entries which define default shell commands available console through Telnet session. Each element array cmd_ent structure (defined cmd.h) that identifies following: ASCII string characters that user enters console invoke command Boolean flag indicate whether this command internal name routine that gets called perform command link next command When modifying entries defaultcmds array, always cbuiltin field TRUE value cnext field either NULLPTR NULL. example, wanted command shell that executed when user types test console, shell function that implements this command called shell_test_cmd, following line defaultcmds array. "test", TRUE, (SHELL_CMD)shell_test_cmd, NULLPTR Operating System Configuration RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide example commands console time, main.c file PPPDemo Demo folder. explanation default commands available shell, please refer Shell Command Reference page 395. sys_conf.c This file contains tables critical operation ZTP-the process table semaphore table. Note: these tables configured small, does function. Take care tune these tables small increments while testing environment that closely simulates expected target environment. proctab[n] array represents process table. every process, there corresponding entry process table. When this table full, more processes created, create function returns SYSERR. modify maximum number processes, change value requires 10-15 entries depending actual configuration. Therefore, should plus number processes added user. list processes currently system obtained using shell command console. Please Shell Command Reference section page 395. semaph[n] array represents semaphore table. Every semaphore system that created calling screate function includes corresponding entry this table. When this table full, more semaphores created, screate function returns SYSERR. modify maximum number semaphores available system, change value Caution: Semaphores used many different parts ZTP. caution when reducing size semaph[n] array. RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual tty_conf.c This file contains table, ttytab[n]. device must configured every shell interface system. example, default console requires device does every active Telnet session. When this table full, more devices used with shell device. change number devices available with ZTP, modify value allow console Telnet session exist same time, should least two. Network Configuration configuration files identified this section also located conf directory. Modify this configuration files affect behavior TCP/IP protocol stack. arp_conf.c This file configures address resolution protocol resources. contains table arptable[n]. entry required arptable[] each network host with which this system communicates. Entries reused, table only requires enough entries handle number active concurrent connections. Configure value reflect appropriate number entries. value currently bootinfo.c This file contains boot record, which includes default settings network. settings library changed altering parameter bootinfo.c file adding file project, making these same changes main.c. following Bootrecord example shows network parameters settings. tty_conf.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide struct BootInfo Bootrecord "192.168.1.1", Default address "192.168.1.4", Default Gateway "192.168.1.5", Default Timer Server "192.168.1.6", Default File Server "192.168.1.7", Default Name Server "0xFFFFFF00L" Default Subnet Mask Note: time publication this document, Bootrecord included main.c file demo projects that TCP/IP stack. your project also includes Bootrecord main.c file, necessary include bootinfo.c file your project. dgram_conf.c This file includes table dgtab[n], which contains entries specifying endpoints. size this table configurable allow user specify many endpoints support. Configure value reflect appropriate number entries. endpoints used certain elements ZTP, such name resolution. value currently value higher than recommended. emac_conf.c This file contains get_etheraddr routine that called during initialization Ethernet interface (see init_ether). routine must copy 48-bit address that Ethernet controller should local network into system-supplied buffer. default implementation this routine checks determine whether address referenced p_mac_addr configuration variable (see eZ80_HW_Config.c) valid. default get_etheraddr routine copies this address RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual into system-supplied buffer; otherwise, copies default ZiLOG address 009023000000h into system-supplied buffer. igmp_conf.c This file contains host group table, hgtable[n]. Every time IGMP used join another group multicast address), entry placed this table. When table full, this host able join more groups. When host leaves group, corresponding entry this table removed. Configure value reflect appropriate number entries. value currently ip_conf.c This file contains RT_BPSIZE variable. value this variable determines size routing table employed ZTP. entry routing table must exist each subnet that learned this system. addition, certain number entries also required contain default route routes associated with each network interface. Configure value RT_BPSIZE reflect appropriate number routes. value RT_BPSIZE currently Caution: routing table small, portions network become unreachable from this system. caution when adjusting size routing table. routes routes shell command number entries currently routing table. ppp_conf.c This file contains variables that define configurable aspects layer, including peerauthpairs array usernames passwords, structure containing setup parameters, scripts type modemchat. igmp_conf.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide array usernames passwords named peerauthpairs[] authpair structure. example shown code segment below. struct authpair peerauthpairs[] {"ez80", "ppp"}, {"zlgusr", "zlgpwd"} Each entry contains username followed password authorized user. These additional usernames passwords used server authenticate outside clients requesting connections. Other authorized users added changed user. Changes parameters made changing parameter structure. pppconf structure type defined pppconf.h), shown follows: struct pppconf char *myaddress; char *myuser; char *mypassword; char *peeraddress; unsigned short auth; MRU; unsigned long ACCM; LCPTimer; LCPMaxTimeouts; LCPMaxTerminate; LCPMaxConfigure; offerSecondaryDNS; offerPrimaryNBNS; offerSecondaryNBNS; boolean debug; unsigned char ppp_mode; unsigned char use_peer_dns; unsigned char enable_routing; RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual unsigned char ppp_is_default_route; unsigned char do_auto_reconnect; struct modemchat *chat; nchat; These parameters further described following pages: char *myaddress. string that contains four-octet address used local connection. NULL variable indicate that local obtained negotiation from other connection. char *myuser. string that represents username that used authentication when acting client connecting remote system (dial-out). char *mypassword. string that represents client password used authentication (dial-out). char *peeraddress. string that contains four-octet address that used remote connection. NULL command indicate that remote obtained negotiation from other connection. value specified, connection only established remote negotiates same address. unsigned short auth. value that specifies authentication protocol use. value means peer authenticated. value PPP_PAP requires remote authenticate using protocol. MRU. Maximum Receive Unit specifies largest packet size that received. unsigned long ACCM. Asynchronous Control Character (ACCM) 32-bit value that specifies which control characters (those less than 20h) require transparency applied when peer transmits them over data link. Each represents value equal position that set. example, ACCM then peer required transmit value sequence 20h. ppp_conf.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide LCPTimer. Link Control Protocol Timer measures wait time between configuration packets when response received. default value seconds. LCPMaxTimeouts. maximum number time-outs duration LCP_Timer that allows either establish terminate connection. example, attempts establish connection LCPMaxTimeouts LCP_Timer seconds. Otherwise, terminates. LCPMaxTerminate. number times termination request packet sent unanswered, after which link assumed dead. LCPMaxConfigure. number times configuration request packet sent either unanswered rejected before connection terminated. offerSecondaryDNS. string that contains four-octet address secondary server provided peer. offerPrimaryNBNS. string that contains four-octet address primary NBNS server provided peer. offerSecondaryNBNS. string that contains four-octet address secondary NBNS server provided peer. boolean debug. boolean expression that indicates whether debug messages displayed console. unsigned char ppp_mode. current mode operation layer. Permissible values are: DCC_CLIENT, DCC_SERVER, DIALIP_CLIENT, DIALUP_SERVER (see definition PPP_MODE_E enumeration includes\pppconf.h file. unsigned char use_peer_dns. flag indicate should request address Domain Name Server from peer. use_perr_dns flag nonzero value, layer requests address remote's server. peer supplies address, uses this address default name server duration connection. link broken, reverts using address used before connection established. RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual unsigned char enable_routing. flag indicate should allow routing between Ethernet interfaces. enable_routing nonzero value, forwards packets received from that destined local host Ethernet interface. Similarly, packets received from Ethernet interface that destined local host forwarded over interface. unsigned char ppp_is_default_route. flag indicate whether default gateway address should changed that peer device after connection established. this flag nonzero value, default route modified peer gateway duration connection. connection terminates, original gateway address restored. unsigned char do_auto_reconnect. flag indicate whether should automatically attempt reestablish connection after link disconnected. this flag connection attempted until either ppp_resume() called until pppresume shell command executed. this flag nonzero value, immediately begins executing modemchat script specified this structure after link broken. struct modemchat chat. pointer modemchat structure that contains script executed establish physical connection. Depending current mode operation layer (see unsigned char ppp_mode above), this script could take external modem off-hook dial preconfigured number, wait incoming connection. Default scripts provided conf\ppp_conf.c file. nchat. number entries modemchat script referenced chat member this structure. Examples above settings both server client appear code segments below. Additional examples modifying these values found PPPDemo project included install. ppp_conf.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Server Settings struct pppconf 192.168.2.1, myaddress NULL, myuser NULL, mypassword 192.168.2.2, peeraddress PPP_PAP, auth protocol, none 1500, MTU/MRU 0xffffffff, ACCM LCPTimer LCPMaxTimeouts LCPMaxTerminate LCPMaxConfigure NULL, offerSecondaryDNS NULL, offerPrimaryNBNS NULL, offerSecondaryNBNS TRUE, debug DIALUP_SERVER, default DIALUP Server mode existing server, request server address from peer while connected*/ PPP-Ethernet Routing disabled, PPP-Ethernet enabled existing default route, change default route peer while connected Manual reconnect, Auto Reconnect modemchat, Default chat script Dialup Server Number entries modemchat script Dialup Server RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Client Settings struct pppconf NULL, myaddress "zilog", myuser "demo", mypassword NULL, peeraddress auth protocol, none 1500, MTU/MRU 0xffffffff, ACCM LCPTimer LCPMaxTimeouts LCPMaxTerminate LCPMaxConfigure NULL, offerSecondaryDNS NULL, offerPrimaryNBNS NULL, offerSecondaryNBNS TRUE, debug DIALUP_CLIENT, default DIALUP Client mode existing server, request server address from peer while connected*/ PPP-Ethernet Routing disabled, PPP-Ethernet enabled existing default route, change default route peer while connected Manual reconnect, Auto Reconnect dialchat, ndialchat Default chat script Dialup Client Number entries modemchat script Dialup Client ppp_conf.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Structures type modemchat contain chat scripts (character strings) that used exchanges between modem software perform tasks such answering incoming call (PPP server) dialing specific phone number (PPP client). There four default modemchat scripts ppp_conf.c file starting point creating your projects. default modemchat scripts listed Table Table Modemchat Scripts modemchat dialchat dcchostchat Used when acts server answering incoming calls from external modem. Used when acts client dialing outgoing calls using external modem. Used when acts server using Direct Cable Connect (DCC, NULL modem) client with Windows. Used when acts client using Direct Cable Connect (DCC, NULL modem) server with Windows. dccclientchat structure modemchat shown code below. struct modemchat char *send; char *expect; unsigned short timeout; modemchat parameters defined follows: send. pointer string that sent device; NULL string should sent. RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual expect. pointer string that expected from device; NULL response expected. timeout. maximum number seconds wait expected string from external device. After sending string, modem control software sets timer waits expected string. expected string arrives before time-out period, timer stopped next modemchat script executed. However, time-out occurs before expected string received, layer closes serial port abandons this connection attempt. time-out specified time-out period infinite value. snmib.c This file contains Management Information Base (MIB) controlled SNMP Agent. implemented array mib_info structures (see mib.h includes directory). There entry mib[] array each leaf object MIB. leaf object contains direct descendants. There also entries mib[] tables objects. Each mib[] table entry contains object identifier that uniquely identifies object within MIB, data type object, pointer value object, flag that indicates object modified SNMP primitive. user this file project modify mib[] appropriate application. every table that added mib[], corresponding entry added sn_table[] array located snmib.c file. This secondary table contains information required SNMP library properly manipulate objects within table. particular, each entry sn_table[] array contains address user-supplied routine implement SNMP functions objects within table. addition, sn_table[] entries contain address user-supplied function find Next object within table that accorded arbitrary input object identifier. Finally, sn_table[] entry describes number fields (that columns) within table number snmib.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide subidentifiers comprising table index. more information about updating SNMP mib[] sn_table[] arrays, please refer SNMP section page 139. snmp_conf.c This file contains user-modifiable objects within System Group general SNMP configuration values. Objects within System group that tailored your application include: SysObjectID. This object identifier uniquely identifies this product within your organization's Enterprise code. SysDescr. This displayable text string describes your product. SysContact. This displayable string contains email address contact person your organization responsible managing this device. SysName. This displayable string contains assigned name this device. Typically, this name fully qualified domain name device, such blackbox238.company.com. SysLocation. This displayable string identifies physical location this device. SysServices. This 7-bit quantity identifies service layers offered your device. addition these objects from SNMP System group, snmp_conf.c file contains following variables that tailored your application: u_short snmp_max_object_size. This variable represents number bytes largest SNMP object value that your application must process. example, define object within that 2000byte-long octet string, value snmp_max_object_size should 2000. ensure proper operation SNMP library routines, this value should always least large sizeof(struct oid). RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual char snmp_trap_target[]. This string characters identifies name device which SNMP trap message sent. name specified domain name address. default, SNMP Trap messages sent port target device. must modify destination port, append colon device name port number that should used. example, send Trap messages Port 12345 device traptarget.mycompnay.com, specify snmp_trap_target device.mycompany.com:12345. Bool Generate_Cold_Start_Traps, Bool Generate_Link_Up_Traps, Bool Generate_Link_Down_Traps, Bool Generate_Enterprise_ Traps. These flags indicate whether SNMP library should generate corresponding Trap message type. default, these flags TRUE, meaning that system generates corresponding Trap message sends snmp_trap_target[] device. system does provide mechanism disable generation individual enterprise-specific traps. Therefore, Generate_Enterprise_Traps flag FALSE, system does forward enterprise-specific Trap generated your application. char snmp_community_name[]. This text string identifies community name this SNMP device. Every incoming SNMP request (Get, Next, Set) contains target SNMP community name operation. library compares target community name value snmp_community_name[] only processes request community names match. Additionally, Authentication Traps enabled (either through modification compile time remote SNMP management entity manipulating time), then Authentication Trap sent snmp_trap_target device. tcp_conf.c This file reserves storage control block table, tcbtab[n]. entry tcbtab[] required each active endpoint. Adjusting this declaration changes maximum number endpoints that active simultaneously. Configure value reflect appropriate maximum tcp_conf.c RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide number simultaneous connection endpoints. value currently ssl_conf.c This file used control session cache server. There configurable parameters associated with server shown below. SSL_BYTE SSL_MAX_SESSION_CACHE_ENTRIES SSL_DWORD SSL_CACHE_TIMEOUT 30000; SSL_MAX_SESSION_CACHE_ENTRIES variable used specify maximum number entries that server session cache contain. When this variable server does cache information from previous sessions. result, every time client requires connect with server, server must execute computationally intensive algorithm initiate session. When session cache used, client request that server resume previously established session from session cache. server able locate required session cache, resuming previous session takes fraction time required start session. second configuration variable, SSL_CACHE_TIMEOUT, specifies maximum amount time ticks) that entry server session cache remains valid. default timeout minutes. Every time client resumes session that previously cached, timeout reset another SSL_CACHE_TIMEOUT interval. After entry server session cache times-out, necessary server execute computationally intensive algorithm establish session. newly created session's initial timeout SSL_CACHE_TIMEOUT ticks. RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Build Options final method configuring system modify build configuration within IDE. This includes linking different libraries modifying project settings. Note: Whenever source code modified user requirements, corresponding library source code file must regenerated copied .\libs folder within directory. demo project searches libraries .\libs folder changes made reflected output. Libraries software provided libraries. These libraries organized stack element, page storage, hardware support, operating system. Compiler supports software providing additional libraries. software configured provide only libraries that user requires adding object stubs some libraries that required. Table shows libraries associated object stubs provided Table Libraries Location .\libs .\libs .\libs .\libs Library arp.lib debug.lib dgram.lib eZ80190.lib Contents driver Some debug dump routines datagram driver, which provides user interface driver Platform-specific code eZ80190 device Location Object Stub Build Options RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Table Libraries (Continued) Location .\libs .\libs .\libs .\libs .\libs .\libs .\libs .\libs .\libs .\libs .\libs .\libs .\libs .\libs .\libs .\libs .\libs .\libs Library eZ80L92.lib eZ80F91.lib eZ80F92.lib eZ80F93.lib CS8900A.lib F91_emac.lib Contents Platform-specific code eZ80L92 device Platform-specific code eZ80F91 device Platform-specific code eZ80F92 device Platform-specific code eZ80F93 device External Ethernet driver CS8900A device Internal Ethernet driver eZ80F91 device Location Object Stub RT8019AS.lib External Ethernet driver Realtek 8019 device http.lib icmp.lib igmp.lib ip.lib net.lib netapp.lib ppp.lib shell.lib sys.lib tcp.lib tcpd.lib webserver ICMP driver IGMP driver driver Network configuration support routines Some small network applications, such Telnet, TIMEP, SNMP driver debug shell interfaces driver user interfaces driver .\conf tcp_stub.o .\conf net_stub.o .\conf .\conf icmp_stub.o igmp_stub.o RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Table Libraries (Continued) Location .\libs .\libs .\libs .\libs .\libs .\libs Library tty.lib udp.lib snmp.lib Contents driver that used conjunction with serial port debug shell driver SNMP driver Location .\conf .\conf Object Stub tty_stub.o udp_stub.o Acclaim_Webs Default website eZ80® family ite.lib devices eZ80_Website. Default website eZ80190 eZ80L92 devices xc.lib library routines Linker Directives linker directives explained this section. .TOS This directive Stack. requires .TOS highest physical address defined Linker Target range example, Target range 0xC00000 0xC7FFFF, then .TOS 0xC80000. This directive should address first byte data that startup code requires initialize startup code boot.asm. BSS_BASE should always reference base This directive indicates many contigous bytes data (starting with .BSS_BASE) that startup code requires initialize zero. Normally contiguous bytes data must size segment. code that sets contiguous bytes data boot.asm .BSS_BASE .BSS_LENGTH Linker Directives RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide .RAM_BASE This directive indicates memory address first byte memory defined linker target memory range. your projects this will 0xC00000. This directive indicates highest address used project (that address last byte data +1). Note that directive length segment. uses this variable identify start heap (dynamic memory allocation). This directive physical address external (Micron) Flash ZiLOG Development Platforms. uses this value display physical memory boot also external Flash into read array mode. your platform does include Micron external Flash, suggested that comment code boot.asm that writes 0xFF into .FLASH_BASE. This directive indicates total external Flash memory (Micron Flash) available ZiLOG's eZ80® Development Platform. This directive indicates total size code. uses this definition display memory usage during boot when processing console command. code this ez80\arch.c shell\x_mem.c files. .RAM_LENGTH .FLASH_BASE .TOTAL_FLASH .CODE_SIZE .DATA_SIZE RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual .INT_VT_BASE .INT_JT_BASE Currently, non-F91 modules-eZ80F92/93-must have Interrupt Vector Table (INT_VT) located first addresss space. Within this vector table 2-byte offsets Jump Table (INT_JT) that contain long jump instructions bytes each) actual ISRs. first definition tells where located second where located. code ez80\evec.c uses this information initialize interrupt system modify table entries when set_evec() called. .INT_VT_BASE then does initialize vector table during startup. eZ80F91 module, interrupt table located anywhere memory. Also, vector entries each bytes wide. Therefore there only single table located .INT_JT_BASE. Stack Configuration Many drivers omitted from including driver stub instead driver library itself. Some libraries omitted remove stack elements. available libraries stub objects shown Table page Configure libraries stub objects making appropriate entries Settings Options window (select Settings. command from Project menu). entries made Object/Library modules edit after selecting General category Linker this window. Optionally, libraries included configuration simply adding them project. Object stubs, however, included only entering them into Linker dialog. When library added project, does increase size output until function library referenced from code outside library. output size only increased amount attributed that function library. consequence, size build outputs always minimized. Stack Configuration RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide following description stub objects that substituted corresponding library. Network Stub net.lib file contains general networking functions used ARP, UDP, protocols. user's application does require network support, network stub net_stub.o linked into project instead net.lib. ICMP Driver icmp.lib file contains ICMP protocol driver. ICMP driver omitted from configuration linking file icmp_stub.o instead icmp.lib. Note: ICMP driver omitted, does respond network pings, generate network error messages. IGMP Driver igmp.lib file contains Internet group message protocol driver. IGMP driver omitted from configuration linking file igmp_stub.o instead igmp.lib. Driver tcp.lib tcpd.lib files contain transmission control protocol driver. driver omitted from configuration linking file tcp_stub.o instead files tcp.lib tcpd.lib. Driver tty.lib file contains driver used terminal communications with debug console. user's project does require driver, omitted from configuration including file tty_stub.o. RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual Driver udp.lib file contains user datagram protocol driver. driver omitted from configuration including file udp_stub.o instead udp.lib. Initialization This section describes contents initialization files sequence events that occurs before system calls main(). necessary read understand this information demo projects included with ZTP, useful developers trying debug port stack custom hardware platform. There main system files used during initialization: boot.asm boot_xxx.asm (where character code that indicate which eZ80 processors target platform. ram_boot.asm flash_boot.asm interrupt.asm f91_interrupt.asm These files available source code ez80_inc directory. After hardware-specific code these source files executed, kernel routines libraries executed initialize construct system environment which tasks operate. entry point these kernel routines nulluser() function which described this section. Ram_boot.asm compile-time, this file inserted beginning boot.asm pre-porcessor symbol RAM_MAP defined (see "Preprocessor" category Project->Settings menu). Initialization RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide RAM_MAP symbol defined Flash_boot.asm included boot.asm file. assumes that ram_boot.asm file used located address 0x000000 physical memory. This file contains eZ80 vectors which must located specific addresses start physical memory. Therefore necessary ensure that your project contains block memory beginning address 0x00 (see memory range Target Project->Settings menu). default eZ80 reset vectors (and handler) call ADL_START begin system (re)initialization. This file also contains entry point: ADL_START. This address target address jumptocode() routine boot.asm that called when KE_Reboot called. ADL_START also default target vectors vecotr. ADL_START programs eZ80 I-register (interrupt register) value .INT_VT_BASE linker symbol (see "Additional Linker Directives" window accessed selecting "Add Directives" button Linker Project->Settings menu) through variable p_INT_VT_base. last thing that ram_boot does execute code from boot_xxx.asm files. Valid values string are: eZ80F91 processor eZ80F92 processor eZ80F93 processor eZ80L92 processor eZ80190 processor Which file used depends value setting General Project->Settings menu. example, when eZ80F91 selected, ZDSII automatically defines assembler symbol RM000806-0804 Configuration eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide Reference Manual called _EZ80F91 that ram_boot.asm select appropriate hardware initialization file. Flash_boot.asm RAM_MAP symbol defined during project compilation, flash_boot.asm file inserted start boot.asm. flash_boot.asm file similar ram_boot.asm file. only difference that flash_boot.asm file does contain vectors, does contain vecotr. difference because this file only used when there some external project already loaded into internal external flash that configured reset handlers beginning memory address 0x00. Note: default demo projects, flash_boot.asm only used when project targetted either eZ80190 eZ80L92 platforms target resident flash loader been burned into external flash starting address 0x00. Boot_xxx.asm These five files (boot_F91.asm, boot_F92.asm, boot_F93.asm, boot_L92.asm boot_190.asm) contain instructions disable interrupts peripherals devices. Near system initalization, enables maskable interrupts. peripheral devices generates interrupt before system user application installs required interrupt service routine, spurious interrupt generated. this happens displays panic message console such Unexpected Interrupt!!! spins loop with interrupts disabled, hanging system. Besides disabling interrupts peripheral devices, these files contain instructions configure following eZ80 special registers: Mode (except eZ80190), Chip Selects, GPIO applicable, Internal Internal Flash. values placed into these registers found Flash_boot.asm RM000806-0804 eZ80® Family Microprocessors ZiLOG TCP/IP Software Suite Programmer's Guide eZ80_HW_Config.c file within #ifdef blocks. #ifdef block that compiled into project block defined "Preprocessor Definitions" text Preprocessor category within Project->Settings menu. Boot.asm This initialization file included file list projects. Boot.asm includes either ram_boot.asm flash_boot.asm file depending whether assembler symbol RAM_MAP defined. Once code ram_boot.asm flash_boot.asm completes execution, boot.asm performs following tasks: Initializes value eZ80 register value Linker Symbol .TOS. default this value highest memory address system. Initializes variables Although variables contain initial value, resets these variables each time system initialized ensure consistent behavior every boot. code that sets variables presumes variables contiguous block. Also, locates heap used dynamic memory allocations immediately after segment defined ram_blocks array (see ez80_HW_Config.c). Copy initialized data variables from "copy base Data" seg Other recent searchesVIPer22A-E - VIPer22A-E VIPer22A-E Datasheet SI5413-H - SI5413-H SI5413-H Datasheet NCP346 - NCP346 NCP346 Datasheet IR2101 - IR2101 IR2101 Datasheet 61L04004 - 61L04004 61L04004 Datasheet 2SC4132 - 2SC4132 2SC4132 Datasheet 2SD1857 - 2SD1857 2SD1857 Datasheet
Privacy Policy | Disclaimer |