各位大佬好,今天我按照rt-thread/bsp/stm32/docs/STM32系列BSP制作教程.md 的步骤尝试制作基于STM32F427IIH开发板的bsp包,
所有步骤都做了,但在hal库的编译上出现了大量的报错,大概看了一下,似乎与类型重复定义有关。不清楚是为什么,望大佬能帮忙
看看可能是什么原因,谢谢!
部分错误位置:
MDK全部报错信息:
Using Compiler ‘V5.06 update 4 (build 422)’, folder: ‘D:\Program Files\KeilArm\ARM\ARMCC\Bin’
Build target ‘rt-thread’
compiling clock.c…
compiling cpu.c…
compiling components.c…
compiling device.c…
compiling irq.c…
compiling idle.c…
compiling kservice.c…
compiling ipc.c…
compiling mem.c…
compiling mempool.c…
compiling scheduler.c…
compiling object.c…
compiling signal.c…
compiling thread.c…
compiling timer.c…
compiling main.c…
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h(400): error: #256: invalid redeclaration of type name “RCC_PLLI2SInitTypeDef” (declared at line 312)
}RCC_PLLI2SInitTypeDef;
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h(419): error: #256: invalid redeclaration of type name “RCC_PeriphCLKInitTypeDef” (declared at line 375)
}RCC_PeriphCLKInitTypeDef;
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h(513): warning: #47-D: incompatible redefinition of macro “RCC_PERIPHCLK_RTC” (declared at line 504)
define RCC_PERIPHCLK_RTC 0x00000002U
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h(514): warning: #47-D: incompatible redefinition of macro “RCC_PERIPHCLK_PLLI2S” (declared at line 505)
define RCC_PERIPHCLK_PLLI2S 0x00000004U
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h(2177): warning: #47-D: incompatible redefinition of macro “__HAL_RCC_USB_OTG_HS_ULPI_IS_CLK_DISABLED” (declared at line 1170)
define __HAL_RCC_USB_OTG_HS_ULPI_IS_CLK_DISABLED() ((RCC->AHB1ENR & (RCC_AHB1ENR_OTGHSULPIEN))== RESET)
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h(2576): warning: #47-D: incompatible redefinition of macro “__HAL_RCC_TIM10_IS_CLK_ENABLED” (declared at line 1641)
define __HAL_RCC_TIM10_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM10EN)) != RESET)
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h(2583): warning: #47-D: incompatible redefinition of macro “__HAL_RCC_TIM10_IS_CLK_DISABLED” (declared at line 1645)
define __HAL_RCC_TIM10_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM10EN)) == RESET)
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h(6886): warning: #47-D: incompatible redefinition of macro “IS_RCC_PERIPHCLOCK” (declared at line 6882)
define IS_RCC_PERIPHCLOCK(SELECTION) ((1U <= (SELECTION)) && ((SELECTION) <= 0x00000007U))
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h(327): warning: #47-D: incompatible redefinition of macro “GPIO_AF5_I2S3ext” (declared at line 218)
define GPIO_AF5_I2S3ext ((uint8_t)0x05) / I2S3ext_SD Alternate Function mapping /
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h(1280): warning: #47-D: incompatible redefinition of macro “GPIO_GET_INDEX” (declared at line 1268)
define GPIOGETINDEX(GPIOx) (uint8_t)(((__GPIOx) == (GPIOA))? 0U :
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h(1398): warning: #47-D: incompatible redefinition of macro “IS_GPIO_AF” (declared at line 1371)
define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) ||
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h(353): warning: #47-D: incompatible redefinition of macro “FLASH_MER_BIT” (declared at line 345)
define FLASH_MER_BIT (FLASH_CR_MER) /!< only 1 MER Bit /
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h(775): warning: #47-D: incompatible redefinition of macro “FLASH_SECTOR_TOTAL” (declared at line 764)
define FLASH_SECTOR_TOTAL 12U
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h(888): warning: #47-D: incompatible redefinition of macro “IS_FLASH_LATENCY” (declared at line 866)
define IS_FLASH_LATENCY(LATENCY) (((LATENCY) == FLASH_LATENCY_0) ||
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h(910): warning: #47-D: incompatible redefinition of macro “IS_FLASH_BANK” (declared at line 900)
define IS_FLASH_BANK(BANK) (((BANK) == FLASH_BANK_1))
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h(942): warning: #47-D: incompatible redefinition of macro “IS_FLASH_SECTOR” (declared at line 915)
define IS_FLASH_SECTOR(SECTOR) (((SECTOR) == FLASH_SECTOR_0) || ((SECTOR) == FLASH_SECTOR_1) ||
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h(983): warning: #47-D: incompatible redefinition of macro “IS_OB_WRP_SECTOR” (declared at line 975)
define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & 0xFFFFF000U) == 0x00000000U) && ((SECTOR) != 0x00000000U))
applications\main.c: 15 warnings, 2 errors
assembling startup_stm32f407xx.s…
compiling board.c…
。。。。。
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h(983): warning: #47-D: incompatible redefinition of macro “IS_OB_WRP_SECTOR” (declared at line 975)
define IS_OB_WRP_SECTOR(SECTOR)((((SECTOR) & 0xFFFFF000U) == 0x00000000U) && ((SECTOR) != 0x00000000U))
..\libraries\STM32F4xx_HAL\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_usart.c: 15 warnings, 2 errors
“.\build\keil\Obj t-thread.axf” - 96 Error(s), 345 Warning(s).
Target not created.
Build Time Elapsed: 00:00:08