[build] Add ESP_PROGRAM module
ISSUE:
@@ -10226,6 +10226,23 @@ module MCU_PROGRAM: PROGRAM {
.CMD=MCU_LINK_EXE
}
+macro _ESP_ELF2IMAGE(Elf) {
+ .CMD=${cwd:BINDIR} ${tool:"contrib/tools/esptool/esptool"} --chip esp32c3 elf2image -o ${output;noext:Elf.bin} $Elf
+}
+
+ESP_LINK_EXE=$LINK_EXE && $_ESP_ELF2IMAGE($MODULE_PREFIX$REALPRJNAME)
+
+### @usage: ESP_PROGRAM([progname])
+###
+### Program module for Espressif microcontrollers.
+### Converts ELF to binary image file suitable for flashing.
+### Currently, only ESP32-C3 is supported.
+module ESP_PROGRAM: PROGRAM {
+ .CMD=ESP_LINK_EXE
+ ALLOCATOR(FAKE)
+ NO_PLATFORM()
+}
+
# tag:flags tag:internal tag:windows-specific
### @usage: _MSVC_FLAGS_WINDOWS_IMPL(target_platform compiler_flags) # internal
###
