stm32f103c8t6移植freertos操作系统错误警告笔记

*** Using Compiler 'V6.16', folder: 'd:\Keil_v5\ARM\ARMCLANG\Bin'

compiling main.c...

USER/main.c(8): warning: In file included from...

./USER/main.h(5): warning: In file included from...


./CMSIS\stm32f10x.h(271): error: missing ',' between enumerators
  USBWakeUp_IRQn              = 42      /*!< USB Device WakeUp from
suspend through EXTI Line Interrupt */
                                  ^
                                  
上面这个文件的271行没有加逗号。

./CMSIS\stm32f10x.h(301): warning: declaration shadows a variable in the global scope [-Wshadow]
  ADC1_2_IRQn                 = 18,    
 /*!< ADC1 and ADC2 global Interrupt                       */
  ^


./CMSIS\stm32f10x.h(247): note: previous declaration is here
  ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2 global
Interrupt                       */
  ^

./CMSIS\stm32f10x.h(301): error: redefinition of enumerator 'ADC1_2_IRQn'
  ADC1_2_IRQn                 = 18,     /*!< ADC1 and ADC2
global Interrupt                       */
  ^
./CMSIS\stm32f10x.h(247): note: previous definition is here
  ADC1_2_IRQn                 =
18,     /*!< ADC1 and ADC2 global Interrupt                       */
  ^
./CMSIS\stm32f10x.h(302): warning: declaration shadows a
variable in the global scope [-Wshadow]
  USB_HP_CAN1_TX_IRQn         = 19,     /*!< USB Device High Priority or CAN1 TX Interrupts    
  */
  ^
./CMSIS\stm32f10x.h(248): note: previous declaration is here
  USB_HP_CAN1_TX_IRQn         = 19,     /*!< USB Device High
Priority or CAN1 TX Interrupts       */
  ^
./CMSIS\stm32f10x.h(302): error: redefinition of enumerator 'USB_HP_CAN1_TX_IRQn'
 
USB_HP_CAN1_TX_IRQn         = 19,     /*!< USB Device High Priority or CAN1 TX Interrupts       */
  ^
./CMSIS\stm32f10x.h(248): note:
previous definition is here
  USB_HP_CAN1_TX_IRQn         = 19,     /*!< USB Device High Priority or CAN1 TX Interrupts       */
  ^
./CMSIS\stm32f10x.h(303): warning: declaration shadows a variable in the global scope [-Wshadow]
  USB_LP_CAN1_RX0_IRQn        = 20,    
 /*!< USB Device Low Priority or CAN1 RX0 Interrupts       */
  ^
./CMSIS\stm32f10x.h(249): note: previous declaration is here
 
USB_LP_CAN1_RX0_IRQn        = 20,     /*!< USB Device Low Priority or CAN1 RX0 Interrupts       */
  ^
./CMSIS\stm32f10x.h(303): error:
redefinition of enumerator 'USB_LP_CAN1_RX0_IRQn'
  USB_LP_CAN1_RX0_IRQn        = 20,     /*!< USB Device Low Priority or CAN1 RX0
Interrupts       */
  ^
./CMSIS\stm32f10x.h(249): note: previous definition is here
  USB_LP_CAN1_RX0_IRQn        = 20,     /*!< USB
Device Low Priority or CAN1 RX0 Interrupts       */
  ^
./CMSIS\stm32f10x.h(304): warning: declaration shadows a variable in the global
scope [-Wshadow]
  CAN1_RX1_IRQn               = 21,     /*!< CAN1 RX1 Interrupt                                   */
  ^
./CMSIS
\stm32f10x.h(250): note: previous declaration is here
  CAN1_RX1_IRQn               = 21,     /*!< CAN1 RX1 Interrupt                  
                */
  ^
./CMSIS\stm32f10x.h(304): error: redefinition of enumerator 'CAN1_RX1_IRQn'
  CAN1_RX1_IRQn               = 21,    
 /*!< CAN1 RX1 Interrupt                                   */
  ^
./CMSIS\stm32f10x.h(250): note: previous definition is here
 
CAN1_RX1_IRQn               = 21,     /*!< CAN1 RX1 Interrupt                                   */
  ^
./CMSIS\stm32f10x.h(305):
warning: declaration shadows a variable in the global scope [-Wshadow]
  CAN1_SCE_IRQn               = 22,     /*!< CAN1 SCE Interrupt  
                                 */
  ^
./CMSIS\stm32f10x.h(251): note: previous declaration is here
  CAN1_SCE_IRQn               = 22,  
   /*!< CAN1 SCE Interrupt                                   */
  ^
