Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(ARM).Porting TCP-IP programmer's guide.Ver 1.6.pdf
Скачиваний:
43
Добавлен:
23.08.2013
Размер:
2.64 Mб
Скачать

Introduction

1.2ARM TCP/IP requirements

Before beginning a port, you must ensure that the necessary resources are available in the target environment. There must be:

a processor with spare CPU capacity with an operating system

a debug monitor

RAM

a network interface.

The exact size of these resources varies depending on the features you plan to implement, the performance you require, and how many simultaneous users you have to support.

The following is a brief summary of services that ARM TCP/IP requires from the system:

at least one network interface device

a timer that ticks at least once a second

memory, processing power, and operating system requirements, which are detailed in this section.

1.2.1Memory requirements

It is not possible to provide exact memory requirements, however an estimate can be obtained by examining the results provided by the examples. The values provided in Table 1-1 on page 1-5 are from the menus example (see menus on page C-6). The code was compiled for the ARM7TDMI processor core in Thumb state with ADS, version 1.0.1 and was optimized for code size rather than speed. All figures exclude C runtime libraries, board support, and the Menus application.

The majority of the ipport.h build options (such as, routing, NPDEBUG, NET_STATS, and DHCP_CLIENT) are not defined, so the sizes shown in the table below are smaller than if they had been defined. Packet buffers, that are allocated from the heap at initialization time, are not included in these figures.

1-4

Copyright © 1998-2001 ARM Limited. All rights reserved.

ARM DUI 0144B

Introduction

Note

The values in Table 1-1 might change with subsequent releases because the code is subject to continuous development.

Table 1-1 ARM7TDMI memory requirements (in bytes) for a basic stack

 

Thumb

 

 

 

 

 

code and

Read-write

Zero-init

Thumb

RAM

 

read-only

data

data

ROM

 

 

 

data

 

 

 

 

 

 

 

 

 

 

IP

6720

8028

408

6804

488

 

 

 

 

 

 

ICMP

664

4

104

668

108

 

 

 

 

 

 

UDP

568

4

16

572

20

 

 

 

 

 

 

TCP

10304

76

172

10380

248

 

 

 

 

 

 

sockets

1652

0

0

1652

0

 

 

 

 

 

 

ARP

1272

20

232

1292

252

 

 

 

 

 

 

Ethernet driver

4303

80

128

4336

208

 

 

 

 

 

 

NV parameters

1336

12

200

1348

212

 

 

 

 

 

 

Totals

26820

276

1260

27096

1536

 

 

 

 

 

 

The compilers place read-only data items, such as strings and constants, into the read-only code area. Therefore, the memory requirements for the code area include these constant data items. When designing your system, you have to estimate the amount of ROM and RAM required:

The ROM requirement is the sum of the read-only area and the read-write data (the read-write data has pre-initialized values).

The RAM requirement is the sum of the read-write data and the zero-init data, plus the dynamic memory requirements of the system (for example, network buffers).

TCP and sockets use a large portion of memory. Systems that require only IP and User Datagram Protocol (UDP) services (such as routers and SNMP agents) can remove the TCP and sockets layers to reduce memory requirements.

ARM DUI 0144B

Copyright © 1998-2001 ARM Limited. All rights reserved.

1-5

Introduction

1.2.2Operating system requirements

The stack requires the following basic services from the target system:

clock tick A clock tick counter must be incremented at regular intervals. See cticks in the section on Timers and multitasking on page 2-8.

memory access

The standard malloc() and free() library calls are ideal. If you do not need a TCP or Dynamic Host Configuration Protocol (DHCP) server, these functions are called at startup time only and can be replaced with a static or partition-based scheme.

multitasking

The stack must obtain CPU cycles to process received packets (and handle timeouts) on a timely basis. Two methods are discussed in Task control on page 2-14.

1-6

Copyright © 1998-2001 ARM Limited. All rights reserved.

ARM DUI 0144B