Migration guide to Zephyr v3.6.0 (Working Draft)
This document describes the changes required or recommended when migrating your application from Zephyr v3.5.0 to Zephyr v3.6.0.
Any other changes (not directly related to migrating applications) can be found in the release notes.
Required changes
Kernel
C Library
Optional Modules
The following modules have been made optional and are not downloaded with west update by default anymore:
canopennode
(GitHub #64139)
To enable them again use the west config manifest.project-filter -- +<module
name>
command, or west config manifest.group-filter -- +optional
to
enable all optional modules, and then run west update
again.
Device Drivers and Device Tree
The
st,lsm6dsv16x
sensor driver has been changed to support configuration of both int1 and int2 pins. The DT attributeirq-gpios
has been removed and substituted by two new attributes,int1-gpios
andint2-gpios
. These attributes must be configured in the Device Tree similarly to the following example:/ { lsm6dsv16x@0 { compatible = "st,lsm6dsv16x"; int1-gpios = <&gpioa 4 GPIO_ACTIVE_HIGH>; int2-gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>; drdy-pin = <2>; }; };
Runtime configuration is now disabled by default for Nordic UART drivers. The motivation for the change is that this feature is rarely used and disabling it significantly reduces the memory footprint.
Power Management
Shell
The following subsystem and driver shell modules are now disabled by default. Each required shell module must now be explicitly enabled via Kconfig (GitHub #65307):
Bootloader
MCUboot’s deprecated
CONFIG_ZEPHYR_TRY_MASS_ERASE
Kconfig option has been removed. If an erase is needed when flashing MCUboot, this should now be provided directly to thewest
command e.g.west flash --erase
. (GitHub #64703)
Bluetooth
The HCI implementation for both the Host and the Controller sides has been renamed for the IPC transport. The
CONFIG_BT_RPMSG
Kconfig option is nowCONFIG_BT_HCI_IPC
, and thezephyr,bt-hci-rpmsg-ipc
Devicetree chosen is nowzephyr,bt-hci-ipc
. The existing sample has also been renamed, fromsamples/bluetooth/hci_rpmsg
tosamples/bluetooth/hci_ipc
. (GitHub #64391)The BT GATT callback list, appended to by
bt_gatt_cb_register()
, is no longer cleared onbt_enable()
. Callbacks can now be registered before the initial call tobt_enable()
, and should no longer be re-registered after abt_disable()
bt_enable()
cycle. (GitHub #63693)The Bluetooth UUID has been modified to rodata in
BT_UUID_DECLARE_16
,BT_UUID_DECLARE_32` and ``BT_UUID_DECLARE_128
as the return value has been changed to const. Any pointer to a UUID must be prefixed with const, otherwise there will be a compilation warning. For example changestruct bt_uuid *uuid = BT_UUID_DECLARE_16(xx)
toconst struct bt_uuid *uuid = BT_UUID_DECLARE_16(xx)
. (GitHub #66136)Mesh
The Bluetooth Mesh
model
declaration has been changed to add prefixconst
. Themodel->user_data
,model->elem_idx
andmodel->mod_idx
field has been changed to the new runtime structure, replaced bymodel->rt->user_data
,model->rt->elem_idx
andmodel->rt->mod_idx
separately. (GitHub #65152)The Bluetooth Mesh
element
declaration has been changed to add prefixconst
. Theelem->addr
field has been changed to the new runtime structure, replaced byelem->rt->addr
. (GitHub #65388)Deprecated
CONFIG_BT_MESH_PROV_DEVICE
. This option is replaced by new optionCONFIG_BT_MESH_PROVISIONEE
to be aligned with Mesh Protocol Specification v1.1, section 5.4. (GitHub #64252)Removed the
CONFIG_BT_MESH_V1d1
Kconfig option.Removed the
CONFIG_BT_MESH_TX_SEG_RETRANS_COUNT
,CONFIG_BT_MESH_TX_SEG_RETRANS_TIMEOUT_UNICAST
,CONFIG_BT_MESH_TX_SEG_RETRANS_TIMEOUT_GROUP
,CONFIG_BT_MESH_SEG_ACK_BASE_TIMEOUT
,CONFIG_BT_MESH_SEG_ACK_PER_HOP_TIMEOUT
,BT_MESH_SEG_ACK_PER_SEGMENT_TIMEOUT
Kconfig options. They are superseded by theCONFIG_BT_MESH_SAR_TX_SEG_INT_STEP
,CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_COUNT
,CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_WITHOUT_PROG_COUNT
,CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_INT_STEP
,CONFIG_BT_MESH_SAR_TX_UNICAST_RETRANS_INT_INC
,CONFIG_BT_MESH_SAR_TX_MULTICAST_RETRANS_COUNT
,CONFIG_BT_MESH_SAR_TX_MULTICAST_RETRANS_INT
,CONFIG_BT_MESH_SAR_RX_SEG_THRESHOLD
,CONFIG_BT_MESH_SAR_RX_ACK_DELAY_INC
,CONFIG_BT_MESH_SAR_RX_SEG_INT_STEP
,CONFIG_BT_MESH_SAR_RX_DISCARD_TIMEOUT
,CONFIG_BT_MESH_SAR_RX_ACK_RETRANS_COUNT
Kconfig options.
LoRaWAN
The API to register a callback to provide battery level information to the LoRaWAN stack has been renamed from
lorawan_set_battery_level_callback
tolorawan_register_battery_level_callback()
and the return type is nowvoid
. This is more consistent with similar functions for downlink and data rate changed callbacks. (GitHub #65103)
Networking
The CoAP public API has some minor changes to take into account. The
coap_remove_observer()
now returns a result if the observer was removed. This change is used by the newly introduced CoAP server subsystem. Also, therequest
argument forcoap_well_known_core_get()
is madeconst
. (GitHub #64265)CoAP observer events have moved from a callback function in a CoAP resource to the Network Events subsystem. The
CONFIG_COAP_OBSERVER_EVENTS
configuration option has been removed. (GitHub #65936)The CoAP public API function
coap_pending_init()
has changed. The parameterretries
is replaced with a pointer tocoap_transmission_parameters
. This allows to specify retransmission parameters of the confirmable message. It is safe to pass a NULL pointer to use default values. (GitHub #66482)The CoAP public API functions
coap_service_send()
andcoap_resource_send()
have changed. An additional parameter pointer tocoap_transmission_parameters
has been added. It is safe to pass a NULL pointer to use default values. (GitHub #66540)The IGMP multicast library now supports IGMPv3. This results in a minor change to the existing api. The
net_ipv4_igmp_join()
now takes an additional argument of the typeconst struct igmp_param *param
. This allows IGMPv3 to exclude/include certain groups of addresses. If this functionality is not used or available (when using IGMPv2), you can safely pass a NULL pointer. IGMPv3 can be enabled using the KconfigCONFIG_NET_IPV4_IGMPV3
. (GitHub #65293)The network stack now uses a separate IPv4 TTL (time-to-live) value for multicast packets. Before, the same TTL value was used for unicast and multicast packets. The IPv6 hop limit value is also changed so that unicast and multicast packets can have a different one. (GitHub #65886)
Other Subsystems
MCUmgr applications that make use of serial transports (shell or UART) must now select
CONFIG_CRC
, this was previously erroneously selected if MCUmgr was enabled, when for non-serial transports it was not needed. (GitHub #64078)Touchscreen drivers
focaltech,ft5336
andgoodix,gt911
were using the incorrect polarity for the respectivereset-gpios
. This has been fixed so those signals now have to be flagged asGPIO_ACTIVE_LOW
in the devicetree. (GitHub #64800)
Recommended Changes
New macros available for ST sensor DT properties setting. These macros have a self-explanatory name that helps in recognizing what the property setting means (e.g. LSM6DSV16X_DT_ODR_AT_60Hz). (GitHub #65410)