2021-01-20 03:52 AM
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
Solved! Go to Solution.
2021-01-21 01:11 PM
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...
2021-02-02 09:36 AM
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!
2021-02-03 12:42 AM
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!