Skip to content

Commit 3786d39

Browse files
committed
kv_config: TDBStore doesn't require flash simulation anymore
1 parent 36df9d1 commit 3786d39

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

storage/kvstore/kv_config/source/kv_config.cpp

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "tdbstore/TDBStore.h"
2727
#include "mbed_error.h"
2828
#include "drivers/FlashIAP.h"
29-
#include "blockdevice/FlashSimBlockDevice.h"
3029
#include "mbed_trace.h"
3130
#include "securestore/SecureStore.h"
3231
#define TRACE_GROUP "KVCFG"
@@ -738,21 +737,7 @@ int _storage_config_TDB_EXTERNAL()
738737
return MBED_ERROR_FAILED_OPERATION ;
739738
}
740739

741-
//TDBStore needs a block device base on flash. So if this is non-flash type block device,
742-
//add FlashSimBlockDevice on top of it.
743-
if (bd->get_erase_value() == -1) {
744-
//TDBStore needs FlashSimBlockDevice when working with non-flash type block device
745-
if (bd->init() != MBED_SUCCESS) {
746-
tr_error("KV Config: Fail to init external BlockDevice.");
747-
return MBED_ERROR_FAILED_OPERATION ;
748-
}
749-
750-
static FlashSimBlockDevice flash_bd(bd);
751-
kvstore_config.external_bd = &flash_bd;
752-
} else {
753-
kvstore_config.external_bd = bd;
754-
}
755-
740+
kvstore_config.external_bd = bd;
756741
kvstore_config.flags_mask = ~(0);
757742

758743
return _storage_config_tdb_external_common();
@@ -778,20 +763,7 @@ int _storage_config_TDB_EXTERNAL_NO_RBP()
778763
return MBED_ERROR_FAILED_OPERATION ;
779764
}
780765

781-
//TDBStore needs a block device base on flash. So if this is non-flash type block device,
782-
//add FlashSimBlockDevice on top of the SDBlockDevice
783-
if (bd->get_erase_value() == -1) {
784-
//TDBStore needs FlashSimBlockDevice when working with non-flash type block device
785-
if (bd->init() != MBED_SUCCESS) {
786-
tr_error("KV Config: Fail to init external BlockDevice.");
787-
return MBED_ERROR_FAILED_OPERATION ;
788-
}
789-
790-
static FlashSimBlockDevice flash_bd(bd);
791-
kvstore_config.external_bd = &flash_bd;
792-
} else {
793-
kvstore_config.external_bd = bd;
794-
}
766+
kvstore_config.external_bd = bd;
795767

796768
//Masking flag - Actually used to remove any KVStore flag which is not supported
797769
//in the chosen KVStore profile.

0 commit comments

Comments
 (0)