Skip to content

Commit 7455372

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 b4f7ef6 commit 7455372

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

features/storage/kvstore/conf/kv_config.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ int _calculate_blocksize_match_tdbstore(BlockDevice *bd)
185185
}
186186

187187
if (number_of_page < TDBStore::STORE_PAGES) {
188-
tr_warning("KV Config: There are less than ten pages sectors - TDBStore will not work.");
188+
tr_warning("KV Config: There are less than fourteen pages - TDBStore will not work.");
189189
return -1;
190190
}
191191

@@ -581,9 +581,9 @@ int _create_internal_tdb(BlockDevice **internal_bd, KVStore **internal_tdb, bd_s
581581
return MBED_ERROR_FAILED_OPERATION ;
582582
}
583583

584-
//Check if TDBStore has at least 2 sectors or 10 pages.
584+
//Check if TDBStore has at least 2 sectors or 14 pages.
585585
if (_calculate_blocksize_match_tdbstore(*internal_bd) != MBED_SUCCESS) {
586-
tr_error("KV Config: Can not create TDBStore with less then 2 sectors or 10 pages.");
586+
tr_error("KV Config: Can not create TDBStore with less then 2 sectors or 14 pages.");
587587
return MBED_ERROR_INVALID_ARGUMENT;
588588
}
589589

@@ -749,9 +749,9 @@ int _storage_config_tdb_external_common()
749749
return MBED_ERROR_FAILED_OPERATION ;
750750
}
751751

752-
//Check that there is at least 2 sectors for the external TDBStore
752+
//Check that there is at least 2 sectors or 14 pages for the external TDBStore
753753
if (_calculate_blocksize_match_tdbstore(kvstore_config.external_bd) != MBED_SUCCESS) {
754-
tr_error("KV Config: Can not create TDBStore with less then 2 sectors or 10 pages.");
754+
tr_error("KV Config: Can not create TDBStore with less then 2 sectors or 14 pages.");
755755
return MBED_ERROR_INVALID_SIZE;
756756
}
757757

features/storage/kvstore/tdbstore/TDBStore.h

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

3737
static const uint32_t RESERVED_AREA_SIZE = 64;
3838

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

4646
/**
4747
* @brief Class constructor

0 commit comments

Comments
 (0)