Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ mbed_greentea_add_test(
main.cpp
TEST_REQUIRED_LIBS
mbed-storage-blockdevice
NEEDED_RAM_KIB 6
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ mbed_greentea_add_test(
main.cpp
TEST_REQUIRED_LIBS
mbed-storage-blockdevice
NEEDED_RAM_KIB 10
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ mbed_greentea_add_test(
main.cpp
TEST_REQUIRED_LIBS
mbed-storage-blockdevice
NEEDED_RAM_KIB 10
)
2 changes: 1 addition & 1 deletion storage/filesystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

if(MBED_ENABLE_OS_INTERNAL_TESTS)
if(MBED_BUILD_GREENTEA_TESTS)
# add greentea test
add_subdirectory(tests/TESTS/filesystem)
else()
add_subdirectory(tests/UNITTESTS)
endif()
Expand Down
4 changes: 4 additions & 0 deletions storage/filesystem/tests/TESTS/filesystem/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2025 Jamie Smith.
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(general_filesystem)
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-storage-filesystem-general_filesystem)

include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)

project(${TEST_TARGET})
if((NOT "COMPONENT_SPIF=1" IN_LIST MBED_TARGET_DEFINITIONS) AND
(NOT "COMPONENT_QSPIF=1" IN_LIST MBED_TARGET_DEFINITIONS) AND
(NOT "COMPONENT_OSPIF=1" IN_LIST MBED_TARGET_DEFINITIONS) AND
(NOT "COMPONENT_SD=1" IN_LIST MBED_TARGET_DEFINITIONS))
set(SKIP_REASON "External block device needed.")
endif()

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-storage-filesystem-general_filesystem
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
mbed-storage-littlefs
mbed-storage
mbed-storage-sd
TEST_SKIPPED
${SKIP_REASON}
)
2 changes: 1 addition & 1 deletion storage/kvstore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

if(MBED_ENABLE_OS_INTERNAL_TESTS)
if(MBED_BUILD_GREENTEA_TESTS)
# add greentea test
add_subdirectory(tests/TESTS/kvstore)
else()
add_subdirectory(tests/UNITTESTS)
endif()
Expand Down
6 changes: 6 additions & 0 deletions storage/kvstore/direct_access_devicekey/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if(MBED_ENABLE_OS_INTERNAL_TESTS)
if(MBED_BUILD_GREENTEA_TESTS)
add_subdirectory(tests/TESTS/direct_access_devicekey)
endif()
endif()

add_library(mbed-storage-direct-access-devicekey STATIC EXCLUDE_FROM_ALL)

