Skip to content

Commit

Permalink
Merge pull request #9 from PelionIoT/release-1.4.0-lite
Browse files Browse the repository at this point in the history
pelion-client-lite-example 1.4.0-lite
  • Loading branch information
Risto Huhtala committed Sep 21, 2021
2 parents 9610795 + c59a7a5 commit 30544a2
Show file tree
Hide file tree
Showing 40 changed files with 1,904 additions and 1,675 deletions.
1 change: 1 addition & 0 deletions .mbedignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
source/platform/linux/*
__x86_x64_NativeLinux_mbedtls/*
__*/*
lwm2m-resource/*
venv/*
delta-tool/*
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog for Pelion Device Management Client Lite Reference Example

### Release 1.4.0-lite (21.09.2021)

* Fixed bug where application assumed that event_id and event_type are both 0 when event handler is initialized. Now uses `PDMC_CONNECT_STARTUP_EVENT_TYPE -1 ` from client's LWM2M interface when creating own event handler.
* [Mbed OS] Updated ISM43362 WiFi driver to #3813a4b with fixes for logging and UDP socket handling.
* Bootloader changes:
1. Changed the bootloader library name from `tools.lib` to `prebuilt-bl.lib`.
1. The new bootloader library contains a bootloader binary image and an `mbed_lib.json` file for each target in the `prebuilt-bl/TARGET_target_name/TARGET_BL_INTERNAL_FLASH` directory. The `mbed_lib.json` file defines common configurations for the bootloader and the application, including the bootloader flash bank size; the storage type, address and size; firmware-over-the-air (FOTA) storage configurations; `header_format` and `restricted_size`.
1. Added the `target.bootloader_img` parameter to the `mbed_lib.json` file of the bootloader. This parameter defines the path to the bootloader image.
1. Set the storage configuration to `null` in the `mbed_app.json` file to ignore the default storage configuration. As a result, the build system uses the configuration defined by the `mbed_lib.json` file of the bootloader.
* [Mbed OS] Updated to 6.12.0:
1. minimal-printf is now enabled by default. It can be disabled by adding `"target.printf_lib": "std"` to the application configuration. For example, using `float` type LWM2M resources would require disabling minimal-printf.

### Release 1.3.0-lite (07.12.2020)

- Changed how the example application behaves when network connect fails. Now the application retries to connect after a timeout.
Expand Down
2 changes: 1 addition & 1 deletion TESTS/pelion-e2e-python-test-library.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/PelionIoT/pelion-e2e-python-test-library/#39e118e03dc89f1800922f3a91d219b25c45cb1a
https://github.com/PelionIoT/pelion-e2e-python-test-library/#b1254f39b5d4fe4a5805642f109bd6d6f27adaaa
2 changes: 1 addition & 1 deletion drivers/COMPONENT_WIFI_ISM43362.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/ARMmbed/wifi-ism43362/#1978369b2310ea3955715b67869b717fd224a74c
https://github.com/ARMmbed/wifi-ism43362/#09a71bf84fec10704ed2dcecf38f97cb2c95c2b9
10 changes: 3 additions & 7 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,9 @@ int main(void)
printf("Application ready\n" );

(void) init_platform();
int timeout_ms = 1000;
while (!init_connection(-1)){
// wait timeout is always doubled
printf("Network connect failed. Try again after %d milliseconds.\n",timeout_ms);
do_wait(timeout_ms);
timeout_ms *= 2;
}

// init connection might take some time and it might reboot if retry logic fails
init_connection();

// Print some statistics of the object sizes and heap memory consumption
// if the MBED_HEAP_STATS_ENABLED is defined.
Expand Down
2 changes: 1 addition & 1 deletion mbed-cloud-client.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/PelionIoT/pelion-client-lite/#48aeeeeb5bdcb872c3f8ec4988c82fea1d898c8e
https://github.com/PelionIoT/pelion-client-lite/#2f4f38c89cb103e9133dbf7cd7f9d2298f1d789b
2 changes: 1 addition & 1 deletion mbed-os.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/ARMmbed/mbed-os/#b6370b4c37f3d4665ed1cdcb1afea85396bba1b3
https://github.com/ARMmbed/mbed-os/#cecc47b4a53951527dd3f670465c8566396ad101
29 changes: 9 additions & 20 deletions mbed_app.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"macros": [
"MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\"",
"MBED_CLOUD_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\"",
"MBED_BOOTLOADER_FLASH_BANK_SIZE=MBED_ROM_SIZE/2"
"MBED_CLOUD_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\""
],
"requires": ["SecureStore",
"mbed-bootloader-NRF52840_DK-TARGET_BL_INTERNAL_FLASH",
"filesystemstore",
"filesystem",
"littlefs",
Expand All @@ -21,13 +21,14 @@
"storage",
"storage_tdb_internal",
"system-storage",
"bootloader",
"minimal-printf",
"mbed-client-randlib",
"device_key",
"mbed-protocol-manager",
"mbed-coap",
"nanostack-eventloop",
"nanostack-interface",
"mbed-mesh-api",
"bare-metal",
"rtos-api",
"mbed-cloud-client",
Expand All @@ -49,22 +50,14 @@
"mbed-crypto",
"psa",
"nordic",
"delta-tool",
"esp8266",
"fat_chan"],
"target_overrides": {
"*": {
"target.features_add" : ["BOOTLOADER"],
"target.extra_labels_add" : ["BL_INTERNAL_FLASH"],
"target.macros_add" : ["DISABLE_ERROR_DESCRIPTION=1",
"MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP_QUEUE",
"MBED_CLOUD_CLIENT_LIFETIME=600"],
"target.header_format": [
["magic", "const", "32le", "0x5c0253a3"],
["firmwareSize", "size", "32le", ["application"]],
["firmwareVersion", "const", "64le", "0x0"],
["firmwareDigest", "digest", "SHA256", "application"],
["precursorDigest", "digest", "SHA256", "application"]
],
"platform.stdio-baud-rate" : 115200,
"platform.stdio-convert-newlines" : true,
"platform.stdio-buffered-serial" : false,
Expand All @@ -86,12 +79,14 @@
"fota.app-default-cb-no-print" : false,
"nsapi.dns-cache-size" : 0,
"fota.num-components" : 2,
"storage.storage_type" : null,
"storage_tdb_internal.internal_base_address": null,
"storage_tdb_internal.internal_size" : null,
"mbed-cloud-client.storage-reset-dev-credentials": false,
"nsapi.default-cellular-apn" : "\"internet\""
},
"NRF52840_DK": {
"target.network-default-interface-type" : "CELLULAR",
"target.bootloader_img" : "tools/mbed-bootloader-nrf52840_dk-internal_flash_27872bf.hex",
"target.OUTPUT_EXT" : "hex",
"target.components_add" : ["FLASHIAP"],
"target.components_remove" : ["QSPIF"],
Expand All @@ -114,13 +109,7 @@
"QUECTEL_BG96.cts" : "p35",
"QUECTEL_BG96.rts" : "p36",
"QUECTEL_BG96.pwr" : "P1_6",
"QUECTEL_BG96.rst" : "P1_5",
"storage.storage_type" : "TDB_INTERNAL",
"storage_tdb_internal.internal_size" : "(32*1024)",
"storage_tdb_internal.internal_base_address": "(MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE)",
"fota.block-device-type" : "FOTA_INTERNAL_FLASH_BD",
"fota.storage-start-address" : "MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE + MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE",
"fota.storage-size" : "MBED_BOOTLOADER_FLASH_BANK_SIZE - MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE"
"QUECTEL_BG96.rst" : "P1_5"
}
},
"config": {
Expand Down
27 changes: 7 additions & 20 deletions mbed_app_baremetal_tls.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"macros": [
"MBEDTLS_USER_CONFIG_FILE=\"mbed-cloud-client/tools/baremetal_mbedtls_config.h\"",
"MBED_CLOUD_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\"",
"MBED_BOOTLOADER_FLASH_BANK_SIZE=MBED_ROM_SIZE/2"
"MBED_CLOUD_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\""
],
"requires": ["SecureStore",
"mbed-bootloader-K64F-TARGET_BL_INTERNAL_FLASH",
"filesystemstore",
"filesystem",
"littlefs",
Expand All @@ -21,7 +21,6 @@
"storage",
"storage_tdb_internal",
"system-storage",
"bootloader",
"minimal-printf",
"mbed-client-randlib",
"device_key",
Expand Down Expand Up @@ -49,23 +48,15 @@
"mbed-crypto",
"psa",
"nordic",
"delta-tool",
"esp8266",
"fat_chan"],
"target_overrides": {
"*": {
"target.features_add" : ["BOOTLOADER"],
"target.extra_labels_add" : ["BL_INTERNAL_FLASH"],
"target.macros_add" : ["DISABLE_ERROR_DESCRIPTION=1",
"MBED_CLOUD_CLIENT_TRANSPORT_MODE_UDP_QUEUE",
"MBED_CLOUD_CLIENT_LIFETIME=600",
"PROTOMAN_USE_SSL_SESSION_RESUME=0"],
"target.header_format": [
["magic", "const", "32le", "0x5c0253a3"],
["firmwareSize", "size", "32le", ["application"]],
["firmwareVersion", "const", "64le", "0x0"],
["firmwareDigest", "digest", "SHA256", "application"],
["precursorDigest", "digest", "SHA256", "application"]
],
"platform.stdio-baud-rate" : 115200,
"platform.stdio-convert-newlines" : true,
"platform.stdio-buffered-serial" : false,
Expand All @@ -91,13 +82,15 @@
"fota.app-default-cb-no-print" : false,
"nsapi.dns-cache-size" : 0,
"fota.num-components" : 2,
"storage.storage_type" : null,
"storage_tdb_internal.internal_base_address": null,
"storage_tdb_internal.internal_size" : null,
"nsapi.default-wifi-security" : "WPA_WPA2",
"nsapi.default-wifi-ssid" : "\"SSID\"",
"nsapi.default-wifi-password" : "\"Password\""
},
"K64F": {
"target.network-default-interface-type" : "WIFI",
"target.bootloader_img" : "tools/mbed-bootloader-k64f-internal_flash_27872bf.bin",
"target.macros_remove" : ["MBEDTLS_CONFIG_HW_SUPPORT"],
"target.components_add" : ["FLASHIAP"],
"target.components_remove" : ["SD"],
Expand All @@ -106,18 +99,12 @@
"target.header_offset" : "0x8000",
"target.app_offset" : "0x8200",
"target.restrict_size" : "0x77E00",
"storage.storage_type" : "TDB_INTERNAL",
"storage_tdb_internal.internal_size" : "(32*1024)",
"storage_tdb_internal.internal_base_address": "(MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE)",
"esp8266.rx" : "PTC3",
"esp8266.tx" : "PTC4",
"esp8266.rst" : "D8",
"esp8266.rts" : "PTC1",
"esp8266.cts" : "PTC2",
"esp8266.provide-default" : true,
"fota.block-device-type" : "FOTA_INTERNAL_FLASH_BD",
"fota.storage-start-address" : "MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE + MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE",
"fota.storage-size" : "MBED_BOOTLOADER_FLASH_BANK_SIZE - MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE"
"esp8266.provide-default" : true
}
},
"config": {
Expand Down
47 changes: 7 additions & 40 deletions mbed_app_rtos.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
{
"macros": [
"MBEDTLS_USER_CONFIG_FILE=\"mbedtls_mbed_client_config.h\"",
"MBED_CLOUD_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\"",
"MBED_BOOTLOADER_FLASH_BANK_SIZE=MBED_ROM_SIZE/2"
"MBED_CLOUD_CLIENT_USER_CONFIG_FILE=\"mbed_cloud_client_user_config.h\""
],
"target_overrides": {
"*": {
"target.features_add" : ["BOOTLOADER"],
"target.macros_add" : ["DISABLE_ERROR_DESCRIPTION=1"],
"target.header_format": [
["magic", "const", "32le", "0x5c0253a3"],
["firmwareSize", "size", "32le", ["application"]],
["firmwareVersion", "const", "64le", "0x0"],
["firmwareDigest", "digest", "SHA256", "application"],
["precursorDigest", "digest", "SHA256", "application"]
],
"target.extra_labels_add" : ["BL_INTERNAL_FLASH"],
"platform.stdio-baud-rate" : 115200,
"platform.stdio-convert-newlines" : true,
"platform.stdio-buffered-serial" : false,
Expand All @@ -35,6 +27,9 @@
"mbed-client.event-loop-size" : 512,
"fota.app-default-cb-no-print" : false,
"fota.num-components" : 2,
"storage.storage_type" : null,
"storage_tdb_internal.internal_base_address": null,
"storage_tdb_internal.internal_size" : null,
"nsapi.dns-cache-size" : 0,
"nsapi.default-cellular-apn" : "\"internet\"",
"nsapi.default-wifi-security" : "WPA_WPA2",
Expand All @@ -43,25 +38,17 @@
},
"DISCO_L475VG_IOT01A": {
"target.network-default-interface-type" : "WIFI",
"target.bootloader_img" : "tools/mbed-bootloader-disco-l475svg-internal_flash_27872bf.bin",
"target.header_offset" : "0x8000",
"target.app_offset" : "0x8200",
"target.restrict_size" : "0x77E00",
"target.components_add" : ["WIFI_ISM43362"],
"target.components_remove" : ["QSPIF"],
"storage_tdb_internal.internal_size" : "(32*1024)",
"storage_tdb_internal.internal_base_address": "(MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE)",
"storage.storage_type" : "TDB_INTERNAL",
"ism43362.read-thread-stack-size" : 1024,
"ism43362.read-thread-stack-size" : 2048,
"ism43362.provide-default" : true,
"mbed-client.sn-coap-max-blockwise-payload-size" : 512,
"fota.block-device-type" : "FOTA_INTERNAL_FLASH_BD",
"fota.storage-start-address" : "MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE + MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE",
"fota.storage-size" : "MBED_BOOTLOADER_FLASH_BANK_SIZE - MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE"
"mbed-client.sn-coap-max-blockwise-payload-size" : 512
},
"DISCO_L475VG_IOT01A_CELLULAR_ALTAIR": {
"target.network-default-interface-type" : "CELLULAR",
"target.bootloader_img" : "tools/mbed-bootloader-disco-l475svg-internal_flash_27872bf.bin",
"target.header_offset" : "0x8000",
"target.app_offset" : "0x8200",
"target.restrict_size" : "0x77E00",
Expand Down Expand Up @@ -91,27 +78,7 @@
"nsapi.default-cellular-plmn" : null,
"nsapi.default-cellular-username" : null,
"nsapi.default-cellular-password" : null,
"storage_tdb_internal.internal_size" : "(32*1024)",
"storage_tdb_internal.internal_base_address": "(MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE)",
"storage.storage_type" : "TDB_INTERNAL",
"fota.block-device-type" : "FOTA_INTERNAL_FLASH_BD",
"fota.storage-start-address" : "MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE + MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE",
"fota.storage-size" : "MBED_BOOTLOADER_FLASH_BANK_SIZE - MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE",
"ppp.thread-stacksize" : 1024
},
"K64F": {
"target.network-default-interface-type" : "ETHERNET",
"target.bootloader_img" : "tools/mbed-bootloader-k64f-internal_flash_27872bf.bin",
"target.restrict_size" : "0x77E00",
"target.header_offset" : "0x8000",
"target.app_offset" : "0x8200",
"target.components_remove" : ["SD"],
"storage.storage_type" : "TDB_INTERNAL",
"storage_tdb_internal.internal_size" : "(32*1024)",
"storage_tdb_internal.internal_base_address": "(MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE)",
"fota.block-device-type" : "FOTA_INTERNAL_FLASH_BD",
"fota.storage-start-address" : "MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE + MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE",
"fota.storage-size" : "MBED_BOOTLOADER_FLASH_BANK_SIZE - MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE"
}
},
"config": {
Expand Down
6 changes: 6 additions & 0 deletions mbedtls_mbed_client_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@

#undef MBEDTLS_FS_IO

// Need MBEDTLS_SSL_CONTEXT_SERIALIZATION and MBEDTLS_SSL_DTLS_CONNECTION_ID for CID feature
// This requires Mbed TLS 2.18.0 or later.
#define MBEDTLS_SSL_CONTEXT_SERIALIZATION
#define MBEDTLS_SSL_DTLS_CONNECTION_ID


#include "mbedtls/check_config.h"

#endif /* MBEDTLS_USER_CONFIG_H */
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "mbed-bootloader-DISCO_F769NI-TARGET_BL_INTERNAL_FLASH",
"target_overrides": {
"*": {
"target.macros_add": [
"MBED_BOOTLOADER_FLASH_BANK_SIZE=MBED_ROM_SIZE/2",
"MBED_CONF_STORAGE_STORAGE_TYPE=TDB_INTERNAL",
"MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS=(MBED_ROM_START + MBED_BOOTLOADER_FLASH_BANK_SIZE)",
"MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE=(2*16*1024)",
"MBED_CLOUD_CLIENT_FOTA_BLOCK_DEVICE_TYPE=FOTA_INTERNAL_FLASH_MBED_OS_BD",
"MBED_CLOUD_CLIENT_FOTA_STORAGE_START_ADDR=(MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS + MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE)",
"MBED_CLOUD_CLIENT_FOTA_STORAGE_SIZE=(MBED_BOOTLOADER_FLASH_BANK_SIZE - MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE)"

],
"target.bootloader_img": "mbed-bootloader-6121dde.bin",
"target.header_offset" : "0x8000",
"target.app_offset" : "0x8200",
"target.restrict_size" : "0xF7E00",
"target.header_format": [
["magic", "const", "32le", "0x5c0253a3"],
["firmwareSize", "size", "32le", ["application"]],
["firmwareVersion", "const", "64le", "0x0"],
["firmwareDigest", "digest", "SHA256", "application"],
["precursorDigest", "digest", "SHA256", "application"]
]
}
}
}

Binary file not shown.
Loading

0 comments on commit 30544a2

Please sign in to comment.