diff --git a/components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp b/components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp index 208ff5aeb8..ae0ca070ed 100644 --- a/components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp +++ b/components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp @@ -29,8 +29,6 @@ using namespace mbed; /* Default QSPIF Parameters */ /****************************/ -#define QSPIF_DEFAULT_READ_SIZE 1 -#define QSPIF_DEFAULT_PROG_SIZE 1 #define QSPIF_DEFAULT_PAGE_SIZE 256 #define QSPIF_DEFAULT_SE_SIZE 4096 #define QSPI_MAX_STATUS_REGISTER_SIZE 3 @@ -462,14 +460,14 @@ exit_point: bd_size_t QSPIFBlockDevice::get_read_size() const { - // Assuming all devices support 1byte read granularity - return QSPIF_DEFAULT_READ_SIZE; + // Return minimum read size in bytes for the device + return MBED_CONF_QSPIF_QSPI_MIN_READ_SIZE; } bd_size_t QSPIFBlockDevice::get_program_size() const { - // Assuming all devices support 1byte program granularity - return QSPIF_DEFAULT_PROG_SIZE; + // Return minimum program/write size in bytes for the device + return MBED_CONF_QSPIF_QSPI_MIN_PROG_SIZE; } bd_size_t QSPIFBlockDevice::get_erase_size() const diff --git a/components/storage/blockdevice/COMPONENT_QSPIF/mbed_lib.json b/components/storage/blockdevice/COMPONENT_QSPIF/mbed_lib.json index dc49d3f462..ca0f48205c 100644 --- a/components/storage/blockdevice/COMPONENT_QSPIF/mbed_lib.json +++ b/components/storage/blockdevice/COMPONENT_QSPIF/mbed_lib.json @@ -8,7 +8,9 @@ "QSPI_SCK": "QSPI_FLASH1_SCK", "QSPI_CSN": "QSPI_FLASH1_CSN", "QSPI_POLARITY_MODE": 0, - "QSPI_FREQ": "40000000" + "QSPI_FREQ": "40000000", + "QSPI_MIN_READ_SIZE": "1", + "QSPI_MIN_PROG_SIZE": "1" }, "target_overrides": { "DISCO_F413ZH": {