target_include_directories(mbed-storage-direct-access-devicekey
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2025 Jamie Smith.
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(tdb)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2025 Jamie Smith.
# SPDX-License-Identifier: Apache-2.0

if(NOT "DEVICE_FLASH=1" IN_LIST MBED_TARGET_DEFINITIONS)
set(TEST_SKIPPED "This test requires flash support!")
endif()

mbed_greentea_add_test(
TEST_NAME
mbed-storage-kvstore-direct-access-devicekey
TEST_SKIPPED
${TEST_SKIPPED}
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
mbed-storage-direct-access-devicekey
)
2 changes: 1 addition & 1 deletion storage/kvstore/filesystemstore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

if(MBED_ENABLE_OS_INTERNAL_TESTS)
if(MBED_BUILD_GREENTEA_TESTS)
# add greentea test
add_subdirectory(tests/TESTS/filesystemstore)
else()
add_subdirectory(tests/UNITTESTS)
endif()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2025 Jamie Smith.
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(general)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2025 Jamie Smith.
# SPDX-License-Identifier: Apache-2.0

if(NOT "DEVICE_TRNG=1" IN_LIST MBED_TARGET_DEFINITIONS)
set(TEST_SKIPPED "This test requires TRNG support!")
endif()

if(NOT "DEVICE_FLASH=1" IN_LIST MBED_TARGET_DEFINITIONS)
set(TEST_SKIPPED "This test requires flash API support!")
endif()

mbed_greentea_add_test(
TEST_NAME
mbed-storage-kvstore-filesystemstore
TEST_SKIPPED
${TEST_SKIPPED}
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
mbed-storage
mbed-storage-filesystemstore
)
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "utest.h"
#include <stdlib.h>

#include "SecureStore.h"

#if !SECURESTORE_ENABLED
#error [NOT_SUPPORTED] SecureStore need to be enabled for this test
#else
Expand Down Expand Up @@ -448,7 +450,7 @@ void test_file_system_store_multi_threads()
err = fsst->reset();
TEST_ASSERT_EQUAL_ERROR_CODE(0, err);

thread_data_t thread_data[3];
thread_data_t thread_data[FSST_TEST_NUM_OF_THREADS];

/* Thread Access Test Starts */
rtos::Thread set_thread[FSST_TEST_NUM_OF_THREADS];
Expand Down
6 changes: 6 additions & 0 deletions storage/kvstore/tests/TESTS/kvstore/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2025 Jamie Smith.
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(general_tests_phase_1)
add_subdirectory(general_tests_phase_2)
add_subdirectory(static_tests)
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
if(NOT "DEVICE_TRNG=1" IN_LIST MBED_TARGET_DEFINITIONS)
set(TEST_SKIPPED "This test requires TRNG support!")
endif()

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-storage-kvstore-general_tests_phase_1)

include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)

project(${TEST_TARGET})
if(NOT "DEVICE_FLASH=1" IN_LIST MBED_TARGET_DEFINITIONS)
set(TEST_SKIPPED "This test requires flash API support!")
endif()

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-storage-kvstore-general_tests_phase_1
TEST_SKIPPED
${TEST_SKIPPED}
NEEDED_FLASH_KIB 140
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ static void kvstore_init()

res = bd->init();
TEST_ASSERT_EQUAL_ERROR_CODE(0, res);
int erase_val = bd->get_erase_value();
// Clear out any stale data that might be left from a previous test.
// Multiply by 2 because SecureStore requires two underlying block devices of this size
size_t bytes_to_erase = align_up(2 * PAGES_ESTIMATE * bd->get_program_size(), bd->get_erase_size());
Expand All @@ -101,8 +100,8 @@ static void kvstore_init()
if (kv_setup == TDBStoreSet) {
#if DEVICE_FLASH && !COMPONENT_SPIF && !COMPONENT_QSPIF && !COMPONENT_DATAFLASH && !COMPONENT_SD
// TDBStore requires two areas of equal size, do the check for FlashIAP
TEST_SKIP_UNLESS(MBED_CONF_TARGET_INTERNAL_FLASH_UNIFORM_SECTORS ||
(MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE != 0) && (MBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS != 0xFFFFFFFF))
TEST_SKIP_UNLESS(MBED_CONF_TARGET_INTERNAL_FLASH_UNIFORM_SECTORS);
TEST_SKIP_UNLESS(bd->get_erase_size() * 2 <= bd->size());
#endif
kvstore = new TDBStore(bd);
}
Expand Down Expand Up @@ -148,7 +147,10 @@ static void kvstore_init()
res = kvstore->init();
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, res);
#if DEVICEKEY_ENABLED
DeviceKey::get_instance().generate_root_of_trust();
auto rootOfTrustRet = DeviceKey::get_instance().generate_root_of_trust();
if (rootOfTrustRet != DEVICEKEY_SUCCESS) {
printf("Failed to generate device key root of trust. Error: %d\n. Some SecureStore tests will fail.", rootOfTrustRet);
}
#endif
}

Expand All @@ -159,8 +161,6 @@ static void kvstore_deinit()

TEST_SKIP_UNLESS(kvstore != NULL);

int erase_val = bd->get_erase_value();

