Page 1 of 1

Starting the DHCP in STM32 demo

Posted: Wed Nov 14, 2012 11:52 am
by tmanev
Any idea how to start the DHCP in the lwip demo with STM32 and ChibiOS ?

I added this in lwipthread.c but the program halts somewhere in dhcp_start!

Code: Select all

  netif_set_default(&thisif);
#if LWIP_DHCP
  dhcp_start(&thisif);
#endif
  netif_set_up(&thisif);


Best regards,
Todor

Re: Starting the DHCP in STM32 demo

Posted: Fri Nov 16, 2012 10:05 pm
by Giovanni
Hi,

I hoped someone could answer, I never did this too, you could try to look for info in the lwIP mailing list.

Giovanni

Re: Starting the DHCP in STM32 demo

Posted: Fri Nov 16, 2012 10:34 pm
by mabl
Hmmm I also never used DHCP - but there is a note on the lwip wiki:
This example assumes static IP, but the final netif_set_up could be replace by dhcp_start or autoip_start (see Network interfaces management for more information).


Maybe you have to remove the call to netif_set_up?

Also:
When calling from other threads, use the netifapi_dhcp_*() functions defined in the api-module netifapi.c.

So dont use dhcp_start directly.

Also see:
http://lwip.wikia.com/wiki/Network_inte ... management
http://lwip.wikia.com/wiki/DHCP

Re: Starting the DHCP in STM32 demo

Posted: Wed Dec 12, 2012 2:22 pm
by tmanev
Thank you, netifapi_dhcp_start() is working for me.

Todor