Tasmota/pio-tools/obj-dump.py

23 lines
1017 B
Python
Raw Normal View History

2019-10-23 12:11:53 +01:00
# Little convenience script to get an object dump
Import('env')
def obj_dump_after_elf(source, target, env):
platform = env.PioPlatform()
board = env.BoardConfig()
mcu = board.get("build.mcu", "esp32")
2019-10-23 12:11:53 +01:00
print("Create firmware.asm")
if mcu == "esp8266":
env.Execute("xtensa-lx106-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
if mcu == "esp32":
env.Execute("xtensa-esp32-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
2022-01-07 21:28:52 +00:00
if mcu == "esp32s2":
env.Execute("xtensa-esp32s2-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
2022-02-12 19:01:12 +00:00
if mcu == "esp32s3":
env.Execute("xtensa-esp32s3-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
if mcu == "esp32c3":
env.Execute("riscv32-esp-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
2019-10-23 12:11:53 +01:00
env.AddPostAction("$BUILD_DIR/${PROGNAME}.elf", [obj_dump_after_elf])