修改components\toolchain\gcc
中的Makefile.common
文件里的toolchain中的编译工具,因为安装的arm-none-eabi路径与“Makefile.posix”中定义的不一致。
# Toolchain commands
CC := $(call quote,$(GNU_PREFIX)-gcc)
CXX := $(call quote,$(GNU_PREFIX)-c++)
AS := $(call quote,$(GNU_PREFIX)-as)
AR := $(call quote,$(GNU_PREFIX)-ar) -r
LD := $(call quote,$(GNU_PREFIX)-ld)
NM := $(call quote,$(GNU_PREFIX)-nm)
OBJDUMP := $(call quote,$(GNU_PREFIX)-objdump)
OBJCOPY := $(call quote,$(GNU_PREFIX)-objcopy)
SIZE := $(call quote,$(GNU_PREFIX)-size)
#CC := $(call quote,$(GNU_INSTALL_ROOT)$(GNU_PREFIX)-gcc)
#CXX := $(call quote,$(GNU_INSTALL_ROOT)$(GNU_PREFIX)-c++)
#AS := $(call quote,$(GNU_INSTALL_ROOT)$(GNU_PREFIX)-as)
#AR := $(call quote,$(GNU_INSTALL_ROOT)$(GNU_PREFIX)-ar) -r
#LD := $(call quote,$(GNU_INSTALL_ROOT)$(GNU_PREFIX)-ld)
#NM := $(call quote,$(GNU_INSTALL_ROOT)$(GNU_PREFIX)-nm)
#OBJDUMP := $(call quote,$(GNU_INSTALL_ROOT)$(GNU_PREFIX)-objdump)
#OBJCOPY := $(call quote,$(GNU_INSTALL_ROOT)$(GNU_PREFIX)-objcopy)
#SIZE := $(call quote,$(GNU_INSTALL_ROOT)$(GNU_PREFIX)-size)
然后就可以通过make进行编译:
dolphin@gy211935:/mnt/g/WORK/nRF5_SDK_17.0.2_d674dde/examples/peripheral/usbd_ble_uart/pca10100/s113/armgcc$ make -j
mkdir _build
cd _build && mkdir nrf52833_xxaa
Assembling file: gcc_startup_nrf52833.S
Compiling file: nrf_log_backend_rtt.c
..........
Compiling file: nrf_sdh_ble.c
Compiling file: nrf_sdh_soc.c
Linking target: _build/nrf52833_xxaa.out
text data bss dec hex filename
62736 216 4720 67672 10858 _build/nrf52833_xxaa.out
Preparing: _build/nrf52833_xxaa.hex
Preparing: _build/nrf52833_xxaa.bin
DONE nrf52833_xxaa