Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
x85446 committed Dec 15, 2021
2 parents 1a2b5f5 + 381b906 commit b48ce95
Show file tree
Hide file tree
Showing 18 changed files with 153 additions and 97 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ needs to be enabled and the firmware for the bluetooth chip needs to be installe
can be done by adding following lines to the local.conf:

```
DISTRO_FEATURES_append += " bluetooth "
DISTRO_FEATURES_append = " bluetooth "
CORE_IMAGE_EXTRA_INSTALL += " linux-firmware-bcm43430 linux-firmware-bcm43430a1-hcd "
```
Expand Down
2 changes: 1 addition & 1 deletion conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
BBFILE_COLLECTIONS += "meta-mbed-edge"
BBFILE_PATTERN_meta-mbed-edge = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-mbed-edge = "6"
LAYERSERIES_COMPAT_meta-mbed-edge = "dunfell gatesgarth"
LAYERSERIES_COMPAT_meta-mbed-edge = "dunfell gatesgarth hardknott"
LAYERDEPENDS_meta-mbed-edge = "rust-layer clang-layer"
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From cd4690c12e868af9c7734054173569e9c4c58900 Mon Sep 17 00:00:00 2001
From: Kimmo Vaisanen <[email protected]>
Date: Mon, 15 Nov 2021 13:06:47 +0200
Subject: [PATCH] Temporary fix for trace mutex lock issue

tr_array method is only allowed to be called from mbed trace functions (tr_info, tr_debug...).
Otherwise it will leave trace mutex locked.

