diff --git a/features/storage/kvstore/conf/tdb_internal/mbed_lib.json b/features/storage/kvstore/conf/tdb_internal/mbed_lib.json index 140f7e5e26..8b1403703e 100644 --- a/features/storage/kvstore/conf/tdb_internal/mbed_lib.json +++ b/features/storage/kvstore/conf/tdb_internal/mbed_lib.json @@ -15,6 +15,10 @@ "internal_size": "0x8000", "internal_base_address": "0x00028000" }, + "LPC55S69_NS": { + "internal_size": "0x8000", + "internal_base_address": "0x00090000" + }, "DISCO_H747I": { "internal_size": "2*FLASH_SECTOR_SIZE", "internal_base_address": "0x080C0000" diff --git a/features/storage/kvstore/tdbstore/TDBStore.cpp b/features/storage/kvstore/tdbstore/TDBStore.cpp index d7166c722e..6595964121 100644 --- a/features/storage/kvstore/tdbstore/TDBStore.cpp +++ b/features/storage/kvstore/tdbstore/TDBStore.cpp @@ -134,6 +134,11 @@ TDBStore::TDBStore(BlockDevice *bd) : _ram_table(0), _max_keys(0), for (int i = 0; i < _max_open_iterators; i++) { _iterator_table[i] = { 0 }; } + + /* Minimum space required by Reserved area and master record */ + MBED_ASSERT(bd->size() + >= (align_up(RESERVED_AREA_SIZE + sizeof(reserved_trailer_t), _prog_size) + + record_size(master_rec_key, sizeof(master_record_data_t)))); } TDBStore::~TDBStore()