Skip to content

Commit 74505f0

Browse files
committed
Update Config.mk
1 parent e0d3992 commit 74505f0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tools/esp32/Config.mk

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ else ifeq ($(CONFIG_ESP32_APP_FORMAT_MCUBOOT),y)
130130
IMGTOOL_SIGN_ARGS := --pad $(VERIFIED) $(IMGTOOL_ALIGN_ARGS) -v 0 -s auto \
131131
-H $(CONFIG_ESP32_APP_MCUBOOT_HEADER_SIZE) --pad-header \
132132
-S $(CONFIG_ESP32_OTA_SLOT_SIZE)
133+
else
134+
# CONFIG_ESPRESSIF_SIMPLE_BOOT
135+
136+
APP_OFFSET := 0x1000
137+
APP_IMAGE := nuttx.bin
138+
FLASH_APP := $(APP_OFFSET) $(APP_IMAGE)
139+
ESPTOOL_BINDIR := .
133140
endif
134141

135142
ESPTOOL_BINS += $(FLASH_APP)
@@ -262,6 +269,25 @@ define MKIMAGE
262269
$(Q) echo nuttx.bin >> nuttx.manifest
263270
$(Q) echo "Generated: nuttx.bin (MCUboot compatible)"
264271
endef
272+
else
273+
define MKIMAGE
274+
$(Q) echo "MKIMAGE: ESP32 binary"
275+
$(Q) if ! esptool.py version 1>/dev/null 2>&1; then \
276+
echo ""; \
277+
echo "esptool.py not found. Please run: \"pip install esptool==4.8.dev4\""; \
278+
echo ""; \
279+
echo "Run make again to create the nuttx.bin image."; \
280+
exit 1; \
281+
fi
282+
$(Q) if [ -z $(FLASH_SIZE) ]; then \
283+
echo "Missing Flash memory size configuration."; \
284+
exit 1; \
285+
fi
286+
$(eval ELF2IMAGE_OPTS := $(if $(CONFIG_ESPRESSIF_SIMPLE_BOOT),--ram-only-header) -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ))
287+
$(ESPTOOL_FILE) -c esp32 elf2image $(ELF2IMAGE_OPTS) -o nuttx.bin nuttx
288+
$(Q) echo nuttx.bin >> nuttx.manifest
289+
$(Q) echo "Generated: nuttx.bin"
290+
endef
265291
endif
266292
endif
267293

0 commit comments

Comments
 (0)