This is a temporary workaround until this is properly fixed in mbed-client. This workaround
assumes actual trace is done in INFO -level (code uses tr_info and client does not runtime change the level).
---
mbed-client/mbed-client-c/source/sn_nsdl.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/lib/mbed-cloud-client/mbed-client/mbed-client-c/source/sn_nsdl.c b/lib/mbed-cloud-client/mbed-client/mbed-client-c/source/sn_nsdl.c
index c9b5907..950edbc 100755
--- a/lib/mbed-cloud-client/mbed-client/mbed-client-c/source/sn_nsdl.c
+++ b/lib/mbed-cloud-client/mbed-client/mbed-client-c/source/sn_nsdl.c
@@ -2338,6 +2338,7 @@ bool sn_nsdl_remove_resource_attribute(sn_nsdl_static_resource_parameters_s *par

#endif

+#if MBED_TRACE_MAX_LEVEL >= TRACE_LEVEL_INFO
#define WRITE_TAG(buf, buf_size, format, ...) \
{ \
int written = snprintf(buf, buf_size, format, ##__VA_ARGS__); \
@@ -2347,6 +2348,9 @@ bool sn_nsdl_remove_resource_attribute(sn_nsdl_static_resource_parameters_s *par
ret += written; \
} \
}
+#else
+#define WRITE_TAG(buf, buf_size, format, ...) ;
+#endif

void sn_nsdl_print_coap_data(sn_coap_hdr_s *coap_header_ptr, bool outgoing)
{
--
2.25.1
13 changes: 0 additions & 13 deletions recipes-connectivity/mbed-edge-core/files/0006-fota-callback.patch

This file was deleted.

46 changes: 0 additions & 46 deletions recipes-connectivity/mbed-edge-core/files/edge-core.init

This file was deleted.

8 changes: 0 additions & 8 deletions recipes-connectivity/mbed-edge-core/files/edge-core.logrotate

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@
#define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL 60
#define MBED_CLIENT_TCP_KEEPALIVE_TIME 60

#define MBED_CONF_MBED_CLIENT_MAX_RECONNECT_TIMEOUT 600

#endif /* MBED_CLIENT_USER_CONFIG_H */
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ SET (PAL_TARGET_DEVICE "mx8mm")
SET (PAL_USER_DEFINED_CONFIGURATION "\"${TARGET_CONFIG_ROOT}/sotp_fs_mx8mm_yocto.h\"")
SET (BIND_TO_ALL_INTERFACES 0)
SET (PAL_UPDATE_FIRMWARE_DIR "\"/mnt/cache/firmware\"")
SET (ARM_UC_SOCKET_TIMEOUT_MS 300000)

if (${FIRMWARE_UPDATE})
SET (MBED_CLOUD_CLIENT_UPDATE_STORAGE ARM_UCP_LINUX_YOCTO_GENERIC)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ 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_UPDATE_FIRMWARE_DIR "\"/upgrades\"")
SET (ARM_UC_SOCKET_TIMEOUT_MS 300000)

if (${FIRMWARE_UPDATE})
SET (MBED_CLOUD_CLIENT_UPDATE_STORAGE ARM_UCP_LINUX_YOCTO_RPI)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
if (${FOTA_ENABLE})
add_definitions(
-DMBED_CLOUD_CLIENT_FOTA_LINUX_HEADER_FILENAME="/userdata/fota_fw_metadata"
-DMBED_CLOUD_CLIENT_FOTA_LINUX_UPDATE_STORAGE_FILENAME="/userdata/fota_candidate"
-DMBED_CLOUD_CLIENT_FOTA_LINUX_CANDIDATE_FILENAME="/userdata/fota_raw_candidate"
-DMBED_CLOUD_CLIENT_FOTA_LINUX_CONFIG_DIR="/userdata"
-DMBED_CLOUD_CLIENT_FOTA_LINUX_UPDATE_STORAGE_FILENAME="fota_candidate"
-DMBED_CLOUD_CLIENT_FOTA_LINUX_CANDIDATE_FILENAME="fota_raw_candidate"
)

SET (MBED_CLOUD_CLIENT_MIDDLEWARE curl)
Expand Down
1 change: 0 additions & 1 deletion recipes-connectivity/mbed-edge-core/files/uz/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ 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_UPDATE_FIRMWARE_DIR "\"/mnt/cache/firmware\"")
SET (ARM_UC_SOCKET_TIMEOUT_MS 300000)

if (${FIRMWARE_UPDATE})
SET (MBED_CLOUD_CLIENT_UPDATE_STORAGE ARM_UCP_LINUX_YOCTO_GENERIC)
Expand Down
3 changes: 0 additions & 3 deletions recipes-connectivity/mbed-edge-core/mbed-edge-core-mx8mm.bb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ SRC_URI += "file://target.cmake \
file://target-default.cmake \
file://sotp_fs_mx8mm_yocto.h \
file://deploy_ostree_delta_update.sh \
file://0006-fota-callback.patch \
file://0001-fix_psa_storage_location.patch \
file://pal_plat_mx8mm.c \
file://0008-ordered-reboot.patch "

SCRIPT_DIR = "${WORKDIR}/git/lib/mbed-cloud-client/update-client-hub/modules/pal-linux/scripts"

do_configure_prepend() {
mkdir -p ${S}/lib/mbed-cloud-client/mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Linux/Board_Specific/TARGET_mx8mm
cp ${WORKDIR}/pal_plat_mx8mm.c ${S}/lib/mbed-cloud-client/mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Linux/Board_Specific/TARGET_mx8mm/
Expand Down
1 change: 0 additions & 1 deletion recipes-connectivity/mbed-edge-core/mbed-edge-core-rpi3.bb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ SRC_URI += "file://target.cmake \
file://target-default.cmake \
file://sotp_fs_rpi3_yocto.h \
file://deploy_ostree_delta_update.sh \
file://0006-fota-callback.patch \
file://0001-fix_psa_storage_location.patch \
file://pal_plat_rpi3.c \
file://0008-ordered-reboot.patch "
Expand Down
4 changes: 1 addition & 3 deletions recipes-connectivity/mbed-edge-core/mbed-edge-core-uz.bb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ 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_FOTA_COMBINED_IMAGE_SUPPORT ?= "ON"
MBED_EDGE_CORE_CONFIG_CURL_DYNAMIC_LINK ?= "ON"
MBED_EDGE_CORE_CONFIG_DEVELOPER_MODE ?= "ON"
MBED_EDGE_CORE_CONFIG_FACTORY_MODE ?= "OFF"
Expand All @@ -20,13 +21,10 @@ SRC_URI += "file://target.cmake \
file://target-default.cmake \
file://sotp_fs_uz_yocto.h \
file://deploy_ostree_delta_update.sh \
file://0006-fota-callback.patch \
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"

do_configure_prepend() {
mkdir -p ${S}/lib/mbed-cloud-client/mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Linux/Board_Specific/TARGET_uz
cp ${WORKDIR}/pal_plat_uz.c ${S}/lib/mbed-cloud-client/mbed-client-pal/Source/Port/Reference-Impl/OS_Specific/Linux/Board_Specific/TARGET_uz/
Expand Down
20 changes: 9 additions & 11 deletions recipes-connectivity/mbed-edge-core/mbed-edge-core.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=1dece7821bf3fd70fe1309eaa3
# Patches for quilt goes to files directory
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRCREV = "0.18.0"
SRCREV = "0.19.1"

RM_WORK_EXCLUDE += "${PN}"

SRC_URI = "gitsm://github.com/PelionIoT/mbed-edge.git \
file://edge-core.init \
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://0001-Temporary-fix-for-trace-mutex-lock-issue.patch \
"

SRC_URI += "\
Expand Down Expand Up @@ -65,6 +64,11 @@ EXTRA_OECMAKE += " \
-DMBED_CLOUD_CLIENT_CURL_DYNAMIC_LINK=${MBED_EDGE_CORE_CONFIG_CURL_DYNAMIC_LINK} \
-DFOTA_ENABLE=${MBED_EDGE_CORE_CONFIG_FOTA_ENABLE} \
-DFOTA_TRACE=${MBED_EDGE_CORE_CONFIG_FOTA_TRACE} \
-DFOTA_COMBINED_IMAGE_SUPPORT=${MBED_EDGE_CORE_CONFIG_FOTA_COMBINED_IMAGE_SUPPORT} \
-DFOTA_SCRIPT_DIR=\"/wigwag/mbed\" \
-DFOTA_INSTALL_MAIN_SCRIPT=\"deploy_ostree_delta_update.sh\" \
-DBOOT_CAPSULE_UPDATE_DIR=\"/boot/efi/EFI/UpdateCapsule\" \
-DBOOT_CAPSULE_UPDATE_FILENAME=\"u-boot-caps.bin\" \
-DDEVELOPER_MODE=${MBED_EDGE_CORE_CONFIG_DEVELOPER_MODE} \
-DFACTORY_MODE=${MBED_EDGE_CORE_CONFIG_FACTORY_MODE} \
-DBYOC_MODE=${MBED_EDGE_CORE_CONFIG_BYOC_MODE} \
Expand All @@ -80,7 +84,7 @@ SYSTEMD_SERVICE_${PN} = "edge-core.service"

do_configure_prepend() {
cd ${S}

[ -f "${WORKDIR}/mbed_cloud_dev_credentials.c" ] && {
mv "${WORKDIR}/mbed_cloud_dev_credentials.c" config/
}
Expand All @@ -90,6 +94,7 @@ do_configure_prepend() {

export HTTP_PROXY=${HTTP_PROXY}
export HTTPS_PROXY=${HTTPS_PROXY}
cd ${B}

}

Expand All @@ -104,12 +109,9 @@ do_compile_prepend() {
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() {
install -d "${D}/etc/init.d/"
install -m 755 "${WORKDIR}/edge-core.init" "${D}/etc/init.d/${INITSCRIPT_NAME}"

install -d "${D}${systemd_system_unitdir}"

Expand All @@ -124,10 +126,6 @@ do_install() {
install -d "${D}/wigwag/mbed"
install "${WORKDIR}/build/bin/edge-core" "${D}/wigwag/mbed"

install -d "${D}${sysconfdir}/logrotate.d/"
install -m 644 "${WORKDIR}/edge-core.logrotate" "${D}${sysconfdir}/logrotate.d"


install -d "${D}/etc/tmpfiles.d"
echo "d /var/rootdirs/userdata 0755 root root -" >> "${D}/etc/tmpfiles.d/userdata-tmpfiles.conf"
ln -sf "/var/rootdirs/userdata" "${D}/userdata"
Expand Down
4 changes: 2 additions & 2 deletions recipes-connectivity/mbed-edge-examples/mbed-edge-examples.bb
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ EXTRA_OECMAKE += " \
-DTARGET_TOOLCHAIN=yocto \
-DCMAKE_BUILD_TYPE=Release \
${MBED_EDGE_CUSTOM_CMAKE_ARGUMENTS} "
inherit cmake
inherit cmake update-rc.d

inherit update-rc.d
INITSCRIPT_NAME = "mept-ble"
INITSCRIPT_PARAMS = "defaults 86 15"

do_configure_prepend() {
cd ${S}
git submodule update --init --recursive
cd ${B}
}

do_install() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ LICENSE = "Apache-2.0"

inherit cargo
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"
git://github.com/ARMmbed/mbedtls.git;protocol=https;destsuffix=mbedtls;name=mbedtls;branch=development_2.x"

SRCREV_pn-${PN} = "${PV}"
SRCREV_mbedtls = "mbedtls-2.25.0"
SRCREV_mbedtls = "mbedtls-2.27.0"

S = "${WORKDIR}/git"
S_MBEDTLS = "${WORKDIR}/mbedtls"
Expand Down
Loading

0 comments on commit b48ce95

Please sign in to comment.