From 1c22f1e15e1569c257b1f1f01a916efd8a90b09c Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 22 Nov 2021 17:59:33 +0100 Subject: [PATCH 1/2] 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 From 2b9c81cbdcee9e8daa838e24dba72a32957e7ac4 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 22 Nov 2021 18:17:36 +0100 Subject: [PATCH 2/2] xtensa: Pass the test with latest gdb --- components/xtensa/trax/test/gdb_log_expected.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/xtensa/trax/test/gdb_log_expected.txt b/components/xtensa/trax/test/gdb_log_expected.txt index da8fdc1022..b765388ee9 100644 --- a/components/xtensa/trax/test/gdb_log_expected.txt +++ b/components/xtensa/trax/test/gdb_log_expected.txt @@ -4,7 +4,7 @@ Hardware assisted breakpoint 1 at 0x4008043d: file test.c, line 22. Temporary breakpoint 1, entry () at test.c:22 22 for (int i = 0; i < 10; ++ i) { -Program stopped. +Program received signal SIGINT, Interrupt. entry () at test.c:26 26 } 0001: Indirect branch message, 2 packets, PC range 0x40080400 - 0x4008040a, target PC 0x40080411, icnt=9, uaddr=0x11, exc=0 @@ -38227,3 +38227,4 @@ Dump of assembler code from 0x4008042c to 0x40080430: 0x4008042c : entry a1, 32 0x4008042f : mov.n a7, a1 End of assembler dump. +[Inferior 1 (Remote target) detached]