Skip to content

Removing dependency of TDBStore in SystemStorage file and moving some file location - TFM support. #9361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions features/storage/kvstore/tdbstore/TDBStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
#include "mbed_error.h"
#include "mbed_wait_api.h"
#include "MbedCRC.h"
//Bypass the check of NVStore co existance if compiled for TARGET_TFM
#if !(BYPASS_NVSTORE_CHECK)
#include "SystemStorage.h"
#endif

using namespace mbed;

Expand Down Expand Up @@ -990,13 +993,18 @@ int TDBStore::init()
goto end;
}

//Bypass the check of NVStore co existance if compiled for TARGET_TFM
#if !(BYPASS_NVSTORE_CHECK)

//Check if we are on internal memory && try to set the internal memory for TDBStore use.
if (strcmp(_bd->get_type(), "FLASHIAP") == 0 &&
avoid_conflict_nvstore_tdbstore(TDBSTORE) == MBED_ERROR_ALREADY_INITIALIZED) {

MBED_ERROR(MBED_ERROR_ALREADY_INITIALIZED, "TDBStore in internal memory can not be initialize when NVStore is in use");
}

#endif

_max_keys = initial_max_keys;

ram_table = new ram_table_entry_t[_max_keys];
Expand Down