res = kvstore->deinit();
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, res);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
if(NOT "DEVICE_TRNG=1" IN_LIST MBED_TARGET_DEFINITIONS)
set(TEST_SKIPPED "This test requires TRNG support!")
endif()

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-storage-kvstore-general_tests_phase_2)

include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)

project(${TEST_TARGET})
if(NOT "DEVICE_FLASH=1" IN_LIST MBED_TARGET_DEFINITIONS)
set(TEST_SKIPPED "This test requires flash API support!")
endif()

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-storage-kvstore-general_tests_phase_2
TEST_SKIPPED
${TEST_SKIPPED}
NEEDED_FLASH_KIB 140
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ static void kvstore_init()

res = bd->init();
TEST_ASSERT_EQUAL_ERROR_CODE(0, res);
int erase_val = bd->get_erase_value();
// Clear out any stale data that might be left from a previous test
// Multiply by 2 because SecureStore requires two underlying block devices of this size
size_t bytes_to_erase = align_up(2 * PAGES_ESTIMATE * bd->get_program_size(), bd->get_erase_size());
Expand All @@ -97,8 +96,8 @@ static void kvstore_init()
if (kv_setup == TDBStoreSet) {
#if DEVICE_FLASH && !COMPONENT_SPIF && !COMPONENT_QSPIF && !COMPONENT_DATAFLASH && !COMPONENT_SD
// TDBStore requires two areas of equal size
TEST_SKIP_UNLESS(MBED_CONF_TARGET_INTERNAL_FLASH_UNIFORM_SECTORS ||
(MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE != 0) && (MBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS != 0xFFFFFFFF))
TEST_SKIP_UNLESS(MBED_CONF_TARGET_INTERNAL_FLASH_UNIFORM_SECTORS);
TEST_SKIP_UNLESS(bd->get_erase_size() * 2 <= bd->size());
#endif
kvstore = new TDBStore(bd);
}
Expand Down Expand Up @@ -158,8 +157,6 @@ static void kvstore_deinit()

TEST_SKIP_UNLESS(kvstore != NULL);

int erase_val = bd->get_erase_value();

res = kvstore->deinit();
TEST_ASSERT_EQUAL_ERROR_CODE(MBED_SUCCESS, res);

Expand Down
12 changes: 2 additions & 10 deletions storage/kvstore/tests/TESTS/kvstore/static_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-storage-kvstore-static_tests)

include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)

project(${TEST_TARGET})

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-storage-kvstore-static_tests
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
mbed-storage-kv-global-api
NEEDED_FLASH_KIB 70
)
2 changes: 1 addition & 1 deletion targets/targets.json5
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
],
"device_name": "LPC1769",
"components_add": [
"COMPONENT_I2CEE"
"I2CEE"
],
"overrides": {
"default-adc-vref": 3.3, // Vref is 3.3V
Expand Down
11 changes: 0 additions & 11 deletions targets/upload_method_cfg/K64F.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@
# 1. Be sure to update the DAPLink firmware on the board via these instructions: https://os.mbed.com/blog/entry/DAPLink-bootloader-update/
# 2. OpenOCD 0.12 flashes this device perfectly and can enter a debug session, but cannot hit breakpoints
# 3. LinkServer can both flash and debug, so it's the recommended upload method for this device.
# 4. LinkServer does appear to have a bug where it doesn't map the peripheral registers as valid memory, so you can't
# inspect them. I was able to work around this by inserting a block like this into <LinkServer install dir>/devices/FRDM-K64F.json:
#
# "name": "MK64FN1M0xxx12",
# "family": "K6x",
# "memory": [
# + {
# + "location": "0x40000000",
# + "size": "0x000f0000",
# + "type": "RAM"
# + },

# General config parameters
# -------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# Workaround for issue where this file:
# https://github.com/openocd-org/openocd/blob/master/tcl/target/max32670.cfg
# tries to include max32xxx_common.cfg with the wrong name

source [find target/max32xxx_common.cfg]
Loading