Skip to content

Commit ed65206

Browse files
authored
Use correct object copy for TxtToBin (platformio#714)
* Use correct objectcopy binaries and corresponding flags for ESP32S2 and ESP32C3
1 parent d342bce commit ed65206

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

builder/frameworks/_embed_files.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,22 @@ def transform_to_asm(target, source, env):
102102
return files, source
103103

104104

105+
mcu = board.get("build.mcu", "esp32")
105106
env.Append(
106107
BUILDERS=dict(
107108
TxtToBin=Builder(
108109
action=env.VerboseAction(
109110
" ".join(
110111
[
111-
"xtensa-esp32-elf-objcopy",
112+
"riscv32-esp-elf-objcopy"
113+
if mcu == "esp32c3"
114+
else "xtensa-%s-elf-objcopy" % mcu,
112115
"--input-target",
113116
"binary",
114117
"--output-target",
115-
"elf32-xtensa-le",
118+
"elf32-littleriscv" if mcu == "esp32c3" else "elf32-xtensa-le",
116119
"--binary-architecture",
117-
"xtensa",
120+
"riscv" if mcu == "esp32c3" else "xtensa",
118121
"--rename-section",
119122
".data=.rodata.embedded",
120123
"$SOURCE",

0 commit comments

Comments
 (0)