lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] ARM7 data abort exception - hacky solution


From: address@hidden
Subject: Re: [lwip-devel] ARM7 data abort exception - hacky solution
Date: Tue, 02 Feb 2010 20:56:39 +0100
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1

John, did you make any progress as to why the change mention below was necessary? I'm running lwIP on a platform requiring 32-bit alignment as well and didn't yet have any error like the one you described. I'd be curious to know where your problem came from!

Simon


John Martindale wrote:

Hi all,

Just thought I'd post here in case this information helps anyone else.

I've been trying to port lwIP 1.3.0 to an ARM7 platform (LPC2148) running TNKernel 2.5 as the OS and interfacing a DM9000 device. When I ran the port I would keep getting data abort asserts, caused by trying to read invalid memory locations (for a great description of how to trap and diagnose these errors, see http://www.embedded.com/192202641). This was especially apparent with DHCP enabled (crashed immediately).

After a period of (slightly random!) tinkering with the code I found that the problem (or maybe just **a** problem?) is due to the pointers used in memory management (I’m using the default memory scheme). In mem.h, if the memory pool is <64000 bytes, then uint16 pointers are used. By forcing these to be uint32 pointers everything starts working. Altered code:

//if MEM_SIZE > 64000l

*#if* 1

*typedef* u32_t mem_size_t;

*#else*

*typedef* u16_t mem_size_t;

*#endif* /* MEM_SIZE > 64000 */

Relevant lwipopts.h settings:

*#define* MEM_ALIGNMENT 4

*#define* ETH_PAD_SIZE 2

So now I have the lwIP stack running smoothly, pinging, telnet server, (basic) http server, lovely! I haven’t had time to analyse exactly what is going on or why this works, but it might be related to this: http://lists.nongnu.org/archive/html/lwip-devel/2008-01/msg00181.html? It also doesn’t seem like a clean solution – so if anyone has a better fix please post it up.

Anyway, hope this helps someone else,

John Martindale






reply via email to

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