lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] lwIP, TCP works now here. Revised cs8900a drive


From: leon . woestenberg
Subject: [lwip-users] Re: [lwip] lwIP, TCP works now here. Revised cs8900a driver released.
Date: Thu, 09 Jan 2003 01:04:50 -0000

Hello Horst,

setting MEM_ALIGN to 2 helped for me.

I think the MEM_ALIGN define is the memory
access alignment needed for anything bigger
than a byte. (correct me if I'm wrong).

Our controller does have byte granularity
memory access, but it may or may not be
able to access 16-bit words on odd addresses.
If it cannot, it was my stupid mistake not defining
MEM_ALIGN correctly.

Regards,

Leon Woestenberg.





                                                                                
                                    
                    Horst                                                       
                                    
                    Garnetzke            To:     address@hidden                 
                                      
                    <address@hidden>       cc:                                  
                                      
                    Sent by:             Subject:     Re: [lwip] lwIP, TCP 
works now here. Revised cs8900a driver   
                    address@hidden        released.                             
                                    
                    s.se                                                        
                                    
                                                                                
                                    
                                                                                
                                    
                    04-01-02 16:16                                              
                                    
                    Please respond                                              
                                    
                    to lwip                                                     
                                    
                                                                                
                                    
                                                                                
                                    




Hi Leon,

address@hidden wrote:

> I have traced down the bug that crashed my controller.
>
> My MEM_ALIGN was set to 1, on a 16-bit processor,
> which made it crash somewhere in mem_alloc() on odd\
> size memory allocations. I cannot pin-point where exactly.
>
> Of course, the error only occured on an odd-sized HTML
> page, making the debugging worse :)
>


I had the same problem some weeks ago!
For even aligned http data you should change the print statement
in file "makefsdata" at line 40 (or so):

     $file =~ s/\.//;
     $fvar = $file;
     $fvar =~ s-/-_-g;
     $fvar =~ s-\.-_-g;

     print(OUTPUT "__attribute__ ((aligned (2))) static const char
data".$fvar."[] = {\n");

     $i = 0;
     while(read(FILE, $data, 1)) {


The added
     __attribute__ ((aligned (2)))
works with gnu-gcc (linux 2.4).

Hope it helps!

/Horst

--
Horst Garnetzke                      address@hidden

[This message was sent through the lwip discussion list.]




[This message was sent through the lwip discussion list.]




reply via email to

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