From ed65206ab0c49d8254976c454220fb5cbf2ccc0b Mon Sep 17 00:00:00 2001 From: Maximilian Gerhardt Date: Mon, 18 Apr 2022 16:27:17 +0200 Subject: [PATCH] Use correct object copy for TxtToBin (#714) * Use correct objectcopy binaries and corresponding flags for ESP32S2 and ESP32C3 --- builder/frameworks/_embed_files.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/builder/frameworks/_embed_files.py b/builder/frameworks/_embed_files.py index a267e0f..5469e3b 100644 --- a/builder/frameworks/_embed_files.py +++ b/builder/frameworks/_embed_files.py @@ -102,19 +102,22 @@ def transform_to_asm(target, source, env): return files, source +mcu = board.get("build.mcu", "esp32") env.Append( BUILDERS=dict( TxtToBin=Builder( action=env.VerboseAction( " ".join( [ - "xtensa-esp32-elf-objcopy", + "riscv32-esp-elf-objcopy" + if mcu == "esp32c3" + else "xtensa-%s-elf-objcopy" % mcu, "--input-target", "binary", "--output-target", - "elf32-xtensa-le", + "elf32-littleriscv" if mcu == "esp32c3" else "elf32-xtensa-le", "--binary-architecture", - "xtensa", + "riscv" if mcu == "esp32c3" else "xtensa", "--rename-section", ".data=.rodata.embedded", "$SOURCE",