[求助]急急急! Crypto移植出现stm32自带库中的宏定义冲突

buycool001 buycool001 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
求助一下大家,遇到一个问题:

开发环境:Keil
芯片:STM32F103RE
问题描述:
1. 使用STM32Cube创建的源代码,用了LL库和HAL库;
2. 移植另外一个IAR代码过来,其中用到Crypto中,因为IAR之前用的.a文件,Keil无法编译,所以下载了ST官方最新的Crypto库,导入Keil工程中,Keil中显示这些官方库文件(.c,.h,.lib文件都是锁上的额,无法编辑);
3. 用Keil Rebuild后,会报错,如下:

请教:请教我自身引用的ST库中的宏定义 和 Crypto中引用库中的宏定义重复,同时无法修改Crypto库,如果修改自身的文件,1.工作量很大;2.可能会发生位置的错误; 所以请教大家应该如何解决? 非常感谢,谢谢!


Build started: Project: CDZ
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Build target 'CDZ'
compiling main.c...
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(133): warning: #47-D: incompatible redefinition of macro "HSE_STARTUP_TIMEOUT"
#define HSE_STARTUP_TIMEOUT ((uint16_t)0x0500) /*!< Time out for HSE start up */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(135): warning: #47-D: incompatible redefinition of macro "HSI_VALUE"
#define HSI_VALUE ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz*/
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(163): warning: #47-D: incompatible redefinition of macro "__MPU_PRESENT" (declared at line 51 of "../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h")
#define __MPU_PRESENT 0 /*!< Other STM32 devices does not provide an MPU */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(165): warning: #47-D: incompatible redefinition of macro "__NVIC_PRIO_BITS" (declared at line 52 of "../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h")
#define __NVIC_PRIO_BITS 4 /*!< STM32 uses 4 Bits for the Priority Levels */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(166): warning: #47-D: incompatible redefinition of macro "__Vendor_SysTickConfig" (declared at line 53 of "../Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h")
#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(175): error: #101: "NonMaskableInt_IRQn" has already been declared in the current scope
NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(176): error: #101: "MemoryManagement_IRQn" has already been declared in the current scope
MemoryManagement_IRQn = -12, /*!< 4 Cortex-M3 Memory Management Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(177): error: #101: "BusFault_IRQn" has already been declared in the current scope
BusFault_IRQn = -11, /*!< 5 Cortex-M3 Bus Fault Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(178): error: #101: "UsageFault_IRQn" has already been declared in the current scope
UsageFault_IRQn = -10, /*!< 6 Cortex-M3 Usage Fault Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(179): error: #101: "SVCall_IRQn" has already been declared in the current scope
SVCall_IRQn = -5, /*!< 11 Cortex-M3 SV Call Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(180): error: #101: "DebugMonitor_IRQn" has already been declared in the current scope
DebugMonitor_IRQn = -4, /*!< 12 Cortex-M3 Debug Monitor Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(181): error: #101: "PendSV_IRQn" has already been declared in the current scope
PendSV_IRQn = -2, /*!< 14 Cortex-M3 Pend SV Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(182): error: #101: "SysTick_IRQn" has already been declared in the current scope
SysTick_IRQn = -1, /*!< 15 Cortex-M3 System Tick Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(185): error: #101: "WWDG_IRQn" has already been declared in the current scope
WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(186): error: #101: "PVD_IRQn" has already been declared in the current scope
PVD_IRQn = 1, /*!< PVD through EXTI Line detection Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(187): error: #101: "TAMPER_IRQn" has already been declared in the current scope
TAMPER_IRQn = 2, /*!< Tamper Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(188): error: #101: "RTC_IRQn" has already been declared in the current scope
RTC_IRQn = 3, /*!< RTC global Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(189): error: #101: "FLASH_IRQn" has already been declared in the current scope
FLASH_IRQn = 4, /*!< FLASH global Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(190): error: #101: "RCC_IRQn" has already been declared in the current scope
RCC_IRQn = 5, /*!< RCC global Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(191): error: #101: "EXTI0_IRQn" has already been declared in the current scope
EXTI0_IRQn = 6, /*!< EXTI Line0 Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(192): error: #101: "EXTI1_IRQn" has already been declared in the current scope
EXTI1_IRQn = 7, /*!< EXTI Line1 Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(193): error: #101: "EXTI2_IRQn" has already been declared in the current scope
EXTI2_IRQn = 8, /*!< EXTI Line2 Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(194): error: #101: "EXTI3_IRQn" has already been declared in the current scope
EXTI3_IRQn = 9, /*!< EXTI Line3 Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(195): error: #101: "EXTI4_IRQn" has already been declared in the current scope
EXTI4_IRQn = 10, /*!< EXTI Line4 Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(196): error: #101: "DMA1_Channel1_IRQn" has already been declared in the current scope
DMA1_Channel1_IRQn = 11, /*!< DMA1 Channel 1 global Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(197): error: #101: "DMA1_Channel2_IRQn" has already been declared in the current scope
DMA1_Channel2_IRQn = 12, /*!< DMA1 Channel 2 global Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(198): error: #101: "DMA1_Channel3_IRQn" has already been declared in the current scope
DMA1_Channel3_IRQn = 13, /*!< DMA1 Channel 3 global Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(199): error: #101: "DMA1_Channel4_IRQn" has already been declared in the current scope
DMA1_Channel4_IRQn = 14, /*!< DMA1 Channel 4 global Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(200): error: #101: "DMA1_Channel5_IRQn" has already been declared in the current scope
DMA1_Channel5_IRQn = 15, /*!< DMA1 Channel 5 global Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(201): error: #101: "DMA1_Channel6_IRQn" has already been declared in the current scope
DMA1_Channel6_IRQn = 16, /*!< DMA1 Channel 6 global Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(202): error: #101: "DMA1_Channel7_IRQn" has already been declared in the current scope
DMA1_Channel7_IRQn = 17, /*!< DMA1 Channel 7 global Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(303): error: #101: "ADC1_2_IRQn" has already been declared in the current scope
ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(304): error: #101: "USB_HP_CAN1_TX_IRQn" has already been declared in the current scope
USB_HP_CAN1_TX_IRQn = 19, /*!< USB Device High Priority or CAN1 TX Interrupts */
C:\Users\YC2\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include\stm32f10x.h(305): error: #101: "USB_LP_CAN1_RX0_IRQn" has already been declared in the current scope
...全文

