cancel
Showing results for 
Search instead for 
Did you mean: 

Do Not Generate Function Call option for MX_TouchGFX_Init not working

franck23
Senior

Hi,

In CubeMx, Project Manager tab -> Advanced Settings, the "Do Not Generate Function Call" for MX_TouchGFX_Init is not working.

After selecting it and generating the code, the MX_TouchGFX_Init() is still present in the main.c and going back to the Advanced Settings, the previously selected check box got deselected.

This is a problem because when using the QuadSpi with TouchGFx, it needs to be mapped before TouchGFX initialization.

The mapping cannot be made in the MX_QUADSPI_Init because there is no USER CODE section at the end of this function (Hey ST, what about having a user code section at the end of EVERY HAL init function???).

Settings:

MCU: STM32H743

CubeMx: 6.1.1

CubeIDE: 1.5.1

Firmware Package: FW_H7 1.8.0

12 REPLIES 12
franck23
Senior

Thanks for the macro tip, looks safer than using the "Do Not Generate Function Call" for the QSPI as I was doing.

I wouldn't have this issue if I was not using the "Generate peripheral initialization as pair '.c/.h'" option, but I find that it makes my code easier to maintain when using it.

Just got me in trouble this one time...

JCici.1
Associate

Hi,

I'm having the same problem. When I have selected the option "Generate peripheral initialization as a pair of '.c/.h' files per peripheral" in CubeMX, the function "MX_QUADSPI_Init()" in the file "quadspi.c" doesn't have an USER CODE section.

Is this behavior a bug?

Settings:

STM32CubeIDE 1.5.1

CubeMX 6.1.1

STM32CubeF7 Firmware Package V1.16.0

Thanks!

franck23
Senior

Maybe not a bug, but definitely an annoying oversight :(.

I don't see any valid reason for ST to populate the Mx functions differently depending on their location.

It looks like they have 2 sets of functions, which is a bit scary for maintenance!