Programmers Guide6500

Download Programmers Guide6500

Post on 16-Dec-2015

38 views

Category:

Documents

6 download

Embed Size (px)

DESCRIPTION

CoBox Lantronix

TRANSCRIPT

  • Programmers Guide

    CoBox

    Version 6500 05-17-2007

    i

  • Contents

    Before starting 7 Hardware requirements........................................................................................................7 Software requirements .........................................................................................................7

    General 8 CPK Introduction.................................................................................................................8 CoBox Family......................................................................................................................8 CoBOS Introduction ............................................................................................................8 CoBOS Tasks ......................................................................................................................8 CoBOS Serial Channel Control ...........................................................................................9 Steps to writing and checking CoBox programs..................................................................9

    Hardware Overview 10 Hardware ...........................................................................................................................10

    Chipsets ...............................................................................................................10 CPU Register Usage ............................................................................................11

    Memory Maps....................................................................................................................12 DSTni Based Products.........................................................................................12 RAM3..................................................................................................................16 RAM2..................................................................................................................16 RAM1 (64 Kbytes) ..............................................................................................16 RAM0 (lower 64 Kbytes) ....................................................................................16 XPort & Micro-100 Serial Flash Page Map ........................................................17 TFTP Firmware area............................................................................................17

    Programming Environment 18 Operating System...............................................................................................................18 Directory Structure ............................................................................................................18 Environment Variables ......................................................................................................18 Compiling ..........................................................................................................................19

    Compiler..............................................................................................................19 Libraries ..............................................................................................................19 Makefile ..............................................................................................................19 Version File (VERSION) ....................................................................................19 Linker File (.LK) .................................................................................................20 Batch Files (.BAT) ..............................................................................................20 Make Commands.................................................................................................20 Firmware Support of various Products and Password .........................................21 Restrictions..........................................................................................................21

    Programming .....................................................................................................................22 Multitasking.........................................................................................................22 Watchdog ............................................................................................................22 How to Send a Ping .............................................................................................23 TCP Connections.................................................................................................24 How to open, close and re-open sockets..............................................................24 UDP Data Transfer ..............................................................................................25 Queues / FIFOs....................................................................................................26

    2 Before starting Programmer's Guide CoBox

  • Timer ...................................................................................................................27 LED Control ........................................................................................................27 Tasks....................................................................................................................27 Streams ................................................................................................................28 HTTP Server Control ..........................................................................................28 Hardware Detection.............................................................................................28

    Debugging .........................................................................................................................29 Serial Port ............................................................................................................29 Syslog ..................................................................................................................30 UDP.....................................................................................................................30 ProMon................................................................................................................31 Telnet...................................................................................................................31

    How to upgrade a project from 4.3 to 4.5 ..........................................................................31 Changes in the programming environment..........................................................31

    How to upgrade a project from 4.5 to 5.0 ..........................................................................32 Changes in the programming environment..........................................................32

    How to upgrade a project from 5.0 to 5.2 ..........................................................................33 Changes in the programming environment..........................................................33

    How to upgrade a project from 5.2 to 5.5 ..........................................................................34 Changes in the programming environment..........................................................34

    How to upgrade a project from 5.5 to 5.51 ........................................................................34 Changes in the programming environment..........................................................34

    How to upgrade a project from 5.51 to 5.8 ........................................................................35 Changes in the programming environment..........................................................35

    How to upgrade a project from 5.8 to 6.1 ..........................................................................35 Changes in the programming environment..........................................................35

    How to upgrade a project from 6.1 to 6.5 ..........................................................................36 Changes in the programming environment..........................................................36

    Additional Notes................................................................................................................37 Library Functions ................................................................................................37 Tools....................................................................................................................37

    Input and Output Functions ...............................................................................................38 FlushIn.................................................................................................................38 fprintf...................................................................................................................38 getch ....................................................................................................................38 get_int..................................................................................................................38 get_ips .................................................................................................................38 gethex ..................................................................................................................39 gethex8 ................................................................................................................39 getint....................................................................................................................39 getint8..................................................................................................