Skip to content

@adbridge adbridge released this Jun 27, 2019 · 831 commits to master since this release

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


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


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


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


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);
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];
_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

Cellular: Make AT_CellularContext::get_context() virtual


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


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 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.


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


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

Update CMSIS to 5.5.1


CMSIS updated from 5.4.0 to 5.5.1.

KVStore: Support external storage out of mbed-os tree


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


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.
-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


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


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

Mail/MemoryPool: blocking alloc


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


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


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


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


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


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


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


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


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

Default to Cordio BLE stack for NRF52* targets


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 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:
  • 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).


Ports for upcoming targets

Add ARM_MUSCA_A1 target

Fixes and changes

Update Mbed TLS 2.18.0 rc1

Bring Nordic SDK v15 update to master

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

BLE HealthThermometerService: correct GATT characteristics

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

Fix AdvertisingDataBuilder UUID insertion bug

+UPSND sent to poll activation status

BLE: Deprecate UARTService and suppress compiler warnings

BLE: Fix deprecated API calls in battery and thermometer services

Update cube h7 to 1.4.0


TESTS: Update examples.json to enable testing

Nanostack release for Mbed OS 5.13

Cellular: Fix unit test valgrind warnings

Fix usb_device-msd test Python dependencies

Update mbed-coap to version 4.8.0

Change W7500 GPIO driver

Fix bug Operator new[] out of memory

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

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

PSA release script update: Add toolchain option

K66F: Update SAI and SAI EDMA driver to SDK 2.5

Runtime DNS server addition implement

Add Wi-Sun certificate options to mesh API configuration JSON

SysTimer should be buildable without lp ticker

Introduce Semaphore::acquire methods

Arm Compiler 5: Fix mbed_atomic_impl.h assembly

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

M2351: Fix serial sync error in SPDMC test

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

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

BLE: Management of Tx path on Cordio

BLE: Put the acl buffer size in config

Cellular: Initialize CellularContext member variables in correct class

Cellular: Fix compile warnings from cellular

Add semihosting and SWO examples to mbed_override_console()

Check in files for the FPGA CI test shield

TEST: Update Python script to enable examples smoke test

Cellular: Fix setting of statemachine timeout


gpio_api.h: Clarify desired behavior for NC

Allow NC pins to be instantiated on Silicon Labs platforms

DataFlash: Change erase size to pages to reduce memory usage

LWIP TCP socket close - disconnecting fix

Implement nanostack eventloop tick timer

Add exception case for IPv6 only mode of BG96

LWIP 2.1.2 tcpip thread stack overflow fix

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

Cellular: Make AT_CellularContext::get_context() virtual

Set compilers to C++14 and C11

Nanostack: Translate errors from sendmsg

Cellular: Send disconnect to correct ctx

Clean up Arm toolchains from get_mbed_official_release()

Update CMSIS to 5.5.1

KVStore: Support external storage out of mbed-os tree

Update to LWIP 2.1.2

Add option to disable default UART console

Cellular: New state machine state and better info from stm

GCC: remove -fno-builtin option

Remove FEATURE_STORAGE and all underlying deprecated features

Remove unused tools modules and document the used ones

Add the INTERRUPTIN compilation guard for ESP8266

Mail/MemoryPool: blocking alloc

Cellular: CellularContext must provide access to CellularDevice

BLE - Notify HCI driver of host stack inactivity

Sleep manager: Optimize counter

Timer: Remove hard-coded lp_ticker knowledge

Assembler atomics

CellularBase -> CellularInterface tidy

Cellular: Retry logic for CellularContext connect

Cellular: Make CellularStateMachine timeouts configurable

Add vprintf to Rawserial

Enable post build bootloader merging in uVision

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

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

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

ESP8266: Country code API

Asynchronous Serial API fixes and refactoring

Add USBCDC_ECM class

Add ARM_MUSCA_A1 target

CAN: Fix signness mismatch in CANMessage constructors

Cypress: Fix issue #10613

ARMC6: Suppress "register deprecated" warning

Fix NRF52 memory pools

mbed-crypto: Automatically enable entropy injection

Update requirement for manifest-tool

ns_list: avoid UINT_FAST8_MAX (fix Arm Compiler 5 builds)

Fix Arm Compiler 5 compilation

Update to Mbed TLS 2.18.0rc3

Re-enable complilation for Wi-Fi and nanostack examples

mbed-crypto: Update to Mbed Crypto 1.1.0d1

Fix NRF52 enabled UART count and enable UART0/1

Default to Cordio BLE stack for NRF52* targets

Cellular: Remove IPv6 and IPv4v6 as supported properties for BG96

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.

Assets 2
You can’t perform that action at this time.