eclipse GNU ARM - 未找到 nano.specs
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26931979/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
GNU ARM - nano.specs not found
提问by JacaHyman
Last days I've been trying to compile a STM32F4xx project with Ubuntu 14.04LTS, Eclipse and GNU ARM plugin for Eclipse. Now it says that nano.specs
is missing.
Here is my build log:
最近几天,我一直在尝试使用Ubuntu 14.04LTS、Eclipse 和 Eclipse 的 GNU ARM 插件编译 STM32F4xx 项目。现在它说nano.specs
缺少了。这是我的构建日志:
14:39:35 **** Incremental Build of configuration Release for project F4Test ****
make all
Building target: F4Test.elf
Invoking: Cross ARM C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -Wextra -g -T mem.ld -T libs.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L"../ldscripts" -Wl,-Map,"F4Test.map" --specs=nano.specs -o "F4Test.elf" ./system/src/stm32f4-hal/stm32f4xx_hal.o ./system/src/stm32f4-hal/stm32f4xx_hal_cortex.o ./system/src/stm32f4-hal/stm32f4xx_hal_flash.o ./system/src/stm32f4-hal/stm32f4xx_hal_flash_ex.o ./system/src/stm32f4-hal/stm32f4xx_hal_flash_ramfunc.o ./system/src/stm32f4-hal/stm32f4xx_hal_gpio.o ./system/src/stm32f4-hal/stm32f4xx_hal_iwdg.o ./system/src/stm32f4-hal/stm32f4xx_hal_pcd_ex.o ./system/src/stm32f4-hal/stm32f4xx_hal_pwr.o ./system/src/stm32f4-hal/stm32f4xx_hal_pwr_ex.o ./system/src/stm32f4-hal/stm32f4xx_hal_rcc.o ./system/src/stm32f4-hal/stm32f4xx_hal_rcc_ex.o ./system/src/newlib/_cxx.o ./system/src/newlib/_exit.o ./system/src/newlib/_sbrk.o ./system/src/newlib/_startup.o ./system/src/newlib/_syscalls.o ./system/src/newlib/_write.o ./system/src/newlib/assert.o ./system/src/diag/Trace.o ./system/src/diag/trace_impl.o ./system/src/cortexm/_initialize_hardware.o ./system/src/cortexm/_reset_hardware.o ./system/src/cortexm/exception_handlers.o ./system/src/cmsis/system_stm32f4xx.o ./system/src/cmsis/vectors_stm32f4xx.o ./src/BlinkLed.o ./src/Timer.o ./src/_initialize_hardware.o ./src/main.o
arm-none-eabi-g++: error: nano.specs: No such file or directory
make: *** [F4Test.elf] Error 1
14:39:35 Build Finished (took 65ms)
I found some nano.specs
files on my computer. What should I do? Just remove linker flag (I can't actually do that, because I can't figure out how to do that in Eclipse) or something else?
Thanks for your help!
我nano.specs
在我的电脑上找到了一些文件。我该怎么办?只需删除链接器标志(我实际上不能这样做,因为我不知道如何在 Eclipse 中做到这一点)或其他什么?谢谢你的帮助!
回答by JacaHyman
I solved the problem. I was just using arm-none-eabi-xxx
packages provided by Ubuntu, not original ones - that was the problem. All you need to do is simply download packages from toolchain's websiteand install them. They work just fine!
我解决了这个问题。我只是使用arm-none-eabi-xxx
Ubuntu 提供的软件包,而不是原始软件包 - 这就是问题所在。您需要做的只是从工具链的网站下载软件包并安装它们。他们工作得很好!
回答by Tomasz Gandor
Optional step
可选步骤
If you have installed the bundled toolchain from Ubuntu's repositories - get rid of them:
如果您已经从 Ubuntu 的存储库安装了捆绑的工具链 - 摆脱它们:
$ sudo apt-get remove gcc-arm-none-eabi
Recommended way to install
推荐的安装方式
This is described on the plugin's page:
这在插件页面上有描述:
http://gnuarmeclipse.github.io/toolchain/install/
http://gnuarmeclipse.github.io/toolchain/install/
-> with an exact description what packages are needed for your specific edition (14.04 LTS, x64 in this case).
-> 准确描述您的特定版本(在本例中为 14.04 LTS,x64)所需的软件包。
First, install 32-bit dependency libraries:
首先,安装32位依赖库:
$ sudo apt-get -y install lib32z1 lib32ncurses5 lib32bz2-1.0
(15.04 - and later? - need just lib32ncurses5
, while older Ubuntus - 12.04 e.a. - have ia32-libs
).
(15.04 - 及更高版本? - 只需要lib32ncurses5
,而较旧的 Ubuntus - 12.04 ea - 有ia32-libs
)。
Then download a pre-compiled toolchain package from here:
然后从这里下载一个预编译的工具链包:
https://launchpad.net/gcc-arm-embedded/+download
https://launchpad.net/gcc-arm-embedded/+download
(they recommend gcc 4.9 at the time of writing, but it should be OK to take the newest, gcc 5.3 version).
(他们在撰写本文时推荐 gcc 4.9,但采用最新的 gcc 5.3 版本应该没问题)。
Recommended install location
推荐安装位置
Finally untar the package into /usr/local
- this way the Eclipse plugin should find it, without configuring toolchains in Eclipse preferences or modifying $PATH
variable.
最后将包解压缩到/usr/local
- 这样 Eclipse 插件应该可以找到它,而无需在 Eclipse 首选项中配置工具链或修改$PATH
变量。
$ cd /usr/local
$ sudo tar xf ~/Downloads/gcc-arm-none-eabi-*-linux.tar.bz2
回答by Aaron Campbell
If you are compiling for ARM Cortex-M or Cortex-R, try installing the package gcc-arm-embedded
with apt-get instead of gcc-arm-none-eabi
. This worked for me, and the suggestion came from the documentation for Arm's "Yotta" build tool: http://yottadocs.mbed.com/#linux-cross-compile.
如果您正在为 ARM Cortex-M 或 Cortex-R 进行编译,请尝试gcc-arm-embedded
使用 apt-get 而不是gcc-arm-none-eabi
. 这对我有用,建议来自 Arm 的“Yotta”构建工具的文档:http: //yottadocs.mbed.com/#linux-cross-compile。