Skip to main content
Charles Yarnold
Associate II
January 2, 2017
Question

Setting a hostname with STM32Cube

  • January 2, 2017
  • 1 reply
  • 1562 views
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

    This topic has been closed for replies.

    1 reply

    Oussema Hajjem_O
    Visitor II
    January 2, 2017
    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.

    Charles Yarnold
    Associate II
    January 2, 2017
    Posted on January 02, 2017 at 17:39

    Thanks very much Leo.

    Best,

    Charles