Skip to content

Commit 043dc79

Browse files
iabdalkaderdpgeorge
authored andcommitted
stm32/boards/ARDUINO_GIGA: Enable 4MiB ROMFS partition in ext flash.
Signed-off-by: iabdalkader <[email protected]>
1 parent d5aeca2 commit 043dc79

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

ports/stm32/boards/ARDUINO_GIGA/mpconfigboard.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ typedef unsigned int mp_uint_t; // must be pointer size
3232
#define MICROPY_HW_ENTER_BOOTLOADER_VIA_RESET (0)
3333
#define MICROPY_HW_TIM_IS_RESERVED(id) (id == 1)
3434

35+
// ROMFS config
36+
#define MICROPY_HW_ROMFS_ENABLE_EXTERNAL_QSPI (1)
37+
#define MICROPY_HW_ROMFS_QSPI_SPIFLASH_OBJ (&spi_bdev.spiflash)
38+
#define MICROPY_HW_ROMFS_ENABLE_PART0 (1)
39+
3540
// Flash storage config
3641
#define MICROPY_HW_SPIFLASH_ENABLE_CACHE (1)
3742
#define MICROPY_HW_SPIFLASH_SOFT_RESET (1)
@@ -125,8 +130,8 @@ void GIGA_board_low_power(int mode);
125130
// QSPI flash #1 for storage
126131
#define MICROPY_HW_QSPI_PRESCALER (2) // 100MHz
127132
#define MICROPY_HW_QSPIFLASH_SIZE_BITS_LOG2 (27)
128-
// Reserve 1MiB at the end for compatibility with alternate firmware that places WiFi blob here.
129-
#define MICROPY_HW_SPIFLASH_SIZE_BITS (120 * 1024 * 1024)
133+
// Reserve 4MiB for romfs and 1MiB for WiFi/BT firmware.
134+
#define MICROPY_HW_SPIFLASH_SIZE_BITS (88 * 1024 * 1024)
130135
#define MICROPY_HW_QSPIFLASH_CS (pyb_pin_QSPI2_CS)
131136
#define MICROPY_HW_QSPIFLASH_SCK (pyb_pin_QSPI2_CLK)
132137
#define MICROPY_HW_QSPIFLASH_IO0 (pyb_pin_QSPI2_D0)

ports/stm32/boards/ARDUINO_GIGA/stm32h747.ld

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ MEMORY
1313
SRAM3 (xrw) : ORIGIN = 0x30040000, LENGTH = 32K /* SRAM3 D2 */
1414
SRAM4 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K /* SRAM4 D3 */
1515
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* Total available flash */
16-
FLASH_EXT (rx) : ORIGIN = 0x90000000, LENGTH = 16384K /* 16MBs external QSPI flash */
1716
FLASH_BL (rx) : ORIGIN = 0x08000000, LENGTH = 128K /* Arduino bootloader */
1817
FLASH_FS (r) : ORIGIN = 0x08020000, LENGTH = 128K /* filesystem */
1918
FLASH_TEXT (rx) : ORIGIN = 0x08040000, LENGTH = 1280K /* CM7 firmware */
2019
FLASH_CM4 (rx) : ORIGIN = 0x08180000, LENGTH = 512K /* CM4 firmware */
20+
FLASH_ROMFS (rx) : ORIGIN = 0x90B00000, LENGTH = 4096K /* romfs partition in QSPI flash */
2121
}
2222

2323
/* produce a link error if there is not this amount of RAM for these sections */
@@ -44,6 +44,10 @@ _micropy_hw_internal_flash_storage_ram_cache_end = ORIGIN(DTCM) + LENGTH(DTCM);
4444
_micropy_hw_internal_flash_storage_start = ORIGIN(FLASH_FS);
4545
_micropy_hw_internal_flash_storage_end = ORIGIN(FLASH_FS) + LENGTH(FLASH_FS);
4646

47+
/* Location of romfs filesystem */
48+
_micropy_hw_romfs_part0_start = ORIGIN(FLASH_ROMFS);
49+
_micropy_hw_romfs_part0_size = LENGTH(FLASH_ROMFS);
50+
4751
/* OpenAMP shared memory region */
4852
_openamp_shm_region_start = ORIGIN(SRAM4);
4953
_openamp_shm_region_end = ORIGIN(SRAM4) + LENGTH(SRAM4);

0 commit comments

Comments
 (0)