Skip to content

mbed-os-5.13.0

Compare
Choose a tag to compare
@adbridge adbridge released this 27 Jun 15:20
· 9740 commits to master since this release
7482462

We are pleased to announce the Mbed OS 5.13.0 release is now available.

Summary

As IoT devices proliferate, our focus is shifting toward optimizing Arm Mbed OS to best address the use cases our customers face. In 5.13, we have reduced the number of new features we’re delivering and have instead concentrated on specific optimizations of existing features that benefit our customers.

Migration guide

This section lists specific changes that are part of this release and may need special attention.

Nanostack release for Mbed OS 5.13

10624

This release contains updates for the Mesh protocols:

  • Stability improvements and bug fixes to Wi-SUN and Thread protocol.
  • EAPOL (certificate-based network authentication) enabled to Wi-SUN mesh protocol.

Notes about Mesh stack maturity:

  • This version of Wi-SUN stack is interoperable only with itself (development work still ongoing).
  • Wi-SUN protocol is tested using functional protocol testing suites.
  • Wi-SUN nonfunctional testing is performed using 40 devices connected to single Wi-SUN network.
  • Thread stack is verified using protocol testing suite that includes certification test suite.

DataFlash: Change erase size to pages to reduce memory use

10478

Previously the DataFlash driver exposed the minimum erase size as blocks, which are typically 4 K. DataFlash, however, supports page erases as small as 256 B.

This change implements page erases, which lower RAM requirements for buffers.

Because this has no relation to any file system and lowers the minimum erase size, it should not cause issues with devices with existing data stored on them. However, a future format of FATFS may end up with smaller sectors by default, which would further reduce RAM requirements.

Enterprise_mode + wifi_configuraiton_api: update ODIN drivers to v3.7.0 RC1

10454

A private API is provided for ODIN_W2 target against enterprise mode.

nsapi_error_t connect(
const char          *ssid,
const char          *pass,
nsapi_security_t  security,
auth_cert_s         *cert_handle,
const char          *username = NULL,
const char          *user_pswd = NULL,
uint8_t               channel = 0);

The application is required to pass a certificate (CA cert or client cert) and key (private key) in PEM format. You are required to pass those certificates through cert_handle auth_cert_s. An appropriate security should be selected: either NSAPI_SECURITY_EAP_TLS or NSAPI_SECURITY_PEAP.

For example:

static auth_cert_s   certificates;
_wifi = new OdinWiFiInterface(true);
#ifdef EAP_TLS_TESTING
certificates.client_cert = &cert_data[0];
certificates.client_prvt_key = &cert_data_key[0];
certificates.ca_cert = NULL;
#elif defined(PEAP_TESTING)
certificates.client_cert = NULL;
certificates.client_prvt_key = NULL;
certificates.ca_cert = &ca_cert_data[0];
#endif
_wifi->connect(ssid, pass, security, &certificates, _peap_username, _peap_user_pass, channel);

Configuration API

virtual unsigned int get_config(void *setting);
virtual void set_config(void *setting, cb_uint32 value);

A description of parameters is available in https://github.com/u-blox/mbed-os/blob/0dda8c447c644cb8ee5063099ad09226a6caf746/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/cb_wlan_driver_config.h

Cellular: Make AT_CellularContext::get_context() virtual

10442

Makes AT_CellularContext::get_context() virtual - overwrite-able by the individual cell module driver authors (similar to what is available for other AT_CellularContext functions, like do_connect()).

Set compilers to C++14 and C11

10427

GCC and Arm toolchain profiles now select C++14 and C11, matching IAR, and these are the tested profiles. The code base in this release should still work if profiles are set to C++98 and C99, though this is no longer tested.

Migration notes

As the default profiles now select C++14 and C11 for GCC and Arm toolchains, some applications may fail to compile because they use constructs that were valid in C++98 but are not in C++14.

IAR 8 has always operated in C++14/C11 mode, so there are no new changes for IAR users who switched to IAR 8 for Mbed OS 5.12, but these notes apply to users migrating from older Mbed OS versions that used IAR 7.

