Get AUTOIP working on lwIP
Hello forum,
I'm working in STM32CubeIDE with the STM32F107VCT6 on a custom board which successfully run a TCP Server application using Ethernet communication + FREERTOS + lwIP and I'm struggling in enabling AUTOIP feature.
My custom board need to be IP assigned if working in a network ...where a DHCP server exist, but also in a personal network (e.g. LAN cable connected from the board straight to the PC LAN Port)...where a DHCP server does not exist. Premise that DHCP if correctly working in the first scenario, I can't get the second one working.
Since switching dinamically to a static IP is not a good solution (I can't elect a static IP beforehand and...I'm freightened about doing this with lwIP) I was triggered by a forum post by LCE (here) talking of AUTOIP as solution, I've google around the web for lwIP AUTOIP feature but noone is talking about it or giving working examples, then my attempts follow below.
In STM32CubeIDE I've flagged:
General Settings > IPv4-DHCP Options > LWIP_AUTOIP (AUTOIP Module) > Enabled
Key Options > IPv4 - AUTOIP Options > LWIP_AUTOIP (AUTOIP Module) > Enabled
... > LWIP_DHCP_AUTOIP_COOP (DHCP/AUTOIP Cooperation Mode) > Enabled
...> LWIP_DHCP_AUTOIP_COOP_TRIES (DHCP AUTOIP Coop Tries) > 9 (...default value)
In lwipopts.h I correctly get:
/*----- Value in opt.h for LWIP_DHCP: 0 -----*/
#define LWIP_DHCP 1
//...
/*----- Default Value for LWIP_AUTOIP: 0 ---*/
#define LWIP_AUTOIP 1
/*----- Default Value for LWIP_DHCP_AUTOIP_COOP: 0 ---*/
#define LWIP_DHCP_AUTOIP_COOP 1
I set on the PC a static ip as follow:

Then, I expect, when connecting the board to the PC something to show up in the AUTOIP ip range: 169.254.x.y
But.. "arp -a" don't show nothing...
Is the code not working, missing something or is me missing how detect the card?
Thanks
