Skip to content

Commit

Permalink
Merge pull request #43 from PelionIoT/dev
Browse files Browse the repository at this point in the history
release 2.3.0 dev-->master merge
  • Loading branch information
Travis McCollum authored Apr 1, 2021
2 parents 87802c4 + 87479a8 commit a3e2e8f
Show file tree
Hide file tree
Showing 19 changed files with 309 additions and 91 deletions.
1 change: 1 addition & 0 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
@@ -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 */

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From af5a526b949e2b0f9c6ccca3b5d0c81762ceec84 Mon Sep 17 00:00:00 2001
From: Yash Goyal <[email protected]>
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

Original file line number Diff line number Diff line change
Expand Up @@ -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)

This file was deleted.

14 changes: 8 additions & 6 deletions recipes-connectivity/mbed-edge-core/files/0005-fota.manual_patch
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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.
28 changes: 23 additions & 5 deletions recipes-connectivity/mbed-edge-core/files/imx8mmevk/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
@@ -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 */
19 changes: 17 additions & 2 deletions recipes-connectivity/mbed-edge-core/files/rpi3/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
27 changes: 24 additions & 3 deletions recipes-connectivity/mbed-edge-core/files/uz/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
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"
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

Expand All @@ -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"

Expand Down
3 changes: 2 additions & 1 deletion recipes-connectivity/mbed-edge-core/mbed-edge-core-rpi3.bb
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
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"
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

Expand Down
7 changes: 5 additions & 2 deletions recipes-connectivity/mbed-edge-core/mbed-edge-core-uz.bb
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
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"
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

Expand All @@ -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"

Expand Down
Loading

0 comments on commit a3e2e8f

Please sign in to comment.