./CMSIS\stm32f10x.h(305): error: redefinition of enumerator
'CAN1_SCE_IRQn'
  CAN1_SCE_IRQn               = 22,     /*!< CAN1 SCE Interrupt                                   */
  ^
./CMSIS
\stm32f10x.h(251): note: previous definition is here
  CAN1_SCE_IRQn               = 22,     /*!< CAN1 SCE Interrupt                    
               */
  ^
./CMSIS\stm32f10x.h(306): warning: declaration shadows a variable in the global scope [-Wshadow]
  EXTI9_5_IRQn    
           = 23,     /*!< External Line[9:5] Interrupts                        */
  ^
./CMSIS\stm32f10x.h(252): note: previous
declaration is here
  EXTI9_5_IRQn                = 23,     /*!< External Line[9:5] Interrupts                        */
  ^
./CMSIS
\stm32f10x.h(306): error: redefinition of enumerator 'EXTI9_5_IRQn'
  EXTI9_5_IRQn                = 23,     /*!< External Line[9:5]
Interrupts                        */
  ^
./CMSIS\stm32f10x.h(252): note: previous definition is here
  EXTI9_5_IRQn                = 23,  
   /*!< External Line[9:5] Interrupts                        */
  ^
./CMSIS\stm32f10x.h(307): warning: declaration shadows a variable in
the global scope [-Wshadow]
  TIM1_BRK_IRQn               = 24,     /*!< TIM1 Break Interrupt                                 */
  ^
./CMSIS\stm32f10x.h(253): note: previous declaration is here
  TIM1_BRK_IRQn               = 24,     /*!< TIM1 Break Interrupt          
                       */
  ^
./CMSIS\stm32f10x.h(307): error: redefinition of enumerator 'TIM1_BRK_IRQn'
  TIM1_BRK_IRQn               =
24,     /*!< TIM1 Break Interrupt                                 */
  ^
./CMSIS\stm32f10x.h(253): note: previous definition is here
 
TIM1_BRK_IRQn               = 24,     /*!< TIM1 Break Interrupt                                 */
  ^
./CMSIS\stm32f10x.h(308):
warning: declaration shadows a variable in the global scope [-Wshadow]
  TIM1_UP_IRQn                = 25,     /*!< TIM1 Update
Interrupt                                */
  ^
./CMSIS\stm32f10x.h(254): note: previous declaration is here
  TIM1_UP_IRQn              
 = 25,     /*!< TIM1 Update Interrupt                                */
  ^
./CMSIS\stm32f10x.h(308): error: redefinition of enumerator
'TIM1_UP_IRQn'
  TIM1_UP_IRQn                = 25,     /*!< TIM1 Update Interrupt                                */
  ^
./CMSIS
\stm32f10x.h(254): note: previous definition is here
  TIM1_UP_IRQn                = 25,     /*!< TIM1 Update Interrupt                
               */
  ^
./CMSIS\stm32f10x.h(309): warning: declaration shadows a variable in the global scope [-Wshadow]
 
TIM1_TRG_COM_IRQn           = 26,     /*!< TIM1 Trigger and Commutation Interrupt               */
  ^
./CMSIS\stm32f10x.h(255): note:
previous declaration is here
  TIM1_TRG_COM_IRQn           = 26,     /*!< TIM1 Trigger and Commutation Interrupt               */
  ^
./CMSIS\stm32f10x.h(309): error: redefinition of enumerator 'TIM1_TRG_COM_IRQn'
  TIM1_TRG_COM_IRQn           = 26,     /*!< TIM1
Trigger and Commutation Interrupt               */
  ^
./CMSIS\stm32f10x.h(255): note: previous definition is here
  TIM1_TRG_COM_IRQn    
       = 26,     /*!< TIM1 Trigger and Commutation Interrupt               */
  ^
./CMSIS\stm32f10x.h(310): warning: declaration shadows
a variable in the global scope [-Wshadow]
  TIM1_CC_IRQn                = 27,     /*!< TIM1 Capture Compare Interrupt                  
    */
  ^
./CMSIS\stm32f10x.h(256): note: previous declaration is here
  TIM1_CC_IRQn                = 27,     /*!< TIM1 Capture Compare
Interrupt                       */
  ^
./CMSIS\stm32f10x.h(310): error: redefinition of enumerator 'TIM1_CC_IRQn'
  TIM1_CC_IRQn          
      = 27,     /*!< TIM1 Capture Compare Interrupt                       */
  ^
./CMSIS\stm32f10x.h(256): note: previous definition is
here
  TIM1_CC_IRQn                = 27,     /*!< TIM1 Capture Compare Interrupt                       */
  ^
