tools/espXX/Config.mk: Refactor the flash options.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
Abdelatif Guettouche 2021-09-08 11:28:41 +02:00 committed by Gustavo Henrique Nihei
parent adef19704d
commit cca3fa36ce
3 changed files with 12 additions and 12 deletions

View File

@ -58,6 +58,8 @@ else
ESPTOOL_WRITEFLASH_OPTS := -fs $(FLASH_SIZE) -fm dio -ff $(FLASH_FREQ)
endif
ESPTOOL_FLASH_OPTS := -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ)
# Configure the variables according to build environment
ifdef ESPTOOL_BINDIR
@ -117,8 +119,7 @@ define MERGEBIN
echo "Missing Flash memory size configuration for the ESP32 chip."; \
exit 1; \
fi
$(eval ESPTOOL_MERGEBIN_OPTS := -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ))
esptool.py -c esp32 merge_bin --output nuttx.merged.bin $(ESPTOOL_MERGEBIN_OPTS) $(ESPTOOL_BINS)
esptool.py -c esp32 merge_bin --output nuttx.merged.bin $(ESPTOOL_FLASH_OPTS) $(ESPTOOL_BINS)
$(Q) echo nuttx.merged.bin >> nuttx.manifest
$(Q) echo "Generated: nuttx.merged.bin"
endef
@ -165,8 +166,7 @@ define ELF2IMAGE
echo "Missing Flash memory size configuration for the ESP32 chip."; \
exit 1; \
fi
$(eval ESPTOOL_ELF2IMG_OPTS := -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ))
esptool.py -c esp32 elf2image $(ESPTOOL_ELF2IMG_OPTS) -o nuttx.bin nuttx
esptool.py -c esp32 elf2image $(ESPTOOL_FLASH_OPTS) -o nuttx.bin nuttx
$(Q) echo "Generated: nuttx.bin (ESP32 compatible)"
endef
endif

View File

@ -58,6 +58,8 @@ else
ESPTOOL_WRITEFLASH_OPTS := -fs $(FLASH_SIZE) -fm dio -ff $(FLASH_FREQ)
endif
ESPTOOL_FLASH_OPTS := -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ)
ifdef ESPTOOL_BINDIR
BL_OFFSET := 0x0
PT_OFFSET := 0x8000
@ -85,8 +87,7 @@ define ELF2IMAGE
echo "Missing Flash memory size configuration for the ESP32-C3 chip."; \
exit 1; \
fi
$(eval ESPTOOL_ELF2IMG_OPTS := -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ))
esptool.py -c esp32c3 elf2image $(ESPTOOL_ELF2IMG_OPTS) -o nuttx.bin nuttx
esptool.py -c esp32c3 elf2image $(ESPTOOL_FLASH_OPTS) -o nuttx.bin nuttx
$(Q) echo "Generated: nuttx.bin (ESP32-C3 compatible)"
endef
@ -103,8 +104,7 @@ define MERGEBIN
echo "Missing Flash memory size configuration for the ESP32-C3 chip."; \
exit 1; \
fi
$(eval ESPTOOL_MERGEBIN_OPTS := -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ))
esptool.py -c esp32c3 merge_bin --output nuttx.merged.bin $(ESPTOOL_MERGEBIN_OPTS) $(ESPTOOL_BINS)
esptool.py -c esp32c3 merge_bin --output nuttx.merged.bin $(ESPTOOL_FLASH_OPTS) $(ESPTOOL_BINS)
$(Q) echo nuttx.merged.bin >> nuttx.manifest
$(Q) echo "Generated: nuttx.merged.bin"
endef

View File

@ -58,6 +58,8 @@ else
ESPTOOL_WRITEFLASH_OPTS := -fs $(FLASH_SIZE) -fm dio -ff $(FLASH_FREQ)
endif
ESPTOOL_FLASH_OPTS := -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ)
ifdef ESPTOOL_BINDIR
BL_OFFSET := 0x1000
PT_OFFSET := 0x8000
@ -85,8 +87,7 @@ define ELF2IMAGE
echo "Missing Flash memory size configuration for the ESP32-S2 chip."; \
exit 1; \
fi
$(eval ESPTOOL_ELF2IMG_OPTS := -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ))
esptool.py -c esp32s2 elf2image $(ESPTOOL_ELF2IMG_OPTS) -o nuttx.bin nuttx
esptool.py -c esp32s2 elf2image $(ESPTOOL_FLASH_OPTS) -o nuttx.bin nuttx
$(Q) echo "Generated: nuttx.bin (ESP32-S2 compatible)"
endef
@ -103,8 +104,7 @@ define MERGEBIN
echo "Missing Flash memory size configuration for the ESP32-S2 chip."; \
exit 1; \
fi
$(eval ESPTOOL_MERGEBIN_OPTS := -fs $(FLASH_SIZE) -fm $(FLASH_MODE) -ff $(FLASH_FREQ))
esptool.py -c esp32s2 merge_bin --output nuttx.merged.bin $(ESPTOOL_MERGEBIN_OPTS) $(ESPTOOL_BINS)
esptool.py -c esp32s2 merge_bin --output nuttx.merged.bin $(ESPTOOL_FLASH_OPTS) $(ESPTOOL_BINS)
$(Q) echo nuttx.merged.bin >> nuttx.manifest
$(Q) echo "Generated: nuttx.merged.bin"
endef