Skip to content

Commit 701b468

Browse files
author
Seppo Takalo
committed
Don't enable Device Key, if KVStore is not configured
1 parent 6d5cab9 commit 701b468

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

features/device_key/source/DeviceKey.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
#include "stdint.h"
2121
#include "platform/NonCopyable.h"
2222

23-
#define DEVICEKEY_ENABLED 1
24-
2523
// Whole class is not supported if entropy is not enabled
2624
// Flash device is required as Device Key is currently depending on it
27-
#if !DEVICE_FLASH || !defined(COMPONENT_FLASHIAP)
28-
#undef DEVICEKEY_ENABLED
25+
// and KVStore needs to be configured properly, as Device key lives inside it
26+
#if DEVICE_FLASH && defined(COMPONENT_FLASHIAP) && MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE
27+
#define DEVICEKEY_ENABLED 1
28+
#else
2929
#define DEVICEKEY_ENABLED 0
3030
#endif
3131

features/storage/TESTS/kvstore/direct_access_devicekey_test/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
#ifndef COMPONENT_FLASHIAP
19-
#error [NOT_SUPPORTED] Target must have internal FlashIAP for this test
20-
#else
21-
2218
#include "mbed.h"
2319
#include <stdio.h>
2420
#include <string.h>
@@ -35,6 +31,10 @@
3531
#include "utest.h"
3632
#include <stdlib.h>
3733

34+
#if !defined(COMPONENT_FLASHIAP) || !DEVICEKEY_ENABLED
35+
#error [NOT_SUPPORTED] Target must have internal FlashIAP and Device Key configured for this test
36+
#else
37+
3838
using namespace utest::v1;
3939
using namespace mbed;
4040

0 commit comments

Comments
 (0)