./CMSIS\stm32f10x.h(311):
warning: declaration shadows a variable in the global scope [-Wshadow]
  TIM2_IRQn                   = 28,     /*!< TIM2 global
Interrupt                                */
  ^
./CMSIS\stm32f10x.h(257): note: previous declaration is here
  TIM2_IRQn                  
 = 28,     /*!< TIM2 global Interrupt                                */
  ^
./CMSIS\stm32f10x.h(311): error: redefinition of enumerator
'TIM2_IRQn'
  TIM2_IRQn                   = 28,     /*!< TIM2 global Interrupt                                */
  ^
./CMSIS\stm32f10x.h
(257): note: previous definition is here
  TIM2_IRQn                   = 28,     /*!< TIM2 global Interrupt                            
   */
  ^
./CMSIS\stm32f10x.h(312): warning: declaration shadows a variable in the global scope [-Wshadow]
  TIM3_IRQn                  
= 29,     /*!< TIM3 global Interrupt                                */
  ^
./CMSIS\stm32f10x.h(258): note: previous declaration is here
 
TIM3_IRQn                   = 29,     /*!< TIM3 global Interrupt                                */
  ^
./CMSIS\stm32f10x.h(312): error:
redefinition of enumerator 'TIM3_IRQn'
  TIM3_IRQn                   = 29,     /*!< TIM3 global Interrupt                              
 */
  ^
./CMSIS\stm32f10x.h(258): note: previous definition is here
  TIM3_IRQn                   = 29,     /*!< TIM3 global Interrupt    
                            */
  ^
./CMSIS\stm32f10x.h(313): warning: declaration shadows a variable in the global scope [-Wshadow]
 
TIM4_IRQn                   = 30,     /*!< TIM4 global Interrupt                                */
  ^
./CMSIS\stm32f10x.h(259): note:
previous declaration is here
  TIM4_IRQn                   = 30,     /*!< TIM4 global Interrupt                                */
  ^
./CMSIS\stm32f10x.h(313): error: redefinition of enumerator 'TIM4_IRQn'
  TIM4_IRQn                   = 30,     /*!< TIM4 global
Interrupt                                */
  ^
./CMSIS\stm32f10x.h(259): note: previous definition is here
  TIM4_IRQn                  
= 30,     /*!< TIM4 global Interrupt                                */
  ^
./CMSIS\stm32f10x.h(314): warning: declaration shadows a
variable in the global scope [-Wshadow]
  I2C1_EV_IRQn                = 31,     /*!< I2C1 Event Interrupt                              
  */
  ^
./CMSIS\stm32f10x.h(260): note: previous declaration is here
  I2C1_EV_IRQn                = 31,     /*!< I2C1 Event Interrupt  
                              */
  ^
./CMSIS\stm32f10x.h(314): error: redefinition of enumerator 'I2C1_EV_IRQn'
  I2C1_EV_IRQn            
    = 31,     /*!< I2C1 Event Interrupt                                 */
  ^
./CMSIS\stm32f10x.h(260): note: previous definition is
here
  I2C1_EV_IRQn                = 31,     /*!< I2C1 Event Interrupt                                 */
  ^
./CMSIS\stm32f10x.h(315):
warning: declaration shadows a variable in the global scope [-Wshadow]
  I2C1_ER_IRQn                = 32,     /*!< I2C1 Error
Interrupt                                 */
  ^
./CMSIS\stm32f10x.h(261): note: previous declaration is here
  I2C1_ER_IRQn              
  = 32,     /*!< I2C1 Error Interrupt                                 */
  ^
./CMSIS\stm32f10x.h(315): error: redefinition of enumerator
'I2C1_ER_IRQn'
  I2C1_ER_IRQn                = 32,     /*!< I2C1 Error Interrupt                                 */
  ^
./CMSIS
\stm32f10x.h(261): note: previous definition is here
  I2C1_ER_IRQn                = 32,     /*!< I2C1 Error Interrupt                  
               */
  ^
./CMSIS\stm32f10x.h(316): warning: declaration shadows a variable in the global scope [-Wshadow]
  I2C2_EV_IRQn    
           = 33,     /*!< I2C2 Event Interrupt                                 */
  ^
./CMSIS\stm32f10x.h(262): note: previous
declaration is here
  I2C2_EV_IRQn                = 33,     /*!< I2C2 Event Interrupt                                 */
  ^
./CMSIS
\stm32f10x.h(316): error: redefinition of enumerator 'I2C2_EV_IRQn'
  I2C2_EV_IRQn                = 33,     /*!< I2C2 Event Interrupt  
                              */
  ^
./CMSIS\stm32f10x.h(262): note: previous definition is here
  I2C2_EV_IRQn                = 33,    
