cancel
Showing results for 
Search instead for 
Did you mean: 

CMAKE project generates unsuppressable macro redefine

dvescovi
Senior

I am using cubemx to generate a CMAKE project for a NUCLEO_144 based board (NUCLEO_H563).

Project generation creates a cmake/stm32cubemx/CmakeLists.txt file that generates a macro define "USE_NUCLEO_144".

it also auto creates a stm32h5xx_nucleo_conf.h file that also creates the same define:

 
/** @defgroup STM32H5XX_NUCLEO_CONFIG_Exported_Constants Exported Constants
  * @{
  */
/* Nucleo pin and part number defines */
#define USE_NUCLEO_144
/* #define USE_NUCLEO_64 */
 
This creates a duplicate redefinition warning upon build in many places as this header is included throughout my project in many places.
This is extremely annoying.
I can suppress the warning by adding:
 
#if !defined (USE_NUCLEO_144)
#define USE_NUCLEO_144
#endif /* USE_NUCLEO_144 */
 
to the stm32h5xx_nucleo_conf.h file
but of course, this change gets wiped out upon next cubemx code regeneration.
 
It would be so helpful if this guard was included if whatever mechanism you use to generate the _conf.h file.
 
 
 
 
 
 
 
1 ACCEPTED SOLUTION

Accepted Solutions

Hello @dvescovi 

Issue is fixed in the latest STM32CubeMX release 6.17.0 available here.

KR, Souhaib

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.

View solution in original post

2 REPLIES 2
Souhaib MAZHOUD
ST Employee

Hello @dvescovi 

Thanks for highlighting this issue,

Our team are aware about this issue, and it will be fixed in the upcoming releases of STM32CubeMX (Ticket 222934 This is an internal tracking number and is not accessible or usable by customers.)

KR, Souhaib

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.

Hello @dvescovi 

Issue is fixed in the latest STM32CubeMX release 6.17.0 available here.

KR, Souhaib

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.