summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-02-21 00:45:13 +1100
committerDamien George <damien@micropython.org>2025-03-06 12:52:35 +1100
commit45c36f87ea025386c7d2f9b3c5d8916e54b70318 (patch)
tree033c326acbcc5d2e0ccdc06a11173f9eb65d2408
parentbea7645b2e55881c4f42e6cfbe2a6433c5986794 (diff)
downloadmicropython-45c36f87ea025386c7d2f9b3c5d8916e54b70318.tar.gz
micropython-45c36f87ea025386c7d2f9b3c5d8916e54b70318.zip
stm32/boards: Enable ROMFS partitions on PYBD_SFx boards.
Using unused and previously inaccessible external QSPI flash. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/stm32/boards/PYBD_SF2/f722_qspi.ld7
-rw-r--r--ports/stm32/boards/PYBD_SF2/mpconfigboard.h5
-rw-r--r--ports/stm32/boards/PYBD_SF6/f767.ld6
-rw-r--r--ports/stm32/boards/PYBD_SF6/mpconfigboard.h5
4 files changed, 21 insertions, 2 deletions
diff --git a/ports/stm32/boards/PYBD_SF2/f722_qspi.ld b/ports/stm32/boards/PYBD_SF2/f722_qspi.ld
index 70d7f9cc4b..05126233ec 100644
--- a/ports/stm32/boards/PYBD_SF2/f722_qspi.ld
+++ b/ports/stm32/boards/PYBD_SF2/f722_qspi.ld
@@ -20,7 +20,8 @@ MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
FLASH_APP (rx) : ORIGIN = 0x08008000, LENGTH = 480K /* sectors 2-7 */
- FLASH_EXT (rx) : ORIGIN = 0x90000000, LENGTH = 2048K /* external QSPI */
+ FLASH_EXT (rx) : ORIGIN = 0x90000000, LENGTH = 1024K /* external QSPI */
+ FLASH_ROMFS (rx): ORIGIN = 0x90100000, LENGTH = 1024K /* external QSPI */
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 256K /* DTCM+SRAM1+SRAM2 */
}
@@ -39,6 +40,10 @@ _ram_end = ORIGIN(RAM) + LENGTH(RAM);
_heap_start = _ebss; /* heap starts just after statically allocated memory */
_heap_end = _sstack;
+/* ROMFS location */
+_micropy_hw_romfs_part1_start = ORIGIN(FLASH_ROMFS);
+_micropy_hw_romfs_part1_size = LENGTH(FLASH_ROMFS);
+
/* Define output sections */
SECTIONS
{
diff --git a/ports/stm32/boards/PYBD_SF2/mpconfigboard.h b/ports/stm32/boards/PYBD_SF2/mpconfigboard.h
index f0ef67e77e..e8923bf9b6 100644
--- a/ports/stm32/boards/PYBD_SF2/mpconfigboard.h
+++ b/ports/stm32/boards/PYBD_SF2/mpconfigboard.h
@@ -64,6 +64,11 @@ void board_sleep(int value);
#define MICROPY_HW_RTC_USE_US (1)
#define MICROPY_HW_RTC_USE_CALOUT (1)
+// ROMFS config
+#define MICROPY_HW_ROMFS_ENABLE_EXTERNAL_QSPI (1)
+#define MICROPY_HW_ROMFS_QSPI_SPIFLASH_OBJ (&spi_bdev2.spiflash)
+#define MICROPY_HW_ROMFS_ENABLE_PART1 (1)
+
// SPI flash #1, for R/W storage
#define MICROPY_HW_SOFTQSPI_SCK_LOW(self) (GPIOE->BSRR = (0x10000 << 11))
#define MICROPY_HW_SOFTQSPI_SCK_HIGH(self) (GPIOE->BSRR = (1 << 11))
diff --git a/ports/stm32/boards/PYBD_SF6/f767.ld b/ports/stm32/boards/PYBD_SF6/f767.ld
index 4262a48a99..68da1f19d4 100644
--- a/ports/stm32/boards/PYBD_SF6/f767.ld
+++ b/ports/stm32/boards/PYBD_SF6/f767.ld
@@ -18,7 +18,7 @@ MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
FLASH_APP (rx) : ORIGIN = 0x08008000, LENGTH = 2016K /* sectors 1-11 3x32K 1*128K 7*256K */
- FLASH_EXT (rx) : ORIGIN = 0x90000000, LENGTH = 2048K /* external QSPI */
+ FLASH_ROMFS (rx): ORIGIN = 0x90000000, LENGTH = 2048K /* external QSPI */
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 512K /* DTCM=128k, SRAM1=368K, SRAM2=16K */
}
@@ -37,4 +37,8 @@ _ram_end = ORIGIN(RAM) + LENGTH(RAM);
_heap_start = _ebss; /* heap starts just after statically allocated memory */
_heap_end = _sstack;
+/* ROMFS location */
+_micropy_hw_romfs_part1_start = ORIGIN(FLASH_ROMFS);
+_micropy_hw_romfs_part1_size = LENGTH(FLASH_ROMFS);
+
INCLUDE common_bl.ld
diff --git a/ports/stm32/boards/PYBD_SF6/mpconfigboard.h b/ports/stm32/boards/PYBD_SF6/mpconfigboard.h
index 8c11d7b2ee..526a111177 100644
--- a/ports/stm32/boards/PYBD_SF6/mpconfigboard.h
+++ b/ports/stm32/boards/PYBD_SF6/mpconfigboard.h
@@ -45,6 +45,11 @@
#define MICROPY_HW_CLK_PLLQ (6)
#define MICROPY_HW_FLASH_LATENCY (FLASH_LATENCY_4)
+// ROMFS config
+#define MICROPY_HW_ROMFS_ENABLE_EXTERNAL_QSPI (1)
+#define MICROPY_HW_ROMFS_QSPI_SPIFLASH_OBJ (&spi_bdev2.spiflash)
+#define MICROPY_HW_ROMFS_ENABLE_PART1 (1)
+
// Extra UART config
#define MICROPY_HW_UART7_TX (pyb_pin_W16)
#define MICROPY_HW_UART7_RX (pyb_pin_W22B)