mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
tools/esp32/Config.mk: Refine the usage of the IDF binaries.
1. Don't use the bootloader and partition-table binaries from a hello-world example. Rather the ESPTOOL_BINDIR variable can be used to give a user-defined location. 2. The ESPTOOL_BINDIR variable has to be as generic as possible. Don't assume any board configuration. Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
ea3eccb490
commit
b1ba1d4bca
@@ -22,12 +22,13 @@
|
|||||||
# and assemble source files and to insert the resulting object files into an
|
# and assemble source files and to insert the resulting object files into an
|
||||||
# archive. These replace the default definitions at tools/Config.mk
|
# archive. These replace the default definitions at tools/Config.mk
|
||||||
|
|
||||||
ifdef BLOBDIR
|
ifdef ESPTOOL_BINDIR
|
||||||
BOOTLOADER=${BLOBDIR}/esp32core/bootloader.bin
|
BL_OFFSET=0x1000
|
||||||
PARTITION_TABLE=${BLOBDIR}/esp32core/partition-table.bin
|
PT_OFFSET=0x8000
|
||||||
else
|
BOOTLOADER=$(ESPTOOL_BINDIR)/bootloader.bin
|
||||||
BOOTLOADER=$(IDF_PATH)/hello_world/build/bootloader/bootloader.bin
|
PARTITION_TABLE=$(ESPTOOL_BINDIR)/partition-table.bin
|
||||||
PARTITION_TABLE=$(IDF_PATH)/hello_world/build/partition_table/partition-table.bin
|
FLASH_BL=$(BL_OFFSET) $(BOOTLOADER)
|
||||||
|
FLASH_PT=$(PT_OFFSET) $(PARTITION_TABLE)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_ESP32_FLASH_2M),y)
|
ifeq ($(CONFIG_ESP32_FLASH_2M),y)
|
||||||
@@ -76,8 +77,8 @@ ESPTOOL_BAUD ?= 921600
|
|||||||
define DOWNLOAD
|
define DOWNLOAD
|
||||||
$(Q) if [ -z $(ESPTOOL_PORT) ]; then \
|
$(Q) if [ -z $(ESPTOOL_PORT) ]; then \
|
||||||
echo "DOWNLOAD error: Missing serial port device argument."; \
|
echo "DOWNLOAD error: Missing serial port device argument."; \
|
||||||
echo "USAGE: make download ESPTOOL_PORT=<port> [ ESPTOOL_BAUD=<baud> ]"; \
|
echo "USAGE: make download ESPTOOL_PORT=<port> [ ESPTOOL_BAUD=<baud> ] [ ESPTOOL_BINDIR=<dir> ]"; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
esptool.py --chip esp32 --port $(ESPTOOL_PORT) --baud $(ESPTOOL_BAUD) write_flash 0x1000 $(BOOTLOADER) 0x8000 $(PARTITION_TABLE) 0x10000 $(1).bin
|
esptool.py --chip esp32 --port $(ESPTOOL_PORT) --baud $(ESPTOOL_BAUD) write_flash $(FLASH_BL) $(FLASH_PT) 0x10000 $(1).bin
|
||||||
endef
|
endef
|
||||||
|
|||||||
Reference in New Issue
Block a user