File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 11# Little convenience script to get an object dump
2+ # You may add "-S" to the objdump commandline (i.e. replace "-D -C " with "-d -S -C ")
3+ # to get source code intermixed with disassembly (SLOW !)
24
35Import ('env' )
46
57def obj_dump_after_elf (source , target , env ):
8+ platform = env .PioPlatform ()
9+ board = env .BoardConfig ()
10+ mcu = board .get ("build.mcu" , "esp32" )
11+
612 print ("Create firmware.asm" )
7- env .Execute ("xtensa-lx106-elf-objdump " + "-D " + str (target [0 ]) + " > " + "${PROGNAME}.asm" )
8-
13+ if mcu == "esp8266" :
14+ env .Execute ("xtensa-lx106-elf-objdump " + "-D -C " + str (target [0 ]) + " > " + "$BUILD_DIR/${PROGNAME}.asm" )
15+ if mcu == "esp32" :
16+ env .Execute ("xtensa-esp32-elf-objdump " + "-D -C " + str (target [0 ]) + " > " + "$BUILD_DIR/${PROGNAME}.asm" )
17+ if mcu == "esp32s2" :
18+ env .Execute ("xtensa-esp32s2-elf-objdump " + "-D -C " + str (target [0 ]) + " > " + "$BUILD_DIR/${PROGNAME}.asm" )
19+ if mcu == "esp32s3" :
20+ env .Execute ("xtensa-esp32s3-elf-objdump " + "-D -C " + str (target [0 ]) + " > " + "$BUILD_DIR/${PROGNAME}.asm" )
21+ if mcu == "esp32c3" :
22+ env .Execute ("riscv32-esp-elf-objdump " + "-D -C " + str (target [0 ]) + " > " + "$BUILD_DIR/${PROGNAME}.asm" )
23+
924env .AddPostAction ("$BUILD_DIR/${PROGNAME}.elf" , [obj_dump_after_elf ])
Original file line number Diff line number Diff line change @@ -215,6 +215,7 @@ extra_scripts =
215215 post:pio-scripts/output_bins.py
216216 post:pio-scripts/strip-floats.py
217217 pre:pio-scripts/user_config_copy.py
218+ ; post:pio-scripts/obj-dump.py ;; convenience script to create a disassembly dump of the firmware (hardcore debugging)
218219
219220# ------------------------------------------------------------------------------
220221# COMMON SETTINGS:
You can’t perform that action at this time.
0 commit comments