cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f4xx.h warning: incompatible redefinitions

jingqing3948
Associate II

When I tried to compile a new project using the latest firmware lib function (in keil MDK-ARM uVision), I got these warnings:

jingqing3948_0-1699463785586.png

whether compiling my own project or the template project.

It seems like stm32f4xx.h has a lot of incompatible redefinitions? How can I fix this?

jingqing3948_1-1699463889291.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
jingqing3948
Associate II

After review it, I know that in v1.8.1 stm32f4xx.h there is only one redefinition like this. So I delete the below section.

jingqing3948_0-1699468822143.png

 

View solution in original post

3 REPLIES 3

Yes, you're pulling content from two different include files. Perhaps you created with the Wizard?

Need to look very carefully at what Keil is pulling in vs what's in the ST libraries. Particularly CMSIS

ST's old SPL should have example MDK projects that should be more usable, and clone-able. With new MDK versions they'll want to use the version 6.xx compiler. most of the examples will expect 5.xx

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

No I think the redefinitions only happened in stm32f4xx.h itself... like the second picture above.

jingqing3948
Associate II

After review it, I know that in v1.8.1 stm32f4xx.h there is only one redefinition like this. So I delete the below section.

jingqing3948_0-1699468822143.png