This migration guide is complementary to the Release Notes. It describes practical actions you must take to update your code to a newer version of the nRF5 SDK for Mesh.
Table of contents
The following files have been added in the v3.0.0 release:
mesh/core/src/core_tx_lpn.c
mesh/core/src/lpn.c
mesh/core/src/mesh_lpn_subman.c
mesh/core/src/mesh_mem_stdlib.c
mesh/core/src/timeslot_timer.c
external/app_timer/app_timer_mesh.c
(details below)examples/common/src/app_level.c
examples/common/src/ble_softdevice_support.c
(details below)The following files have been removed in the v3.0.0 release:
examples/common/src/mesh_softdevice_init.c
(details below)Update your projects accordingly to include or remove these files.
The integration with the nRF5 SDK v15.2 caused the following changes:
softdevice_irq_priority_checker()
has been removed from mesh_app_utils.h
.nrf_sdh.c
replacement has been removed.nrf_sdh.c
in the nRF5 SDK, as the IRQ level fix was upstreamed.Stack has been divided into two time frequency domains:
Additionally, app_timer API can be used in an application as-is. However, the SDK app_timer abilities are not sufficient for managing the stack functionality. Extended app_timer with modifications has been added in external/app_timer
. Modified version will be compiled and linked to applications (based on stack build system) instead of SDK app_timer. SDK app_timer API header file should be used as well.
The following define that turns on app_timer
in the building process must be added to app_config.h
to make these changes work:
#define APP_TIMER_ENABLED 1
In the initialization phase of the examples, the mesh_softdevice_init
module has been replaced with the BLE SoftDevice support module.
In the start phase of the examples, the execution_start()
function has been removed.
Use the function ble_stack_init() to initialize the SoftDevice Handler and the BLE stack, and to register the Mesh handler for SoC events.
Make sure the function mesh_stack_start() is called at the end of the start phase (see start()
function in the Light Switch Server code as an example). After calling mesh_stack_start(), all mesh API interaction must happen at the IRQ priority level specified in the call to mesh_stack_init(). Calling mesh functions at wrong IRQ priority levels after enabling the stack can cause unpredictable behavior (see Interrupt priority levels for details).
The nRF Mesh SDK is now enforcing the Mesh Profile Specification v1.0 rule that disallows multiple simulatneous segmented messages from a source address to the same destination.
This change means that models must wait until their previous segmented message is finished sending before they can send another. If multiple models on the same element have the same publish address, they have to coordinate their publishing as well.
If the application attempts to publish two simultaneous segmented messages with the same source and destination, the second publish call gets rejected with error code NRF_ERROR_INVALID_STATE
.
Models that previously scheduled multiple segmented messages in the same context must instead subscribe to NRF_MESH_EVT_TX_COMPLETE events or set up timers for sending to avoid the error code.
true
or messages that are longer than NRF_MESH_UNSEG_PAYLOAD_SIZE_MAX. Unsegmented messages can be interleaved with both segmented and unsegmented messages of any source and destination.Compile time configuration for supported features of the device changed, which makes DEVICE_FEATURES
, MESH_FEATURE_GATT
, GATT_PROXY
macros outdated.
Make sure you apply the following changes to your code:
MESH_FEATURE_GATT
.GATT_PROXY
.DEVICE_FEATURES
.There is a new parameter attention_duration_s
for the nrf_mesh_prov_provision() function in mesh/prov/api/nrf_mesh_prov.h
. This parameter is required in the provisioning process.
Update all uses of the nrf_mesh_prov_provision() function with the additional attention_duration_s
argument.