Skip to content

Commit e9f08cb

Browse files
committed
NRF5x: min read/write implementation
1 parent a6509cf commit e9f08cb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ using namespace mbed;
2929

3030
/* Default QSPIF Parameters */
3131
/****************************/
32-
#define QSPIF_DEFAULT_READ_SIZE 1
33-
#define QSPIF_DEFAULT_PROG_SIZE 1
3432
#define QSPIF_DEFAULT_PAGE_SIZE 256
3533
#define QSPIF_DEFAULT_SE_SIZE 4096
3634
#define QSPI_MAX_STATUS_REGISTER_SIZE 3
@@ -462,14 +460,14 @@ int QSPIFBlockDevice::erase(bd_addr_t addr, bd_size_t in_size)
462460

463461
bd_size_t QSPIFBlockDevice::get_read_size() const
464462
{
465-
// Assuming all devices support 1byte read granularity
466-
return QSPIF_DEFAULT_READ_SIZE;
463+
// Return minimum read size in bytes for the device
464+
return MBED_CONF_QSPIF_QSPI_MIN_READ_SIZE;
467465
}
468466

469467
bd_size_t QSPIFBlockDevice::get_program_size() const
470468
{
471-
// Assuming all devices support 1byte program granularity
472-
return QSPIF_DEFAULT_PROG_SIZE;
469+
// Return minimum program/write size in bytes for the device
470+
return MBED_CONF_QSPIF_QSPI_MIN_PROG_SIZE;
473471
}
474472

475473
bd_size_t QSPIFBlockDevice::get_erase_size() const

components/storage/blockdevice/COMPONENT_QSPIF/mbed_lib.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"QSPI_SCK": "QSPI_FLASH1_SCK",
99
"QSPI_CSN": "QSPI_FLASH1_CSN",
1010
"QSPI_POLARITY_MODE": 0,
11-
"QSPI_FREQ": "40000000"
11+
"QSPI_FREQ": "40000000",
12+
"QSPI_MIN_READ_SIZE": "1",
13+
"QSPI_MIN_PROG_SIZE": "1"
1214
},
1315
"target_overrides": {
1416
"DISCO_F413ZH": {

0 commit comments

Comments
 (0)