Skip to content

Commit 3ef04db

Browse files
author
Kyle Kearney
committed
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.
1 parent 0002830 commit 3ef04db

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

features/storage/kvstore/conf/filesystem/mbed_lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "storage_filesystem",
33
"config": {
44
"rbp_internal_size": {
5-
"help": "Default is the larger of the last 2 sectors or last 10 pages of flash.",
5+
"help": "Default is the larger of the last 2 sectors or last 14 pages of flash.",
66
"value": "0"
77
},
88
"internal_base_address": {

features/storage/kvstore/conf/kv_config.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@ int _calculate_blocksize_match_tdbstore(BlockDevice *bd)
184184
bd_size_t number_of_sector = size / erase_size;
185185
bd_size_t number_of_page = size / page_size;
186186
if (number_of_sector < TDBStore::STORE_SECTORS) {
187-
tr_warning("KV Config: There are less than two sectors - TDBStore will not work.");
187+
tr_warning("KV Config: There are less than %d sectors - TDBStore will not work.", TDBStore::STORE_SECTORS);
188188
return -1;
189189
}
190190

191191
if (number_of_page < TDBStore::STORE_PAGES) {
192-
tr_warning("KV Config: There are less than ten pages sectors - TDBStore will not work.");
192+
tr_warning("KV Config: There are less than %d pages - TDBStore will not work.", TDBStore::STORE_PAGES);
193193
return -1;
194194
}
195195

@@ -592,9 +592,9 @@ int _create_internal_tdb(BlockDevice **internal_bd, KVStore **internal_tdb, bd_s
592592
return MBED_ERROR_FAILED_OPERATION ;
593593
}
594594

595-
//Check if TDBStore has at least 2 sectors or 10 pages.
595+
//Check if TDBStore has at least 2 sectors or 14 pages.
596596
if (_calculate_blocksize_match_tdbstore(*internal_bd) != MBED_SUCCESS) {
597-
tr_error("KV Config: Can not create TDBStore with less then 2 sectors or 10 pages.");
597+
tr_error("KV Config: Can not create TDBStore with less then %d sectors or %d pages.", TDBStore::STORE_SECTORS, TDBStore::STORE_PAGES);
598598
return MBED_ERROR_INVALID_ARGUMENT;
599599
}
600600

@@ -760,9 +760,9 @@ int _storage_config_tdb_external_common()
760760
return MBED_ERROR_FAILED_OPERATION ;
761761
}
762762

763-
//Check that there is at least 2 sectors for the external TDBStore
763+
//Check that there is at least 2 sectors or 14 pages for the external TDBStore
764764
if (_calculate_blocksize_match_tdbstore(kvstore_config.external_bd) != MBED_SUCCESS) {
765-
tr_error("KV Config: Can not create TDBStore with less then 2 sectors or 10 pages.");
765+
tr_error("KV Config: Can not create TDBStore with less then 2 sectors or 14 pages.");
766766
return MBED_ERROR_INVALID_SIZE;
767767
}
768768

features/storage/kvstore/conf/tdb_external/mbed_lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "storage_tdb_external",
33
"config": {
44
"rbp_internal_size": {
5-
"help": "Default is the larger of the last 2 sectors or last 10 pages of flash.",
5+
"help": "Default is the larger of the last 2 sectors or last 14 pages of flash.",
66
"value": "0"
77
},
88
"internal_base_address": {

features/storage/kvstore/conf/tdb_internal/mbed_lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "storage_tdb_internal",
33
"config": {
44
"internal_size": {
5-
"help": "Size of the FlashIAP block device. Default size will be the larger of the last 2 sectors or last 10 pages of flash.",
5+
"help": "Size of the FlashIAP block device. Default size will be the larger of the last 2 sectors or last 14 pages of flash.",
66
"value": "0"
77
},
88
"internal_base_address": {

features/storage/kvstore/tdbstore/TDBStore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ class TDBStore : public KVStore {
3737

3838
static const uint32_t RESERVED_AREA_SIZE = 64;
3939

40-
// Use the last 2 sectors or 10 pages of flash for the TDBStore by default (whichever is larger)
40+
// Use the last 2 sectors or 14 pages of flash for the TDBStore by default (whichever is larger)
4141
// For each area: must be a minimum of 1 page of reserved and 2 pages for master record
4242
/** Minimum number of internal flash sectors required for TDBStore */
4343
static const int STORE_SECTORS = 2;
4444
/** Minimum number of internal flash pages required for TDBStore */
45-
static const int STORE_PAGES = 10;
45+
static const int STORE_PAGES = 14;
4646

4747
/**
4848
* @brief Class constructor

0 commit comments

Comments
 (0)