26
26
#include " tdbstore/TDBStore.h"
27
27
#include " mbed_error.h"
28
28
#include " drivers/FlashIAP.h"
29
- #include " blockdevice/FlashSimBlockDevice.h"
30
29
#include " mbed_trace.h"
31
30
#include " securestore/SecureStore.h"
32
31
#define TRACE_GROUP " KVCFG"
@@ -738,21 +737,7 @@ int _storage_config_TDB_EXTERNAL()
738
737
return MBED_ERROR_FAILED_OPERATION ;
739
738
}
740
739
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;
756
741
kvstore_config.flags_mask = ~(0 );
757
742
758
743
return _storage_config_tdb_external_common ();
@@ -778,20 +763,7 @@ int _storage_config_TDB_EXTERNAL_NO_RBP()
778
763
return MBED_ERROR_FAILED_OPERATION ;
779
764
}
780
765
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;
795
767
796
768
// Masking flag - Actually used to remove any KVStore flag which is not supported
797
769
// in the chosen KVStore profile.
0 commit comments