Common compatibility issues
  • A space is required when a macro follows a string literal, for example in C99-style printf formats:

    uint32_t val;
    printf("val = %"PRIu32, val); // Not valid in C++11
    printf("val = %" PRIu32, val); // OK

    Without the space, C++11 interprets it as being a request for a user-defined "PRIu32-type" string literal.

  • Initializer lists cannot have implicit narrowing conversions:

    uint32_t x;
    uint8_t array1[] = { x }; // Not valid in C++11
    uint8_t array2[] = { 0xffff }; // Not valid in C++11
    uint8_t array3[] = { x & 0xff }; // Not valid in C++11
    uint8_t array4[] = { (uint8_t) x }; // OK
    uint8_t array5[] = { static_cast<uint8_t>(x) }; // OK
    uint8_t array6[] = { 0xffff & 0xff }; // OK (because it's a compile-time constant that fits)

    These changes should be easy to make to existing code bases. You can find a guide to other possible breakages in C++11 at https://stackoverflow.com/questions/6399615/what-breaking-changes-are-introduced-in-c11. C++14 and C11 can cause a few extra issues.

Future compatibility issues

The register keyword is deprecated in C++14 and is removed in C++17. Some compilers issue warnings for register use in C++14, but this has been temporarily suppressed due to the prevalence of the keyword in target code. C++ code should be updated to remove the keyword as soon as possible: The warning will be reactivated after Mbed OS itself no longer triggers it.

Fallback

Mbed OS 5.13 releases should still work if compiled as C++98/C99, though this is not tested. If you have serious application compatibility issues, you should be able to switch the build profile back to the earlier language version as a temporary measure. This is likely to no longer be the case for Mbed OS 5.14.

Arm Compiler 5

Arm Compiler 5 has limited C++11 support and no C++14 or C11 support, and Arm Compiler 5 is no longer tested or officially supported. Nevertheless, Arm Compiler 5 builds have deliberately not been broken; the Arm Compiler 5 build profiles select its C++11 mode in an attempt to match the other toolchains as much as possible, but the limited support may itself cause issues. Attempts to check __cplusplus >= 201103 may activate code Arm Compiler 5 cannot actually compile. Like the other toolchains, the profile can be switched back to C++98 if necessary for now.

Continued Arm Compiler 5 support will limit the adoption of C++11 and C++14 features in the Mbed OS code base, so it is possible Arm Compiler 5 builds may stop working in an upcoming release.

Nanostack: translate errors from sendmsg

10410

Nanostack send calls return more accurate information in case of errors.

Update CMSIS to 5.5.1

10366

CMSIS updated from 5.4.0 to 5.5.1.

KVStore: Support external storage out of mbed-os tree

10355

Support external storage out of mbed-os tree in KVStore. To enable it, you need to:

  1. Configure KVStore configuration parameter blockdevice to other.

  2. Override get_other_blockdevice() to provide block device out of mbed-os tree.

    BlockDevice *get_other_blockdevice();

Update to LWIP 2.1.2

10353

The latest LWIP 2.1.2 released is now integrated with Mbed OS. The new LWIP release has improvements in following areas:

-IP4 routing.
-IP6 scopes and zones.
-DHCP6.
-ND6.
-TCP.
-Sockets.
-Binding network interfaces to sockets.

The LWIP changelog contains detailed changes

Mbed OS dedicated patches were applied to the new LWIP version.

Multihoming was refactored due to the new socket-interface bind implementation.

Add option to disable default UART console

10328

A new configuration option, target.console-uart, allows default serial console functionality to be deactivated, either because the target has serial but no console, or to save power/memory by not using the console.

Remove FEATURE_STORAGE and all underlying deprecated features

10258

Remove FEATURE_STORAGE and all underlying deprecated features: cfstore, flash-journal and storage-volume-manager.

Mail/MemoryPool: blocking alloc

10225

Mail and MemoryPool now provide blocking forms of alloc calls that can sleep the thread until a memory block is available.