/*!< I2C2 Event Interrupt                                 */
  ^
./CMSIS\stm32f10x.h(317): warning: declaration shadows a variable in
the global scope [-Wshadow]
  I2C2_ER_IRQn                = 34,     /*!< I2C2 Error Interrupt                                 */
  ^
./CMSIS\stm32f10x.h(263): note: previous declaration is here
  I2C2_ER_IRQn                = 34,     /*!< I2C2 Error Interrupt          
                       */
  ^
./CMSIS\stm32f10x.h(317): error: redefinition of enumerator 'I2C2_ER_IRQn'
  I2C2_ER_IRQn                =
34,     /*!< I2C2 Error Interrupt                                 */
  ^
./CMSIS\stm32f10x.h(263): note: previous definition is here
 
I2C2_ER_IRQn                = 34,     /*!< I2C2 Error Interrupt                                 */
  ^
./CMSIS\stm32f10x.h(318):
warning: declaration shadows a variable in the global scope [-Wshadow]
  SPI1_IRQn                   = 35,     /*!< SPI1 global
Interrupt                                */
  ^
./CMSIS\stm32f10x.h(264): note: previous declaration is here
  SPI1_IRQn                  
 = 35,     /*!< SPI1 global Interrupt                                */
  ^
./CMSIS\stm32f10x.h(318): error: redefinition of enumerator
'SPI1_IRQn'
  SPI1_IRQn                   = 35,     /*!< SPI1 global Interrupt                                */
  ^
./CMSIS\stm32f10x.h
(264): note: previous definition is here
  SPI1_IRQn                   = 35,     /*!< SPI1 global Interrupt                            
   */
  ^
./CMSIS\stm32f10x.h(319): warning: declaration shadows a variable in the global scope [-Wshadow]
  SPI2_IRQn                  
= 36,     /*!< SPI2 global Interrupt                                */
  ^
./CMSIS\stm32f10x.h(265): note: previous declaration is here
 
SPI2_IRQn                   = 36,     /*!< SPI2 global Interrupt                                */
  ^

fatal error: too many errors emitted, stopping now [-ferror-limit=]
19 warnings and 20 errors generated.
"USER/main.c" - 19 Error(s), 19
Warning(s).

 

出现以上批量错误原因是:出现重复定义导致,把魔术棒的选项卡里的define选项里的STM32_F10X_HD去掉,问题解决

../Libraries/CMSIS/core_cm3.h(1720): warning: function 'NVIC_SystemReset' could be declared with attribute 'noreturn' [-Wmissing-
noreturn]

 

遇到这种情况,直接将只需要在keil设置里把版本ARM Compiler这一项从keil_6变成keil_5就可以了


*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'd:\Keil_v5\ARM\ARMCC\Bin'
compiling main.c...
USER\main.h(8): warning:  #1-D:
last line of file ends without a newline
  #endif
USER\main.c: 1 warning, 0 errors
"USER\main.c" - 0 Error(s), 1 Warning(s).

原因是在头文件中的最后一行回车就行

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
基于FreeRTOS操作系统stm32F103C8T6项目可以实现多任务并发运行。FreeRTOS是一个小巧、可裁剪的RTOS系统,具有以下特点: 1. 内核支持抢占式、合作式和时间片调度,可以根据任务的优先级来决定下一刻应该运行哪个任务。 2. 提供了一个用于低功耗的Tickless模式,可以有效节省能源。 3. 支持动态或静态RAM,可以根据需要选择创建任务、消息队列、信号量、软件定时器等组件时使用的内存类型。 4. 已经在超过30种架构的芯片上进行了移植,包括stm32F103系列。 5. FreeRTOS系统简单、小巧、易用,通常情况下内核占用4k-9k字节的空间。 6. 支持实时任务和协程,任务与任务、任务与中断之间可以使用任务通知、消息队列、信号量等进行通信和同步。 7. 具有优先级继承特性的互斥信号量,高效的软件定时器,强大的跟踪执行功能和堆栈溢出检测功能。 8. 任务数量和优先级没有限制,可以根据项目需求创建任意数量和优先级的任务。 因此,基于FreeRTOS操作系统stm32F103C8T6项目可以充分利用该RTOS系统的特点,实现多任务并发运行,提高系统的实时性和可靠性。 #### 引用[.reference_title] - *1* [stm32F103C8T6基于FreeRTOS操作系统的多任务(STM32CUBEMX)](https://blog.csdn.net/Mouer__/article/details/121616118)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [stm32F103C8T6基于FreeRTOS操作系统的多任务](https://blog.csdn.net/weixin_46129506/article/details/121659483)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

星海露水

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值