From 1c22f1e15e1569c257b1f1f01a916efd8a90b09c Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 22 Nov 2021 17:59:33 +0100 Subject: [PATCH] xtensa: Revert back Makefile for trax test Revert back the regression of 766aa5708443099f3f033b739cda0e1de101cca6 --- components/xtensa/trax/test/Makefile | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 components/xtensa/trax/test/Makefile diff --git a/components/xtensa/trax/test/Makefile b/components/xtensa/trax/test/Makefile new file mode 100644 index 0000000000..c8c24904c0 --- /dev/null +++ b/components/xtensa/trax/test/Makefile @@ -0,0 +1,39 @@ +PROG_BIN := test.bin +PROG_ELF := test.elf +OBJ := test.o +PREFIX := xtensa-esp32-elf- +CC := $(PREFIX)gcc +LD := $(PREFIX)ld +GDB ?= $(PREFIX)gdb +CFLAGS := -g -O0 +LDFLAGS := -L $(IDF_PATH)/components/bootloader/subproject/main/ld/esp32 \ + -T bootloader.ld \ + -u entry \ + -e entry \ + -g + +TRACE_FILE := trace_pro.bin +GDB_LOG := gdb_log.txt +GDB_LOG_REF := gdb_log_expected.txt + +all: $(PROG_BIN) + +$(PROG_ELF): $(OBJ) + $(LD) $(LDFLAGS) -o $@ $< + +$(PROG_BIN): $(PROG_ELF) + esptool.py --chip esp32 elf2image --output $@ --flash_freq 40m --flash_mode dio $< + +flash: $(PROG_BIN) + esptool.py --port $(ESPPORT) write_flash 0x1000 $(PROG_BIN) + +test: + rm -f $(TRACE_FILE) + $(GDB) -n --batch -x gdbinit | tee $(GDB_LOG) + diff $(GDB_LOG) $(GDB_LOG_REF) + @echo "Test pass" + +clean: + rm -f $(PROG_ELF) $(PROG_BIN) $(OBJ) $(TRACE_FILE) $(GDB_LOG) + +.PHONY: all clean flash test