nRF5 SDK v13.0.0
Migration guide

Table of Contents

If you built an application based on nRF5 SDK v12.2.0, complete the actions listed in the following sections to migrate your application to nRF5 SDK v13.0.0.

Note that this migration guide does not list all changes, but it covers the most important changes that require you to update your code. See the release notes for further information on changes that were made in this release.

Bluetooth low energy (BLE)

New BLE SoftDevices

SDK v13.0.0 supports the BLE SoftDevices S132 v4.0.2 and S140 v5.0.0-2.alpha. The SDK was adapted to the newest SoftDevice API.

For additional details about the SoftDevices, see s132_nrf52_4.0.2_migration-document.pdf and s132_nrf52_4.0.2_releasenotes.pdf located in components\softdevice\s132\doc and s140_nrf52840_5.0.0-2.alpha_migration-document.pdf and s140_nrf52840_5.0.0-2.alpha_release-notes-update-1.pdf located in components\softdevice\s140\doc.

Action: If you use direct SoftDevice calls, follow the steps outlined in the SoftDevice migration documents to update your application to the newest API.

SoftDevice handler

The following changes were done to the API of the SoftDevice handler library:

For all BLE examples, the ble_stack_init function was updated to reflect the required changes. Function calls preceding sd_ble_enable have changed to reflect the new SoftDevice.

Action: Update your application as shown in the BLE examples.

Advertising module

The following API was added to the Advertising Module:

This function sets the configuration tag that is used for a connection in the advertising module. Any connection that is made uses the connection configuration tag that is currently set. If the new API function is not called, a default connection tag is used.

ble_advertising_conn_cfg_tag_set must be called after ble_advertising_init, but before ble_advertising_start.

The connection configuration tag is the tag used in sd_ble_cfg_set. In the SDK examples, the tag is set up during ble_stack_init.

Action: Use this function if you want to use non-default settings for an upcoming connection.

Nordic UART Service

In the Nordic UART Service and Nordic UART Service Client, the terminology use of RX and TX was inverted compared to the apps that can interact with the service (for example, the nRF Toolbox UART app). This mismatch has been corrected in this release. As a result, the names of a few of the functions in the Nordic UART Service have changed.

Action: Update your function calls from ble_nus_c_rx_notif_enable (old) to ble_nus_c_tx_notif_enable (new).

The UART/Serial Port Emulation over BLE example was changed to not check for a '\r' character when parsing input from UART, because it would send empty packets over the air when "\r\n" was together. Therefore, UART terminals used with the ble_app_uart example must send '\n' as newline. Sending '\r' alone is not sufficient.

Action: Update your terminals to use '\n' as newline when interacting with the ble_app_uart example.

GATT module

The following changes were done to the Experimental: GATT Module:

Other protocols

New ANT SoftDevice

SDK v13.0.0 supports the ANT SoftDevice S212 v4.0.0. The ANT channel configuration was adapted to the newest SoftDevice API.

For additional details about the ANT SoftDevices, see thisisant.com.

Action: The new S212 SoftDevice API is an extension of the v2.0.0, so no updates are required unless you want to use added functionality.

BLE/NFC examples

The following BLE/NFC examples were refactored to use the NFC BLE pairing library:

Action: For the above examples, select the desired pairing mode in the sdk_config.h file:

Secure DFU

Extended error codes

Extended error codes is a new set of error codes that the DFU target may send as a response to the DFU controller. When the DFU controller receives an error code "0x0B", this indicates that the next byte of the packet contains more detailed information about the cause of the error.

Action: If you have an implementation of, for example, a mobile app for performing DFU, update it to handle the new "0x0B" error code.

Secure DFU for nRF52840

On nRF52840 devices, the bootloader is now located at the end of the device's flash area (0xF8000). This allows for larger applications to coexist with the bootloader.

Action: Make sure that the bootloader settings page is at the correct location. nrfutil accepts "--family NRF52840" to generate a bootloader settings page that is compatible with nRF52840 devices.

Buttonless DFU Service

The Buttonless DFU Service now uses the Nordic proprietary 16-bit UUID reserved for Nordic Secure DFU (0xFE59).

The Buttonless DFU characteristic has a new UUID: 0x8EC90003-F315-4F60-9FB8-838830DAEA50. It has been changed from notification to indication.

Action: Update your application that interacts with the Buttonless DFU Service to use the new UUID and to handle incoming indications instead of notifications on the Buttonless DFU characteristic.

Hardware peripherals

Board Support Package

Changed API: The ticks_per_100ms parameter was removed from the Board Support Package (BSP) initialization function bsp_init.

Action: Remove the ticks_per_100ms parameter from the function call.

POWER driver

The API functions of the POWER driver now return error codes. The driver must be initialized before the SoftDevice is enabled.

Action: Handle the return codes in your application.

PWM driver

The nrf_drv_pwm_simple_playback and nrf_drv_pwm_simple_playback functions of the PWM driver now return error codes. However, they will always return NRF_SUCCESS unless PPI is used to trigger playback.

Action: If you are using PPI to trigger playback, handle the return codes in your application. Otherwise, ignore the return codes.

SPI master driver

Changed API: The nrf_drv_spi_init function and the event handler of the SPI master driver require a new parameter p_context. This parameter is returned in the event handler.

Action: Update your function calls. If you do not want to use the new feature, pass p_context=NULL.

Capacitive Sensor low-level library

The Capacitive Sensor low-level library can use COMP or SAADC. However, COMP is not recommended because of Anomaly 84.

Action: Update sdk_config.h and configure the module to use SAADC.

Power Management library

Changed API: The ticks_per_1s parameter was removed from the Power Management library initialization function nrf_pwr_mgmt_init.

Action: Remove the ticks_per_1s parameter from the function call.

Timer library

The following changes were done to the Timer library:

TWI transaction manager

The following changes were done to the TWI transaction manager:


Documentation feedback | Developer Zone | Subscribe | Updated