mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
esp32: Create chip selection config to improve capabilities refinement
This commit is contained in:
committed by
Abdelatif Guettouche
parent
84daebf2cc
commit
a8cf8abfaa
+18
-4
@@ -32,6 +32,16 @@ else
|
||||
PARTITION_TABLE=$(IDF_PATH)/hello_world/build/partition_table/partition-table.bin
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ESP32_FLASH_2M),y)
|
||||
FLASH_SIZE="2MB"
|
||||
else ifeq ($(CONFIG_ESP32_FLASH_4M),y)
|
||||
FLASH_SIZE="4MB"
|
||||
else ifeq ($(CONFIG_ESP32_FLASH_8M),y)
|
||||
FLASH_SIZE="8MB"
|
||||
else ifeq ($(CONFIG_ESP32_FLASH_16M),y)
|
||||
FLASH_SIZE="16MB"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ESP32_QEMU_IMAGE),y)
|
||||
MK_QEMU_IMG=$(TOPDIR)/tools/esp32/mk_qemu_img.sh $(BOOTLOADER) $(PARTITION_TABLE)
|
||||
else
|
||||
@@ -39,16 +49,20 @@ else
|
||||
endif
|
||||
|
||||
define POSTBUILD
|
||||
$(Q)echo "MKIMAGE: ESP32 binary"
|
||||
$(Q) echo "MKIMAGE: ESP32 binary"
|
||||
$(Q) if ! esptool.py version 1>/dev/null 2>&1; then \
|
||||
echo ""; \
|
||||
echo "esptool.py not found. Please run: \"pip install esptool.py\""; \
|
||||
echo "Or run: \"make -C tools/esp32\" to install all IDF tools."; \
|
||||
echo "Or run: \"make -C $(TOPDIR)/tools/esp32\" to install all IDF tools."; \
|
||||
echo ""; \
|
||||
echo "Run make again to create the nuttx.bin image."; \
|
||||
else \
|
||||
esptool.py --chip esp32 elf2image --flash_mode dio --flash_size 4MB -o nuttx.bin nuttx; \
|
||||
if [ -z $(FLASH_SIZE) ]; then \
|
||||
echo "Missing Flash memory size configuration for the ESP32 chip."; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
esptool.py --chip esp32 elf2image --flash_mode dio --flash_size $(FLASH_SIZE) -o nuttx.bin nuttx; \
|
||||
echo "Generated: nuttx.bin (ESP32 compatible)"; \
|
||||
fi
|
||||
$(MK_QEMU_IMG)
|
||||
$(Q) $(MK_QEMU_IMG)
|
||||
endef
|
||||
|
||||
Reference in New Issue
Block a user