From 9b4b28fc3f88880a8c000b51de694a03d6cc0e3c Mon Sep 17 00:00:00 2001 From: adustm Date: Mon, 9 Apr 2018 17:20:53 +0200 Subject: [PATCH] Support maximum flash size : 4Gbytes --- targets/TARGET_STM/qspi_api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/targets/TARGET_STM/qspi_api.c b/targets/TARGET_STM/qspi_api.c index 1b1c6af9f9..2069e7805c 100644 --- a/targets/TARGET_STM/qspi_api.c +++ b/targets/TARGET_STM/qspi_api.c @@ -34,7 +34,9 @@ #include "pinmap.h" #include "PeripheralPins.h" -#define QSPI_FLASH_SIZE_DEFAULT 0x800000 +/* Max amount of flash size is 4Gbytes */ +/* hence 2^(31+1), then FLASH_SIZE_DEFAULT = 31<<20 */ +#define QSPI_FLASH_SIZE_DEFAULT 0x1F00000 void qspi_prepare_command(const qspi_command_t *command, QSPI_CommandTypeDef *st_command) {