Forums

uIP checksum problem (LPC2378)

Started by Tim Mitchell October 16, 2008
I'm still struggling with getting uIP to work on LPC2378 (Olimex
LPC2378STK board). I have got ARP working, but when I send a TCP packet
the PC shows a checksum error.

I've gone through Paul's code for LPC2124 which helped with some
structure packing issues, but unfortunately I started with the latest
version of uIP which has changed quite a bit from that. I have checked
with the FreeRTOS code and my checksum code seems to be the same as
that. I have implemented all the workarounds in the errata sheet as
well. I am wondering if it's some sort of integer size problem or
endianness or something which I haven't set properly. Anyone any ideas?
--
Tim Mitchell

An Engineer's Guide to the LPC2100 Series

> -----Original Message-----
> From: l...
> [mailto:l...] On Behalf Of Tim Mitchell
> Sent: 16 October 2008 10:33
> To: l...
> Subject: [lpc2000] uIP checksum problem (LPC2378)
>
> I'm still struggling with getting uIP to work on LPC2378
> (Olimex LPC2378STK board). I have got ARP working, but when I
> send a TCP packet the PC shows a checksum error.
>
> I've gone through Paul's code for LPC2124 which helped with
> some structure packing issues, but unfortunately I started
> with the latest version of uIP which has changed quite a bit
> from that. I have checked with the FreeRTOS code and my
> checksum code seems to be the same as that. I have
> implemented all the workarounds in the errata sheet as well.
> I am wondering if it's some sort of integer size problem or
> endianness or something which I haven't set properly. Anyone
> any ideas?
>
Is the checksum actually failing - or are you just getting error messages
with reference to the checksum from your packet sniffer (Wireshark or the
like)? Is it on incoming or outgoing packets?

It is normal to see checksum errors on packet sniffers where the NIC adds a
checksum as the packet exits your system, after the packet has already been
captured by the sniffer, so the sniffer never sees the correct checksum.

If you are using Wireshark then you can turn that error reporting off.

Step through the code where the checksums are actually calculated and
compared to know if you have a genuine problem.

Regards,
Richard.

+ http://www.FreeRTOS.org
17 official architecture ports, more than 6000 downloads per month.

+ http://www.SafeRTOS.com
Certified by T as meeting the requirements for safety related systems.

FreeRTOS.org Info wrote:
>> -----Original Message-----
>> From: l...
>> [mailto:l...] On Behalf Of Tim Mitchell
>> Sent: 16 October 2008 10:33
>> To: l...
>> Subject: [lpc2000] uIP checksum problem (LPC2378)
>>
>> I'm still struggling with getting uIP to work on LPC2378 (Olimex
>> LPC2378STK board). I have got ARP working, but when I send a TCP
>> packet the PC shows a checksum error.
>>
>> I've gone through Paul's code for LPC2124 which helped with some
>> structure packing issues, but unfortunately I started with the latest
>> version of uIP which has changed quite a bit from that. I have
>> checked with the FreeRTOS code and my checksum code seems to be the
>> same as that. I have implemented all the workarounds in the errata
>> sheet as well. I am wondering if it's some sort of integer size
>> problem or endianness or something which I haven't set properly.
>> Anyone any ideas?
>>
> Is the checksum actually failing - or are you just getting error
> messages with reference to the checksum from your packet sniffer
> (Wireshark or the like)? Is it on incoming or outgoing packets?
>
> It is normal to see checksum errors on packet sniffers where the NIC
> adds a checksum as the packet exits your system, after the packet has
> already been captured by the sniffer, so the sniffer never sees the
> correct checksum.
>
> If you are using Wireshark then you can turn that error reporting off.
>
> Step through the code where the checksums are actually calculated and
> compared to know if you have a genuine problem.
>

Thanks Richard, I am using Wireshark so that error is probably false.

What appears to happen is that if I just http the IP address of the
board (ie no page requested) it does actually serve the 404 page.
However it then won't do anything else until it is reset. If I ask for
index.html (which is too big to fit in one packet, unlike the 404 page)
then I get a "no data returned" error - it looks like it can send one
packet and then something goes wrong.

--
Tim Mitchell
Hi Tim,

> Thanks Richard, I am using Wireshark so that error is probably false.

It is (usually) if you have an offload engine.

> What appears to happen is that if I just http the IP address of the
> board (ie no page requested) it does actually serve the 404 page.
> However it then won't do anything else until it is reset. If I ask for
> index.html (which is too big to fit in one packet, unlike the 404 page)
> then I get a "no data returned" error - it looks like it can send one
> packet and then something goes wrong.

I seem to recall that this is something to do with the timeouts in uIP.
It's been a while since I looked into this. Debugging the uIP code was
quite easy.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

> I'm still struggling with getting uIP to work on LPC2378 (Olimex
> LPC2378STK board). I have got ARP working, but when I send a TCP packet
> the PC shows a checksum error.

Once I had alignment problems in lwIP. Try sending only data that is 16-bit or even 32-bit alligned to see where the problem is. The problem was in NE2000 driver.
Try using debug output of the uIP to narrow down the problem.