   
  
90000538_C
Operating system/version: 6.0
Part number/version: 90000538_C
Release date: September 2003
www.netsilicon.com
NET+Works with GNU Tools
Programmer’s Guide
©2001-2003 NetSilicon, Inc.
Printed in the United States of America. All rights reserved.
NetSilicon, NET+Works, and NET+OS are trademarks of NetSilicon, Inc. ARM Is a registered trademark of
ARM Limited. NET+ARM is a registered trademark of ARM Limited and is exclusively sublicensed to
NetSilicon. Digi and Digi International are trademarks or registered trademarks of Digi International Inc. in
the United States and other countries. All other trademarks are the property of their respective owners.
NetSilicon makes no representations or warranties regarding the contents of this document. Information in
this document is subject to change without notice and does not represent a commitment on the part of
NetSilicon. This document is protected by United States copyright law, and may not be copied, reproduced,
transmitted, or distributed in whole or in part, without the express prior written permission of NetSilicon.
No title to or ownership of the products described in this document or any of its parts, including patents,
copyrights, and trade secrets, is transferred to customers. NetSilicon reserves the right to make changes to
products without notice, and advises its customers to obtain the latest version of relevant information to
verify, before placing orders, that the information being relied on is current.
NETSILICON PRODUCTS ARE NOT DESIGNED, INTENDED, AUTHORIZED, OR WARRANTED TO BE
SUITABLE FOR USE IN LIFE-SUPPORT APPLICATIONS, DEVICES, OR SYSTEMS, OR OTHER
CRITICAL APPLICATIONS.
NetSilicon assumes no liability for applications assistance, customer product design, software performance,
or infringement of patents or services described herein. Nor does NetSilicon warrant or represent that any
license, either express or implied, is granted under any patent right, copyright, mask work right, or other
intellectual property right of NetSilicon covering or relating to any combination, machine, or process in
which such semiconductor products or services might be or are used.
5
Contents
Using This Guide................................................................................................9
Chapter 1: NET+Works Introduction...........................................................13
Board support package..............................................................................14
HTML-to-C compiler................................................................................14
Security......................................................................................................15
Chapter 2: Building and Debugging a Sample Application........................17
About these instructions............................................................................18
Working with the sample application........................................................18
Configuring the development board..........................................................21
Tips............................................................................................................23
Running additional gdb sessions.....................................................23
printf support in gdb........................................................................23
Standard C library ...........................................................................23
Chapter 3: Using the HTML-to-C Compiler................................................25
What is the HTML-to-C compiler.............................................................26
Web content.....................................................................................26
Static and dynamic content and forms processing..........................27
Preparing to use the HTML-to-C compiler.....................................29
How the HTML-to-C compiler works ............................................30
Using the HTML-to-C compiler................................................................32
Creating a new project.....................................................................33
Removing obsolete data..................................................................34
Adding or removing source files.....................................................34
Specifying the location of files........................................................35
6
Generating C source files................................................................35
Setting or changing a project’s home page .....................................35
Editing URL files ......................................................................................37
Opening the url.c file.......................................................................37
Adding and deleting URLs..............................................................37
Editing a URL .................................................................................38
Setting the user and password of a URL.........................................38
Chapter 4: Using the MIBMAN Utility.........................................................41
Overview...................................................................................................42
SNMP..............................................................................................42
Scalar MIB objects..........................................................................43
MIB tables.......................................................................................43
Traps................................................................................................44
Action routines................................................................................44
Implementing a MIB: an example...................................................44
Converting an SNMP MIB into C code ....................................................46
Step 1: Using SMICng ....................................................................46
Step 2: Using MIBMAN.................................................................47
Step 3: Final integration..................................................................59
Writing action routines..............................................................................60
Action routines for scalar objects....................................................60
Action routines for tables................................................................64
SNMP OID and string index values................................................73
Chapter 5: Using the Advanced Web Server PBuilder Utility....................75
Overview...................................................................................................76
The PBuilder utility.........................................................................76
About the Advanced Web Server Toolkit documentation..............77
Running the PBuilder utility......................................................................78
Linking the application with the PBuilder output files .............................80
security.c file...................................................................................80
7
cgi.c and file.c files .........................................................................80
Comment tags............................................................................................81
Creating Web pages...................................................................................82
AWS custom variables....................................................................82
Data types........................................................................................83
Displaying variables........................................................................84
Changing variables..........................................................................84
Security............................................................................................87
Exceptional cases ............................................................................87
Controlling the MAW module ..................................................................89
Setting the semaphore timeout ........................................................89
Array subscripts...............................................................................90
Error handling .................................................................................91
Building the application..................................................................91
Phrase dictionaries and compression...............................................91
Maintaining and modifying Web content..................................................93
Sample applications...................................................................................94
Chapter 6: Troubleshooting...........................................................................95
Diagnosing errors......................................................................................95
Diagnosing a fatal error...................................................................96
Diagnosing an unexpected exception..............................................96
Reserializing a development board ...........................................................97
Development boards and serial numbers ........................................97
Observing the LEDs........................................................................98
Preparing to reserialize....................................................................98
Assigning a MAC address to the NET+Works board.....................98
Restoring the contents of flash ROM......................................................101
Step 1: Configure the development board and the ICE.................101
Step 2: Building the bootloader.....................................................102
Step 3: Building the application image and starting NAFTPAPP 102
Step 4: Sending rom.bin to the development board......................103
Step 5: Verifying the boot ROM image on the development board103
8
n n n n n n n 9
Review this section for basic information about this guide as well as for general support
contact information.
About this guide
This guide describes NET+OS and how to use it as part of your development cycle. Part of
the NET+Works integrated product family, NET+OS is a network software suite optimized
for the NET+ARM.
Software release
This guide supports NET+OS 6.0 By default, this software is installed in the
directory.
Who should read this guide
This guide is for software engineers and others who use NET+Works for NET+OS.
To complete the tasks described in this guide, you must:
Be familiar with installing and configuring software.
Have sufficient user privileges to do these tasks.
Be familiar with network software and development board systems.
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
••
Using This Guide
Conventions used in this guide
10
NET+Works with GNU Tools Programmer’s Guide
Conventions used in this guide
This table describes the typographic conventions used in this guide:
What’s in this guide
This table shows where you can find information this guide:
This convention Is used for
italic type Emphasis, new terms, variables, and document titles.
bold, sans serif type
Menu commands, dialog box components, and other items that
appear on-screen.
Select
menu option Menu commands. The first word is the menu name; the words that
follow are menu selections.
File names, pathnames, and code examples.
Table 1:
To read about See
The components of NET+Works Chapter 1,”NET+Works Introduction”
How to build and debug a sample
application
Chapter 2, “Building and Debugging a Sample
Application”
How to convert HTML and related Web
page files to C code
Chapter 3, “Using the HTML-to-C Compiler”
How to use the MIBMAN utility Chapter 4, “Using the MIBMAN Utility”
How to use the PBuilder utility Chapter 5, “Using the Advanced Web Server
PBuilder Utility”
Diagnosing problems and reserializing a
development board
Chapter 6, “Troubleshooting”
Table 2:
11
Using This Guide
Related documentation
NET+Works Quick Install Guide describes how to install the hardware.
NET+Works with GNU Tools BSP Porting Guide describes how to port
the board support package (BSP) to a new hardware application with
GNU tools.
The NET+Works online help describes the application programmer
interfaces (APIs) that are provided with NET+OS.
For information on third-party products and other components, review
the documentation CD-ROM that came with your development kit.
For information about the processor you are using, see your NET+Works
hardware documentation.
Customer support
To get help with a question or technical problem with this product, or to make
comments and recommendations about our products or documentation, use the
contact information listed in the tables that follow.
NetSilicon support
For Contact information
Technical support Telephone: 1 800 243-2333 / 1 781 647-1234
Fax: 1 781 893-1388
E-mail: tech_suppor[email protected]
Documentation [email protected]
NetSilicon home page www.netsilicon.com
Online problem reporting www.netsilicon.com/problemreporting.jsp
Table 3:
Digi support
For Contact information
Technical support Telephone: 1 877 912-3444 / 1 952 912-3456
Fax: 1 952 912-4960
Documentation techpubs@digi.com
Digi home page www.digi.com/support/eservice/eservicelogin.jsp
Online problem reporting www.digi.com/problemreporting.jsp
Table 4:
n n n n n n n 13
NET+Works Introduction
CHAPTER 1
This chapter provides an overview of NET+Works.
Board support package
14 n n n n n n n
NET+Works with GNU Tools Programmer’s Guide
Overview
The NET+Works products offer an embedded solution for hardware and networking
software that is being implemented into product designs.
NET+Works is designed as an alternative to a PC for products that must be connected to
Ethernet for TCP access and for Internet/Intranet access.
The NET+Works package includes:
Either the NS7520 or the NET+50
A development board and board support package
The networking firmware
The object code with application programming interfaces (APIs)
Development tools
Documentation
For information about the NET+ARM devices, see the hardware documentation for the
processor you are using.
Board support package
The board support package (BSP) is intended to work with the NET+OS real-time
operating system. Some NET+Works drivers provide the necessary APIs.
HTML-to-C compiler
The toolkit provides a compiler that translates your HTML code into C code. You can then
compile the C code as part of the project, which allows you to create the pages your menu
system needs to perform the tasks necessary for your device. Sample code also is provided.
www.netsilicon.com
n n n n n n n 15
NET+Works Introduction
Security
NET+OS 6.0 provides security based on:
Netscape Communications Secure Sockets Layer (SSL) version 3
RFC2246 Transport Layer Security (TLS) version 1, to provide secure
communications over unsecured networks
Basic X.509 certificate generation and server authentication
The services are supported:
HTTPS (HTTP over TLS v1), port 443, RFC 2818, SSLv3
Raw TCP/IP over SSL
Raw sockets over SSL (secure tunneling)
RSA key exchange/supported algorithm
Symmetric cipher algorithms
3DES-EBE-CDC
AES128-CBC
AES256-CBC
–DES
SSL is implemented through an API layer that enables existing sockets-based applications
to be modified to communicate transparently over links that are secured by the SSL/TLS
protocols.
An Advanced Encryption Standard RFC 3268-based cipher suite is available for use with
TSL. In addition, the API layer provides a mechanism by which users can invoke an SSL/
TSL-enabled HTTPS server.
n n n n n n n 17
Building and Debugging a
Sample Application
CHAPTER 2
This chapter provides a brief tutorial on the development environment.
About these instructions
18 n n n n n n n
NET+Works with GNU Tools Programmer’s Guide
About these instructions
This chapter provides a brief tutorial on the development environment using
the Raven.
These instructions assume that you installed NET+Works in
, the
default installation directory. If you installed software in a different directory,
specify the drive and directory information.
Before you begin the tutorial, see your network administrator for this information:
An IP address
A subnet mask
The default gateway
You will need this information when you configure the development board.
Working with the sample application
1 Open a terminal connection to the development board so you can monitor
development board status.
You can use HyperTerminal by selecting
Start Programs
NET+OS 6.0 GNU HyperTerminal Connection on Com1.
A terminal window opens.
2 Run — a utility that converts gdb commands to JTAG
signals — by selecting
Start Programs NET+OS 6.0 GNU 
OcdLibRemote.
A message similar to this appears:
.
3 Open a X-Tools window by selecting Start Programs
NET+OS 6.0 GNU X-Tools v3.0 Shell.
A window opens.
www.netsilicon.com
n n n n n n n 19
Building and Debugging a Sample Application
4 In the X-Tools window, start a Cygwin bash shell by running arm-elf
using this command:
This message appears:
5 Change to the board support package (BSP) directory:
6 Build the BSP by entering the set of commands for your development
board:
7 Change to the directory in which the application resides:
The directory becomes the working directory.
For this development board Use these commands
NS7520
NET+50 revision D boards
NET+50 BGA boards
Digi Connect EM
Digi Connect Wi-EM
Digi Connect ME
Digi Connect Wi-ME
Digi Connect SP
Working with the sample application
20 n n n n n n n
NET+Works with GNU Tools Programmer’s Guide
8 Build the application files by entering the set of commands for your
development board:
The application files are built.
9 Run by entering:
The prompt appears.
10 Copy the script for your development board from the
directory to the
directory, and then execute it:
For this development board Use these commands
NS7520
NET+50 revision D boards
NET+50 BGA boards
Digi Connect EM
Digi Connect Wi-EM
Digi Connect ME
Digi Connect Wi-ME
Digi Connect SP
For this development board Use this command
NS7520
NET+50
Digi Connect EM
Digi Connect Wi-EM
Digi Connect ME
Digi Connect Wi-ME
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI