Connect Wi-ME Integration Kit

Digi Connect Wi-ME Integration Kit, Connect EM Integration Kit, Connect SP, Connect Wi-EM Integration Kit, NET 50 Microprocessor User guide

  • Hello! I am an AI chatbot trained to assist you with the Digi Connect Wi-ME Integration Kit User guide. I’ve already reviewed the document and can help you find the information you need or explain it in simple terms. Just ask your questions, and providing more details will help me assist you more effectively!
NET+OS with Green Hills
BSP Porting Guide
Operating system/version: 6.2
Part number/version: 90000693_B
Release date: March 2006
www.digi.com
NET+Works with Green Hills
Tools BSP Porting Guide
©2006 Digi International Inc.
Printed in the United States of America. All rights reserved.
Digi, Digi International, the Digi logo, the Making Device Networking Easy logo, NetSilicon, a
Digi International Company, NET+, NET+OS and NET+Works are trademarks or registered
trademarks of Digi International, Inc. in the United States and other countries worldwide. All
other trademarks are the property of their respective owners.
Information is this document is subject to change without notice and does not represent a
committment on the part of Digi International.
Digi provides this document “as is,” without warranty of any kind, either expressed or
implied, including, but not limited to, the implied warranties of, fitness or merchantability
for a particular purpose. Digi may make improvements and/or changes in this manual or in
the product(s) and/or the program(s) described in this manual at any time.
This product could include technical inaccuracies or typographical errors. Changes are made
periodically to the information herein; these changes may be incorporated in new editions
of the publication.
Contents
      v
Chapter 1: Introduction ....................................................................... 1
Overview .................................................................................. 2
Application development............................................................... 2
What is the board support package?.................................................. 3
Why does the target BSP need to change from the
NET+ARM development board BSP? ............................................ 3
What are the benefits of following the NET+ARM reference design? ..... 4
What’s the best way to add my target hardware BSP platform? .......... 4
NET+OS tree structure .................................................................. 5
bsp .................................................................................. 6
examples ........................................................................... 6
bin................................................................................... 6
h ..................................................................................... 7
ghssrc ............................................................................... 7
smicng .............................................................................. 8
arm7 ................................................................................ 8
arm9 ................................................................................ 8
debugger_ files.................................................................... 8
docs ................................................................................. 8
vi      
Chapter 2: NET+OS BSP for ARM7 ............................................... 9
Overview ................................................................................. 10
Platforms................................................................................. 10
Initialization ............................................................................. 11
Initializing hardware ............................................................ 11
Initialization sequence.......................................................... 11
C library startup ................................................................. 11
NABoardInit ....................................................................... 12
ROM bootloader .................................................................. 12
BSP tree structure ...................................................................... 13
Top-level directory .............................................................. 13
bootloader subdirectory ........................................................ 13
devices directory ................................................................ 14
platforms directory.............................................................. 14
Customizing the BSP for application hardware .................................... 15
Follow the reference design ................................................... 16
Verify the features your hardware supports................................. 16
Task 1: Purchase and assign Ethernet MAC addresses...................... 16
Task 2: Create a new platform subdirectory ................................ 17
Task 3: Build and modify the BSP build file ................................. 17
Task 4: Modify the linker scripts .............................................. 17
Task 5: Modify BSP configuration files........................................ 19
Task 6: Modify the new BSP to start up the required drivers ............. 23
Task 7: Modify the format of BSP arguments in NVRAM ................... 24
Task 8: Modify error and exception handlers................................ 25
Task 9: Verify the debugger initialization files ............................. 26
Task 10: Debug the initialization code ....................................... 28
Task 11: Modify the startup dialog............................................ 31
Task 12: Modify the POST ...................................................... 31
Task 13: Modify the ACE ........................................................ 32
Other BSP customizing ................................................................. 32
BSP_NVRAM_DRIVER ............................................................. 33
TCP/IP stack ...................................................................... 33
File system........................................................................ 34
      vii
Chapter 3: NET+OS BSP for ARM9 ............................................. 37
Overview ................................................................................. 38
Supported platforms ................................................................... 38
Initialization ............................................................................. 38
Initializing hardware ............................................................ 38
Initialization sequence.......................................................... 39
C library startup ................................................................. 40
NABoardInit ....................................................................... 40
ROM bootloader ......................................................................... 40
BSP tree structure ...................................................................... 41
Top-level directory .............................................................. 41
bootloader subdirectory ........................................................ 41
devices directory ................................................................ 42
platforms directory.............................................................. 43
Customizing the BSP for application hardware .................................... 43
Follow the reference design ................................................... 44
Verify the features your hardware supports................................. 44
Task 1: Purchase and assign Ethernet MAC addresses...................... 45
Task 2: Create a new platform subdirectory ................................ 45
Task 3: Add your platform to the central build system.................... 45
Task 4: Modify the linker scripts .............................................. 45
Task 5: Modify BSP configuration files........................................ 47
Task 6: Modify the new BSP to start up the required drivers ............. 53
Task 7: Modify the format of BSP arguments in NVRAM ................... 56
Task 8: Modify error and exception handlers................................ 57
Task 9: Verify the debugger initialization files ............................. 58
Task 10: Debug the initialization code ....................................... 59
Task 11: Modify the startup dialog............................................ 62
Task 12: Modify the POST ...................................................... 63
Task 13: Modify the ACE ........................................................ 63
Other BSP customizing ................................................................. 64
BSP_NVRAM_DRIVER ............................................................. 64
TCP/IP stack ...................................................................... 64
File system........................................................................ 66
viii      
Chapter 4: Linker Files ....................................................................... 69
Overview ................................................................................. 70
Linker files provided for sample projects........................................... 70
Basic Green Hills section of the linker files ................................. 71
NET+OS section of the linker files............................................. 71
Address mapping (ARM9 only) ........................................................ 72
NET+OS memory map (ARM9 only) ............................................ 74
Memory aliasing in NET+OS (ARM7 only) ............................................ 75
Chapter 5:
Adding Flash .................................................................... 77
Overview ................................................................................. 78
Flash table data structure...................................................... 78
Adding new flash........................................................................ 80
Supporting larger flash.......................................................... 81
Chapter 6:
Device Drivers ................................................................ 83
Overview ................................................................................. 84
Adding devices .......................................................................... 84
deviceInfo structure............................................................. 84
Device driver functions ......................................................... 85
Return values............................................................................ 95
NET+OS device drivers .......................................................... 97
Device driver interface ......................................................... 98
Chapter 7:
Hardware Dependencies
for ARM7-based Platforms
...................................... 99
Overview ................................................................................100
DMA channels...........................................................................100
Ethernet PHY ...........................................................................101
ENI controller ..........................................................................101
Serial ports .............................................................................101
Software watchdog ....................................................................102
Big Endian mode .......................................................................102
      ix
System clock............................................................................102
BSP_CLOCK_SOURCE............................................................102
XTAL1_FREQUENCY .............................................................103
CRYSTAL_OSCILLATOR_FREQUENCY..........................................103
PLL Control Register setting ..................................................103
System timers ..........................................................................104
Timer 1 ...........................................................................104
Timer 2 ...........................................................................104
Interrupts ...............................................................................104
Memory map............................................................................105
Chapter 8:
Hardware Dependencies
for ARM9-based Platforms
.................................... 107
Overview ................................................................................108
DMA channels...........................................................................108
Ethernet PHY ...........................................................................108
Endianness ..............................................................................109
General purpose timers...............................................................109
System timers ...................................................................109
All other general purpose timers .............................................110
Interrupts ...............................................................................110
System clock............................................................................111
Chip selects.............................................................................111
Memory map............................................................................112
Chapter 9:
Porting NET+OS v6.0 Applications
to NET+OS v6.2
.......................................................... 113
Overview ................................................................................114
BSP build file ...........................................................................114
Application build files.................................................................114
Linker scripts ...........................................................................115
Bootloader files ........................................................................115
Cache API ...............................................................................115
Embedded Networking Interface ....................................................116
x      
ISR API ...................................................................................116
RAM API .................................................................................116
Real Time Clock driver................................................................116
SYSCLK API ..............................................................................117
GPIO configuration ....................................................................117
SPI API ...................................................................................118
Stack sizes for exception handlers..................................................118
Interrupt priorities ....................................................................118
Chapter 10:
Porting NET+OS v6.1 Applications to
NET+OS v6.2
.............................................................. 119
Overview ................................................................................120
BSP build file ...........................................................................120
Application build files.................................................................120
Linker scripts ...........................................................................121
Bootloader files ........................................................................121
Client parallel driver ..................................................................121
I2C driver ...............................................................................122
Interrupt Service Routine (ISR) API .................................................122
MMU API .................................................................................123
PLL functions ...........................................................................123
Real time clock driver ................................................................124
GPIO configuration ....................................................................124
Timer driver ............................................................................124
SPI API ...................................................................................125
Network heap caching ................................................................125
USB host API ............................................................................125
      xi
