summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-08-16 00:51:37 +1000
committerJim Mussared <jim.mussared@gmail.com>2023-08-23 15:49:37 +1000
commitef03ca8bf2e06d3d8b753aafdf13e1399dc26847 (patch)
treec487fb5cd2a5b70b5a9c9b8e9ed22c0820c0b6ac
parentaa236981192395cda555efa3db5f490c168bebdd (diff)
esp8266: Add board variant support.
This merges the existing GENERIC, GENERIC_1M, and GENERIC_512k boards into variants of the new ESP8266_GENERIC board (renamed from GENERIC so as not to clash with other ports). Also moves the generation of the "OTA" variant (previously generated by autobuild/build-esp8266-latest.sh) into the variant. Following the convention established for the WEACTSTUDIO rp2 board, the names of the variants are FLASH_1M and FLASH_512K (but rename the .ld files to use MiB and kiB). Updates autobuild to build esp8266 firmware the same way as other ports. This requires renaming the output from firmware-combined.bin to just firmware.bin. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
-rw-r--r--ports/esp8266/Makefile32
-rw-r--r--ports/esp8266/README.md43
-rw-r--r--ports/esp8266/boards/ESP8266_GENERIC/_boot.py6
-rw-r--r--ports/esp8266/boards/ESP8266_GENERIC/board.json (renamed from ports/esp8266/boards/GENERIC/board.json)6
-rw-r--r--ports/esp8266/boards/ESP8266_GENERIC/board.md (renamed from ports/esp8266/boards/GENERIC/board.md)13
-rw-r--r--ports/esp8266/boards/ESP8266_GENERIC/manifest_2MiB.py (renamed from ports/esp8266/boards/GENERIC/manifest.py)0
-rw-r--r--ports/esp8266/boards/ESP8266_GENERIC/manifest_512kiB.py (renamed from ports/esp8266/boards/GENERIC_512K/manifest.py)0
-rw-r--r--ports/esp8266/boards/ESP8266_GENERIC/mpconfigboard.h52
-rw-r--r--ports/esp8266/boards/ESP8266_GENERIC/mpconfigboard.mk50
-rw-r--r--ports/esp8266/boards/GENERIC/mpconfigboard.h14
-rw-r--r--ports/esp8266/boards/GENERIC/mpconfigboard.mk8
-rw-r--r--ports/esp8266/boards/GENERIC_1M/board.json16
-rw-r--r--ports/esp8266/boards/GENERIC_1M/board.md5
-rw-r--r--ports/esp8266/boards/GENERIC_1M/mpconfigboard.h17
-rw-r--r--ports/esp8266/boards/GENERIC_1M/mpconfigboard.mk5
-rw-r--r--ports/esp8266/boards/GENERIC_512K/_boot.py3
-rw-r--r--ports/esp8266/boards/GENERIC_512K/board.json16
-rw-r--r--ports/esp8266/boards/GENERIC_512K/board.md3
-rw-r--r--ports/esp8266/boards/GENERIC_512K/mpconfigboard.h13
-rw-r--r--ports/esp8266/boards/GENERIC_512K/mpconfigboard.mk3
-rw-r--r--ports/esp8266/boards/esp8266_1MiB.ld (renamed from ports/esp8266/boards/esp8266_1m.ld)0
-rw-r--r--ports/esp8266/boards/esp8266_2MiB.ld (renamed from ports/esp8266/boards/esp8266_2m.ld)0
-rw-r--r--ports/esp8266/boards/esp8266_512kiB.ld (renamed from ports/esp8266/boards/esp8266_512k.ld)0
-rw-r--r--pyproject.toml2
-rwxr-xr-xtools/autobuild/autobuild.sh2
-rwxr-xr-xtools/autobuild/build-boards.sh4
-rwxr-xr-xtools/autobuild/build-esp8266-latest.sh61
-rwxr-xr-xtools/ci.sh6
28 files changed, 179 insertions, 201 deletions
diff --git a/ports/esp8266/Makefile b/ports/esp8266/Makefile
index 1cdcafa03..e4c907c57 100644
--- a/ports/esp8266/Makefile
+++ b/ports/esp8266/Makefile
@@ -4,17 +4,25 @@ ifdef BOARD_DIR
# the path as the board name.
BOARD ?= $(notdir $(BOARD_DIR:/=))
else
-# If not given on the command line, then default to GENERIC.
-BOARD ?= GENERIC
+# If not given on the command line, then default to ESP8266_GENERIC.
+BOARD ?= ESP8266_GENERIC
BOARD_DIR ?= boards/$(BOARD)
endif
ifeq ($(wildcard $(BOARD_DIR)/.),)
+ifeq ($(findstring boards/GENERIC,$(BOARD_DIR)),boards/GENERIC)
+$(warning The GENERIC* boards have been renamed to ESP8266_GENERIC)
+endif
$(error Invalid BOARD specified: $(BOARD_DIR))
endif
-# If the build directory is not given, make it reflect the board name.
+# If the build directory is not given, make it reflect the board name (and
+# optionally the board variant).
+ifneq ($(BOARD_VARIANT),)
+BUILD ?= build-$(BOARD)-$(BOARD_VARIANT)
+else
BUILD ?= build-$(BOARD)
+endif
include ../../py/mkenv.mk
@@ -40,7 +48,7 @@ include $(TOP)/extmod/extmod.mk
GIT_SUBMODULES += lib/axtls lib/berkeley-db-1.xx
-FWBIN = $(BUILD)/firmware-combined.bin
+FWBIN = $(BUILD)/firmware.bin
PORT ?= /dev/ttyACM0
BAUD ?= 115200
FLASH_MODE ?= qio
@@ -202,7 +210,7 @@ FROZEN_EXTRA_DEPS = $(CONFVARS_FILE)
.PHONY: deploy
-deploy: $(BUILD)/firmware-combined.bin
+deploy: $(FWBIN)
$(ECHO) "Writing $< to the board"
$(Q)esptool.py --port $(PORT) --baud $(BAUD) write_flash --verify --flash_size=$(FLASH_SIZE) --flash_mode=$(FLASH_MODE) 0 $<
@@ -213,20 +221,26 @@ erase:
reset:
echo -e "\r\nimport machine; machine.reset()\r\n" >$(PORT)
+ifeq ($(BOARD_VARIANT),OTA)
+$(FWBIN): $(BUILD)/firmware.elf
+ $(ECHO) "Create $@"
+ $(Q)esptool.py elf2image $^
+ $(Q)$(PYTHON) makeimg.py $(BUILD)/firmware.elf-0x00000.bin $(BUILD)/firmware.elf-0x[0-5][1-f]000.bin $(BUILD)/firmware-ota.bin
+
+ $(Q)cat $(YAOTA8266)/yaota8266.bin $(BUILD)/firmware-ota.bin > $@
+ $(Q)$(PYTHON) $(YAOTA8266)/ota-client/ota_client.py sign $@
+else
$(FWBIN): $(BUILD)/firmware.elf
$(ECHO) "Create $@"
$(Q)esptool.py elf2image $^
$(Q)$(PYTHON) makeimg.py $(BUILD)/firmware.elf-0x00000.bin $(BUILD)/firmware.elf-0x[0-5][1-f]000.bin $@
+endif
$(BUILD)/firmware.elf: $(OBJ)
$(ECHO) "LINK $@"
$(Q)$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
$(Q)$(SIZE) $@
-ota:
- rm -f $(BUILD)/firmware.elf $(BUILD)/firmware.elf*.bin
- $(MAKE) LD_FILES=boards/esp8266_ota.ld FWBIN=$(BUILD)/firmware-ota.bin
-
include $(TOP)/py/mkrules.mk
clean-modules:
diff --git a/ports/esp8266/README.md b/ports/esp8266/README.md
index 1e0cae213..561c77140 100644
--- a/ports/esp8266/README.md
+++ b/ports/esp8266/README.md
@@ -23,6 +23,9 @@ Supported features include:
Documentation is available at http://docs.micropython.org/en/latest/esp8266/quickref.html.
+The default build requires a 2MiB flash chip, but see below for support for
+1MiB and 512kiB options.
+
Build instructions
------------------
@@ -67,10 +70,10 @@ Then to compile the ESP8266 firmware:
```
$ cd ports/esp8266
-$ docker run --rm -v $HOME:$HOME -u $UID -w $PWD larsks/esp-open-sdk make -j BOARD=GENERIC
+$ docker run --rm -v $HOME:$HOME -u $UID -w $PWD larsks/esp-open-sdk make -j BOARD=ESP8266_GENERIC
```
-This will produce binary images in the `build-GENERIC/` subdirectory.
+This will produce binary images in the `build-ESP8266_GENERIC/` subdirectory.
Substitute the board for whichever board you're using.
__Building with a local toolchain__
@@ -106,10 +109,10 @@ Then to compile the ESP8266 firmware:
```
$ cd ports/esp8266
-$ make -j BOARD=GENERIC
+$ make -j BOARD=ESP8266_GENERIC
```
-This will produce binary images in the `build-GENERIC/` subdirectory.
+This will produce binary images in the `build-ESP8266_GENERIC/` subdirectory.
Substitute the board for whichever board you're using.
@@ -149,25 +152,29 @@ $ make PORT=/dev/ttyUSB0 FLASH_MODE=qio FLASH_SIZE=32m deploy
(note that flash size is in megabits)
If you want to flash manually using `esptool.py` directly, the image produced is
-`build-GENERIC/firmware-combined.bin`, to be flashed at 0x00000.
+`build-ESP8266_GENERIC/firmware.bin`, to be flashed at 0x00000.
-The default board definition is the directory `boards/GENERIC`.
+The default board definition is the directory `boards/ESP8266_GENERIC`.
For a custom configuration you can define your own board in the directory `boards/`.
-The `BOARD` variable can be set on the make command line, for example:
-```bash
-$ make BOARD=GENERIC_512K
-```
+__Reduced FlashROM variants__
-__512KB FlashROM version__
+The normal build described above requires modules with at least 2MiB of
+FlashROM onboard. There's a special configuration for 512kiB modules, which can
+be built with the `FLASH_512K` variant. This configuration is highly limited,
+lacks filesystem support, WebREPL, and has many other features disabled. It's
+mostly suitable for advanced users who are interested to fine-tune options to
+achieve a required setup. If you are an end user, please consider using a
+module with at least 2MiB of FlashROM.
-The normal build described above requires modules with at least 1MB of FlashROM
-onboard. There's a special configuration for 512KB modules, which can be
-built with `make BOARD=GENERIC_512K`. This configuration is highly limited, lacks
-filesystem support, WebREPL, and has many other features disabled. It's mostly
-suitable for advanced users who are interested to fine-tune options to achieve a
-required setup. If you are an end user, please consider using a module with at
-least 1MB of FlashROM.
+A variant is also provided for 1MiB modules which just lacks the included
+micropython-lib packages.
+
+The variant can be set on the make command line, for example:
+```bash
+$ make BOARD=ESP8266_GENERIC BOARD_VARIANT=FLASH_512K
+$ make BOARD=ESP8266_GENERIC BOARD_VARIANT=FLASH_1M
+```
First start
-----------
diff --git a/ports/esp8266/boards/ESP8266_GENERIC/_boot.py b/ports/esp8266/boards/ESP8266_GENERIC/_boot.py
new file mode 100644
index 000000000..16da8bc4c
--- /dev/null
+++ b/ports/esp8266/boards/ESP8266_GENERIC/_boot.py
@@ -0,0 +1,6 @@
+# Minimal _boot.py for the 512kiB variant. Does not set up a block device or
+# filesystem. Other variants use esp8266/modules/_boot.py.
+
+import gc
+
+gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4)
diff --git a/ports/esp8266/boards/GENERIC/board.json b/ports/esp8266/boards/ESP8266_GENERIC/board.json
index dffe6d271..1fca10c5f 100644
--- a/ports/esp8266/boards/GENERIC/board.json
+++ b/ports/esp8266/boards/ESP8266_GENERIC/board.json
@@ -9,11 +9,13 @@
],
"images": [],
"mcu": "esp8266",
- "product": "ESP8266 with 2MiB+ flash",
+ "product": "ESP8266",
"thumbnail": "",
"url": "https://www.espressif.com/en/products/modules",
"variants": {
- "ota": "OTA compatible"
+ "OTA": "OTA compatible",
+ "FLASH_1M": "1MiB flash",
+ "FLASH_512K": "512kiB flash"
},
"vendor": "Espressif"
}
diff --git a/ports/esp8266/boards/GENERIC/board.md b/ports/esp8266/boards/ESP8266_GENERIC/board.md
index fa0cf410d..96fbab617 100644
--- a/ports/esp8266/boards/GENERIC/board.md
+++ b/ports/esp8266/boards/ESP8266_GENERIC/board.md
@@ -1,6 +1,13 @@
-The following are daily builds of the ESP8266 firmware for boards with at
-least 2MiB of flash. They have the latest features and bug fixes, WebREPL is
-not automatically started, and debugging is enabled by default.
+The following are daily builds of the ESP8266 firmware. This will work on
+boards with at least 2MiB of flash. They have the latest features and bug
+fixes, WebREPL is not automatically started, and debugging is enabled by
+default.
+
+For boards with 1MiB or 512kiB of flash, two variants are provided with reduced
+functionality. The 1MiB variant removes asyncio and FAT-filesystem support as
+well as some modules from micropython-lib. The 512kiB variant further removes
+all filesystem support, as well as framebuffer support, some Python language
+features, and has less detailed error messages.
Note: v1.12-334 and newer (including v1.13) require an ESP8266 module with
2MiB of flash or more, and use littlefs as the filesystem by default. When
diff --git a/ports/esp8266/boards/GENERIC/manifest.py b/ports/esp8266/boards/ESP8266_GENERIC/manifest_2MiB.py
index fd9c41dc5..fd9c41dc5 100644
--- a/ports/esp8266/boards/GENERIC/manifest.py
+++ b/ports/esp8266/boards/ESP8266_GENERIC/manifest_2MiB.py
diff --git a/ports/esp8266/boards/GENERIC_512K/manifest.py b/ports/esp8266/boards/ESP8266_GENERIC/manifest_512kiB.py
index 15f6cffc3..15f6cffc3 100644
--- a/ports/esp8266/boards/GENERIC_512K/manifest.py
+++ b/ports/esp8266/boards/ESP8266_GENERIC/manifest_512kiB.py
diff --git a/ports/esp8266/boards/ESP8266_GENERIC/mpconfigboard.h b/ports/esp8266/boards/ESP8266_GENERIC/mpconfigboard.h
new file mode 100644
index 000000000..3a9c40e79
--- /dev/null
+++ b/ports/esp8266/boards/ESP8266_GENERIC/mpconfigboard.h
@@ -0,0 +1,52 @@
+#if defined(MICROPY_ESP8266_2M)
+
+#define MICROPY_HW_BOARD_NAME "ESP module"
+#define MICROPY_HW_MCU_NAME "ESP8266"
+
+#define MICROPY_PERSISTENT_CODE_LOAD (1)
+#define MICROPY_EMIT_XTENSA (1)
+#define MICROPY_EMIT_INLINE_XTENSA (1)
+
+#define MICROPY_DEBUG_PRINTERS (1)
+#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL)
+
+#define MICROPY_READER_VFS (MICROPY_VFS)
+#define MICROPY_VFS (1)
+
+#define MICROPY_PY_CRYPTOLIB (1)
+
+#elif defined(MICROPY_ESP8266_1M)
+
+#define MICROPY_HW_BOARD_NAME "ESP module (1M)"
+#define MICROPY_HW_MCU_NAME "ESP8266"
+
+#define MICROPY_PERSISTENT_CODE_LOAD (1)
+#define MICROPY_EMIT_XTENSA (1)
+#define MICROPY_EMIT_INLINE_XTENSA (1)
+
+#define MICROPY_DEBUG_PRINTERS (1)
+#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL)
+
+#define MICROPY_READER_VFS (MICROPY_VFS)
+#define MICROPY_VFS (1)
+
+
+#define MICROPY_PY_CRYPTOLIB (1)
+
+#elif defined(MICROPY_ESP8266_512K)
+
+#define MICROPY_HW_BOARD_NAME "ESP module (512K)"
+#define MICROPY_HW_MCU_NAME "ESP8266"
+
+#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)
+
+#define MICROPY_PY_FSTRINGS (0)
+#define MICROPY_PY_BUILTINS_SLICE_ATTRS (0)
+#define MICROPY_PY_ALL_SPECIAL_METHODS (0)
+#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0)
+#define MICROPY_PY_SYS_STDIO_BUFFER (0)
+#define MICROPY_PY_ASYNCIO (0)
+#define MICROPY_PY_RE_SUB (0)
+#define MICROPY_PY_FRAMEBUF (0)
+
+#endif
diff --git a/ports/esp8266/boards/ESP8266_GENERIC/mpconfigboard.mk b/ports/esp8266/boards/ESP8266_GENERIC/mpconfigboard.mk
new file mode 100644
index 000000000..2eb78d7e8
--- /dev/null
+++ b/ports/esp8266/boards/ESP8266_GENERIC/mpconfigboard.mk
@@ -0,0 +1,50 @@
+ifeq ($(BOARD_VARIANT),)
+LD_FILES = boards/esp8266_2MiB.ld
+
+MICROPY_ESPNOW ?= 1
+MICROPY_PY_BTREE ?= 1
+MICROPY_VFS_FAT ?= 1
+MICROPY_VFS_LFS2 ?= 1
+
+# Add asyncio and extra micropython-lib packages (in addition to the port manifest).
+FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest_2MiB.py
+
+# Configure mpconfigboard.h.
+CFLAGS += -DMICROPY_ESP8266_2M
+endif
+
+ifeq ($(BOARD_VARIANT),FLASH_1M)
+LD_FILES = boards/esp8266_1MiB.ld
+
+MICROPY_ESPNOW ?= 1
+MICROPY_PY_BTREE ?= 1
+MICROPY_VFS_LFS2 ?= 1
+
+# Note: Implicitly uses the port manifest.
+
+# Configure mpconfigboard.h.
+CFLAGS += -DMICROPY_ESP8266_1M
+endif
+
+ifeq ($(BOARD_VARIANT),OTA)
+LD_FILES = boards/esp8266_ota.ld
+
+MICROPY_ESPNOW ?= 1
+MICROPY_PY_BTREE ?= 1
+MICROPY_VFS_LFS2 ?= 1
+
+# Note: Implicitly uses the port manifest.
+
+# Configure mpconfigboard.h.
+CFLAGS += -DMICROPY_ESP8266_1M
+endif
+
+ifeq ($(BOARD_VARIANT),FLASH_512K)
+LD_FILES = boards/esp8266_512kiB.ld
+
+# Note: Use the minimal manifest.py.
+FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest_512kiB.py
+
+# Configure mpconfigboard.h.
+CFLAGS += -DMICROPY_ESP8266_512K
+endif
diff --git a/ports/esp8266/boards/GENERIC/mpconfigboard.h b/ports/esp8266/boards/GENERIC/mpconfigboard.h
deleted file mode 100644
index 52c93f83a..000000000
--- a/ports/esp8266/boards/GENERIC/mpconfigboard.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#define MICROPY_HW_BOARD_NAME "ESP module"
-#define MICROPY_HW_MCU_NAME "ESP8266"
-
-#define MICROPY_PERSISTENT_CODE_LOAD (1)
-#define MICROPY_EMIT_XTENSA (1)
-#define MICROPY_EMIT_INLINE_XTENSA (1)
-
-#define MICROPY_DEBUG_PRINTERS (1)
-#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL)
-
-#define MICROPY_READER_VFS (MICROPY_VFS)
-#define MICROPY_VFS (1)
-
-#define MICROPY_PY_CRYPTOLIB (1)
diff --git a/ports/esp8266/boards/GENERIC/mpconfigboard.mk b/ports/esp8266/boards/GENERIC/mpconfigboard.mk
deleted file mode 100644
index 8d7babdc8..000000000
--- a/ports/esp8266/boards/GENERIC/mpconfigboard.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-LD_FILES = boards/esp8266_2m.ld
-
-MICROPY_ESPNOW ?= 1
-MICROPY_PY_BTREE ?= 1
-MICROPY_VFS_FAT ?= 1
-MICROPY_VFS_LFS2 ?= 1
-
-FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py
diff --git a/ports/esp8266/boards/GENERIC_1M/board.json b/ports/esp8266/boards/GENERIC_1M/board.json
deleted file mode 100644
index 4ab5c79df..000000000
--- a/ports/esp8266/boards/GENERIC_1M/board.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "deploy": [
- "../deploy.md"
- ],
- "docs": "",
- "features": [
- "External Flash",
- "WiFi"
- ],
- "images": [],
- "mcu": "esp8266",
- "product": "ESP8266 with 1MiB flash",
- "thumbnail": "",
- "url": "https://www.espressif.com/en/products/modules",
- "vendor": "Espressif"
-}
diff --git a/ports/esp8266/boards/GENERIC_1M/board.md b/ports/esp8266/boards/GENERIC_1M/board.md
deleted file mode 100644
index 17cc6e3a6..000000000
--- a/ports/esp8266/boards/GENERIC_1M/board.md
+++ /dev/null
@@ -1,5 +0,0 @@
-The following are daily builds of the ESP8266 firmware tailored for modules with
-only 1MiB of flash. This firmware uses littlefs as the filesystem.
-When upgrading from older firmware that uses a FAT filesystem please backup your files
-first, and either erase all flash before upgrading, or after upgrading execute
-`os.VfsLfs2.mkfs(bdev)`.
diff --git a/ports/esp8266/boards/GENERIC_1M/mpconfigboard.h b/ports/esp8266/boards/GENERIC_1M/mpconfigboard.h
deleted file mode 100644
index 41752e692..000000000
--- a/ports/esp8266/boards/GENERIC_1M/mpconfigboard.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#define MICROPY_HW_BOARD_NAME "ESP module (1M)"
-#define MICROPY_HW_MCU_NAME "ESP8266"
-
-#define MICROPY_PERSISTENT_CODE_LOAD (1)
-#define MICROPY_EMIT_XTENSA (1)
-#define MICROPY_EMIT_INLINE_XTENSA (1)
-
-#define MICROPY_DEBUG_PRINTERS (1)
-#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL)
-
-#define MICROPY_READER_VFS (MICROPY_VFS)
-#define MICROPY_VFS (1)
-
-#define MICROPY_PY_FSTRINGS (0)
-#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0)
-#define MICROPY_PY_ASYNCIO (0)
-#define MICROPY_PY_CRYPTOLIB (1)
diff --git a/ports/esp8266/boards/GENERIC_1M/mpconfigboard.mk b/ports/esp8266/boards/GENERIC_1M/mpconfigboard.mk
deleted file mode 100644
index adc31702e..000000000
--- a/ports/esp8266/boards/GENERIC_1M/mpconfigboard.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-LD_FILES = boards/esp8266_1m.ld
-
-MICROPY_ESPNOW ?= 1
-MICROPY_PY_BTREE ?= 1
-MICROPY_VFS_LFS2 ?= 1
diff --git a/ports/esp8266/boards/GENERIC_512K/_boot.py b/ports/esp8266/boards/GENERIC_512K/_boot.py
deleted file mode 100644
index 1a55cfd36..000000000
--- a/ports/esp8266/boards/GENERIC_512K/_boot.py
+++ /dev/null
@@ -1,3 +0,0 @@
-import gc
-
-gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4)
diff --git a/ports/esp8266/boards/GENERIC_512K/board.json b/ports/esp8266/boards/GENERIC_512K/board.json
deleted file mode 100644
index e035562be..000000000
--- a/ports/esp8266/boards/GENERIC_512K/board.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "deploy": [
- "../deploy.md"
- ],
- "docs": "",
- "features": [
- "External Flash",
- "WiFi"
- ],
- "images": [],
- "mcu": "esp8266",
- "product": "ESP8266 with 512kiB flash",
- "thumbnail": "",
- "url": "https://www.espressif.com/en/products/modules",
- "vendor": "Espressif"
-}
diff --git a/ports/esp8266/boards/GENERIC_512K/board.md b/ports/esp8266/boards/GENERIC_512K/board.md
deleted file mode 100644
index 1f6e2c790..000000000
--- a/ports/esp8266/boards/GENERIC_512K/board.md
+++ /dev/null
@@ -1,3 +0,0 @@
-The following are daily builds of the ESP8266 firmware tailored for modules with
-only 512kiB of flash. Certain features are disabled to get the firmware down
-to this size.
diff --git a/ports/esp8266/boards/GENERIC_512K/mpconfigboard.h b/ports/esp8266/boards/GENERIC_512K/mpconfigboard.h
deleted file mode 100644
index c29e23d5a..000000000
--- a/ports/esp8266/boards/GENERIC_512K/mpconfigboard.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#define MICROPY_HW_BOARD_NAME "ESP module (512K)"
-#define MICROPY_HW_MCU_NAME "ESP8266"
-
-#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)
-
-#define MICROPY_PY_FSTRINGS (0)
-#define MICROPY_PY_BUILTINS_SLICE_ATTRS (0)
-#define MICROPY_PY_ALL_SPECIAL_METHODS (0)
-#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0)
-#define MICROPY_PY_SYS_STDIO_BUFFER (0)
-#define MICROPY_PY_ASYNCIO (0)
-#define MICROPY_PY_RE_SUB (0)
-#define MICROPY_PY_FRAMEBUF (0)
diff --git a/ports/esp8266/boards/GENERIC_512K/mpconfigboard.mk b/ports/esp8266/boards/GENERIC_512K/mpconfigboard.mk
deleted file mode 100644
index 120351909..000000000
--- a/ports/esp8266/boards/GENERIC_512K/mpconfigboard.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-LD_FILES = boards/esp8266_512k.ld
-
-FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py
diff --git a/ports/esp8266/boards/esp8266_1m.ld b/ports/esp8266/boards/esp8266_1MiB.ld
index 94bc6a229..94bc6a229 100644
--- a/ports/esp8266/boards/esp8266_1m.ld
+++ b/ports/esp8266/boards/esp8266_1MiB.ld
diff --git a/ports/esp8266/boards/esp8266_2m.ld b/ports/esp8266/boards/esp8266_2MiB.ld
index b5813ce0f..b5813ce0f 100644
--- a/ports/esp8266/boards/esp8266_2m.ld
+++ b/ports/esp8266/boards/esp8266_2MiB.ld
diff --git a/ports/esp8266/boards/esp8266_512k.ld b/ports/esp8266/boards/esp8266_512kiB.ld
index c4cc79849..c4cc79849 100644
--- a/ports/esp8266/boards/esp8266_512k.ld
+++ b/ports/esp8266/boards/esp8266_512kiB.ld
diff --git a/pyproject.toml b/pyproject.toml
index a05abf887..e3d70385c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -48,4 +48,4 @@ max-complexity = 40
# manifest.py files are evaluated with some global names pre-defined
"**/manifest.py" = ["F821"]
-"ports/**/boards/manifest*.py" = ["F821"]
+"ports/**/boards/**/manifest_*.py" = ["F821"]
diff --git a/tools/autobuild/autobuild.sh b/tools/autobuild/autobuild.sh
index 999a42c0e..12ac230df 100755
--- a/tools/autobuild/autobuild.sh
+++ b/tools/autobuild/autobuild.sh
@@ -62,7 +62,7 @@ FW_TAG="-$FW_DATE-unstable-$FW_GIT"
cd ports/cc3200
${AUTODIR}/build-cc3200-latest.sh ${FW_TAG} ${LOCAL_FIRMWARE}
cd ../esp8266
-${AUTODIR}/build-esp8266-latest.sh ${FW_TAG} ${LOCAL_FIRMWARE}
+build_esp8266_boards ${FW_TAG} ${LOCAL_FIRMWARE}
cd ../esp32
(source ${IDF_PATH_V50}/export.sh && build_esp32_boards ${FW_TAG} ${LOCAL_FIRMWARE})
cd ../mimxrt
diff --git a/tools/autobuild/build-boards.sh b/tools/autobuild/build-boards.sh
index 82d7f3605..6f3f93809 100755
--- a/tools/autobuild/build-boards.sh
+++ b/tools/autobuild/build-boards.sh
@@ -92,6 +92,10 @@ function build_esp32_boards {
build_boards modesp32.c $1 $2 bin elf map uf2 app-bin
}
+function build_esp8266_boards {
+ build_boards modesp.c $1 $2 bin elf map
+}
+
function build_mimxrt_boards {
build_boards modmimxrt.c $1 $2 bin hex
}
diff --git a/tools/autobuild/build-esp8266-latest.sh b/tools/autobuild/build-esp8266-latest.sh
deleted file mode 100755
index 1972e85fc..000000000
--- a/tools/autobuild/build-esp8266-latest.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-
-PYTHON3=python3
-yaota8266=$HOME/yaota8266
-
-# for debugging
-#exec &> /tmp/esp-log-$$.txt
-
-# function for building firmware
-function do_build() {
- descr=$1
- board=$2
- shift
- shift
- echo "building $descr $board"
- build_dir=/tmp/esp8266-build-$board
- $MICROPY_AUTOBUILD_MAKE $@ BOARD=$board BUILD=$build_dir || exit 1
- mv $build_dir/firmware-combined.bin $dest_dir/$descr$fw_tag.bin
- mv $build_dir/firmware.elf $dest_dir/$descr$fw_tag.elf
- mv $build_dir/firmware.map $dest_dir/$descr$fw_tag.map
- rm -rf $build_dir
-}
-
-function do_build_ota() {
- descr=$1
- board=$2
- shift
- shift
- echo "building $descr $board"
- build_dir=/tmp/esp8266-build-$board
- $MICROPY_AUTOBUILD_MAKE $@ BOARD=$board BUILD=$build_dir || exit 1
- cat $yaota8266/yaota8266.bin $build_dir/firmware-ota.bin > $dest_dir/$descr$fw_tag.bin
- pushd $yaota8266/ota-client
- $PYTHON3 ota_client.py sign $build_dir/firmware-ota.bin
- popd
- mv $build_dir/firmware-ota.bin.ota $dest_dir/$descr$fw_tag.ota
- mv $build_dir/firmware.elf $dest_dir/$descr$fw_tag.elf
- mv $build_dir/firmware.map $dest_dir/$descr$fw_tag.map
- rm -rf $build_dir
-}
-
-# check/get parameters
-if [ $# != 2 ]; then
- echo "usage: $0 <fw-tag> <dest-dir>"
- exit 1
-fi
-
-fw_tag=$1
-dest_dir=$2
-
-# check we are in the correct directory
-if [ ! -r boards/esp8266_common.ld ]; then
- echo "must be in esp8266 directory"
- exit 1
-fi
-
-# build the versions
-do_build esp8266 GENERIC
-do_build esp8266-512k GENERIC_512K
-do_build esp8266-1m GENERIC_1M
-do_build_ota esp8266-ota GENERIC_1M ota
diff --git a/tools/ci.sh b/tools/ci.sh
index 55e90dc4a..f60ba0fd5 100755
--- a/tools/ci.sh
+++ b/tools/ci.sh
@@ -155,9 +155,9 @@ function ci_esp8266_path {
function ci_esp8266_build {
make ${MAKEOPTS} -C mpy-cross
make ${MAKEOPTS} -C ports/esp8266 submodules
- make ${MAKEOPTS} -C ports/esp8266
- make ${MAKEOPTS} -C ports/esp8266 BOARD=GENERIC_512K
- make ${MAKEOPTS} -C ports/esp8266 BOARD=GENERIC_1M
+ make ${MAKEOPTS} -C ports/esp8266 BOARD=ESP8266_GENERIC
+ make ${MAKEOPTS} -C ports/esp8266 BOARD=ESP8266_GENERIC BOARD_VARIANT=FLASH_512K
+ make ${MAKEOPTS} -C ports/esp8266 BOARD=ESP8266_GENERIC BOARD_VARIANT=FLASH_1M
}
########################################################################################