2017-07-28 70 views
0

我有一个项目,我试图建立我的新STM32F7核蛋白板出现问题在Eclipse臂无 - EABI链接。我新安装了GNU ARM Embedded toolchain,STM32CubeF7GNU MCU Eclipse Plugin,我用它在我的Windows 7机器上设置了一个新的项目。我以前在我的Ubuntu笔记本电脑上做过这些,没有问题。 设置完项目后,我添加了HAL和CMSIS库,并使用了STM32CubeF7的模板项目。到目前为止,汇编工作正常,但连接时,我得到以下错误:问题使用GNU MCU Eclipse插件

c:/program files (x86)/gnu tools arm embedded/5.4 2016q2/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: cannot find -lc_p-lc_p 

据我了解这里的问题是,一些库一个很奇怪的名字不能被发现。不幸的是,唯一的page that I found where the same error is described是在俄罗斯,我根本不说话。

乍一看,对我来说,它看起来像生成的makefile文件已损坏,和被称为C_P库正试图链接,但两者之间没有空间做两次。所以这可能是Eclipse或Eclipse GNU MCU插件的问题。

事情,我试图摆脱错误的:

  • 更新的Eclipse
  • 降级到几个老版本的GNU ARM的嵌入式工具链的
  • 关闭/打开以下链接器选项:
    • --specs=nano.specs
    • -nodefaultlibs
    • -nostdlib
  • 安装文件夹中的工具链没有任何空格

下面是自动生成的Makefile:

################################################################################ 
# Automatically-generated file. Do not edit! 
################################################################################ 

-include ../makefile.init 

RM := rm -rf 

# All of the sources participating in the build are defined here 
-include sources.mk 
-include system/src/subdir.mk 
-include system/HAL/Src/subdir.mk 
-include system/subdir.mk 
-include src/subdir.mk 
-include subdir.mk 
-include objects.mk 

ifneq ($(MAKECMDGOALS),clean) 
ifneq ($(strip $(CC_DEPS)),) 
-include $(CC_DEPS) 
endif 
ifneq ($(strip $(C++_DEPS)),) 
-include $(C++_DEPS) 
endif 
ifneq ($(strip $(C_UPPER_DEPS)),) 
-include $(C_UPPER_DEPS) 
endif 
ifneq ($(strip $(CXX_DEPS)),) 
-include $(CXX_DEPS) 
endif 
ifneq ($(strip $(ASM_DEPS)),) 
-include $(ASM_DEPS) 
endif 
ifneq ($(strip $(S_UPPER_DEPS)),) 
-include $(S_UPPER_DEPS) 
endif 
ifneq ($(strip $(C_DEPS)),) 
-include $(C_DEPS) 
endif 
ifneq ($(strip $(CPP_DEPS)),) 
-include $(CPP_DEPS) 
endif 
endif 

-include ../makefile.defs 

# Add inputs and outputs from these tool invocations to the build variables 
SECONDARY_FLASH += \ 
stm32Template.hex \ 

SECONDARY_SIZE += \ 
stm32Template.siz \ 


# All Target 
all: stm32Template.elf secondary-outputs 

# Tool invocations 
stm32Template.elf: $(OBJS) $(USER_OBJS) 
    @echo 'Building target: [email protected]' 
    @echo 'Invoking: GNU ARM Cross C++ Linker' 
    arm-none-eabi-g++ -mcpu=cortex-m7 -mthumb -mfloat-abi=soft -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra -g3 -p -pg -T mem.ld -T libs.ld -T sections.ld -nostartfiles -L"../ldscripts" -Wl,-Map,"stm32Template.map" --specs=nano.specs -o "stm32Template.elf" $(OBJS) $(USER_OBJS) $(LIBS) 
    @echo 'Finished building target: [email protected]' 
    @echo ' ' 

stm32Template.hex: stm32Template.elf 
    @echo 'Invoking: GNU ARM Cross Create Flash Image' 
    arm-none-eabi-objcopy -O ihex "stm32Template.elf" "stm32Template.hex" 
    @echo 'Finished building: [email protected]' 
    @echo ' ' 

stm32Template.siz: stm32Template.elf 
    @echo 'Invoking: GNU ARM Cross Print Size' 
    arm-none-eabi-size --format=berkeley "stm32Template.elf" 
    @echo 'Finished building: [email protected]' 
    @echo ' ' 

# Other Targets 
clean: 
    -$(RM) $(CC_DEPS)$(C++_DEPS)$(OBJS)$(C_UPPER_DEPS)$(CXX_DEPS)$(SECONDARY_FLASH)$(SECONDARY_SIZE)$(ASM_DEPS)$(S_UPPER_DEPS)$(C_DEPS)$(CPP_DEPS) stm32Template.elf 
    [email protected] ' ' 

secondary-outputs: $(SECONDARY_FLASH) $(SECONDARY_SIZE) 

.PHONY: all clean dependents 

-include ../makefile.targets 

没有任何人有任何这方面的投入给我吗?

编辑: GNU MCU Eclipse插件为新项目提供了一个模板,即使这样我也会得到相同的错误。

回答

0

过了一段时间,我想出了如何解决这个问题,但不幸的是我还没有发现究竟是什么原因造成的。我搜索了我的GNU ARM Embedded toolchain安装文件夹,但未找到包含c_p的任何库名称。我认为导致这个问题的原因必须在于定义链接器默认库的地方,这就是为什么我认为问题在于工具链本身。

但是,我选择禁用默认库(-nodefaultlibs标志)并将它们自己链接起来。我联系以下库:

-lg -lstdc++ -lgcc -lm -lrdimon -lc

如果有人可以帮我找到这个问题,将不胜感激的实际根源。 但是,既然解决了我的问题,我就要关闭这个问题。

0

你让一个非常重要的错误。您尝试使用DIY Eclipse配置导入为特定环境创建的项目。

安装OpenSTM32。 使用SW4STM32工具链设置生成您的项目。

导入该项目。编译,链接和调试

如果您发现已安装的工具链已过时,您将能够替换它。

+0

我没有导入任何设置,我只是复制源文件,以便我可以自己设置和配置项目。我在家里做了这个,并且在另一个项目上工作 - 但在Linux上。问题是我想继续使用Eclipse,就像我一直在做的那么多年。我想知道为什么会发生这种情况,以便我知道问题出在哪里,无论是工具链还是IDE。 –

+0

好的。不好意思,朋友。 –

+0

不用担心,谢谢你试图帮助:)我刚刚更新了我的问题,当我创建一个干净的新项目并尝试编译它时发生同样的错误。该项目来自GNU MCU Eclipse插件提供的模板,所以它不能因为我将文件复制到项目中。我担心它与工具链有关...... –