Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)

参考了不少文章https://blog.csdn.net/weixin_39560549/article/details/79514303

不过有一些解释原文没有给出:

Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)

这句话的意思是:在你的工程里选你用到的芯片(首个STM32F4xx型号的芯片),用人话讲就是在编译的时候,编译器不知道你用的是什么芯片,

看图,跟踪错误,可知如果没define上面这几个芯片型号之一,就会报错,具体的定义位置在这:

可以见到,没有错了:

如果还是错,就把!defined (STM32F40_41xxx) && !defined (STM32F427_437xx) && !defined (STM32F429_439xx) && !defined (STM32F401xx) && !defined (STM32F411xE)

这些型号define上去,依次试试,不过别都放上去,会出现重定义,redefine问题。

如有错漏,欢迎指正。

侵删。

猜你喜欢

转载自blog.csdn.net/Mr_liu_666/article/details/115436288