summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis McCollum <travis.mccollum@arm.com>2021-04-01 13:18:01 -0500
committerGitHub <noreply@github.com>2021-04-01 13:18:01 -0500
commita3e2e8f0ae073ff7a7dbb8545801d8c72791c918 (patch)
tree4c575a1485f5773259e88aae2a9f72edc279d69a
parent87802c415b59d359c5928ef8a2d503df28d4bde2 (diff)
parent87479a82e6643025748d3c29cdacaf734d9ab1c0 (diff)
Merge pull request #43 from PelionIoT/dev
release 2.3.0 dev-->master merge
-rw-r--r--conf/layer.conf1
-rw-r--r--recipes-connectivity/mbed-edge-core/files/0001-fix_psa_storage_location.patch13
-rw-r--r--recipes-connectivity/mbed-edge-core/files/0001-parsec-se-driver-should-be-compiled-separately-in-Yo.patch32
-rw-r--r--recipes-connectivity/mbed-edge-core/files/0003-fix_libwebsockets_nondebug.manual_patch18
-rw-r--r--recipes-connectivity/mbed-edge-core/files/0004-Removed-the-redundant-cmake-command.manual_patch24
-rw-r--r--recipes-connectivity/mbed-edge-core/files/0005-fota.manual_patch14
-rw-r--r--recipes-connectivity/mbed-edge-core/files/0008-ordered-reboot.patch33
-rw-r--r--recipes-connectivity/mbed-edge-core/files/imx8mmevk/target.cmake28
-rw-r--r--recipes-connectivity/mbed-edge-core/files/mbed_cloud_client_user_config.h44
-rw-r--r--recipes-connectivity/mbed-edge-core/files/rpi3/target.cmake19
-rw-r--r--recipes-connectivity/mbed-edge-core/files/uz/target.cmake27
-rw-r--r--recipes-connectivity/mbed-edge-core/mbed-edge-core-imx8mmevk.bb7
-rw-r--r--recipes-connectivity/mbed-edge-core/mbed-edge-core-rpi3.bb3
-rw-r--r--recipes-connectivity/mbed-edge-core/mbed-edge-core-uz.bb7
-rw-r--r--recipes-connectivity/mbed-edge-core/mbed-edge-core.inc38
-rw-r--r--recipes-connectivity/mbed-edge-examples/files/0003-Set-optimization-level-to-0-only-if-FORTIFY_SOURCE-i.patch26
-rw-r--r--recipes-connectivity/mbed-edge-examples/files/0003-fix-CMake-test-Build-Type-Release.patch25
-rw-r--r--recipes-connectivity/mbed-edge-examples/mbed-edge-examples.bb4
-rw-r--r--recipes-connectivity/parsec-se-driver/parsec-se-driver_0.4.0.bb37
19 files changed, 309 insertions, 91 deletions
diff --git a/conf/layer.conf b/conf/layer.conf
index f715aa3..cef0584 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -9,3 +9,4 @@ BBFILE_COLLECTIONS += "meta-mbed-edge"
BBFILE_PATTERN_meta-mbed-edge = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-mbed-edge = "6"
LAYERSERIES_COMPAT_meta-mbed-edge = "dunfell gatesgarth"
+LAYERDEPENDS_meta-mbed-edge = "rust-layer clang-layer"
diff --git a/recipes-connectivity/mbed-edge-core/files/0001-fix_psa_storage_location.patch b/recipes-connectivity/mbed-edge-core/files/0001-fix_psa_storage_location.patch
new file mode 100644
index 0000000..cd37171
--- /dev/null
+++ b/recipes-connectivity/mbed-edge-core/files/0001-fix_psa_storage_location.patch
@@ -0,0 +1,13 @@
+diff --git a/config/psa_storage_user_config.h b/config/psa_storage_user_config.h
+index 742f5d7..e5fc9b4 100644
+--- a/config/psa_storage_user_config.h
++++ b/config/psa_storage_user_config.h
+@@ -32,6 +32,6 @@
+ #undef PSA_STORAGE_FILE_C_STORAGE_PREFIX
+ #endif
+
+-#define PSA_STORAGE_FILE_C_STORAGE_PREFIX "psa/"
++#define PSA_STORAGE_FILE_C_STORAGE_PREFIX "/userdata/mbed/mcc_config"
+
+ #endif /* PSA_STORAGE_USER_CONFIG_H */
+ \ No newline at end of file
diff --git a/recipes-connectivity/mbed-edge-core/files/0001-parsec-se-driver-should-be-compiled-separately-in-Yo.patch b/recipes-connectivity/mbed-edge-core/files/0001-parsec-se-driver-should-be-compiled-separately-in-Yo.patch
new file mode 100644
index 0000000..ebd71af
--- /dev/null
+++ b/recipes-connectivity/mbed-edge-core/files/0001-parsec-se-driver-should-be-compiled-separately-in-Yo.patch
@@ -0,0 +1,32 @@
+From af5a526b949e2b0f9c6ccca3b5d0c81762ceec84 Mon Sep 17 00:00:00 2001
+From: Yash Goyal <ygoyal@wigwag.com>
+Date: Tue, 9 Mar 2021 17:46:24 -0800
+Subject: [PATCH] parsec-se-driver should be compiled separately in Yocto env
+
+parsec-se-driver is a Rust based project and Yocto do not like calling
+cargo from within cmake. Will add a separate recipe for parsec-se-driver
+and call that as DEPENDS in mbed-edge-core.
+---
+ lib/CMakeLists.txt | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
+index 5a622e4..f289c16 100644
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -53,12 +53,6 @@ if (PARSEC_TPM_SE_SUPPORT OR (FOTA_ENABLE AND NOT MBED_CLOUD_CLIENT_CURL_DYNAMIC
+
+ if (PARSEC_TPM_SE_SUPPORT)
+
+- find_program(CARGO cargo)
+- if (NOT CARGO)
+- message(FATAL_ERROR "cargo not found!")
+- endif ()
+-
+- add_subdirectory("pal-platform/Middleware/parsec_se_driver")
+ add_subdirectory("pal-platform/Middleware/trusted_storage")
+
+ else ()
+--
+2.17.1
+
diff --git a/recipes-connectivity/mbed-edge-core/files/0003-fix_libwebsockets_nondebug.manual_patch b/recipes-connectivity/mbed-edge-core/files/0003-fix_libwebsockets_nondebug.manual_patch
index 4c1b016..6cc8b7a 100644
--- a/recipes-connectivity/mbed-edge-core/files/0003-fix_libwebsockets_nondebug.manual_patch
+++ b/recipes-connectivity/mbed-edge-core/files/0003-fix_libwebsockets_nondebug.manual_patch
@@ -2,18 +2,12 @@ diff --git a/lib/libwebsockets/libwebsockets/CMakeLists.txt b/lib/libwebsockets/
--- a/lib/libwebsockets/libwebsockets/CMakeLists.txt
+++ b/lib/libwebsockets/libwebsockets/CMakeLists.txt
-@@ -1043,13 +1043,13 @@
- set (GCOV_FLAGS "-fprofile-arcs -ftest-coverage -O0")
- endif()
-
+@@ -1237,7 +1237,7 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
if (CMAKE_BUILD_TYPE MATCHES "DEBUG")
- set(CMAKE_C_FLAGS "-O0 ${CMAKE_C_FLAGS}")
+ set(CMAKE_C_FLAGS "-O0 ${CMAKE_C_FLAGS}")
else()
-- set(CMAKE_C_FLAGS "-O3 ${CMAKE_C_FLAGS}")
-+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
+- set(CMAKE_C_FLAGS "-O3 ${CMAKE_C_FLAGS}")
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
endif()
-
- if (UNIX AND NOT LWS_WITH_ESP32)
- set(CMAKE_C_FLAGS "-Wall -Wsign-compare -Wignored-qualifiers -Wtype-limits -Wuninitialized -Werror ${VISIBILITY_FLAG} -Wundef ${GCOV_FLAGS} ${CMAKE_C_FLAGS}" )
- else()
- set(CMAKE_C_FLAGS "-Wall -Wsign-compare -Wignored-qualifiers -Wtype-limits -Wuninitialized -Werror ${VISIBILITY_FLAG} ${GCOV_FLAGS} ${CMAKE_C_FLAGS}" )
+
+ check_c_compiler_flag("-Wignored-qualifiers" LWS_GCC_HAS_IGNORED_QUALIFIERS)
diff --git a/recipes-connectivity/mbed-edge-core/files/0004-Removed-the-redundant-cmake-command.manual_patch b/recipes-connectivity/mbed-edge-core/files/0004-Removed-the-redundant-cmake-command.manual_patch
deleted file mode 100644
index 6393c77..0000000
--- a/recipes-connectivity/mbed-edge-core/files/0004-Removed-the-redundant-cmake-command.manual_patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From dae10c64256f147cd5ea86013cd697a512f22e45 Mon Sep 17 00:00:00 2001
-From: Yash Goyal <ygoyal@wigwag.com>
-Date: Sun, 10 Jan 2021 16:38:00 -0800
-Subject: [PATCH] Removed the redundant cmake command
-
----
- lib/mbed-cloud-client/CMakeLists.txt | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/lib/mbed-cloud-client/CMakeLists.txt b/lib/mbed-cloud-client/CMakeLists.txt
-index 0b02534..706d0bc 100644
---- a/lib/mbed-cloud-client/CMakeLists.txt
-+++ b/lib/mbed-cloud-client/CMakeLists.txt
-@@ -294,7 +294,6 @@ if (FOTA_ENABLE)
- message("curl include at: ${CURL_INCLUDE_DIRS}")
- message("curl link: ${CURL_LIBRARIES}")
- include_directories(SYSTEM ${CURL_LIBRARIES})
-- add_dependencies(fota ${CURL_LIBRARIES})
- target_link_libraries(fota ${CURL_LIBRARIES})
- else()
- add_dependencies(fota libcurl)
---
-2.7.4
-
diff --git a/recipes-connectivity/mbed-edge-core/files/0005-fota.manual_patch b/recipes-connectivity/mbed-edge-core/files/0005-fota.manual_patch
index 13123fb..7ff7cd9 100644
--- a/recipes-connectivity/mbed-edge-core/files/0005-fota.manual_patch
+++ b/recipes-connectivity/mbed-edge-core/files/0005-fota.manual_patch
@@ -1,23 +1,25 @@
diff --git a/lib/mbed-cloud-client/fota/fota_config.h b/lib/mbed-cloud-client/fota/fota_config.h
-index 3cd840a..8ae2673 100644
+index 8bd80d4..4f77e19 100644
--- a/lib/mbed-cloud-client/fota/fota_config.h
+++ b/lib/mbed-cloud-client/fota/fota_config.h
-@@ -55,15 +55,15 @@
+@@ -79,17 +79,17 @@
#endif
-
+
#if !defined(MBED_CLOUD_CLIENT_FOTA_LINUX_HEADER_FILENAME)
-#define MBED_CLOUD_CLIENT_FOTA_LINUX_HEADER_FILENAME "fota_fw_metadata"
+#define MBED_CLOUD_CLIENT_FOTA_LINUX_HEADER_FILENAME "/userdata/fota_fw_metadata"
#endif
-
+
+ #define MBED_CLOUD_CLIENT_FOTA_LINUX_TEMP_HEADER_FILENAME MBED_CLOUD_CLIENT_FOTA_LINUX_HEADER_FILENAME ".tmp"
+
#if !defined(MBED_CLOUD_CLIENT_FOTA_LINUX_UPDATE_STORAGE_FILENAME)
-#define MBED_CLOUD_CLIENT_FOTA_LINUX_UPDATE_STORAGE_FILENAME "fota_candidate"
+#define MBED_CLOUD_CLIENT_FOTA_LINUX_UPDATE_STORAGE_FILENAME "/userdata/fota_candidate"
#endif
-
+
#if !defined(MBED_CLOUD_CLIENT_FOTA_LINUX_CANDIDATE_FILENAME)
-#define MBED_CLOUD_CLIENT_FOTA_LINUX_CANDIDATE_FILENAME "fota_raw_candidate"
+#define MBED_CLOUD_CLIENT_FOTA_LINUX_CANDIDATE_FILENAME "/userdata/fota_raw_candidate"
#endif
-
+
#endif // defined(TARGET_LIKE_LINUX)
diff --git a/recipes-connectivity/mbed-edge-core/files/0008-ordered-reboot.patch b/recipes-connectivity/mbed-edge-core/files/0008-ordered-reboot.patch
new file mode 100644
index 0000000..af9acfb
--- /dev/null
+++ b/recipes-connectivity/mbed-edge-core/files/0008-ordered-reboot.patch
@@ -0,0 +1,33 @@
+diff --git a/lib/mbed-cloud-client/mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Linux/RTOS/pal_plat_rtos.c b/lib/mbed-cloud-client/mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Linux/RTOS/pal_plat_rtos.c
+index 8c94312..4948f42 100644
+--- a/lib/mbed-cloud-client/mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Linux/RTOS/pal_plat_rtos.c
++++ b/lib/mbed-cloud-client/mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Linux/RTOS/pal_plat_rtos.c
+@@ -99,26 +99,8 @@ PAL_PRIVATE void palTimerThread(void const *args);
+ */
+ void pal_plat_osReboot(void)
+ {
+-//Simulator is currently for Linux only
+-#if (PAL_SIMULATE_RTOS_REBOOT == 1)
+- const char *argv[] = {"0" , 0};
+- char *const envp[] = { 0 };
+- argv[0] = program_invocation_name;
+-
+- PAL_LOG_INFO("pal_plat_osReboot -> simulated reboot with execve(%s).\r\n", argv[0]);
+-
+- if (-1 == execve(argv[0], (char **)argv , envp))
+- {
+- PAL_LOG_ERR("child process execve failed [%s]\r\n", argv[0]);
+- }
+-#else
+- PAL_LOG_INFO("Rebooting the system\r\n");
+-
+- // Syncronize cached files to persistant storage.
+- sync();
+- // Reboot the device
+- reboot(RB_AUTOBOOT);
+-#endif
++ PAL_LOG_INFO("pal_plat_osReboot.\r\n");
++ system("reboot");
+ }
+
+ /*! Initialize all data structures (semaphores, mutexs, memory pools, message queues) at system initialization.
diff --git a/recipes-connectivity/mbed-edge-core/files/imx8mmevk/target.cmake b/recipes-connectivity/mbed-edge-core/files/imx8mmevk/target.cmake
index d5fd6cb..6f0e7e5 100644
--- a/recipes-connectivity/mbed-edge-core/files/imx8mmevk/target.cmake
+++ b/recipes-connectivity/mbed-edge-core/files/imx8mmevk/target.cmake
@@ -5,14 +5,32 @@ SET (PAL_TARGET_DEVICE "imx8")
SET (PAL_USER_DEFINED_CONFIGURATION "\"${TARGET_CONFIG_ROOT}/sotp_fs_imx8mmevk_yocto.h\"")
SET (BIND_TO_ALL_INTERFACES 0)
-SET (PAL_FS_MOUNT_POINT_PRIMARY "\"/userdata/mbed/mcc_config\"")
-SET (PAL_FS_MOUNT_POINT_SECONDARY "\"/userdata/mbed/mcc_config\"")
SET (PAL_UPDATE_FIRMWARE_DIR "\"/mnt/cache/firmware\"")
SET (ARM_UC_SOCKET_TIMEOUT_MS 300000)
+# When PARSEC_TPM_SE_SUPPORT is enabled, most likely you are using PSA trusted
+# storage rather than default ESFS to save the provisioning data. In that case, these
+# macros are don't care. To control the psa storage file location, please modify the
+# config/psa_storage_user_config.h.
+SET (PAL_FS_MOUNT_POINT_PRIMARY "\"/userdata/mbed/mcc_config\"")
+SET (PAL_FS_MOUNT_POINT_SECONDARY "\"/userdata/mbed/mcc_config\"")
+
if (${FIRMWARE_UPDATE})
- SET (MBED_CLOUD_CLIENT_UPDATE_STORAGE ARM_UCP_LINUX_YOCTO_GENERIC)
+ SET (MBED_CLOUD_CLIENT_UPDATE_STORAGE ARM_UCP_LINUX_YOCTO_GENERIC)
+endif()
+
+if (${FOTA_ENABLE})
+ SET (MBED_CLOUD_CLIENT_MIDDLEWARE curl)
+ SET (PLATFORM_TARGET Yocto_Generic_YoctoLinux_mbedtls)
+endif()
+
+if(${PARSEC_TPM_SE_SUPPORT})
+ SET (MBED_CLOUD_CLIENT_MIDDLEWARE trusted_storage mbedtls parsec_se_driver)
+ SET (PLATFORM_TARGET Yocto_Generic_YoctoLinux_mbedtls)
+ SET (MBED_CLOUD_CLIENT_OS Linux_Yocto_v2.2)
+ SET (MBED_CLOUD_CLIENT_SDK )
+ SET (MBED_CLOUD_CLIENT_TOOLCHAIN )
+ SET (MBED_CLOUD_CLIENT_BUILD_SYS_MIN_VER 2)
+ SET (MBED_CLOUD_CLIENT_NATIVE_SDK False)
endif()
-SET (MBED_CLOUD_CLIENT_MIDDLEWARE curl)
-SET (PLATFORM_TARGET Yocto_Generic_YoctoLinux_mbedtls)
diff --git a/recipes-connectivity/mbed-edge-core/files/mbed_cloud_client_user_config.h b/recipes-connectivity/mbed-edge-core/files/mbed_cloud_client_user_config.h
new file mode 100644
index 0000000..ee3ae80
--- /dev/null
+++ b/recipes-connectivity/mbed-edge-core/files/mbed_cloud_client_user_config.h
@@ -0,0 +1,44 @@
+/*
+ * ----------------------------------------------------------------------------
+ * Copyright 2018-2021 ARM Ltd.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ----------------------------------------------------------------------------
+ */
+
+/*
+ * Minimal configuration for using mbed-cloud-client
+ */
+
+#ifndef MBED_CLOUD_CLIENT_USER_CONFIG_H
+#define MBED_CLOUD_CLIENT_USER_CONFIG_H
+
+#define MBED_CLOUD_CLIENT_SUPPORT_CLOUD
+#define MBED_CLOUD_CLIENT_ENDPOINT_TYPE "MBED_GW"
+#define MBED_CLOUD_CLIENT_TRANSPORT_MODE_TCP
+#define MBED_CLOUD_CLIENT_LIFETIME 1800
+
+#define SN_COAP_MAX_BLOCKWISE_PAYLOAD_SIZE 1024
+#define SN_COAP_DUPLICATION_MAX_MSGS_COUNT 0
+#define SN_COAP_DISABLE_RESENDINGS 1
+
+/* set download buffer size in bytes (min. 1024 bytes) */
+#define MBED_CLOUD_CLIENT_UPDATE_BUFFER (2 * 1024 * 1024)
+
+/* set the TCP KEEPALIVE values */
+#define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL 60
+#define MBED_CLIENT_TCP_KEEPALIVE_TIME 60
+
+#endif /* MBED_CLIENT_USER_CONFIG_H */
diff --git a/recipes-connectivity/mbed-edge-core/files/rpi3/target.cmake b/recipes-connectivity/mbed-edge-core/files/rpi3/target.cmake
index 9ffdb42..783ffa8 100644
--- a/recipes-connectivity/mbed-edge-core/files/rpi3/target.cmake
+++ b/recipes-connectivity/mbed-edge-core/files/rpi3/target.cmake
@@ -5,11 +5,26 @@ SET (PAL_TARGET_DEVICE "Yocto_Generic")
SET (PAL_USER_DEFINED_CONFIGURATION "\"${TARGET_CONFIG_ROOT}/sotp_fs_rpi3_yocto.h\"")
SET (BIND_TO_ALL_INTERFACES 0)
-SET (PAL_FS_MOUNT_POINT_PRIMARY "\"/userdata/mbed/mcc_config\"")
-SET (PAL_FS_MOUNT_POINT_SECONDARY "\"/userdata/mbed/mcc_config\"")
SET (PAL_UPDATE_FIRMWARE_DIR "\"/upgrades\"")
SET (ARM_UC_SOCKET_TIMEOUT_MS 300000)
+# When PARSEC_TPM_SE_SUPPORT is enabled, most likely you are using PSA trusted
+# storage rather than default ESFS to save the provisioning data. In that case, these
+# macros are irrelevant. To control the psa storage file location, please modify the
+# config/psa_storage_user_config.h.
+SET (PAL_FS_MOUNT_POINT_PRIMARY "\"/userdata/mbed/mcc_config\"")
+SET (PAL_FS_MOUNT_POINT_SECONDARY "\"/userdata/mbed/mcc_config\"")
+
if (${FIRMWARE_UPDATE})
SET (MBED_CLOUD_CLIENT_UPDATE_STORAGE ARM_UCP_LINUX_YOCTO_RPI)
endif()
+
+if(${PARSEC_TPM_SE_SUPPORT})
+ SET (MBED_CLOUD_CLIENT_MIDDLEWARE trusted_storage mbedtls parsec_se_driver)
+ SET (PLATFORM_TARGET Yocto_Generic_YoctoLinux_mbedtls)
+ SET (MBED_CLOUD_CLIENT_OS Linux_Yocto_v2.2)
+ SET (MBED_CLOUD_CLIENT_SDK )
+ SET (MBED_CLOUD_CLIENT_TOOLCHAIN )
+ SET (MBED_CLOUD_CLIENT_BUILD_SYS_MIN_VER 2)
+ SET (MBED_CLOUD_CLIENT_NATIVE_SDK False)
+endif() \ No newline at end of file
diff --git a/recipes-connectivity/mbed-edge-core/files/uz/target.cmake b/recipes-connectivity/mbed-edge-core/files/uz/target.cmake
index 6c68a1d..4ed5988 100644
--- a/recipes-connectivity/mbed-edge-core/files/uz/target.cmake
+++ b/recipes-connectivity/mbed-edge-core/files/uz/target.cmake
@@ -5,11 +5,32 @@ SET (PAL_TARGET_DEVICE "uz")
SET (PAL_USER_DEFINED_CONFIGURATION "\"${TARGET_CONFIG_ROOT}/sotp_fs_uz_yocto.h\"")
SET (BIND_TO_ALL_INTERFACES 0)
-SET (PAL_FS_MOUNT_POINT_PRIMARY "\"/userdata/mbed/mcc_config\"")
-SET (PAL_FS_MOUNT_POINT_SECONDARY "\"/userdata/mbed/mcc_config\"")
SET (PAL_UPDATE_FIRMWARE_DIR "\"/mnt/cache/firmware\"")
SET (ARM_UC_SOCKET_TIMEOUT_MS 300000)
+# When PARSEC_TPM_SE_SUPPORT is enabled, most likely you are using PSA trusted
+# storage rather than default ESFS to save the provisioning data. In that case, these
+# macros are irrelevant. To control the psa storage file location, please modify the
+# config/psa_storage_user_config.h.
+SET (PAL_FS_MOUNT_POINT_PRIMARY "\"/userdata/mbed/mcc_config\"")
+SET (PAL_FS_MOUNT_POINT_SECONDARY "\"/userdata/mbed/mcc_config\"")
+
if (${FIRMWARE_UPDATE})
- SET (MBED_CLOUD_CLIENT_UPDATE_STORAGE ARM_UCP_LINUX_YOCTO_GENERIC)
+ SET (MBED_CLOUD_CLIENT_UPDATE_STORAGE ARM_UCP_LINUX_YOCTO_GENERIC)
endif()
+
+if (${FOTA_ENABLE})
+ SET (MBED_CLOUD_CLIENT_MIDDLEWARE curl)
+ SET (PLATFORM_TARGET Yocto_Generic_YoctoLinux_mbedtls)
+endif()
+
+if(${PARSEC_TPM_SE_SUPPORT})
+ SET (MBED_CLOUD_CLIENT_MIDDLEWARE trusted_storage mbedtls parsec_se_driver)
+ SET (PLATFORM_TARGET Yocto_Generic_YoctoLinux_mbedtls)
+ SET (MBED_CLOUD_CLIENT_OS Linux_Yocto_v2.2)
+ SET (MBED_CLOUD_CLIENT_SDK )
+ SET (MBED_CLOUD_CLIENT_TOOLCHAIN )
+ SET (MBED_CLOUD_CLIENT_BUILD_SYS_MIN_VER 2)
+ SET (MBED_CLOUD_CLIENT_NATIVE_SDK False)
+endif()
+
diff --git a/recipes-connectivity/mbed-edge-core/mbed-edge-core-imx8mmevk.bb b/recipes-connectivity/mbed-edge-core/mbed-edge-core-imx8mmevk.bb
index 04b6ac8..60a9bca 100644
--- a/recipes-connectivity/mbed-edge-core/mbed-edge-core-imx8mmevk.bb
+++ b/recipes-connectivity/mbed-edge-core/mbed-edge-core-imx8mmevk.bb
@@ -1,6 +1,6 @@
COMPATIBLE_MACHINE = "imx8mmevk"
-MBED_EDGE_CORE_CONFIG_TRACE_LEVEL ?= "INFO"
+MBED_EDGE_CORE_CONFIG_TRACE_LEVEL ?= "WARN"
MBED_EDGE_CORE_CONFIG_FIRMWARE_UPDATE ?= "ON"
MBED_EDGE_CORE_CONFIG_FOTA_ENABLE ?= "ON"
MBED_EDGE_CORE_CONFIG_FOTA_TRACE ?= "ON"
@@ -8,6 +8,7 @@ MBED_EDGE_CORE_CONFIG_CURL_DYNAMIC_LINK ?= "ON"
MBED_EDGE_CORE_CONFIG_DEVELOPER_MODE ?= "ON"
MBED_EDGE_CORE_CONFIG_FACTORY_MODE ?= "OFF"
MBED_EDGE_CORE_CONFIG_BYOC_MODE ?= "OFF"
+MBED_EDGE_CORE_CONFIG_PARSEC_TPM_SE_SUPPORT ?= "OFF"
require mbed-edge-core.inc
@@ -19,7 +20,9 @@ SRC_URI += "file://target.cmake \
file://sotp_fs_imx8mmevk_yocto.h \
file://deploy_ostree_delta_update.sh \
file://0006-fota-callback.patch \
- file://pal_plat_imx8.c"
+ file://0001-fix_psa_storage_location.patch \
+ file://pal_plat_imx8.c \
+ file://0008-ordered-reboot.patch "
SCRIPT_DIR = "${WORKDIR}/git/lib/mbed-cloud-client/update-client-hub/modules/pal-linux/scripts"
diff --git a/recipes-connectivity/mbed-edge-core/mbed-edge-core-rpi3.bb b/recipes-connectivity/mbed-edge-core/mbed-edge-core-rpi3.bb
index 58ce44d..22b0a41 100644
--- a/recipes-connectivity/mbed-edge-core/mbed-edge-core-rpi3.bb
+++ b/recipes-connectivity/mbed-edge-core/mbed-edge-core-rpi3.bb
@@ -1,6 +1,6 @@
COMPATIBLE_MACHINE = "raspberrypi3"
-MBED_EDGE_CORE_CONFIG_TRACE_LEVEL ?= "INFO"
+MBED_EDGE_CORE_CONFIG_TRACE_LEVEL ?= "WARN"
MBED_EDGE_CORE_CONFIG_FIRMWARE_UPDATE ?= "ON"
MBED_EDGE_CORE_CONFIG_FOTA_ENABLE ?= "OFF"
MBED_EDGE_CORE_CONFIG_FOTA_TRACE ?= "OFF"
@@ -8,6 +8,7 @@ MBED_EDGE_CORE_CONFIG_CURL_DYNAMIC_LINK ?= "OFF"
MBED_EDGE_CORE_CONFIG_DEVELOPER_MODE ?= "ON"
MBED_EDGE_CORE_CONFIG_FACTORY_MODE ?= "OFF"
MBED_EDGE_CORE_CONFIG_BYOC_MODE ?= "OFF"
+MBED_EDGE_CORE_CONFIG_PARSEC_TPM_SE_SUPPORT ?= "OFF"
require mbed-edge-core.inc
diff --git a/recipes-connectivity/mbed-edge-core/mbed-edge-core-uz.bb b/recipes-connectivity/mbed-edge-core/mbed-edge-core-uz.bb
index f81e300..61425dd 100644
--- a/recipes-connectivity/mbed-edge-core/mbed-edge-core-uz.bb
+++ b/recipes-connectivity/mbed-edge-core/mbed-edge-core-uz.bb
@@ -1,6 +1,6 @@
COMPATIBLE_MACHINE = "uz"
-MBED_EDGE_CORE_CONFIG_TRACE_LEVEL ?= "INFO"
+MBED_EDGE_CORE_CONFIG_TRACE_LEVEL ?= "WARN"
MBED_EDGE_CORE_CONFIG_FIRMWARE_UPDATE ?= "ON"
MBED_EDGE_CORE_CONFIG_FOTA_ENABLE ?= "ON"
MBED_EDGE_CORE_CONFIG_FOTA_TRACE ?= "ON"
@@ -8,6 +8,7 @@ MBED_EDGE_CORE_CONFIG_CURL_DYNAMIC_LINK ?= "ON"
MBED_EDGE_CORE_CONFIG_DEVELOPER_MODE ?= "ON"
MBED_EDGE_CORE_CONFIG_FACTORY_MODE ?= "OFF"
MBED_EDGE_CORE_CONFIG_BYOC_MODE ?= "OFF"
+MBED_EDGE_CORE_CONFIG_PARSEC_TPM_SE_SUPPORT ?= "OFF"
require mbed-edge-core.inc
@@ -19,7 +20,9 @@ SRC_URI += "file://target.cmake \
file://sotp_fs_uz_yocto.h \
file://deploy_ostree_delta_update.sh \
file://0006-fota-callback.patch \
- file://pal_plat_uz.c"
+ file://0001-fix_psa_storage_location.patch \
+ file://pal_plat_uz.c \
+ file://0008-ordered-reboot.patch "
SCRIPT_DIR = "${WORKDIR}/git/lib/mbed-cloud-client/update-client-hub/modules/pal-linux/scripts"
diff --git a/recipes-connectivity/mbed-edge-core/mbed-edge-core.inc b/recipes-connectivity/mbed-edge-core/mbed-edge-core.inc
index b9b46a5..521c2c8 100644
--- a/recipes-connectivity/mbed-edge-core/mbed-edge-core.inc
+++ b/recipes-connectivity/mbed-edge-core/mbed-edge-core.inc
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=1dece7821bf3fd70fe1309eaa3
# Patches for quilt goes to files directory
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-SRCREV = "e85f23be84f8f172c98fa8a2666d0d8667ef463f"
+SRCREV = "0.16.1"
RM_WORK_EXCLUDE += "${PN}"
@@ -15,17 +15,21 @@ SRC_URI = "git://github.com/ARMmbed/mbed-edge.git \
file://edge-core.service \
file://edge-core.logrotate \
file://toolchain.cmake \
+ file://mbed_cloud_client_user_config.h \
file://0001-disable-Doxygen.patch \
+ file://0001-parsec-se-driver-should-be-compiled-separately-in-Yo.patch \
file://0002-fix-libevent-build-with-CMake-in-Yocto.patch \
file://0003-fix_libwebsockets_nondebug.manual_patch \
- file://0004-Removed-the-redundant-cmake-command.manual_patch \
file://0005-fota.manual_patch"
+
SRC_URI += "\
${@bb.utils.contains('MBED_EDGE_CORE_CONFIG_DEVELOPER_MODE','ON','file://mbed_cloud_dev_credentials.c','',d)} \
${@bb.utils.contains('MBED_EDGE_CORE_CONFIG_DEVELOPER_MODE','ON','file://update_default_resources.c','',d)} \
"
-DEPENDS = " libcap mosquitto mercurial-native curl"
+DEPENDS = " libcap mosquitto mercurial-native curl python3-native python3-pip-native python3 python3-setuptools-native python3-setuptools-scm"
+DEPENDS += "${@ 'parsec-se-driver' if d.getVar('MBED_EDGE_CORE_CONFIG_PARSEC_TPM_SE_SUPPORT') == 'ON' else ' '}"
+
RDEPENDS_${PN} = " procps bash tar bzip2 rng-tools glibc-utils"
# Installed packages
@@ -44,13 +48,16 @@ FILES_${PN}-dbg += "/wigwag/mbed/debug \
S = "${WORKDIR}/git"
-inherit cmake update-rc.d systemd
+inherit cmake update-rc.d systemd python3native
+
+MBED_EDGE_CMAKE_BUILD_TYPE ?= "Debug"
EXTRA_OECMAKE += " \
- -DCMAKE_BUILD_TYPE=Debug \
+ -DCMAKE_BUILD_TYPE=${MBED_EDGE_CMAKE_BUILD_TYPE} \
-DTARGET_TOOLCHAIN=yocto \
-DMBED_CONF_MBED_TRACE_ENABLE=1 \
-DTARGET_CONFIG_ROOT=${WORKDIR} \
+ -DCLOUD_CLIENT_CONFIG=${WORKDIR}/mbed_cloud_client_user_config.h \
-DTRACE_LEVEL=${MBED_EDGE_CORE_CONFIG_TRACE_LEVEL} \
-DFIRMWARE_UPDATE=${MBED_EDGE_CORE_CONFIG_FIRMWARE_UPDATE} \
-DMBED_CLOUD_CLIENT_CURL_DYNAMIC_LINK=${MBED_EDGE_CORE_CONFIG_CURL_DYNAMIC_LINK} \
@@ -59,6 +66,7 @@ EXTRA_OECMAKE += " \
-DDEVELOPER_MODE=${MBED_EDGE_CORE_CONFIG_DEVELOPER_MODE} \
-DFACTORY_MODE=${MBED_EDGE_CORE_CONFIG_FACTORY_MODE} \
-DBYOC_MODE=${MBED_EDGE_CORE_CONFIG_BYOC_MODE} \
+ -DPARSEC_TPM_SE_SUPPORT=${MBED_EDGE_CORE_CONFIG_PARSEC_TPM_SE_SUPPORT} \
${MBED_EDGE_CUSTOM_CMAKE_ARGUMENTS} \
"
@@ -79,9 +87,25 @@ do_configure_prepend() {
}
# Temp fix for libwebsockets non-debug build
- patch -p1 < ${WORKDIR}/0003-fix_libwebsockets_nondebug.manual_patch
- patch -p1 < ${WORKDIR}/0004-Removed-the-redundant-cmake-command.manual_patch
patch -p1 < ${WORKDIR}/0005-fota.manual_patch
+
+ export HTTP_PROXY=${HTTP_PROXY}
+ export HTTPS_PROXY=${HTTPS_PROXY}
+
+}
+
+do_compile_prepend() {
+
+ if [ "${MBED_EDGE_CORE_CONFIG_PARSEC_TPM_SE_SUPPORT}" = "ON" ]; then
+ if [ "${MBED_EDGE_CMAKE_BUILD_TYPE}" = "Debug" ]; then
+ mkdir -p ${S}/lib/pal-platform/Middleware/parsec_se_driver/parsec_se_driver/target/debug
+ cp ${PKG_CONFIG_SYSROOT_DIR}/usr/lib/libparsec_se_driver.a ${S}/lib/pal-platform/Middleware/parsec_se_driver/parsec_se_driver/target/debug/
+ else
+ mkdir -p ${S}/lib/pal-platform/Middleware/parsec_se_driver/parsec_se_driver/target/release
+ cp ${PKG_CONFIG_SYSROOT_DIR}/usr/lib/libparsec_se_driver.a ${S}/lib/pal-platform/Middleware/parsec_se_driver/parsec_se_driver/target/release/
+ fi
+ fi
+
}
do_install() {
diff --git a/recipes-connectivity/mbed-edge-examples/files/0003-Set-optimization-level-to-0-only-if-FORTIFY_SOURCE-i.patch b/recipes-connectivity/mbed-edge-examples/files/0003-Set-optimization-level-to-0-only-if-FORTIFY_SOURCE-i.patch
new file mode 100644
index 0000000..d349a0d
--- /dev/null
+++ b/recipes-connectivity/mbed-edge-examples/files/0003-Set-optimization-level-to-0-only-if-FORTIFY_SOURCE-i.patch
@@ -0,0 +1,26 @@
+From ee84d9d9c2d1dd778d35fb0054fbdaaf9beb600c Mon Sep 17 00:00:00 2001
+From: Yash Goyal <ygoyal@wigwag.com>
+Date: Mon, 22 Feb 2021 12:29:35 -0800
+Subject: [PATCH] Set optimization level to 0 only if FORTIFY_SOURCE is set to
+ <=0
+
+---
+ cmake/examples_configure.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/examples_configure.cmake b/cmake/examples_configure.cmake
+index 2b88151..0b29a3f 100644
+--- a/cmake/examples_configure.cmake
++++ b/cmake/examples_configure.cmake
+@@ -14,7 +14,7 @@ if (DEFINED EDGE_CLIENT_REQUEST_TIMEOUT_THRESHOLD_MS)
+ endif ()
+ SET (EDGE_CLIENT_REQUEST_TIMEOUT_THRESHOLD_MS 1800000) # Thirty minute
+
+-if (NOT (CMAKE_BUILD_TYPE STREQUAL Release))
++if (NOT (CMAKE_BUILD_TYPE STREQUAL Release) AND (NOT (_FORTIFY_SOURCE GREATER 0)))
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
+ endif ()
+--
+2.17.1
+
diff --git a/recipes-connectivity/mbed-edge-examples/files/0003-fix-CMake-test-Build-Type-Release.patch b/recipes-connectivity/mbed-edge-examples/files/0003-fix-CMake-test-Build-Type-Release.patch
deleted file mode 100644
index 50b5bd9..0000000
--- a/recipes-connectivity/mbed-edge-examples/files/0003-fix-CMake-test-Build-Type-Release.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 83f3e0254f9a61d109420d23544c23f31f5fe765 Mon Sep 17 00:00:00 2001
-From: Yash Goyal <yash.goyal@arm.com>
-Date: Sun, 3 May 2020 02:36:01 -0500
-Subject: [PATCH 3/3] fix CMake test Build Type Release
-
----
- cmake/examples_configure.cmake | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/cmake/examples_configure.cmake b/cmake/examples_configure.cmake
-index 5105e77..5e4d3f9 100644
---- a/cmake/examples_configure.cmake
-+++ b/cmake/examples_configure.cmake
-@@ -14,7 +14,7 @@ if (DEFINED EDGE_CLIENT_REQUEST_TIMEOUT_THRESHOLD_MS)
- endif ()
- SET (EDGE_CLIENT_REQUEST_TIMEOUT_THRESHOLD_MS 60000) # one minute
-
--if (NOT (CMAKE_BUILD_TYPE STREQUAL release))
-+if (NOT (CMAKE_BUILD_TYPE STREQUAL Release))
- SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
- SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
- endif ()
---
-2.24.0
-
diff --git a/recipes-connectivity/mbed-edge-examples/mbed-edge-examples.bb b/recipes-connectivity/mbed-edge-examples/mbed-edge-examples.bb
index b353585..68bb4a9 100644
--- a/recipes-connectivity/mbed-edge-examples/mbed-edge-examples.bb
+++ b/recipes-connectivity/mbed-edge-examples/mbed-edge-examples.bb
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=1dece7821bf3fd70fe1309eaa3
# Patches for quilt goes to files directory
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-SRCREV = "cd505d1486a4a98800adb99c610706feabd60b11"
+SRCREV = "0.16.0"
SRC_URI = "git://github.com/ARMmbed/mbed-edge-examples.git \
file://pt-example \
@@ -14,7 +14,7 @@ SRC_URI = "git://github.com/ARMmbed/mbed-edge-examples.git \
file://blept-devices.json \
file://0001-disable-doxygen.patch \
file://0002-fix-libevent-build-with-CMake-in-Yocto.patch \
- file://0003-fix-CMake-test-Build-Type-Release.patch \
+ file://0003-Set-optimization-level-to-0-only-if-FORTIFY_SOURCE-i.patch \
file://mept-ble.init \
"
diff --git a/recipes-connectivity/parsec-se-driver/parsec-se-driver_0.4.0.bb b/recipes-connectivity/parsec-se-driver/parsec-se-driver_0.4.0.bb
new file mode 100644
index 0000000..474a0bc
--- /dev/null
+++ b/recipes-connectivity/parsec-se-driver/parsec-se-driver_0.4.0.bb
@@ -0,0 +1,37 @@
+inherit cargo
+
+SUMMARY = "Parsec Secure Element Driver"
+HOMEPAGE = "https://github.com/parallaxsecond/parsec-se-driver"
+LICENSE = "Apache-2.0"
+
+SRC_URI = "git://github.com/parallaxsecond/parsec-se-driver.git;protocol=https;branch=main \
+ git://github.com/ARMmbed/mbedtls.git;protocol=https;destsuffix=mbedtls;name=mbedtls"
+
+SRCREV_pn-${PN} = "${PV}"
+SRCREV_mbedtls = "mbedtls-2.22.0"
+
+S = "${WORKDIR}/git"
+S_MBEDTLS = "${WORKDIR}/mbedtls"
+
+LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+BBCLASSEXTEND = "native"
+
+TOOLCHAIN = "clang"
+
+CARGO_DISABLE_BITBAKE_VENDORING = "1"
+CARGO_VENDORING_DIRECTORY="${S}/vendor"
+
+do_configure_append() {
+ cd ${S}
+ cargo vendor
+}
+
+do_compile_prepend() {
+ export MBEDTLS_INCLUDE_DIR="${S_MBEDTLS}/include"
+}
+
+do_install() {
+ install -d "${D}/${libdir}"
+ install -m 755 "${B}/target/${TARGET_SYS}/release/libparsec_se_driver.a" "${D}/${libdir}"
+}