[求助]急急急! Crypto移植出现stm32自带库中的宏定义冲突
求助一下大家,遇到一个问题:
开发环境: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