Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cpu/esp8266: use FLASHFILE variable
Use ELFFILE as FLASHFILE as all files are created from this
one using esptool.
  • Loading branch information
gschorcht authored and cladmi committed Jun 6, 2019
1 parent 98d64da commit 563c41f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cpu/esp8266/Makefile.include
Expand Up @@ -128,24 +128,27 @@ LINKFLAGS += -T$(RIOTCPU)/$(CPU)/ld/eagle.rom.addr.v6.ld
LINKFLAGS += -nostdlib -lgcc -u ets_run -Wl,-gc-sections # -Wl,--print-gc-sections
LINKFLAGS += -Wl,--warn-unresolved-symbols

# The ELFFILE is the base one used for flashing
FLASHFILE ?= $(ELFFILE)

# configure preflasher to convert .elf to .bin before flashing
FLASH_SIZE = -fs 8m
PREFLASHER ?= esptool.py
PREFFLAGS ?= elf2image $(FLASH_SIZE) $(ELFFILE)
PREFFLAGS ?= elf2image $(FLASH_SIZE) $(FLASHFILE)
FLASHDEPS ?= preflash

# flasher configuration
ifeq ($(QEMU), 1)
FLASHER = cat
FFLAGS += $(ELFFILE)-0x00000.bin /dev/zero | head -c $$((0x10000)) | cat -
FFLAGS += $(ELFFILE)-0x10000.bin /dev/zero | head -c $$((0xfc000)) | cat -
FFLAGS += $(RIOTCPU)/$(CPU)/bin/esp_init_data_default.bin > $(ELFFILE).bin
FFLAGS += $(FLASHFILE)-0x00000.bin /dev/zero | head -c $$((0x10000)) | cat -
FFLAGS += $(FLASHFILE)-0x10000.bin /dev/zero | head -c $$((0xfc000)) | cat -
FFLAGS += $(RIOTCPU)/$(CPU)/bin/esp_init_data_default.bin > $(FLASHFILE).bin
else
FLASH_MODE ?= dout
export PROGRAMMER_SPEED ?= 460800
FLASHER = esptool.py
FFLAGS += -p $(PORT) -b $(PROGRAMMER_SPEED) write_flash
FFLAGS += -fm $(FLASH_MODE)
FFLAGS += 0 $(ELFFILE)-0x00000.bin
FFLAGS += 0x10000 $(ELFFILE)-0x10000.bin; esptool.py -p $(PORT) run
FFLAGS += 0 $(FLASHFILE)-0x00000.bin
FFLAGS += 0x10000 $(FLASHFILE)-0x10000.bin; esptool.py -p $(PORT) run
endif

0 comments on commit 563c41f

Please sign in to comment.