TDBStore: Increase min pages to 14

Increase minimum page count from 10 to 14 based on further experiments
with features-storage-tests-kvstore-static_tests.
pull/11629/head
Kyle Kearney 2019-10-30 16:09:28 -07:00
parent 0002830c03
commit 3ef04db1a3
5 changed files with 11 additions and 11 deletions

View File

@ -2,7 +2,7 @@
"name": "storage_filesystem",
"config": {
"rbp_internal_size": {
"help": "Default is the larger of the last 2 sectors or last 10 pages of flash.",
"help": "Default is the larger of the last 2 sectors or last 14 pages of flash.",
"value": "0"
},
"internal_base_address": {

View File

@ -184,12 +184,12 @@ int _calculate_blocksize_match_tdbstore(BlockDevice *bd)
bd_size_t number_of_sector = size / erase_size;
bd_size_t number_of_page = size / page_size;
if (number_of_sector < TDBStore::STORE_SECTORS) {
tr_warning("KV Config: There are less than two sectors - TDBStore will not work.");
tr_warning("KV Config: There are less than %d sectors - TDBStore will not work.", TDBStore::STORE_SECTORS);
return -1;
}
if (number_of_page < TDBStore::STORE_PAGES) {
tr_warning("KV Config: There are less than ten pages sectors - TDBStore will not work.");
tr_warning("KV Config: There are less than %d pages - TDBStore will not work.", TDBStore::STORE_PAGES);
return -1;
}
@ -592,9 +592,9 @@ int _create_internal_tdb(BlockDevice **internal_bd, KVStore **internal_tdb, bd_s
return MBED_ERROR_FAILED_OPERATION ;
}
//Check if TDBStore has at least 2 sectors or 10 pages.
//Check if TDBStore has at least 2 sectors or 14 pages.
if (_calculate_blocksize_match_tdbstore(*internal_bd) != MBED_SUCCESS) {
tr_error("KV Config: Can not create TDBStore with less then 2 sectors or 10 pages.");
tr_error("KV Config: Can not create TDBStore with less then %d sectors or %d pages.", TDBStore::STORE_SECTORS, TDBStore::STORE_PAGES);
return MBED_ERROR_INVALID_ARGUMENT;
}
@ -760,9 +760,9 @@ int _storage_config_tdb_external_common()
return MBED_ERROR_FAILED_OPERATION ;
}
//Check that there is at least 2 sectors for the external TDBStore
//Check that there is at least 2 sectors or 14 pages for the external TDBStore
if (_calculate_blocksize_match_tdbstore(kvstore_config.external_bd) != MBED_SUCCESS) {
tr_error("KV Config: Can not create TDBStore with less then 2 sectors or 10 pages.");
tr_error("KV Config: Can not create TDBStore with less then 2 sectors or 14 pages.");
return MBED_ERROR_INVALID_SIZE;
}

View File

@ -2,7 +2,7 @@
"name": "storage_tdb_external",
"config": {
"rbp_internal_size": {
"help": "Default is the larger of the last 2 sectors or last 10 pages of flash.",
"help": "Default is the larger of the last 2 sectors or last 14 pages of flash.",
"value": "0"
},
"internal_base_address": {

View File

@ -2,7 +2,7 @@
"name": "storage_tdb_internal",
"config": {
"internal_size": {
"help": "Size of the FlashIAP block device. Default size will be the larger of the last 2 sectors or last 10 pages of flash.",
"help": "Size of the FlashIAP block device. Default size will be the larger of the last 2 sectors or last 14 pages of flash.",
"value": "0"
},
"internal_base_address": {

View File

@ -37,12 +37,12 @@ public:
static const uint32_t RESERVED_AREA_SIZE = 64;
// Use the last 2 sectors or 10 pages of flash for the TDBStore by default (whichever is larger)
// Use the last 2 sectors or 14 pages of flash for the TDBStore by default (whichever is larger)
// For each area: must be a minimum of 1 page of reserved and 2 pages for master record
/** Minimum number of internal flash sectors required for TDBStore */
static const int STORE_SECTORS = 2;
/** Minimum number of internal flash pages required for TDBStore */
static const int STORE_PAGES = 10;
static const int STORE_PAGES = 14;
/**
* @brief Class constructor