2020-11-17 20:49:39 +00:00
|
|
|
# Little convenience script to get an object dump
|
2024-05-06 09:00:41 +00:00
|
|
|
# You may add "-S" to the objdump commandline (i.e. replace "-D -C " with "-d -S -C ")
|
|
|
|
# to get source code intermixed with disassembly (SLOW !)
|
2020-11-17 20:49:39 +00:00
|
|
|
|
|
|
|
Import('env')
|
|
|
|
|
|
|
|
def obj_dump_after_elf(source, target, env):
|
2024-05-06 09:00:41 +00:00
|
|
|
platform = env.PioPlatform()
|
|
|
|
board = env.BoardConfig()
|
|
|
|
mcu = board.get("build.mcu", "esp32")
|
|
|
|
|
2020-11-17 20:49:39 +00:00
|
|
|
print("Create firmware.asm")
|
2024-05-06 09:00:41 +00:00
|
|
|
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")
|
|
|
|
if mcu == "esp32s2":
|
|
|
|
env.Execute("xtensa-esp32s2-elf-objdump "+ "-D -C " + str(target[0]) + " > "+ "$BUILD_DIR/${PROGNAME}.asm")
|
|
|
|
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")
|
|
|
|
|
2020-11-17 20:49:39 +00:00
|
|
|
env.AddPostAction("$BUILD_DIR/${PROGNAME}.elf", [obj_dump_after_elf])
|