Skip to content

Commit 0363e1d

Browse files
dmansodpgeorge
authored andcommitted
esp8266: Add FLASH_MODE,FLASH_SIZE options for make deploy target.
Added options to make deploy so it can be used for ESP8266 boards with other flash configurations. For example NodeMCU DEVKIT V1.0 can now use: $ make FLASH_MODE=dio FLASH_SIZE=32m deploy
1 parent 00c1fc6 commit 0363e1d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

esp8266/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ FROZEN_DIR = scripts
1818
FROZEN_MPY_DIR = modules
1919
PORT ?= /dev/ttyACM0
2020
BAUD ?= 115200
21+
FLASH_MODE ?= qio
22+
FLASH_SIZE ?= 8m
2123
CROSS_COMPILE = xtensa-lx106-elf-
2224
ESP_SDK = $(shell $(CC) -print-sysroot)/usr
2325

@@ -189,7 +191,7 @@ $(BUILD)/frozen_mpy.c: $(FROZEN_MPY_MPY_FILES) $(BUILD)/genhdr/qstrdefs.generate
189191

190192
deploy: $(BUILD)/firmware-combined.bin
191193
$(ECHO) "Writing $< to the board"
192-
$(Q)esptool.py --port $(PORT) --baud $(BAUD) write_flash --verify --flash_size=8m 0 $<
194+
$(Q)esptool.py --port $(PORT) --baud $(BAUD) write_flash --verify --flash_size=$(FLASH_SIZE) --flash_mode=$(FLASH_MODE) 0 $<
193195
#$(Q)esptool.py --port $(PORT) --baud $(BAUD) write_flash --flash_size=8m 0 $(BUILD)/firmware.elf-0x00000.bin 0x9000 $(BUILD)/firmware.elf-0x0[1-f]000.bin
194196

195197
reset:

esp8266/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ $ make deploy
7070
```
7171
This will use the `esptool.py` script to download the images. You must have
7272
your ESP module in the bootloader mode, and connected to a serial port on your PC.
73-
The default serial port is `/dev/ttyACM0`. To specify another, use, eg:
73+
The default serial port is `/dev/ttyACM0`, flash mode is `qio` and flash size is `8m`.
74+
To specify other values, use, eg:
7475
```bash
75-
$ make PORT=/dev/ttyUSB0 deploy
76+
$ make PORT=/dev/ttyUSB0 FLASH_MODE=qio FLASH_SIZE=8m deploy
7677
```
7778

7879
The image produced is `firmware-combined.bin`, to be flashed at 0x00000.

0 commit comments

Comments
 (0)