Starting the DHCP in STM32 demo

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
tmanev
Posts: 22
Joined: Thu Oct 04, 2012 8:57 am

Starting the DHCP in STM32 demo

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Starting the DHCP in STM32 demo

Post 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
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: Starting the DHCP in STM32 demo

Post 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
tmanev
Posts: 22
Joined: Thu Oct 04, 2012 8:57 am

Re: Starting the DHCP in STM32 demo

Post by tmanev »

Thank you, netifapi_dhcp_start() is working for me.

Todor
Post Reply