F0的问题,用MDK5建立的工程无法编译

2019-08-19 18:00发布

新人,原来写过stm32f103没问题,现在想用f030的芯片,但是Keil 5编译一直失败,用网上的例程也不行。
固件库是st官网上下载的,STM32F0xx_StdPeriph_Lib_V1.5.0

芯片选的stm32f030c8,文件树如图,main.c只包含了stm32f0xx.h的头文件,主函数是空的。

工程选项-C/C++里已经宏定义了STM32F10X_MD, USE_STDPERIPH_DRIVER

编译stm32f0xx_rcc.c的时候,以RCC_开头的宏全都显示未定义,在stm32f0xx.h里确实找不到响应的宏定义。

13个警告,都是说函数assert_param隐性声明。




完全绝望了,现在怎么样才能编译成功啊。新人没金币,大家多多见谅。

报错信息如下:
*** Using Compiler 'V5.06 update 4 (build 422)', folder: 'D:Program FilesKeil_v5ARMARMCCBin'
Rebuild target 'Target 1'
assembling startup_stm32f030x8.s...
compiling stm32f0xx_rcc.c...
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(204): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_RCC_HSE(RCC_HSE));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(238): error:  #20: identifier "HSE_STARTUP_TIMEOUT" is undefined
    } while((StartUpCounter != HSE_STARTUP_TIMEOUT) && (HSEStatus == RESET));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(266): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_RCC_HSI_CALIBRATION_VALUE(HSICalibrationValue));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(298): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_FUNCTIONAL_STATE(NewState));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(326): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_RCC_HSI14_CALIBRATION_VALUE(HSI14CalibrationValue));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(355): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_FUNCTIONAL_STATE(NewState));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(376): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_FUNCTIONAL_STATE(NewState));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(408): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_RCC_LSE(RCC_LSE));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(434): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_RCC_LSE_DRIVE(RCC_LSEDrive));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(458): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_FUNCTIONAL_STATE(NewState));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(491): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_RCC_PLL_SOURCE(RCC_PLLSource));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(491): error:  #20: identifier "RCC_CFGR_PLLSRC_HSI_Div2" is undefined
    assert_param(
S_RCC_PLL_SOURCE(RCC_PLLSource));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(491): error:  #20: identifier "RCC_CFGR_PLLSRC_HSI48_PREDIV" is undefined
    assert_param(
S_RCC_PLL_SOURCE(RCC_PLLSource));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(491): error:  #20: identifier "RCC_CFGR_PLLSRC_HSI_PREDIV" is undefined
    assert_param(
S_RCC_PLL_SOURCE(RCC_PLLSource));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL2" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL3" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL4" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL5" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL6" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL7" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL8" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL9" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL10" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL11" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL12" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL13" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL14" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL15" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(492): error:  #20: identifier "RCC_CFGR_PLLMULL16" is undefined
    assert_param(
S_RCC_PLL_MUL(RCC_PLLMul));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(495): error:  #20: identifier "RCC_CFGR_PLLMULL" is undefined

CC->CFGR &= ~(RCC_CFGR_PLLMULL | RCC_CFGR_PLLSRC);
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(515): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_FUNCTIONAL_STATE(NewState));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(541): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_FUNCTIONAL_STATE(NewState));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(545): error:  #20: identifier "RCC_CR2_HSI48ON" is undefined

CC->CR2 |= RCC_CR2_HSI48ON;
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(549): error:  #20: identifier "RCC_CR2_HSI48ON" is undefined

CC->CR2 &= ~RCC_CR2_HSI48ON;
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(565): warning:  #223-D: function "assert_param" declared implicitly
    assert_param(IS_RCC_PREDIV1(RCC_PREDIV1_Div));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(565): error:  #20: identifier "RCC_CFGR2_PREDIV1_DIV1" is undefined
    assert_param(
S_RCC_PREDIV1(RCC_PREDIV1_Div));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(565): error:  #20: identifier "RCC_CFGR2_PREDIV1_DIV2" is undefined
    assert_param(
S_RCC_PREDIV1(RCC_PREDIV1_Div));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(565): error:  #20: identifier "RCC_CFGR2_PREDIV1_DIV3" is undefined
    assert_param(
S_RCC_PREDIV1(RCC_PREDIV1_Div));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(565): error:  #20: identifier "RCC_CFGR2_PREDIV1_DIV4" is undefined
    assert_param(
S_RCC_PREDIV1(RCC_PREDIV1_Div));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(565): error:  #20: identifier "RCC_CFGR2_PREDIV1_DIV5" is undefined
    assert_param(
S_RCC_PREDIV1(RCC_PREDIV1_Div));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(565): error:  #20: identifier "RCC_CFGR2_PREDIV1_DIV6" is undefined
    assert_param(
S_RCC_PREDIV1(RCC_PREDIV1_Div));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(565): error:  #20: identifier "RCC_CFGR2_PREDIV1_DIV7" is undefined
    assert_param(
S_RCC_PREDIV1(RCC_PREDIV1_Div));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c(565): error:  #20: identifier "RCC_CFGR2_PREDIV1_DIV8" is undefined
    assert_param(
S_RCC_PREDIV1(RCC_PREDIV1_Div));
..STM32F0xx_StdPeriph_Lib_V1.5.0LibrariesSTM32F0xx_StdPeriph_Driversrcstm32f0xx_rcc.c: 13 warnings, 30 errors
compiling system_stm32f0xx.c...
compiling main.c...
"..Objectives est-02.axf" - 30 Error(s), 13 Warning(s).
Target not created.
Build Time Elapsed:  00:00:01

友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。