EVK1100 Freertos + lwip + DHCP Optimization BUG

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The latest ASF release 3.3.0 comes with an updated lwip stack, which is nice.

I tried the Freertos + lwip + DHCP example project with a EVK1100 board and it seemed to be working great.

However, compiling it without doing any source modifications with optimization level -Os it does not receive a IP address from my router.

It does work with -O1, -O2, -O3 and even -O0

I was about to file a bug on the bugzilla about this, but the bugzilla seams to be lacking the option to file bugs for ASF version 3.3.0

Looking at the broadcast packages with wireshark it seems like the package gets corrupted by the Maximum DHCP message size request. It should be 1500, but it sends 56370. A byte gets missing and then the rest of the message gets misunderstood by the DHCP server.

Any ideas?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just ran into this issue as well. It still exists using avr32-gnu-toolchain-3.4.2.435, asf-3.13.1, and lwip-1.4.0. I'm trying to wrap my head around it.

Interestingly, a call to printf(), or even a barrier(), after dhcp.c line 282 sets the MSG_LEN option value clears up the bug.

dhcp.c
281:    dhcp_option(dhcp, DHCP_OPTION_MAX_MSG_SIZE, DHCP_OPTION_MAX_MSG_SIZE_LEN);
282:    dhcp_option_short(dhcp, DHCP_MAX_MSG_LEN(netif));
283:    barrier();

I don't know what the root cause of this is, or if that's the best possible work-around.