Device Management Client 3.1.0
Features
RAM optimizations for Device Management Client.
PDMC library | PDMC example | Configuration | Flash | Delta | Static RAM | Peak Dynamic RAM | Peak RAM | Delta | Notes |
---|---|---|---|---|---|---|---|---|---|
3.0.0 | 3.0.0 | ESP8266 | 353644 | 0 | 44904 | 52865 | 97769 | 0 | PDMC example 3.0.0 with default ESP8266 profile. |
3.1.0 | 3.1.0 | ESP8266 | 303044 | -50600 | 25952 | 31962 | 57914 | -39855 | PDMC example 3.1.0 with RAM-optimized ESP8266 minimal profile. |
GCC compiler (GCC_ARM
) with the release profile for K64F with ESP8266 module.
Device Management Client example
- Updated to Mbed OS 5.12.1.
- [Linux] Updated Mbed TLS to 2.17.0.
- General optimization on default stack-sizes and TLS configurations for all configurations.
- Dropped the lwIP buffers from 32 KiB to 12 KiB.
- Flash savings from 7 KiB to 20 KiB.
- RAM savings from 7 KiB to 34 KiB.
- Introduced new
configs/wifi_esp8266_minimal.json
which demonstrates the bare minimum needed for full client functionality.- The configuration uses shared event-queue from main thread, instead of using a separate thread for events. This saves 10.5 KiB RAM.
- New application flag
MCC_MINIMAL
disables several features only designed to enhance user experience, and removes other non-critical features. - Disabled Button and LED usage by default.
- Disabled error descriptions.
- Disabled usage of some helper functions like
fcc_verify()
. - Resources generated by the application are disabled on this profile.
- Changed the KVStore and firmware candidate storage to internal flash configuration. This saves 4 KiB RAM and 34 KiB ROM as you don't need to pull in SDDriver or related components.
- Altogether, these optimizations save 43 KiB flash and 31 KiB RAM in respect to the
configs/wifi_esp8266_v4.json
profile. (49 KiB flash and 39 KiB RAM vs. 3.0.0 release version). - Currently, the minimal profile supports only TCP.
- Minimal configuration is optimimal for boards with about 1024 KiB of flash. If you use it with boards with only 512 KiB flash, you need to enable the external storage for a firmware update candidate and KVstore. The following changes would be needed:
- Change the bootloader to the
block_device
variant. - Change the target offsets to match the
block_device
bootloader. - Change the update storage to point to the external storage.
- Change the KVstore configuration to match the external storage configuration.
- See the porting guide for reference.
- Change the bootloader to the
- K66F default configuration now provides the full Client feature. This target enables all the RAM/ROM intensive features by default.
- Enabled certificate enrollment client features.
- Increased the main stack size to reflect higher RAM requirements for features.
- [MbedOS] Stop using
CellularBase()
as it is deprecated in Mbed OS, useCellularInterface()
instead.
Device Management Connect client
- Fixed client state machine for
pause()
handling. Fixes the issues that caused thepause()
call to be ignored while other operations are active. - Implemented network status callback handling for the client library. Now, the client reacts to changes in the network status callbacks to speed up client connection recovery during reconnection.
- Improved internal flagging of the client library to enable further optimizations and modularization of client components.
Platform Adaptation Layer (PAL)
- Improved TLS configuration to optimize RAM usage.
- Improved header include handling within the PAL layer.
- CMake improvements.
- Improved PAL unit tests.
Known issues
- 3.1.0 version of the example application does not initialize correctly when compiled in production flow. This will be fixed in next release. As a workaround, remove the call for fcc_verify_device_configured_4mbed_cloud() in the application code.
- Older versions of Device Management SDK for Python (v2.03 or older) sent PUT payload with content type JSON, which is an unsupported content type for Client. Client version 2.2.1 no longer accepts PUT requests with unsupported data types. We recommend that you update to SDK v2.0.5 or later, which sends the requests with correct content type (text/plain).
Mbed OS
We recommend that you read the Mbed OS release notes for known issues and their latest status.
- In UDP mode, bootstrap fails with smallest SSL fragment length.
- PSA is in preview level and as such not ready for production yet.
- You cannot update the pre-compiled PSA binary through firmware update. You can only update the application itself.
- Cypress PSoC6:
- Issues with storage. Random failures can occur in testing.
- The native Wi-Fi driver is feature-rich and as such it is quite large (400 KB) and with PSA included (220 KB) there is not much space for the OS and application.
- Client has been tested with ESP8266 (due to flash size) without flow control, because flow-control does not work with this board yet. ESP8266 without flow-control will not work reliably.
- NXP LPC55S69:
- The board has only 640 KB flash. PSA takes 192 KB out of it.
- You can use the Client example (with firmware update and bootloader) with
release
profile due to the flash size limitation. - Only ARMC6 is supported for compilation.
- K64F:
- You can use the board in PSA mode (without real HW PSA implementation).
- The configuration file that allows this is placed under
configs-psa
folder in the example. - The PSA mode adds RAM consumption (static +3.5 KB) and flash/ROM consumption (+18.5 KB).
- Arm and partners are optimizing the solution in future releases.
Linux
- Firmware update installation for very large images on Raspberry Pi3B or Pi3B+ may fail with
mmc0 timeout
failure. This is a generic Raspberry Pi3 issue, see RPI issue #2392. - Firmware update from one Linux distribution version to another does not work. For example, firmware update from Yocto distribution Morty to Rocko is not currently possible, as there are Linux version-dependent files (device tree) in the
BOOT
partition. Therefore, you must update within one major version of a distribution. glibc
versions 2.23 and 2.24 have a bug in thread creation. It can cause random crashes with Linux.- If possible, update
glibc
to version 2.25 (or newer). See sourceware issue 20116 for details. - We have implemented a workaround for this issue to decrease its likelihood. This issue may still occur under certain circumstances.
- If possible, update
- The Device Management Client application must run as
root
to have access rights to perform the firmware update.- This is not the most secure way to handle this issue, so a more secure implementation will come later.
- Yocto distribution has only been tested in developer certificate mode.
Device Management Client Third Party IP report
Device Management Client uses some open source third-party IP (TPIP). This table lists the TPIP and sources:
Original | License | Description |
---|---|---|
cn-cbor | MIT | Factory configurator client (FCC) uses cn-cbor : A constrained node implementation of CBOR in C, with slight modifications. The code is at mbed-cloud-client/factory-configurator-client/secsrv-cbor. |
Unity | MIT | Platform Adaptation Layer (PAL) tests use Unity framework from ThrowTheSwitch. The code is at mbed-cloud-client/mbed-client-pal/Test/Unity. |
You also get more TPIP with the Mbed OS release itself, see their LICENSE.md for details.