summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-03-01 17:22:03 +1100
committerDamien George <damien@micropython.org>2025-03-06 12:52:35 +1100
commit6bec36a4eec999eccc6aadf0de782ebf69454ced (patch)
tree43cf55aa97feec125fdd05e11e9754ea7f893c7f
parent75ff8e5465c766bad0c79d1a5d98170f27f7070b (diff)
esp8266/boards: Add FLASH_2M_ROMFS variant with 320k ROM partition.
The same as the 2M flash variant but with a 320KiB ROM partition. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/esp8266/boards/ESP8266_GENERIC/board.json3
-rw-r--r--ports/esp8266/boards/ESP8266_GENERIC/mpconfigvariant_FLASH_2M_ROMFS.mk12
-rw-r--r--ports/esp8266/boards/esp8266_2MiB_ROMFS.ld24
3 files changed, 38 insertions, 1 deletions
diff --git a/ports/esp8266/boards/ESP8266_GENERIC/board.json b/ports/esp8266/boards/ESP8266_GENERIC/board.json
index 2b3a6b550..8f2aa1240 100644
--- a/ports/esp8266/boards/ESP8266_GENERIC/board.json
+++ b/ports/esp8266/boards/ESP8266_GENERIC/board.json
@@ -17,7 +17,8 @@
"variants": {
"OTA": "OTA compatible",
"FLASH_1M": "1MiB flash",
- "FLASH_512K": "512kiB flash"
+ "FLASH_512K": "512kiB flash",
+ "FLASH_2M_ROMFS": "2MiB flash with ROMFS"
},
"vendor": "Espressif"
}
diff --git a/ports/esp8266/boards/ESP8266_GENERIC/mpconfigvariant_FLASH_2M_ROMFS.mk b/ports/esp8266/boards/ESP8266_GENERIC/mpconfigvariant_FLASH_2M_ROMFS.mk
new file mode 100644
index 000000000..9ee3566d8
--- /dev/null
+++ b/ports/esp8266/boards/ESP8266_GENERIC/mpconfigvariant_FLASH_2M_ROMFS.mk
@@ -0,0 +1,12 @@
+LD_FILES = boards/esp8266_2MiB_ROMFS.ld
+
+MICROPY_PY_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 -DMICROPY_VFS_ROM=1
diff --git a/ports/esp8266/boards/esp8266_2MiB_ROMFS.ld b/ports/esp8266/boards/esp8266_2MiB_ROMFS.ld
new file mode 100644
index 000000000..6020c3d48
--- /dev/null
+++ b/ports/esp8266/boards/esp8266_2MiB_ROMFS.ld
@@ -0,0 +1,24 @@
+/* GNU linker script for ESP8266 with 2M or more flash, and includes a ROMFS partition
+
+ Flash layout:
+ 0x40200000 36k header + iram/dram init
+ 0x40209000 668k firmware (irom0)
+ 0x402c0000 320k ROMFS
+ 0x40300000 1M+ filesystem (not memory mapped)
+*/
+
+MEMORY
+{
+ dport0_0_seg : org = 0x3ff00000, len = 16
+ dram0_0_seg : org = 0x3ffe8000, len = 80K
+ iram1_0_seg : org = 0x40100000, len = 32K
+ irom0_0_seg : org = 0x40209000, len = 1M - 36K - 320K
+ FLASH_ROMFS : org = 0x402b0000, len = 320K
+}
+
+/* define ROMFS extents */
+_micropy_hw_romfs_start = ORIGIN(FLASH_ROMFS);
+_micropy_hw_romfs_size = LENGTH(FLASH_ROMFS);
+
+/* define common sections and symbols */
+INCLUDE boards/esp8266_common.ld