From 1d8de6b24da74a3ff13c0998840b0110accd5507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Wed, 5 Jun 2019 11:42:49 +0200 Subject: [PATCH 1/4] boards/esp*: update RESET and RESET_FLAGS Update to use RESET and RESET_FLAGS variables set conditionally. --- boards/common/esp32/Makefile.include | 3 ++- boards/common/esp8266/Makefile.include | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/boards/common/esp32/Makefile.include b/boards/common/esp32/Makefile.include index 5087328682df..03f2450526bd 100644 --- a/boards/common/esp32/Makefile.include +++ b/boards/common/esp32/Makefile.include @@ -8,4 +8,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) include $(RIOTMAKE)/tools/serial.inc.mk # reset tool configuration -RESET ?= esptool.py --before default_reset run +RESET ?= esptool.py +RESET_FLAGS ?= --before default_reset run diff --git a/boards/common/esp8266/Makefile.include b/boards/common/esp8266/Makefile.include index 44a141a366b3..92beddd9790e 100644 --- a/boards/common/esp8266/Makefile.include +++ b/boards/common/esp8266/Makefile.include @@ -8,4 +8,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) include $(RIOTMAKE)/tools/serial.inc.mk # reset tool configuration -RESET ?= esptool.py --before default_reset run +RESET ?= esptool.py +RESET_FLAGS ?= --before default_reset run From 4a085270ea336afad061afda02702cc9060cb498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Wed, 5 Jun 2019 11:43:36 +0200 Subject: [PATCH 2/4] boards/esp*: use PORT in RESET_FLAGS This allows selecting the correct device when multiple boards are connected. --- boards/common/esp32/Makefile.include | 2 +- boards/common/esp8266/Makefile.include | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/common/esp32/Makefile.include b/boards/common/esp32/Makefile.include index 03f2450526bd..4a005b0d3a43 100644 --- a/boards/common/esp32/Makefile.include +++ b/boards/common/esp32/Makefile.include @@ -9,4 +9,4 @@ include $(RIOTMAKE)/tools/serial.inc.mk # reset tool configuration RESET ?= esptool.py -RESET_FLAGS ?= --before default_reset run +RESET_FLAGS ?= --port $(PORT) --before default_reset run diff --git a/boards/common/esp8266/Makefile.include b/boards/common/esp8266/Makefile.include index 92beddd9790e..bde04dbd4194 100644 --- a/boards/common/esp8266/Makefile.include +++ b/boards/common/esp8266/Makefile.include @@ -9,4 +9,4 @@ include $(RIOTMAKE)/tools/serial.inc.mk # reset tool configuration RESET ?= esptool.py -RESET_FLAGS ?= --before default_reset run +RESET_FLAGS ?= --port $(PORT) --before default_reset run From 90a9adbbda103a24a643f4892ef0aa467d4e1974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Wed, 5 Jun 2019 11:53:00 +0200 Subject: [PATCH 3/4] cpu/esp*: append to FLASHDEPS Append to FLASHDEPS instead of overwriting/lazy setting it. --- cpu/esp32/Makefile.include | 2 +- cpu/esp8266/Makefile.include | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include index b554ba56e746..645a83a9da63 100644 --- a/cpu/esp32/Makefile.include +++ b/cpu/esp32/Makefile.include @@ -159,7 +159,7 @@ PREFFLAGS += ls -l $(FLASHFILE).bin | awk '{ print $$5 }' >> $(BINDIR)/partition PREFFLAGS += python $(RIOTCPU)/$(CPU)/gen_esp32part.py --disable-sha256sum PREFFLAGS += --verify $(BINDIR)/partitions.csv $(BINDIR)/partitions.bin -FLASHDEPS = preflash +FLASHDEPS += preflash # flasher configuration ifeq ($(QEMU), 1) diff --git a/cpu/esp8266/Makefile.include b/cpu/esp8266/Makefile.include index f60655f46245..8154de5cf221 100644 --- a/cpu/esp8266/Makefile.include +++ b/cpu/esp8266/Makefile.include @@ -135,7 +135,7 @@ FLASHFILE ?= $(ELFFILE) FLASH_SIZE = -fs 8m PREFLASHER ?= esptool.py PREFFLAGS ?= elf2image $(FLASH_SIZE) $(FLASHFILE) -FLASHDEPS ?= preflash +FLASHDEPS += preflash # flasher configuration ifeq ($(QEMU), 1) From 422644bd3a1d4247ae74253ca2fa50d7d59fbd1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Wed, 5 Jun 2019 12:09:58 +0200 Subject: [PATCH 4/4] cpu/esp8266: update deprecated flash_size argument Using flash size in megabits is deprecated by esptool. Use the new megabyte notation. WARNING: Flash size arguments in megabits like '8m' are deprecated. Please use the equivalent size '1MB'. Megabit arguments may be removed in a future release. esptool.py v2.6 --- cpu/esp8266/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/esp8266/Makefile.include b/cpu/esp8266/Makefile.include index 8154de5cf221..507949536ed0 100644 --- a/cpu/esp8266/Makefile.include +++ b/cpu/esp8266/Makefile.include @@ -132,7 +132,7 @@ LINKFLAGS += -Wl,--warn-unresolved-symbols FLASHFILE ?= $(ELFFILE) # configure preflasher to convert .elf to .bin before flashing -FLASH_SIZE = -fs 8m +FLASH_SIZE = -fs 1MB PREFLASHER ?= esptool.py PREFFLAGS ?= elf2image $(FLASH_SIZE) $(FLASHFILE) FLASHDEPS += preflash