Skip to content
Snippets Groups Projects
Commit 0363e1d7 authored by dmanso's avatar dmanso Committed by Damien George
Browse files

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
parent 00c1fc6d
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,8 @@ FROZEN_DIR = scripts ...@@ -18,6 +18,8 @@ FROZEN_DIR = scripts
FROZEN_MPY_DIR = modules FROZEN_MPY_DIR = modules
PORT ?= /dev/ttyACM0 PORT ?= /dev/ttyACM0
BAUD ?= 115200 BAUD ?= 115200
FLASH_MODE ?= qio
FLASH_SIZE ?= 8m
CROSS_COMPILE = xtensa-lx106-elf- CROSS_COMPILE = xtensa-lx106-elf-
ESP_SDK = $(shell $(CC) -print-sysroot)/usr ESP_SDK = $(shell $(CC) -print-sysroot)/usr
...@@ -189,7 +191,7 @@ $(BUILD)/frozen_mpy.c: $(FROZEN_MPY_MPY_FILES) $(BUILD)/genhdr/qstrdefs.generate ...@@ -189,7 +191,7 @@ $(BUILD)/frozen_mpy.c: $(FROZEN_MPY_MPY_FILES) $(BUILD)/genhdr/qstrdefs.generate
deploy: $(BUILD)/firmware-combined.bin deploy: $(BUILD)/firmware-combined.bin
$(ECHO) "Writing $< to the board" $(ECHO) "Writing $< to the board"
$(Q)esptool.py --port $(PORT) --baud $(BAUD) write_flash --verify --flash_size=8m 0 $< $(Q)esptool.py --port $(PORT) --baud $(BAUD) write_flash --verify --flash_size=$(FLASH_SIZE) --flash_mode=$(FLASH_MODE) 0 $<
#$(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 #$(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
reset: reset:
......
...@@ -70,9 +70,10 @@ $ make deploy ...@@ -70,9 +70,10 @@ $ make deploy
``` ```
This will use the `esptool.py` script to download the images. You must have This will use the `esptool.py` script to download the images. You must have
your ESP module in the bootloader mode, and connected to a serial port on your PC. your ESP module in the bootloader mode, and connected to a serial port on your PC.
The default serial port is `/dev/ttyACM0`. To specify another, use, eg: The default serial port is `/dev/ttyACM0`, flash mode is `qio` and flash size is `8m`.
To specify other values, use, eg:
```bash ```bash
$ make PORT=/dev/ttyUSB0 deploy $ make PORT=/dev/ttyUSB0 FLASH_MODE=qio FLASH_SIZE=8m deploy
``` ```
The image produced is `firmware-combined.bin`, to be flashed at 0x00000. The image produced is `firmware-combined.bin`, to be flashed at 0x00000.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment