cancel
Showing results for 
Search instead for 
Did you mean: 

Pre_Include_Global.h(27): warning: #47-D: incompatible redefinition of macro "USE_HAL_DRIVER"

BLill.2
Associate

What's with this warning, and how do I avoid it (apart from commenting it out). Is there something that I'm doing in error in STM32CubeMX?

I'm using Keil uVision V5.33.0.0 with an STM32F7 processor.

1 ACCEPTED SOLUTION

Accepted Solutions

It's exactly what it says: At that point, you already had a definition of "USE_HAL_DRIVER" - and you've re-defined it as something different.

The build output should also tell you where the previous definition was.

So look at the two definitions, and decide which one is the one you want.

View solution in original post

8 REPLIES 8

It's exactly what it says: At that point, you already had a definition of "USE_HAL_DRIVER" - and you've re-defined it as something different.

The build output should also tell you where the previous definition was.

So look at the two definitions, and decide which one is the one you want.

BLill.2
Associate

I guess that makes sense, but the problem is that apparently STM32CubeMX dumps it into the project options when the code gets generated. The only other place it occurs is in Pre_Include_Global.h.

I'll just rip it out of the project options and go from there.

Thanks

0693W00000ANRm8QAH.jpg

So looks like a bug in Cube's Keil project generation, then.

Perhaps @mattias norlander​  could comment? Or suggest someone on the appropriate team?

Do you get the same when generating for the CubeIDE ?

What is the actual definition in Pre_Include_Global.h ?

Hi @BLill.2​ ,

Besides to what was suggested by @Andrew Neil​  and in order to go ahead with the investigation of this issue, it will be helpful to share your .ioc file in order to reproduce the problem easily.

I add @Khouloud ZEMMELI​  on the loop to follow-up this case.

-Amel

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.

Yes Amel I confirm, it'll be helpful to use @BLill.2​'s  ioc to check more his case.

Khouloud

vix
Associate II

I have the same problem with Keil uVision V5.36.0.0, STM32H7 processor (with package DFP v 2.8.0) and STM32CubeMX 6.3.0.

I don't see the warning if I downgrade DFP back to version 2.7.0.

Is there any news?

Do you need STCubeGenerated.ioc file?

@vix​ - "Do you need STCubeGenerated.ioc file?"

as @BLill.2​ seems to have gone away without providing her/his IOC file, and @Khouloud ZEMMELI​ said it would be helpful in diagnosing the issue, I guess yours would be helpful instead?

@Andrew Neil​ , @Khouloud ZEMMELI​ 

here I attach my .ioc file.

One important thing is that with Keil::STM32H7_DFP v 2.8.0 I see the warning.

With Keil::STM32H7_DFP v 2.7.0 everything is ok.

With no changes to Keil uVision and STM32CubeMX.