Skip to content

Commit b79ceec

Browse files
iabdalkaderdpgeorge
authored andcommitted
stm32/boards: Reserve SPI bus when it's used for external flash storage.
Reserve SPI flash bus used for storage or XIP. Signed-off-by: iabdalkader <[email protected]>
1 parent 5fa960c commit b79ceec

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

ports/stm32/boards/ADAFRUIT_F405_EXPRESS/mpconfigboard.h

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
// External SPI Flash config
2929
#if !MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE
3030

31+
#define MICROPY_HW_SPI_IS_RESERVED(id) (id == 1) // Reserve SPI flash bus.
3132
#define MICROPY_HW_SPIFLASH_SIZE_BITS (16 * 1024 * 1024) // 16 Mbit (2 MByte)
3233

3334
#define MICROPY_HW_SPIFLASH_CS (MICROPY_HW_SPI1_NSS)

ports/stm32/boards/LEGO_HUB_NO6/mpconfigboard.h

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
#define MICROPY_HW_SPI2_SCK (pyb_pin_FLASH_SCK)
6666
#define MICROPY_HW_SPI2_MISO (pyb_pin_FLASH_MISO)
6767
#define MICROPY_HW_SPI2_MOSI (pyb_pin_FLASH_MOSI)
68+
#define MICROPY_HW_SPI_IS_RESERVED(id) (id == 2) // Reserve SPI flash bus.
6869

6970
// USB config
7071
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pyb_pin_USB_VBUS)

ports/stm32/boards/MIKROE_QUAIL/mpconfigboard.h

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
// External SPI Flash config (Cypress S25FL164K)
7272
#if !MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE
7373

74+
#define MICROPY_HW_SPI_IS_STATIC(id) (id == 3) // Shared with SPIFLASH.
7475
#define MICROPY_HW_SPIFLASH_SIZE_BITS (64 * 1024 * 1024) // 64 Mbit (8 MByte)
7576

7677
#define MICROPY_HW_SPIFLASH_CS (pin_A13)

ports/stm32/boards/WEACT_F411_BLACKPILL/mpconfigboard.h

+3
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (1)
8787

8888
#else
89+
// Reserve SPI flash bus.
90+
#define MICROPY_HW_SPI_IS_RESERVED(id) (id == 1)
91+
8992
// Disable internal filesystem to use spiflash.
9093
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)
9194

0 commit comments

Comments
 (0)