本文主要描述关于idf调试相关内容:
-
ESP32 Core Dump — ESP-IDF Programming Guide v4.0-dev-1287-gd7e659df2 documentation
-
ESP32 静态分析程序 crash 之 objdump
在build目录下运行
xtensa-esp32-elf-objdump -S project_name.elf > debug.txt
-
乐鑫 Wireshark 使用指南 — ESP-IDF 编程指南 v4.0-dev-1350-g842432fb6 文档
-
一个crash案例分析
Stack smashing also when using make (IDFGH-1043) · Issue #3368 · espressif/esp-idf
Ok, after looking at components/esp32/component.mk, got this:
cpu_start.o: CFLAGS := $(filter-out -fstack-protector%, $(CFLAGS))
but the command line has -fstack-protector-all and not -fstack-protector (maybe it’s due to the stack protection level (maximum) I’ve set in menuconfig)
So, I guess the line in the component.mk file should read instead:
cpu_start.o: CFLAGS += -fno-stack-protector
And it works.
There is also a bug in components/esp_common/component.mk, as the last line should read:
src/stack_check.o: CFLAGS += -fno-stack-protector
(Please notice the src/ in front of the stack_check.o filename with was also missing.)