Atmel Start LWIP socket example redefines 'struct timeval'

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

Hi,

 

It seems that lwIP is not configured correctly when using Atmel Start to generate an lwip project with sockets enabled. The lib roadrunner email redefines a 'struct timeval' (in sockets.h) but it is already defined in the arm-none-eabi toolchain (in the file '_timeval.h').

One workaround I found is to define LWIP_TIMEVAL_PRIVATE to 0 in a config file.

 

Is there a better workaround?

Last Edited: Thu. Oct 22, 2020 - 02:29 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zen89 wrote:
The lib redefines a 'struct timeval' (in sockets.h) but it is already defined in the arm-none-eabi toolchain (in the file '_timeval.h').

The joys of 'C' having only one single global namespace.

 

zen89 wrote:
One workaround I found is to define LWIP_TIMEVAL_PRIVATE to 0 in a config file

https://www.nongnu.org/lwip/2_0_...

 

Sounds like that's what it's for?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...