From 776a0ff5a5c369617f2a8e8f9cc6b9e93fa84371 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Tue, 9 Jul 2024 16:53:08 +1000 Subject: [PATCH] stm32/WEACTV20_F411: Add variant for FLASH_4MB. Signed-off-by: Andrew Leech --- ports/stm32/boards/WEACTV20_F411/board.json | 18 ++++++++++++++++++ .../stm32/boards/WEACTV20_F411/mpconfigboard.h | 4 ++++ .../WEACTV20_F411/mpconfigvariant_FLASH_4MB.mk | 1 + 3 files changed, 23 insertions(+) create mode 100644 ports/stm32/boards/WEACTV20_F411/board.json create mode 100644 ports/stm32/boards/WEACTV20_F411/mpconfigvariant_FLASH_4MB.mk diff --git a/ports/stm32/boards/WEACTV20_F411/board.json b/ports/stm32/boards/WEACTV20_F411/board.json new file mode 100644 index 0000000000000..2effbc6721736 --- /dev/null +++ b/ports/stm32/boards/WEACTV20_F411/board.json @@ -0,0 +1,18 @@ +{ + "deploy": [ + "../PYBV10/deploy.md" + ], + "docs": "", + "features": [], + "images": [ + "WEACTV20_F411.jpg" + ], + "mcu": "stm32f411", + "product": "WeAct v2.0 'blackpill'", + "thumbnail": "", + "url": "https://stm32-base.org/boards/STM32F411CEU6-WeAct-Black-Pill-V2.0.html", + "variants": { + "FLASH_4MB": "SPI Flash 4MB" + }, + "vendor": "WeAct Studio" +} diff --git a/ports/stm32/boards/WEACTV20_F411/mpconfigboard.h b/ports/stm32/boards/WEACTV20_F411/mpconfigboard.h index 4883e7653bf0b..eaa492c67d8c6 100644 --- a/ports/stm32/boards/WEACTV20_F411/mpconfigboard.h +++ b/ports/stm32/boards/WEACTV20_F411/mpconfigboard.h @@ -8,7 +8,9 @@ // Set to 1 to use internal flash, set to 0 to use external SPI flash // You also need to set the size of the flash later in this header +#ifndef MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE #define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (1) +#endif // some users having issues with FLASH_LATENCY_2, so set to 3 // from https://forum.micropython.org/viewtopic.php?t=7154 @@ -93,7 +95,9 @@ // 4MB => 32MBit // 8MB => 64MBit // 16MB => 128MBit +#ifndef MICROPY_HW_SPIFLASH_SIZE_BITS #define MICROPY_HW_SPIFLASH_SIZE_BITS (128 * 1024 * 1024) +#endif #if !MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE diff --git a/ports/stm32/boards/WEACTV20_F411/mpconfigvariant_FLASH_4MB.mk b/ports/stm32/boards/WEACTV20_F411/mpconfigvariant_FLASH_4MB.mk new file mode 100644 index 0000000000000..1cfa671f04fbf --- /dev/null +++ b/ports/stm32/boards/WEACTV20_F411/mpconfigvariant_FLASH_4MB.mk @@ -0,0 +1 @@ +CFLAGS += -DMICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE=0 -DMICROPY_HW_SPIFLASH_SIZE_BITS="(32 * 1024 * 1024)"