Appendix A: Using Central Build .......................................129
Overview ................................................................................130
Design.............................................................................130
Structure .........................................................................130
Building with ns9360_a.gpj ..........................................................134
Building a single application ..................................................134
Adding a new application......................................................135
Adding a custom BSP ...........................................................137
Setting options .........................................................................139
Platform..........................................................................140
CPU type .........................................................................140
Endianness .......................................................................140
Warnings .........................................................................140
Optimization.....................................................................140
Debug .............................................................................141
Define flags ......................................................................141
Build option macros ............................................................141
Adding paths.....................................................................142
Directory path...................................................................142
File hooks ........................................................................143
Appendix B: Customizing the SPI Bootloade
r ....................... 145
Overview ................................................................................146
SPI bootloader application images ..................................................147
ROM image .......................................................................147
RAM image .......................................................................147
Application image structure .........................................................148
Application image header .....................................................148
boothdr utility...................................................................150
spibootldr utility ................................................................151
Generating an image ..................................................................152
Configuration file ...............................................................152
General bootloader limitations ...............................................153
Customizing the SPI bootloader utility .............................................154
Customization hooks ...........................................................154
xii      
Appendix C: Customizing the ROM Bootloader.................163
Overview ................................................................................164
Bootloader application images ......................................................164
ROM image .......................................................................164
RAM image .......................................................................165
Application image structure .........................................................166
Application image header .....................................................166
boothdr utility..........................................................................168
Generating an image ..................................................................168
Configuration file ...............................................................169
General bootloader limitations......................................................170
Overview of customizing .............................................................170
Customization hooks ..................................................................171
Appendix D: Customizing ACE ............................................ 179
Overview ................................................................................180
Configuring ACE ........................................................................180
Setting the static IP configuration ...........................................181
Setting DHCP configuration ...................................................182
AUTOIP configuration ..........................................................183
Stopping ACE ....................................................................183
Appendix E: Processor Modes and Exceptions ................ 185
Overview ................................................................................186
Vector table ............................................................................186
IRQ handler .............................................................................188
Servicing AHB interrupts in ARM9 based NET+ARM processor. ...........189
Servicing Bbus interrupts in ARM9 based NET+ARM processor ...........189
Changing interrupt priority ..........................................................190
AHB interrupts: ARM9-based processors.....................................190
Bbus interrupts: ARM9-based processors ....................................193
System interrupts: ARM7-based platforms ..................................195
      xiii
