头像-520049

xbk_804180

个人成就

获得 0 次赞

帮助过1人

Keil5软件编译STM32F103的代码出错,请教各位大神

编译信息如下,请问该如何修改代码或者库文件?Rebuild target 'STM32F103C8x'compiling main.c...compiling gpio.c...compiling tim.c...compiling usart.c...compiling stm32f1xx_it.c...compiling stm32f1xx_hal_msp.c...compiling gizwits_product.c...compiling gizwits_protocol.c.....\Gizwits\gizwits_protocol.c(185): warning:  #550-D: variable "lastReportTime" was set but never used      static uint32_t lastReportTime = 0;..\Gizwits\gizwits_protocol.c(186): warning:  #550-D: variable "currentTime" was set but never used      uint32_t currentTime = 0;..\Gizwits\gizwits_protocol.c: 2 warnings 0 errorscompiling hal_key.c...compiling common.c...compiling dataPointTools.c...compiling ringbuffer.c...compiling stm32f1xx_hal_gpio_ex.c...compiling stm32f1xx_hal_tim.c...compiling stm32f1xx_hal_tim_ex.c...compiling stm32f1xx_hal.c...compiling stm32f1xx_hal_rcc.c...compiling stm32f1xx_hal_rcc_ex.c...compiling stm32f1xx_hal_gpio.c...compiling stm32f1xx_hal_dma.c...compiling stm32f1xx_hal_cortex.c...compiling stm32f1xx_hal_pwr.c...compiling stm32f1xx_hal_flash.c...compiling stm32f1xx_hal_flash_ex.c...compiling stm32f1xx_hal_exti.c...compiling stm32f1xx_hal_uart.c...assembling startup_stm32f10x_md.s...compiling system_stm32f10x.c...linking....\STM32F103C8x\STM32F103C8x.axf: Error: L6218E: Undefined symbol APBPrescTable (referred from stm32f1xx_hal_rcc.o).Not enough information to list image symbols.Finished: 1 information 0 warning and 1 error messages.".\STM32F103C8x\STM32F103C8x.axf" - 1 Error(s) 2 Warning(s).Target not created.Build Time Elapsed:  00:00:28相对应代码如下:stm32f1xx_hal_rcc.c53    extern const uint8_t  APBPrescTable[8U];   /@@*!< APB prescalers table values */​1190      return (HAL_RCC_GetHCLKFreq() >> APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE1) >> RCC_CFGR_PPRE1_Pos]);1202      return (HAL_RCC_GetHCLKFreq() >> APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE2) >> RCC_CFGR_PPRE2_Pos]);