1
我对Makefiles仍然很陌生,所以我在这方面遇到了一些麻烦。我试图为STM32F4编译一些代码,我为STM32F3获得了这个Makefile.common,并且改变了工具链和目录,以反映我将用于开发的那些代码。不幸的是,我收到了这个编译错误,虽然我试图广泛地使用它,但没有任何帮助我解决它的帮助。针对STM32F4的Makefile错误编译
这里是我得到
使误差:execvp: /家庭/威尔弗雷德/ CodeSourcery的/ Sourcery_CodeBench_Lite_for_ARM_GNU_Linux /斌: 权限被拒绝化妆:* [startup_stm32f4xx.o]错误127
这是我的Makefile.common的代码。谢谢!
# name of executable
ELF=$(notdir $(CURDIR)).elf
# Tool path
TOOLROOT=/home/wilfred/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin
# Library path
LIBROOT=/home/wilfred/Computer-Science/STM32F/STM32F4-Discovery_FW_V1.1.0
# Tools
CC=$(TOOLROOT)/arm-none-linux-gnueabi-gcc
LD=$(TOOLROOT)/arm-none-linux-gnueabi-gcc
AR=$(TOOLROOT)/arm-none-linux-gnueabi-ar
AS=$(TOOLROOT)/arm-none-linux-gnueabi-as
OBJCOPY=$(TOOLROOT)/arm-none-linux-gnueabi-objcopy
# Code Paths
DEVICE=$(LIBROOT)/Libraries/CMSIS/ST/STM32F4xx
CORE=$(LIBROOT)/Libraries/CMSIS/Include
PERIPH=$(LIBROOT)/Libraries/STM32F4xx_StdPeriph_Driver
SYSTEM_FILE=$(LIBROOT)/Libraries/CMSIS/ST/STM32F4xx/Source/Templates
STARTUP_FILE=$(LIBROOT)/Libraries/CMSIS/ST/STM32F4xx/Source/Templates/gcc_ride7
# Search path for standard files
vpath %.c $(TEMPLATEROOT)
# Search path for perpheral library
vpath %.c $(CORE)
vpath %.c $(PERIPH)/src
vpath %.c $(DEVICE)
vpath %.c $(SYSTEM_FILE)
vpath %.s $(STARTUP_FILE)
# Processor specific
LDSCRIPT = $(LIBROOT)/Project/Peripheral_Examples/IO_Toggle/TrueSTUDIO/IO_Toggle/stm32_flash.ld
STARTUP = startup_stm32f4xx.o system_stm32f4xx.o
# Compilation Flags
FULLASSERT = -DUSE_FULL_ASSERT
LDFLAGS+= -T$(LDSCRIPT) -mthumb -mcpu=cortex-m4
CFLAGS+= -mcpu=cortex-m4 -mthumb
CFLAGS+= -I$(TEMPLATEROOT) -I$(DEVICE) -I$(CORE) -I$(PERIPH)/inc -I.
CFLAGS+= -DUSE_STDPERIPH_DRIVER $(FULLASSERT)
CFLAGS+= -I$(DEVICE)/Include -I$(CORE)
CFLAGS+= -I$(LIBROOT)/Project/Peripheral_Examples/IO_Toggle
# Build executable
$(ELF) : $(OBJS)
$(LD) $(LDFLAGS) -o [email protected] $(OBJS) $(LDLIBS)
# compile and generate dependency info
%.o: %.c
$(CC) -c $(CFLAGS) $< -o [email protected]
$(CC) -MM $(CFLAGS) $< > $*.d
%.o: %.s
$(CC) -c $(CFLAGS) $< -o [email protected]
%.bin: %.elf
$(OBJCOPY) -O binary $< [email protected]
clean:
rm -f $(OBJS) $(OBJS:.o=.d) $(ELF) startup_stm32f* $(CLEANOTHER) $(BIN)
debug: $(ELF)
arm-none-linux-gnueabi-gdb $(ELF)
download: $(BIN)
st-flash write $(BIN) 0x8000000
etags:
find $(PERIPH) -type f -iname "*.[ch]" | xargs etags --append
find $(DEVICE) -type f -iname "*.[ch]" | xargs etags --append
find $(CORE) -type f -iname "*.[ch]" | xargs etags --append
find . -type f -iname "*.[ch]" | xargs etags --append
all: $(ELF)
# pull in dependencies
-include $(OBJS:.o=.d)
您是否检查过该目录及其内部工具的权限? –
如果在错误消息中没有更多的上下文,就不可能说哪个规则试图使用'$(TOOLROOT)'作为命令。你能提供更多的上下文,还是缩小Makefile? – tripleee
它看起来非常像工具链二进制文件没有设置适当的执行权限位。你可以在你的$ TOOLROOT目录下做一个简单的ls -l,并将该输出添加到原始文章中? – Tuxdude