Cellular: CellularContext must provide access to CellularDevice

10210

When using NetworkInterface::get_default_instance(), the application gets handle to CellularInterface, which is actually CellularContext derived from CellularInterface. The application also needs to handle CellularDevice to open other interfaces.

Assembler atomics

10147

We have:

  • Separated atomic APIs into mbed_atomic.h from mbed_critical.h. Code not including mbed.h may need to check their includes.
  • Added atomic fetch_add, fetch_sub, fetch_and, fetch_or, fetch_xor and compare_exchange_weak operations.
  • Added explicit memory ordering specification. (Don't use this unless you are familiar with the C++11 memory model.)
  • Added freestanding atomic function templates.

Cellular: retry logic for CellularContext connect

10056

Add retry logic for CellularContext connect last phase: activating pdp context/open ppp channel. Retry logic is the same as in CellularStateMachine.

Enable post build bootloader merging in uvision

10021

Offline projects that use the managed bootloader mode (as is the case for all Pelion Device Management projects using the update capability) should now be able to export and debug properly in uVision. A post build script is now enabled, which takes care of the header generation, binary merging and loading of the correct symbols for your application. This only allows debugging the application, not the bootloader.

Note: This feature is only enabled when exporting offline with Mbed CLI. This is because the post build script has a dependency on the Mbed OS tools and their Python dependencies. This means projects exported from the Online Compiler can't use this capability.

Use LP tickers for waiting in no-RTOS builds when available

9960

For bare metal builds, use the lp_ticker for calls to wait_ms instead of us ticker if lp_ticker is available.

ESP8266: treats Wi-Fi scan results as out-of-band data; new API to adjusting Wi-Fi scan settings

9955

ESP8266: new Wi-Fi scan API for active and passive mode. Making channel scan time configurable

GCC - Add support to split heap across 2-RAM banks

9944

Mbed heap split into 2-RAM banks is added, which can be enabled by compiling source with MBED_SPLIT_HEAP macro. You should add linker symbols __mbed_sbrk_start __mbed_krbs_start __mbed_sbrk_start_0 __mbed_krbs_start_0 in GCC linker script to state start and end of each HEAP region.

ESP8266: Country code API

9927

ESP8266Interface: new API to configure country code and channels to be used.

Default to Cordio BLE stack for NRF52* targets

10709

Starting with mbed-os 5.13 and the introduction of Nordic SDK V15, Nordic SoftDevice Bluetooth stack is not supported. Bluetooth remains supported with the help of Arm's Cordio stack.

Known issues

We publish Mbed OS as a collection of modules on GitHub. Issues are raised in specific repositories and then tracked internally. The purpose of this section is to provide a single view of the outstanding key issues that have not been addressed for this release. As such, it is a filtered and reviewed list based on priority and potential effect. Each item summarizes the problem and includes any known workarounds, along with a link to the GitHub issue (if applicable). We welcome any comments or proposed solutions.

For more information about an issue, please contact us on the forum.

TLS: IP addresses in the X.509 certificate subjectAltNames

  • Description: Parsing IP addresses in the X.509 certificate subjectAltNames is not supported yet. In certificate chains relying on IP addresses in subjectAltNames, a BADCERT_CN_MISMATCH error is returned.
  • Workaround: Merge branch https://github.com/ARMmbed/mbedtls/tree/iotssl-602-san-ip into your copy of Mbed TLS before building the application. It is still in the EXPERIMENTAL stage, so use it at your own responsibility.
  • Reported issue: Issue reported by a customer in an email.
  • Priority: MAJOR.

TLS: Mismatch of root CA and issuer of CRL not caught

  • Description: The x509_crt_verifycrl() function ignores the CRL when the CRL has an issuer different from the subject of root CA certificate.
  • Workaround: Make sure that the issuer of the CRL and the root CA certificate's subject are the same before passing them to x509_crt_verifycrl().
  • Reported issue: Reported by a Partner.
  • Priority: MAJOR.

TLS: Self test failure with some hardware accelerators

  • Description: Most hardware acceleration engines (if not all) require the parameters to be from contiguous memory. All the self tests use test vectors that are defined in the .bss section, which means these are not contiguous. This causes the self test to possibly fail when implementing hardware accelerated engines.
  • Workaround: There are no known workarounds.
  • Reported issue: Reported by the development team.
  • Priority: MAJOR.

TLS: Hardware-accelerated hash creates CBC padding oracle in TLS

  • Description: The current countermeasures against CBC padding oracle attacks in Mbed TLS call a low level internal API. The implementation of this API might not be possible with the hardware accelerator API, and even if it is, the timing might still have detectable differences. The lower level API is called out of sequence, and accelerators that are not aware of this might crash.
  • Workaround: Keep MBEDTLS_SSL_ENCRYPT_THEN_MAC enabled in mbedtls/config.h, and enable the Encrypt-then-MAC extension (RFC7366) on the peer's side.
  • Reported issue: Reported by the development team.
  • Priority: MAJOR.

Tools: Error when running mbed test --compile/run list

  • Description: The error, "pkg_resources.DistributionNotFound: The 'mbed-ls==1.*,>=1.5.1' distribution was not found and is required by icetea, mbed-flasher" is observed when running the command "mbed test -m K64F -t ARM --icetea --compile-list -vv".
  • Workaround: There are no known workarounds.
  • Reported issue: #8064.
  • Priority: Major.

Platform: Realtek RTL8195AM does not define flash algorithms for uVision

  • Description: No flashing support in uVision for Realtek RTL8195AM.
  • Workaround: Use drag-and-drop programming.
  • Reported Issue: #4651.
  • Priority: Minor.

Platform: Realtek RTL8195AM - CMSIS-RTOS error: ISR Queue overflow

  • Description: Realtek RTL8195AM does not maintain a long running connection to Mbed device connector. The error manifests as an ISR Queue overflow.
  • Workaround: There are no known workarounds.
  • Reported issue: #5640.
  • Priority: Major.

Core: Some boards are crashing when lots of data is sent and received through buffered serial

  • Description: This is currently known to affect Ublox ODIN W2 and RTL8195AM.
  • Workaround: There are no known workarounds.
  • Reported issue: #8081.
  • Priority: Major.

NVStore and TDBStore objects can collide in internal flash

  • Description: NVStore and TDBStore are classes implementing storage solutions. By default, they allocate the last two sectors in internal flash. If you use both, a runtime error happens. NVStore is deprecated, and you should use TDBStore instead.
  • Workaround: Use TDBStore instead of NVStore.
  • Priority: Minor.

SPI failures on CY8CKIT_062_WIFI_BT

  • Description: When reading from an SD card connected with SPI, sometimes we see that read operation leave some bytes unchanged in the buffer without reporting the error. The root cause is under investigation.
  • Workaround: https://github.com/ARMmbed/mbed-os/tree/feature-SD-verify.
  • Reported issue: IOTSTOR-815.
  • Priority: Major.

UART flow control does not work on Cypress CY8CKIT_062_WIFI_BT_PSA

  • Description: UART hardware flow control: When connecting a Wi-Fi shield with UART, flow control does not work. The root cause is under investigation.
  • Workaround: There are no known workarounds.
  • Reported issue: IOTHAL-481.
  • Priority: Major.

Wi-SUN static IPv6 backbone configuration in nanostack border router is not working

  • Description: Static IPv6 backbone configuration is not working in border router if Wi-SUN mesh network is used and will cause hard fault.
  • Workaround: Use dynamic configuration in border router with functional IPv6 backend.
  • Reported issue: IOTTHD-3591.
  • Priority: Major.

Cordio Link Layer: GAP advertising parameters need to be set before advertising data is set

  • Description: This issue only affects users of the Cordio Link Layer. If this ordering is not respected, GAP advertising data will not be set correctly.
  • Workaround: If using the BLE API, apply changes from #10772. If using the Cordio Host Stack API, make sure advertising parameters are set before advertising data is set when using the Cordio Link Layer.
  • Reported issue: IOTPAN-486.
  • Priority: Major.

Mbed_platform_wait_ns fails on NRF52* when compiled with Arm Compiler 6

  • Description: Under some circumstances, the wait_ns test will fail when compiled with Arm Compiler 6 and run on NRF52_DK. The test results seem highly dependent on compilation options and what is put in the binary. The test always succeeds when -O0 or -O2 is used. It fails only with -Os.
  • Workaround: Compile with a different optimization option.
  • Reported issue: #10849.
  • Priority: Critical.

Testing and improvements

GitHub pull request testing speed up

We have improved our internal Jenkins testing scripts to speed up pull request tests. The purpose is to test only what is needed. The three main improvements are:

  • Algorithms that select needed checks based on code change. In practice, this is most visible in pull requests that contain only README changes. For those changes, no testing is needed at all.
  • An algorithm that ignores greentea tests that did not change and passed previously. This reduces >90% of greentea test duplication, which was the bottleneck of the testing pipeline.
  • Additional hardware, so we can run more hardware tests in parallel.

Based on these big changes and many smaller improvements, automated tests are not the bottleneck for the pull request handling process.

Nightly test setup

We have introduced an additional test phase that runs every night. In this phase, we have more tests and hardware coverage. We will introduce new hardware first in nightly tests and later in pull request tests. This makes pull request testing faster and more robust.

We currently use this setup internally but will report relevant findings to the Partners and community. The intention is to make this more visible to the external community.

Test coverage metrics

We are moving away from calculating the number of tests executed and number of build binaries. These metrics are no longer as relevant because of many optimizations in the test flow.

Below is the number of test cases for each of the test tools. The change since 5.12.0 in the parentheses:

  • Unit tests: 582 (+1), line coverage: 87% (coverage measure only files which contain some tests).
  • Greentea: 1281 (-155), line coverage: 36% (coverage is calculated with Fast Models which cannot execute all test at the moment).
  • Icetea: 42 (+0).

Contents

Ports for upcoming targets

9221
Add ARM_MUSCA_A1 target

Fixes and changes

10675
Update Mbed TLS 2.18.0 rc1

10666
Bring Nordic SDK v15 update to master

10646
Fix deprecation notice for ble::Gap::getState()

10640
BLE HealthThermometerService: correct GATT characteristics

10639
Cellular: Preventing Socket ID assignment until actual socket creation at the modem

10638
Fix AdvertisingDataBuilder UUID insertion bug

10636
+UPSND sent to poll activation status

10635
BLE: Deprecate UARTService and suppress compiler warnings

10634
BLE: Fix deprecated API calls in battery and thermometer services

10631
Update cube h7 to 1.4.0

10627
Remove targets FUTURE_SEQUANA_M0_PSA and FUTURE_SEQUANA_PSA

10625
TESTS: Update examples.json to enable testing

10624
Nanostack release for Mbed OS 5.13

10623
Cellular: Fix unit test valgrind warnings

10621
Fix usb_device-msd test Python dependencies

10620
Update mbed-coap to version 4.8.0

10617
Change W7500 GPIO driver

10616
Fix bug Operator new[] out of memory

10615
This allows CPP application to use the functions from cc.h

10614
Include mbed-greentea==1.7.1 for mbed-os-tools==0.0.8

10606
PSA release script update: Add toolchain option

10605
K66F: Update SAI and SAI EDMA driver to SDK 2.5

10602
Runtime DNS server addition implement

10598
Add Wi-Sun certificate options to mesh API configuration JSON

10597
SysTimer should be buildable without lp ticker

10596
Introduce Semaphore::acquire methods

10594
Arm Compiler 5: Fix mbed_atomic_impl.h assembly

10593
Cellular: Fix flow control pin configs for BC95 and Gemalto targets

10591
M2351: Fix serial sync error in SPDMC test

10587
GR_LYCHEE,RZ_A1H,VK_RZ_A1H: Fix greentea test failure with Arm Compiler 6

10582
Add LED4 definition in PinNames.h of SDP-K1 board

10581
BLE: Management of Tx path on Cordio

10580
BLE: Put the acl buffer size in config

10557
Cellular: Initialize CellularContext member variables in correct class

10554
Cellular: Fix compile warnings from cellular

10553
Add semihosting and SWO examples to mbed_override_console()

10540
Check in files for the FPGA CI test shield

10521
TEST: Update Python script to enable examples smoke test

10511
Cellular: Fix setting of statemachine timeout

10505
Improve importer.py

10489
gpio_api.h: Clarify desired behavior for NC

10482
Allow NC pins to be instantiated on Silicon Labs platforms

10478
DataFlash: Change erase size to pages to reduce memory usage

10476
LWIP TCP socket close - disconnecting fix

10475
Implement nanostack eventloop tick timer

10473
Add exception case for IPv6 only mode of BG96

10456
LWIP 2.1.2 tcpip thread stack overflow fix

10454
Enterprise_mode_+_wifi_configuraiton_api: update ODIN drivers to v3.7.0 RC1

10442
Cellular: Make AT_CellularContext::get_context() virtual

10427
Set compilers to C++14 and C11

10410
Nanostack: Translate errors from sendmsg

10402
Cellular: Send disconnect to correct ctx

10398
Clean up Arm toolchains from get_mbed_official_release()

10366
Update CMSIS to 5.5.1

10355
KVStore: Support external storage out of mbed-os tree

10353
Update to LWIP 2.1.2

10328
Add option to disable default UART console

10324
Cellular: New state machine state and better info from stm

10322
GCC: remove -fno-builtin option

10258
Remove FEATURE_STORAGE and all underlying deprecated features

10254
Remove unused tools modules and document the used ones

10244
Add the INTERRUPTIN compilation guard for ESP8266

10225
Mail/MemoryPool: blocking alloc

10210
Cellular: CellularContext must provide access to CellularDevice

10162
BLE - Notify HCI driver of host stack inactivity

10151
Sleep manager: Optimize counter

10150
Timer: Remove hard-coded lp_ticker knowledge

10147
Assembler atomics

10146
CellularBase -> CellularInterface tidy

10056
Cellular: Retry logic for CellularContext connect

10053
Cellular: Make CellularStateMachine timeouts configurable

10043
Add vprintf to Rawserial

10021
Enable post build bootloader merging in uVision

9960
Use LP tickers for waiting in no-RTOS builds when available

9955
ESP8266: Treats Wi-Fi scan results as out-of-band data; new API to adjust Wi-Fi scan settings

9944
GCC - Add support to split heap across 2-RAM banks

9927
ESP8266: Country code API

9476
Asynchronous Serial API fixes and refactoring

9443
Add USBCDC_ECM class

9221
Add ARM_MUSCA_A1 target

9111
CAN: Fix signness mismatch in CANMessage constructors

10747
Cypress: Fix issue #10613

10740
ARMC6: Suppress "register deprecated" warning

10733
Fix NRF52 memory pools

10722
mbed-crypto: Automatically enable entropy injection

10716
Update requirement for manifest-tool

10809
ns_list: avoid UINT_FAST8_MAX (fix Arm Compiler 5 builds)

10805
Fix Arm Compiler 5 compilation

10802
Update to Mbed TLS 2.18.0rc3

10786
Re-enable complilation for Wi-Fi and nanostack examples

10770
mbed-crypto: Update to Mbed Crypto 1.1.0d1

10753
Fix NRF52 enabled UART count and enable UART0/1

10709
Default to Cordio BLE stack for NRF52* targets

10875
Cellular: Remove IPv6 and IPv4v6 as supported properties for BG96

10764
BG96 IPv6 support and socket ID fix for BG96 and M26

Using this release

You can fetch this release from the mbed-os GitHub repository, using the tag "mbed-os-5.13.0".

If you need any help with this release, please visit our support page, which provides reference links and details of our support channels.