cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX uncheck "Generate Code" not working. BUG

AAlis.23
Associate III

When unchecking "Generate Code" for MX_LWIP_Init, the code is still generated anyway. It's very annoying because I have to delete the generated function every time I generate code. Using CubeMX version 6.14.

2 REPLIES 2
Ghofrane GSOURI
ST Employee

Hello @AAlis.23 

First let me thank you for posting.

When you configure peripherals and middleware in STM32CubeMX, the tool generates initialization code for these components. By default, STM32CubeMX includes function calls to initialize the configured peripherals in the main.c   file. The "Do not generate function call" option allows you to exclude these function calls from the generated code.

Using STM32H743AGIx and CubeMX 6.14.0 

when the option is checked

GhofraneGSOURI_0-1741346531823.png

The generated code is : 

GhofraneGSOURI_1-1741346562933.png

When the option is unchecked 

GhofraneGSOURI_2-1741346622105.png

==> CubeMX works correctly

 

THX

Ghofrane

AAlis.23
Associate III

Hi,

AAlis23_0-1741360127679.png

As you can see, I have "Generate Code" disabled, but when generating the code, CubeMX overwrites the lwip.c file, adding the function void MX_LWIP_Init(void). This causes a compiler error because I already have this function declared (I need to use my own function).

My goal is to use my own function and call it normally.

AAlis23_1-1741360354364.png

CubeMX fails.

In fact, I now have the function declared three times! Every time I generate the code, CubeMX adds a new copy.

AAlis23_0-1741361166107.png