cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a hostname with STM32Cube

Charles Yarnold
Associate II
Posted on January 02, 2017 at 05:45

Hello all,

Finally got my ethernet working on my omliex stm32-e407 board though generating code with the STM32Cube.

Its responding to pings so good to know that and dhcp are working finally. But it seems the host name is blank, is there somewhere in stm32cube I can set this? Or just in the code I edit myself after exporting?

Cheers,

Charles

2 REPLIES 2
Oussema Hajjem_O
Associate III
Posted on January 02, 2017 at 10:42

Hello Charles,

To enable the host name on LwIP, first you have to define the LWIP_NETIF_HOSTNAME parameter to 1 in your lwipopts.h,

the default host name value is 'lwip', please refer to 'ethernetif_init()' function of ethernetif.c file.

Then you can change it by your preferred host name value, or you can call 'netif_set_hostname()' after the initialization to override the default name.

Best Regards.

Posted on January 02, 2017 at 17:39

Thanks very much Leo.

Best,

Charles