STM32加入RTT打印文件编译警告解决

  • STM32加入RTT打印相关文件,编译产生以下错误

Build started: Project: led_blink
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Build target 'Target 1'
compiling core_cm3.c...
compiling misc.c...
compiling stm32f10x_usart.c...
compiling stm32f10x_gpio.c...
compiling stm32f10x_exti.c...
compiling system_stm32f10x.c...
compiling stm32f10x_rcc.c...
compiling main.c...
.\SEGGER\SEGGER_RTT_Conf.h(263): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_LOCK"  (declared at line 197)
      #define SEGGER_RTT_LOCK()   {                                                                   \
.\SEGGER\SEGGER_RTT_Conf.h(270): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_UNLOCK"  (declared at line 198)
      #define SEGGER_RTT_UNLOCK()   BASEPRI = LockState;                                              \
User\main.c: 2 warnings, 0 errors
compiling stm32f10x_it.c...
compiling list.c...
.\SEGGER\SEGGER_RTT_Conf.h(263): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_LOCK"  (declared at line 197)
      #define SEGGER_RTT_LOCK()   {                                                                   \
.\SEGGER\SEGGER_RTT_Conf.h(270): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_UNLOCK"  (declared at line 198)
      #define SEGGER_RTT_UNLOCK()   BASEPRI = LockState;                                              \
freeRTOS\list.c: 2 warnings, 0 errors
compiling croutine.c...
.\SEGGER\SEGGER_RTT_Conf.h(263): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_LOCK"  (declared at line 197)
      #define SEGGER_RTT_LOCK()   {                                                                   \
.\SEGGER\SEGGER_RTT_Conf.h(270): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_UNLOCK"  (declared at line 198)
      #define SEGGER_RTT_UNLOCK()   BASEPRI = LockState;                                              \
freeRTOS\croutine.c: 2 warnings, 0 errors
compiling event_groups.c...
.\SEGGER\SEGGER_RTT_Conf.h(263): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_LOCK"  (declared at line 197)
      #define SEGGER_RTT_LOCK()   {                                                                   \
.\SEGGER\SEGGER_RTT_Conf.h(270): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_UNLOCK"  (declared at line 198)
      #define SEGGER_RTT_UNLOCK()   BASEPRI = LockState;                                              \
freeRTOS\event_groups.c: 2 warnings, 0 errors
compiling stream_buffer.c...
.\SEGGER\SEGGER_RTT_Conf.h(263): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_LOCK"  (declared at line 197)
      #define SEGGER_RTT_LOCK()   {                                                                   \
.\SEGGER\SEGGER_RTT_Conf.h(270): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_UNLOCK"  (declared at line 198)
      #define SEGGER_RTT_UNLOCK()   BASEPRI = LockState;                                              \
freeRTOS\stream_buffer.c: 2 warnings, 0 errors
compiling queue.c...
.\SEGGER\SEGGER_RTT_Conf.h(263): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_LOCK"  (declared at line 197)
      #define SEGGER_RTT_LOCK()   {                                                                   \
.\SEGGER\SEGGER_RTT_Conf.h(270): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_UNLOCK"  (declared at line 198)
      #define SEGGER_RTT_UNLOCK()   BASEPRI = LockState;                                              \
freeRTOS\queue.c: 2 warnings, 0 errors
compiling SEGGER_RTT.c...
SEGGER\SEGGER_RTT_Conf.h(263): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_LOCK"  (declared at line 197)
      #define SEGGER_RTT_LOCK()   {                                                                   \
SEGGER\SEGGER_RTT_Conf.h(270): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_UNLOCK"  (declared at line 198)
      #define SEGGER_RTT_UNLOCK()   BASEPRI = LockState;                                              \
SEGGER\SEGGER_RTT.c: 2 warnings, 0 errors
compiling SEGGER_RTT_printf.c...
SEGGER\SEGGER_RTT_Conf.h(263): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_LOCK"  (declared at line 197)
      #define SEGGER_RTT_LOCK()   {                                                                   \
SEGGER\SEGGER_RTT_Conf.h(270): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_UNLOCK"  (declared at line 198)
      #define SEGGER_RTT_UNLOCK()   BASEPRI = LockState;                                              \
