Skip to content

Commit

Permalink
stm32/WEACTV20_F411: Add variant for V3_FLASH_8MB.
Browse files Browse the repository at this point in the history
Blackpill v3.1 board with 8MB SPI Flash

Signed-off-by: Andrew Leech <[email protected]>
  • Loading branch information
pi-anl committed Aug 14, 2024
1 parent b9ea6e7 commit c861b3e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ports/stm32/boards/WEACTV20_F411/board.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"thumbnail": "",
"url": "https://github.com/andrewleech/micropython/pull/new/wb55_pvd_handler",
"variants": {
"FLASH_4MB": "SPI Flash 4MB"
"FLASH_4MB": "SPI Flash 4MB",
"V3_FLASH_8MB": "v3.1 board with 8MB SPI Flash"
},
"vendor": "WeAct Studio"
}
7 changes: 5 additions & 2 deletions ports/stm32/boards/WEACTV20_F411/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@
// SPI flash pins
#define MICROPY_HW_SPIFLASH_CS (pyb_pin_FLASH_CS)
#define MICROPY_HW_SPIFLASH_SCK (pyb_pin_FLASH_SCK)
#define MICROPY_HW_SPIFLASH_MISO (pyb_pin_FLASH_MISO)
#define MICROPY_HW_SPIFLASH_MOSI (pyb_pin_FLASH_MOSI)

#ifdef WEACTV20_F411_V3
#define MICROPY_HW_SPIFLASH_MISO (pyb_pin_FLASH_MISO_V3)
#else
#define MICROPY_HW_SPIFLASH_MISO (pyb_pin_FLASH_MISO_V2)
#endif
// Set flash size to 128MBit by default
// note that this is in megabits, not megabytes
// to convert megabytes to megabits, multiply by 8
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Version 3.1 board has different pinout for spi flash with 8MB flash.
CFLAGS +=
-DMICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE=0 \
-DMICROPY_HW_SPIFLASH_SIZE_BITS="(8 * 8 * 1024 * 1024)" \
-DWEACTV20_F411_V3=1
3 changes: 2 additions & 1 deletion ports/stm32/boards/WEACTV20_F411/pins.csv
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ USB_DP,PA12
FLASH_CS,PA4
FLASH_SCK,PA5
FLASH_MOSI,PA7
FLASH_MISO,PB4
FLASH_MISO_V2,PB4
FLASH_MISO_V3,PA6

0 comments on commit c861b3e

Please sign in to comment.