Skip to main content
ZdenekK
Associate
February 21, 2023
Solved

How to define LwIP DHCP hostname in CubeMX?

  • February 21, 2023
  • 3 replies
  • 2807 views

Hello,

I am wondering how to set the DHCP hostname for LwIP when using STMCubeMX. The CubeMX tool creates a definition for the hostname in ethernetif.c:

 #if LWIP_NETIF_HOSTNAME

 /* Initialize interface hostname */

 netif->hostname = "lwip";

#endif /* LWIP_NETIF_HOSTNAME */

However, this is "hard wired" in CubeMX. If I change it manually in ethernetif.c, CubeMX rewrites it to the default value "lwip" after each change in the IOC definition. There is no option in CubeMX for the DHCP hostname.

I am using the latest FW, latest Cube tools (CubeIDE version 1.11.0, CubeMX version 6.7.0).

BTW, I found the same question in the forum, four years old

( but with no satisfactory answer.

Thanks in advance for help

Best Regards

Zdenek

This topic has been closed for replies.
Best answer by MSG_ST

Hi,

Thank you for raising this point.

A fix will be done to make "netif->hostname" configurable via CubeMX.

Internal ticket number: 147052

(This is an internal tracking number and is not accessible or usable by customers).

Thank you for your contribution.

Regards

Mahdy

3 replies

MSG_ST
MSG_STBest answer
ST Employee
March 7, 2023

Hi,

Thank you for raising this point.

A fix will be done to make "netif->hostname" configurable via CubeMX.

Internal ticket number: 147052

(This is an internal tracking number and is not accessible or usable by customers).

Thank you for your contribution.

Regards

Mahdy

ZdenekK
ZdenekKAuthor
Associate
March 7, 2023

Hi Mahdy,

many thanks for taking care.

Best Regards

Zdenek

Amel NASRI
Technical Moderator
November 30, 2023

Issue already fixed since STM32CubeMX 6.9.0.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Associate II
February 16, 2024

Has this fix ever been done ? I cannot see an option on CUBEIDE in the LWIP section to set the Hostname