Little Endian ARM fails on 1st TCP datagram

Gene Smith gds at
Mon Aug 18 14:01:35 UTC 2008

Gene Smith wrote:
> I am trying to bring up a new ARM bsp. ARP is working but when any TCP 
> packet comes in it is dropped. With netdemo I see a TCP error:
> "Bad offset in TCP header"
> This is referring to the 4 bit header length field in the TCP header. 
> Looking at the code with that parses this field, it either assumes big 
> or little endian, depending on a BYTE_ORDER macro. It seems to be 
> looking at it as big endian but my processor is definitely little.
> I am not sure where this is actually set. Looking around, it seems to 
> depend on a defined value __ARMEL__ or __ARMEB__ which I can't find 
> defined anywhere in the RTEMS tree.
> I did find a couple of mailing list threads that mention what seems like 
> this problem, such as this:
> But it clains it is fixed in newlib-1.13 and rtems4.8 uses 1.15. So I am 
> not sure if the problem has come back or was never really fixed or I am 
> doing something else wrong.
> -gene

When I allow BYTE_ORDER to be redefined to LITTLE_ENDIAN in endian.h as 
suggested in the above work around the problem goes away. I can now 
connect and telnet into the netdemo app. So it appears that a problem 
still exists, at least for my processor (arm946e-s).


More information about the users mailing list