You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Makefile.posix中配置值以解决nRF52840 armgcc编译错误

nRF52840 编译nRF SDK armgcc报错修复

执行make编译项目时出现如下错误:

su@su-desktop:~/nRF/nRF5_SDK_17.1.0_ddde560/examples/peripheral/template_project/pca10056/blank/armgcc$ make
/home/su/gcc-arm-none-eabi/bin/arm-none-eabi-gcc: 1: cannot open @@P�@8: No such file
/home/su/gcc-arm-none-eabi/bin/arm-none-eabi-gcc: 1: Syntax error: Unterminated quoted string
Cannot find: '/home/su/gcc-arm-none-eabi/bin/arm-none-eabi-gcc'.
Please set values in: "/home/su/nRF/nRF5_SDK_17.1.0_ddde560/components/toolchain/gcc/Makefile.posix"
according to the actual configuration of your system.
../../../../../../components/toolchain/gcc/Makefile.common:129: *** Cannot continue.  Stop.
su@su-desktop:~/nRF/nRF5_SDK_17.1.0_ddde560/examples/peripheral/template_project/pca10056/blank/armgcc$ 

修复步骤

  • 打开SDK路径下的配置文件:/home/su/nRF/nRF5_SDK_17.1.0_ddde560/components/toolchain/gcc/Makefile.posix
  • 修正以下三个核心变量:
    • GNU_INSTALL_ROOT:填写armgcc工具链的根目录(不要带末尾的bin/),比如你的工具链在/home/su/gcc-arm-none-eabi/,就设置为GNU_INSTALL_ROOT := /home/su/gcc-arm-none-eabi/
    • GNU_VERSION:执行arm-none-eabi-gcc --version查看版本号,填入对应值,比如GNU_VERSION := 10.3.1
    • GNU_PREFIX:保持arm-none-eabi不变,即GNU_PREFIX := arm-none-eabi
  • 保存文件后重新运行make命令

内容的提问来源于stack exchange,提问作者varun_koganti

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.24 23:09:22