SEGGER\SEGGER_RTT_printf.c: 2 warnings, 0 errors
compiling timers.c...
.\SEGGER\SEGGER_RTT_Conf.h(263): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_LOCK"  (declared at line 197)
      #define SEGGER_RTT_LOCK()   {                                                                   \
.\SEGGER\SEGGER_RTT_Conf.h(270): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_UNLOCK"  (declared at line 198)
      #define SEGGER_RTT_UNLOCK()   BASEPRI = LockState;                                              \
freeRTOS\timers.c: 2 warnings, 0 errors
compiling tasks.c...
.\SEGGER\SEGGER_RTT_Conf.h(263): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_LOCK"  (declared at line 197)
      #define SEGGER_RTT_LOCK()   {                                                                   \
.\SEGGER\SEGGER_RTT_Conf.h(270): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_UNLOCK"  (declared at line 198)
      #define SEGGER_RTT_UNLOCK()   BASEPRI = LockState;                                              \
freeRTOS\tasks.c: 2 warnings, 0 errors
compiling heap_4.c...
.\SEGGER\SEGGER_RTT_Conf.h(263): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_LOCK"  (declared at line 197)
      #define SEGGER_RTT_LOCK()   {                                                                   \
.\SEGGER\SEGGER_RTT_Conf.h(270): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_UNLOCK"  (declared at line 198)
      #define SEGGER_RTT_UNLOCK()   BASEPRI = LockState;                                              \
freeRTOS\portable\MemMang\heap_4.c: 2 warnings, 0 errors
compiling port.c...
.\SEGGER\SEGGER_RTT_Conf.h(263): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_LOCK"  (declared at line 197)
      #define SEGGER_RTT_LOCK()   {                                                                   \
.\SEGGER\SEGGER_RTT_Conf.h(270): warning:  #47-D: incompatible redefinition of macro "SEGGER_RTT_UNLOCK"  (declared at line 198)
      #define SEGGER_RTT_UNLOCK()   BASEPRI = LockState;                                              \
freeRTOS\portable\RVDS\ARM_CM3\port.c: 2 warnings, 0 errors
linking...
Program Size: Code=13276 RO-data=336 RW-data=160 ZI-data=11448  
FromELF: creating hex file...
".\Objects\input.axf" - 0 Error(s), 24 Warning(s).
Build Time Elapsed:  00:00:04
  • 解决方案

将C/C++页面中的GUN选项取消

  • 再次编译后,解决警告

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1. FX3 SDK main components. User firmware Libraries ThreadX RTOS (cyu3threadx.a) FX3 API Library (cyfxapi.a) Serial Peripheral API Library (cyu3lpp.a) Storage API Library (cyu3sport.a) MIPI CSI-2 API Library (cyu3mipicsi.a) Take the example firmware lowpowertest debug reversion for the test, need link following library. libcyu3lpp.a libcyfxapi.a libcyu3threadx libc.a libgcc.a -lcyu3lpp -lcyfxapi -lcyu3threadx -lc -lgcc While the search path will be: -L"C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\ARM GCC\lib\gcc\arm-none-eabi\4.8.1" -L"C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\ARM GCC\arm-none-eabi\lib" -L"C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\fw_lib\1_3_3\fx3_debug" Link script will be fx3.ld for 512KB SRAM. From fx3 initialization block, could understand the fx3 entry point is CyU3PFirmwareEntry() function, so need manually assign entry point by follow linker command. --entry,CyU3PFirmwareEntry So Keil 4.74 IDE Linker page needs to configure as following pic. 2. Specific GNU cross compile tool path. Under tap project->Manage Project Items… -> Folders/Extensions Point to use GCC cross compile tools, please fill GNU-Tool-Prefix “arm-none-eabi-” while GNU-Tool Folder “C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\ARM GCC\” 3. C compile tap page configure. Predefined symbols __CYU3P_TX__=1. Include Path: ..\inc Without optimizations 4. Specific output file type. Under tap page Project->Options for target fx3->Output Need create object file with debug information. 5. After build elf file, execute user command. After precompiler, compiler and linker could get object file fx3.elf, need to convert to img file for download. So need execute user command: "C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\util\elf2img\elf2img.exe" -i fx3.elf -o fx3.img –v Summary After configuration, click Build button will show build output log like following pic.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值