8000 Flash both images in one go. · hmms/source-code-examples@118aef2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 118aef2

Browse files
committed
Flash both images in one go.
The esptool will start executing the image after it finishes. Also unify all Makefiles and ensure we do not use headers from the wrong architecture.
1 parent 22b20b0 commit 118aef2

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

basic_example/Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ TARGET = app
2626

2727
# which modules (subdirectories) of the project to include in compiling
2828
MODULES = driver user
29-
EXTRA_INCDIR = include /usr/include /usr/include/i386-linux-gnu
29+
EXTRA_INCDIR = include /opt/Espressif/include
3030

3131
# libraries used in this project, mainly provided by the SDK
32-
LIBS = c gcc hal phy net80211 lwip wpa main
32+
LIBS = c gcc hal phy net80211 lwip wpa upgrade upgrade_ssl main
3333

3434
# compiler flags using during compilation of source files
3535
CFLAGS = -Os -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH
@@ -101,7 +101,7 @@ $1/%.o: %.c
101101
$(Q) $(CC) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CFLAGS) -c $$< -o $$@
102102
endef
103103

104-
.PHONY: all checkdirs clean
104+
.PHONY: all checkdirs flash clean
105105

106106
all: checkdirs $(TARGET_OUT) $(FW_FILE_1) $(FW_FILE_2)
107107

@@ -130,9 +130,7 @@ firmware:
130130
$(Q) mkdir -p $@
131131

132132
flash: firmware/0x00000.bin firmware/0x40000.bin
133-
-$(ESPTOOL) --port $(ESPPORT) write_flash 0x00000 firmware/0x00000.bin
134-
sleep 3
135-
-$(ESPTOOL) --port $(ESPPORT) write_flash 0x40000 firmware/0x40000.bin
133+
-$(ESPTOOL) --port $(ESPPORT) write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin
136134

137135
clean:
138136
$(Q) rm -f $(APP_AR)

blinky/Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ TARGET = app
2626

2727
# which modules (subdirectories) of the project to include in compiling
2828
MODULES = driver user
29-
EXTRA_INCDIR = include /usr/include /usr/include/i386-linux-gnu
29+
EXTRA_INCDIR = include /opt/Espressif/include
3030

3131
# libraries used in this project, mainly provided by the SDK
32-
LIBS = c gcc hal phy net80211 lwip wpa main
32+
LIBS = c gcc hal phy net80211 lwip wpa upgrade upgrade_ssl main
3333

3434
# compiler flags using during compilation of source files
3535
CFLAGS = -Os -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH
@@ -101,7 +101,7 @@ $1/%.o: %.c
101101
$(Q) $(CC) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CFLAGS) -c $$< -o $$@
102102
endef
103103

104-
.PHONY: all checkdirs clean
104+
.PHONY: all checkdirs flash clean
105105

106106
all: checkdirs $(TARGET_OUT) $(FW_FILE_1) $(FW_FILE_2)
107107

@@ -130,9 +130,7 @@ firmware:
130130
$(Q) mkdir -p $@
131131

132132
flash: firmware/0x00000.bin firmware/0x40000.bin
133-
-$(ESPTOOL) --port $(ESPPORT) write_flash 0x00000 firmware/0x00000.bin
134-
sleep 3
135-
-$(ESPTOOL) --port $(ESPPORT) write_flash 0x40000 firmware/0x40000.bin
133+
-$(ESPTOOL) --port $(ESPPORT) write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin
136134

137135
clean:
138136
$(Q) rm -f $(APP_AR)

example.Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TARGET = app
2727

2828
# which modules (subdirectories) of the project to include in compiling
2929
MODULES = driver user
30-
EXTRA_INCDIR = include /opt/Espressif/include/
30+
EXTRA_INCDIR = include /opt/Espressif/include
3131

3232
# libraries used in this project, mainly provided by the SDK
3333
LIBS = c gcc hal phy net80211 lwip wpa upgrade upgrade_ssl main
@@ -131,9 +131,7 @@ firmware:
131131
$(Q) mkdir -p $@
132132

133133
flash: firmware/0x00000.bin firmware/0x40000.bin
134-
-$(ESPTOOL) --port $(ESPPORT) write_flash 0x00000 firmware/0x00000.bin
135-
sleep 3
136-
-$(ESPTOOL) --port $(ESPPORT) write_flash 0x40000 firmware/0x40000.bin
134+
-$(ESPTOOL) --port $(ESPPORT) write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin
137135

138136
clean:
139137
$(Q) rm -f $(APP_AR)

0 commit comments

Comments
 (0)
0