Skip to main content
JBerry
Associate II
Jul 27, 2020 9:18 PM UTC
Solved

CubeMX 6.0.0 LwIP generates ethernetif.c that does not compile

It looks like a simple refactor bug. The ethernet_link_check_state function includes the line:

 struct netif *netif = (struct netif *) argument;

but argument does not exist and netif is the name of the function argument. I assume a previous version had argument passed in as a void*. Deleting the line seems sufficient to fix it. Is there a way I can fix it so that it persists across a regeneration?

This topic has been closed for replies.
Bino
BinoBest answer
ST Employee
Aug 24, 2020 7:32 AM UTC

You can update the FTL template (ethernetif_h7.ftl for H7) located in your installation folder (ex. C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX<x.y>\db\templates) so that the fix will persist across regeneration.

BR

10 replies

Khouloud ZEMMELI
ST Employee
Aug 6, 2020 9:03 AM UTC

Hello @JBerry​ 

could you please share your ioc file?

Thanks

Khouloud

JBerry
JBerryAuthor
Associate II
Aug 6, 2020 3:05 PM UTC

Hi @Khouloud ZEMMELI​ here is an .ioc file that has the problem. Thanks.

Khouloud ZEMMELI
ST Employee
Aug 7, 2020 8:14 AM UTC

Thanks @JBerry​  for the feedback, issue will be fixed.

Best Regards,

Khouloud

ETywo.1
Associate
Oct 9, 2020 12:10 PM UTC

Soooo how's that fix coming along? It's been two months. Please tell your management that CI is a valuable thing to do and would have caught this before the bug got released. Seriously.

Bino
BinoBest answer
ST Employee
Aug 24, 2020 7:32 AM UTC

You can update the FTL template (ethernetif_h7.ftl for H7) located in your installation folder (ex. C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX<x.y>\db\templates) so that the fix will persist across regeneration.

BR

Khouloud ZEMMELI
ST Employee
Aug 31, 2020 2:48 PM UTC

@JBerry​ , Fix is done, it will be available for the next release.

Best Regards,

Khouloud

HGumb.1
Associate
Sep 20, 2020 4:19 PM UTC

I think I have the same problem? My STM32Cube MCU Packgage for STM32H7 Series is 1.8.0

Errors:

'argument' undeclared (first use in this function); did you mean '_reent'?

'netif' redeclared as different kind of symbol

make: *** [LWIP/Target/subdir.mk:18: LWIP/Target/ethernetif.o] Error 1

Frak.1
Associate II
Oct 30, 2020 9:26 PM UTC

Hi!

I had the same issue. I realized that "netif" variable is passed as parameter to this function and then it is assigne to the 'netif' (redeclaration). So I changed the argument passed to this function from 'netif' to 'argument'

void ethernet_link_check_state( struct netif *arguement)

That at least fixed the compile error and my simple http server started.

Regards,

SHong.5
Associate III
Nov 6, 2020 8:52 AM UTC

Hi!

Did you change anything else other than "void ethernet_link_check_state( struct netif *arguement)"?

As I changed *netif to *arguement, initial error is gone, but other issues popped up.

Regards,