Interrupt service routines ............................................................197
Installing an ISR .................................................................197
Disabling and removing an ISR ................................................197
ARM9 FIQ handlers.....................................................................197
ARM7 FIQ handlers.....................................................................198
Appendix F: Memory Usage in Networked Applications
. 199
Overview ................................................................................200
Block pools.......................................................................200
Byte pools........................................................................200
Network heap application tuning ...................................................201
Memory usage in TCP connections ..................................................201
Active close of a TCP connection ...................................................202
Time wait state of a TCP connection...............................................203
Using a connection reset instead of an orderly close ............................203
Maximum number of sockets.........................................................204
       xv
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 6.2 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.2. By default, this software is installed in the
C:/netos62_ghs/ 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
xvi       
NET+Works with Green Hills BSP Porting 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.
monospaced type
File names, pathnames, and code examples.
To read about See
An overview of the board support package Chapter 1, “Introduction”
Using the board support package to create a
platform for your customized hardware for
ARM7-based platforms
Chapter 2, “NET+OS BSP for ARM7”
Using the board support package to create a
platform for your customized hardware for
ARM9-based platforms
Chapter 3, “NET+OS BSP for ARM9”
The linker files that are provided for sample
projects
Chapter 4, “Linker Files”
How to update flash memory Chapter 5, “Adding Flash”
Device drivers and device definition Chapter 6, “Device Drivers”
NET+OS hardware dependencies for platforms
that use the NS7520 and NET+50 processor
Chapter 7, “Hardware Dependencies for
ARM7-based Platforms”
NET+OS hardware dependencies for platforms
that use the NS9360 and NS9750 processors
Chapter 8, “Hardware Dependencies for
ARM9-based Platforms”
The differences between the APIs in NET+OS
6.0 and NET+OS 6.2
Chapter 9, “Porting NET+OS v6.0 Applications
to NET+OS v 6.2”
The differences between the APIs in NET+OS
6.1 and NET+OS 6.2
Chapter 10, “Porting NET+OS v6.1
Applications to NET+OS v 6.2”
www.digi.com
       xvii
In addition, a series of appendixes provide information about:
The central build system
Customizing the SPI bootloader, the ROM bootloader, and the Address
Configuration Executive (ACE)
Processor modes and exceptions
Memory usage
Related documentation
NET+Works Quick Install Guide describes how to install the hardware.
NET+Works with Green Hills Getting Started Guide provides a brief,
hands-on exercise.
NET+Works with Green Hills Programmer’s Guide describes how to use
NET+OS to develop programs for your application and hardware.
The NET+Works online help describes the application program interfaces
(APIs) that are provided with NET+OS.
For information about 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.
Documentation updates
Digi occasionally provides documentation updates on the Web site.
Be aware that if you see differences between the documentation you received in
your NET+Works package and the documentation on the Web site, the Web site
content is the latest version.
xviii       
NET+Works with Green Hills BSP Porting Guide
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 this
contact information:
United State telephone: 1 877 912-3444
International telephone: 1 952 912-3444
Web site: http://digi.com
       1
Introduction
CHAPTER 1
This chapter provides an overview of the Board Support Package (BSP) software,
describes how this software is segmented from higher layer application software, and
provides hardware design guidelines to minimize the cost of the software effort. In
addition, this chapter describes the NET+OS tree structure.
Overview
2       
NET+Works with Green Hills BSP Porting Guide
Overview
After you complete a system analysis that includes data throughput, I/O and
processing requirements and select the NET+ARM processor as the target processor,
you can begin two efforts: hardware design and software development.
Hardware design might require a complete new board design, reusing or modifying
a previous design, or using an off-the-shelf NET+ARM module. Target hardware
often is unavailable to software developers for weeks – and sometimes even
months. To minimize product time-to-market, you can begin software development
immediately by partitioning the effort into two distinct tasks: application
development and the board support package (BSP).
Application development
Application development involves piecing together hardware-independent, high-
level software components, while the BSP provides hardware-specific services along
a standardized application programming layer (API) to the application software.
By using a NET+ARM development board and its associated BSP, you can begin
software development immediately. NET+OS is delivered with BSPs to support all
NET+ARM development board platforms and all DIGI Connect products. Each BSP is
tailored to support the development board’s specific target processor (for example,
the NS9360 or NS7520) and the components that surround the processor (memory
and PHY).
The development board is ideal for prototyping general network services, including
Web pages, private management information bases (MIBs), FTP servers, SMTP clients,
or network startup characteristics such as DHCP or Auto IP. In addition, you can pro-
totype non-volatile system configuration, I/O protocols, field upgrade mechanisms,
or file system requirements effectively with a NET+ARM development board.
Alternatively, the BSP enables you to create the platform-specific software needed
to support a hardware platform. Because the BSP is hardware-specific, completing
this software requires the target hardware – and so must wait until the target
hardware is debugged and available.
/