lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] ARM7TDMI lwIP porting problems


From: Alessandro Timossi
Subject: Re: [lwip-users] ARM7TDMI lwIP porting problems
Date: Mon, 21 Jun 2004 18:03:28 +0200
User-agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0

Leon,
I'm using version 0.5.0

In attachment you will find the lwipopts.h file.

Thanks a lot for your help.
Regards
Ale


Leon Woestenberg wrote:
Hello Allessandro,


On Mon, 2004-06-21 at 16:45, Alessandro Timossi wrote:

Hi all,
we are trying to port lwIP to ARM7TDMI, using ADS 1.2 suite from ARM (I

Which version of lwIP?


mean the armcc compiler too). But we found some problems related to memory allocation.

The fact is that sometimes, without any fixed scheme, a message saying that some bytes cannot be allocated appears ("Could not allocate n bytes"). But this is strange because only a few packets have been processed which cannot make the memory full. This behaviour probably

Also, can you please show your lwipopts.h file showing the memory
allocation sizes?

Regards,

Leon.



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users





--


----------------------------------------------------
ALESSANDRO TIMOSSI
Senior Consulting Engineer

Accent Srl - Design Technology Services
Via Torri Bianche 3 - 20059 Vimercate (MI) - Italy
Phone:  +39 039 6290185
Fax:    +39 039 6290140

web site: htpp//www.accent.it
Member of STMicroelectronics Group of Companies
----------------------------------------------------
/*
 * Copyright (c) 2001, Swedish Institute of Computer Science.
 * All rights reserved. 
 *
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions 
 * are met: 
 * 1. Redistributions of source code must retain the above copyright 
 *    notice, this list of conditions and the following disclaimer. 
 * 2. Redistributions in binary form must reproduce the above copyright 
 *    notice, this list of conditions and the following disclaimer in the 
 *    documentation and/or other materials provided with the distribution. 
 * 3. Neither the name of the Institute nor the names of its contributors 
 *    may be used to endorse or promote products derived from this software 
 *    without specific prior written permission. 
 *
 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
 * SUCH DAMAGE. 
 *
 * This file is part of the lwIP TCP/IP stack.
 * 
 * Author: Adam Dunkels <address@hidden>
 *
         */
#ifndef __LWIPOPTS_H__
#define __LWIPOPTS_H__

/* ------------ Memory map ------------ */
/*
 * All lwIP memory is mapped onto the Logic Module SSRAM (2MB)
 *
 * We use only the first MB for now, reserving the second one
 * for a second DMAC
 */
#ifdef ARMIP_SW
#include "logic.h"

/* 4k - max 256 Tx descriptors */
#define TX_DESC_START LMSSRAMSTART
#define TX_DESC_SIZE 0x1000

/* 4k - max 256 Rx descriptors */
#define RX_DESC_START (TX_DESC_START + TX_DESC_SIZE)
#define RX_DESC_SIZE 0x1000

/* 504k - memory pool space - mainly for tx buffers */
#define MEM_POOL_AREA_START (RX_DESC_START + RX_DESC_SIZE)
#define MEM_POOL_AREA_SIZE 0x0007E000

/* 512k - memory pool space - mainly for rx buffers */
#define PBUF_POOL_AREA_START (MEM_POOL_AREA_START + MEM_POOL_AREA_SIZE)
#define PBUF_POOL_AREA_SIZE 0x00080000
#endif /* ARMIP_SW */

/* ---------- Memory options ---------- */
#define MEM_ALIGNMENT           4

//nicola: #define MEM_SIZE                640000
#ifndef ARMIP_SW
#define MEM_SIZE                8000    //nicola 1500
#else /* ARMIP_SW */
/*
 * aldo:
 * in the memory pool space we must fit the "memory" handled by
 * the allocation mechanism + its data struct, leave 32 bytes for that
 */
#define MEM_SIZE                (MEM_POOL_AREA_SIZE - 32)
#endif /* ARMIP_SW */

#define MEM_RECLAIM             1
#define MEMP_RECLAIM            1

#define MEMP_NUM_PBUF           16      // nicola 00 
#define MEMP_NUM_UDP_PCB        8       // nicola 10
#define MEMP_NUM_TCP_PCB        8       // nicola 10
#define MEMP_NUM_TCP_PCB_LISTEN 8       // nicola 10
#define MEMP_NUM_TCP_SEG        16      //nicola 0
#define MEMP_NUM_NETBUF         10      //nicola 200 
#define MEMP_NUM_NETCONN        10      //nicola 200 
#define MEMP_NUM_API_MSG        10      //nicola 200
#define MEMP_NUM_TCPIP_MSG      10      //nicola 200

#define MEMP_NUM_SYS_TIMEOUT    20

/* ---------- Pbuf options ---------- */

//#define PBUF_POOL_SIZE          342   //aldo 512k/(bufsize+16)=342
#define PBUF_POOL_SIZE          250     //aldo has to be <= 255
#define PBUF_POOL_BUFSIZE       1516    //(MTU+ethh word-aligned)

#define PBUF_LINK_HLEN          16

/* ---------- TCP options ---------- */
#define LWIP_TCP                        1               //nicola
#define TCP_TTL                 255

/* Controls if TCP should queue segments that arrive out of
   order. Define to 0 if your device is low on memory. */
#define TCP_QUEUE_OOSEQ         1

/* TCP Maximum segment size. */
#define TCP_MSS                1000  //aldo MTU - PBUF_TRANSPORT_HLEN=1480 
should be enough

/*====================
// Ale
=====================*/
/* TCP sender buffer space (bytes). */
//#define TCP_SND_BUF             256   //nicola 20480
#define TCP_SND_BUF             20480

/* TCP sender buffer space (pbufs). This must be at least = 2 *
   TCP_SND_BUF/TCP_MSS for things to work. */
#define TCP_SND_QUEUELEN        2 * TCP_SND_BUF/TCP_MSS

/*====================
// Ale
=====================*/
/* TCP receive window. */
//#define TCP_WND                 1024  //nicola 20480
#define TCP_WND                 20480 

/* Maximum number of retransmissions of data segments. */
#define TCP_MAXRTX              12

/* Maximum number of retransmissions of SYN segments. */
#define TCP_SYNMAXRTX           4

/* ---------- ARP options ---------- */
#define ARP_TABLE_SIZE 10

/* ---------- IP options ---------- */
/* Define IP_FORWARD to 1 if you wish to have the ability to forward
   IP packets across network interfaces. If you are going to run lwIP
   on a device with only one network interface, define this to 0. */
#define IP_FORWARD              0

/* If defined to 1, IP options are allowed (but not parsed). If
   defined to 0, all packets with IP options are dropped. */
#define IP_OPTIONS              1

/* ---------- ICMP options ---------- */
#define ICMP_TTL                255


/* ---------- UDP options ---------- */
#define UDP_TTL                 255


/* ---------- Statistics options ---------- */
#define STATS

#ifdef STATS
#define LINK_STATS
#define IP_STATS
#define ICMP_STATS
#define UDP_STATS
#define TCP_STATS
#define MEM_STATS
#define MEMP_STATS
#define PBUF_STATS
#define SYS_STATS
#endif /* STATS */

#endif /* __LWIPOPTS_H__ */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]