• 已解决 73482 个问题
  • 已帮助 5993 位优秀工程师

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

xbk_804180 2022-04-29 浏览量:903

编译信息如下,请问该如何修改代码或者库文件?



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 errors
compiling 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.c

53    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]);

0 0 收起

我来回答

上传资料:
选择文件 文件大小不超过15M(格式支持:doc、ppt、xls、pdf、zip、rar、txt)
所有亮答 数量:2
  • 怎么生成的工程啊,用cubemx生成一下试试吧,这种问题,可能 是少头文件或是源文件,从库里添加时少添加了

  • APBPrescTable重定义了啊,在工程项目里搜索一下,看在哪些地方定义了

相关问题

问题达人换一批

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