相关推荐

避坑指南:在Keil MDK环境下为STM32 HAL库移植mbedtls的常见编译错误与解决

本文详细解析了在Keil MDK环境下为STM32 HAL库移植mbedtls时常见的7大编译错误及其解决方案。从版本选择、头文件路径配置到内存模型优化和硬件加速启用,提供了实战验证的精准排雷方案,帮助开发者高效完成安全通信模块的移植工作。特别针对STM32平台与HAL库的兼容性问题给出了专业建议。

weixin_30292745

春秋BC742年世界历史地图矢量文件SHP格式.zip

本资源为《春秋BC742年世界历史地图矢量文件SHP格式》压缩包,文件大小约 26.55 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

白水先森

春秋BC674年世界历史地图矢量文件SHP格式.zip

本资源为《春秋BC674年世界历史地图矢量文件SHP格式》压缩包,文件大小约 26.49 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

白水先森

欠驱动水面船舶的自适应神经(NN)控制圆形+直线轨迹跟踪控制研究(Matlab代码实现)

内容概要:本文针对欠驱动水面船舶在圆形和直线轨迹下的高精度跟踪控制问题,提出了一种基于自适应神经网络(Adaptive Neural Network, NN)的非线性控制方法。该方法有效应对船舶在欠驱动条件下存在的强耦合、非线性动力学特性以及外界环境干扰(如风浪流)等挑战。通过构建适当的神经网络逼近系统未知非线性项,并结合Lyapunov稳定性理论设计自适应律,确保闭环系统的全局一致最终有界性(UUB)。文中详细阐述了控制器结构设计、神经网络权重在线更新机制、控制律推导过程,并利用Matlab/Simulink平台对直线与圆形期望轨迹进行了仿真验证,结果表明所提方法具有良好的跟踪精度、动态响应性能与抗干扰能力,适用于复杂海洋环境下无人船的自主航行控制任务。; 适合人群:具备自动控制理论、船舶与海洋工程或机器人控制等相关专业背景,熟悉非线性系统分析、自适应控制原理,并掌握Matlab仿真工具的研究生、科研人员及从事无人船控制系统开发的工程技术人员。; 使用场景及目标:①研究欠驱动船舶在复杂轨迹下的自主跟踪控制策略;②掌握自适应神经网络在不确定非线性系统中的建模与补偿方法;③复现并拓展高水平期刊论文中的智能控制算法;④为无人水面艇(USV)的实际控制系统开发提供理论支持与仿真验证基础。; 阅读建议:建议读者结合文中的数学推导与Matlab代码实现同步学习,重点理解Lyapunov函数的构造思路、神经网络逼近机制及其参数自适应调整规律,有条件者可进一步将算法迁移至硬件在环(HIL)平台或实船系统进行测试,并与其他先进控制方法(如滑模控制、模型预测控制)开展性能对比分析。

欢多天天写代码

战国BC301年世界历史地图矢量文件SHP格式.zip

本资源为《战国BC301年世界历史地图矢量文件SHP格式》压缩包,文件大小约 2.28 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

白水先森
评论 6
收藏 已收藏
分享
返回顶部
buycool001
嵌入开发(WinCE) 19,525 成员 41,565 内容