incompatible redefinition of macro “STM32F40_41xxx“

本文介绍了解决在重新安装Keil5 MDK后,全编译原有STM32工程项目时遇到的STM32F40_41xxx宏定义不兼容警告的方法。步骤包括:调整魔法棒设置、修改C/C++配置并移除部分宏定义。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

背景

重新安装keil5 MDK后,全编译原先的工程出现
incompatible redefinition of macro “STM32F40_41xxx” 警告

解决方案

1.点击魔法棒
在这里插入图片描述
2.点击 C/C++

在这里插入图片描述
3.将框内的 STM32F40… 只剩下 USE_STDPERIPH_DRIVER
在这里插入图片描述
4.再全编译( 撒花完结 )
在这里插入图片描述

stm32f4xx_gpio.h stm32f*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'D:\嵌入式\keil5\ARM\ARMCC\Bin' Build target 'Target 1' assembling startup_stm32f410xx.s... assembling startup_stm32f429_439xx.s... assembling startup_stm32f446xx.s... assembling startup_stm32f411xe.s... assembling startup_stm32f413_423xx.s... assembling startup_stm32f427x.s... assembling startup_stm32f40_41xxx.s... assembling startup_stm32f401xx.s... assembling startup_stm32f40xx.s... assembling startup_stm32f427_437xx.s... assembling startup_stm32f412xg.s... assembling startup_stm32f469_479xx.s... compiling stm32f4xx_rcc.c... ..\star\stm32f4xx.h(11581): warning: #47-D: incompatible redefinition of macro "DBGMCU_APB2_FZ_DBG_TIM1_STOP" (declared at line 11574) #define DBGMCU_APB2_FZ_DBG_TIM1_STOP DBGMCU_APB1_FZ_DBG_TIM1_STOP ..\star\stm32f4xx.h(11582): warning: #47-D: incompatible redefinition of macro "DBGMCU_APB2_FZ_DBG_TIM8_STOP" (declared at line 11575) #define DBGMCU_APB2_FZ_DBG_TIM8_STOP DBGMCU_APB1_FZ_DBG_TIM8_STOP ..\star\stm32f4xx.h(11583): warning: #47-D: incompatible redefinition of macro "DBGMCU_APB2_FZ_DBG_TIM9_STOP" (declared at line 11576) #define DBGMCU_APB2_FZ_DBG_TIM9_STOP DBGMCU_APB1_FZ_DBG_TIM9_STOP ..\star\stm32f4xx.h(11584): warning: #47-D: incompatible redefinition of macro "DBGMCU_APB2_FZ_DBG_TIM10_STOP" (declared at line 11577) #define DBGMCU_APB2_FZ_DBG_TIM10_STOP DBGMCU_APB1_FZ_DBG_TIM10_STOP ..\star\stm32f4xx.h(11585): warning: #47-D: incompatible redefinition of macro "DBGMCU_APB2_FZ_DBG_TIM11_STOP" (declared at line 11578) #define DBGMCU_APB2_FZ_DBG_TIM11_STOP DBGMCU_APB1_FZ_DBG_TIM11_STOP ..\star\stm32f4xx.h(12028): error: #5: cannot open source input file "stm32f4xx_conf.h": No such file or directory #include "stm32f4xx_conf.h" ..\star\stm32f4xx_rcc.c: 5 warnings, 1 error compiling system_stm32f4xx.c... ..\star\stm32f4xx.h(11581): warning: #47-D: incompat4xx_rcc.h stdint.h 头文件 missing 错误 解决方案
03-26
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值