Migration guide to Zephyr v4.5.0 (Working Draft)
This document describes the changes required when migrating your application from Zephyr v4.4.0 to Zephyr v4.5.0.
Any other changes (not directly related to migrating applications) can be found in the release notes.
Common
Build System
Kernel
_k_neg_eagainhas been renamed to_errno_neg_egainaserrnohas been migrated out of kernel intolib/libc/common.
Boards
Device Drivers and Devicetree
Haptics
The
cirrus,cs40l5xcompatible has been replaced by variant-specific compatiblescirrus,cs40l50,cirrus,cs40l51,cirrus,cs40l52, andcirrus,cs40l53. Applications using the old compatible must update their devicetree nodes accordingly.
Clock Control
The
nxp,imxrt11xx-arm-pllbinding now usesloop-divandpost-divfor ARM PLL configuration. The legacyclock-multandclock-divproperties remain supported but are deprecated. Existing RT11xx overlays should be updated using the mappingloop-div = clock-mult * 2andpost-div = clock-div.
Digital Microphone
The DMIC driver backend API now uses
dmic_driver_apiinstead ofstruct _dmic_ops.Out-of-tree DMIC drivers must rename their backend API struct definitions and switch their API instances to
DEVICE_API(dmic, ...). See GitHub #107695 for examples of how in-tree drivers have been updated. Application code usingdmic_configure(),dmic_trigger(), anddmic_read()is not impacted.
Ethernet
ETHERNET_CONFIG_TYPE_T1S_PARAMand the relatedNET_REQUEST_ETHERNET_SET_T1S_PARAMhas been removed.phy_set_plca_cfg()together withnet_eth_get_phy()should be used instead to set these parameters (GitHub #108136).In the functions implemented by the
ethernet_apia additional argument was added for a pointer tonet_if. This api is not directly exposed to the application, so only out-of-tree drivers need to be updated. (GitHub #106086)The
pinctrl-0andpinctrl-namesdevicetree properties for thenxp,enet-macneed to be moved from the MAC node to the parent Ethernet controller node. (GitHub #107352)
Flash
jedec,spi-nandnow requires aplane-bytesproperty, which indicates the size of each plane in the flash device. For devices with a single plane, this should be set to the same value assize-bytes.
GPIO
The STM32 GPIO driver now returns
-EINVALwhen attempting to configure a GPIO pin in disabled state with a pull-up/pull-down resistor usinggpio_pin_configure(). The driver would previously return0without actually honoring those flags (no PU/PD resistor was enabled). Applications encountering this error should removeGPIO_PULL_UP/GPIO_PULL_DOWNfrom theflagsthey provide togpio_pin_configure(); this will result in the same behavior as before since these flags were effectively ignored. (GitHub #104690)On STM32F1 series, GPIO output pins now use 50 MHz max. speed instead of 10 MHz. (GitHub #104690)
NXP
CONFIG_MCUX_LPTMR_TIMERno longer defaults toybased on the/chosen/zephyr,system-timerchosen node being compatible withnxp,lptmr. Out-of-tree SoCs and boards that rely on the LPTMR as the system timer must now explicitly default the symbol in theirKconfig.defconfig(for exampledefault y if PM).Kinetis KE1xF no longer requires a board overlay to designate the system timer when
CONFIG_PMis enabled. The SoC DTSI now sets thezephyr,system-timerchosen property, so boards that added the overlay described in the Zephyr 4.4 migration guide can remove it.
SD Host Controller
Renamed the Kconfig option
CONFIG_SDHC_STM32_POLLING_SUPPORTtoCONFIG_SDHC_STM32_DMA_MODE. The new symbol enables DMA (defaulty); set it tonto use polling mode. (GitHub #101617)Renamed the Kconfig option
CONFIG_SDHC_STM32_SDIOtoCONFIG_SDHC_STM32_SDMMC. (GitHub #101617)The devicetree compatible
st,stm32-sdiowas renamed. Usest,stm32-sdmmcinstead. With this compatible, the legacy disk driver and the SDHC driver can target the same node. To migrate to the SDHC STM32 SDMMC driver, disable the legacy disk driver:CONFIG_SDMMC_STM32=n
For
st,stm32-sdmmc, thesdhi-on-gpiosproperty has been consolidated into the existingpwr-gpiosproperty. Replacesdhi-on-gpioswithpwr-gpiosin out-of-tree devicetree nodes.
STM32
SoC DTSI files now consistently use interrupt priority zero for all peripherals. Applications must now explicitly configure interrupt priorities using Devicetree if they previously relied on the values found in SoC DTSI files. (GitHub #106188)
Syscon
The syscon API functions
syscon_read_reg()andsyscon_write_reg()now useuint32_tfor the register offset parameter instead ofuint16_t. This allows for larger register offsets. Code that explicitly declaresuint16_tvariables for the register parameter or implements the syscon driver API functions may need to be updated.
WiFi
In the functions implemented by the
net_wifi_mgmt_offload, internallyethernet_apiandwifi_mgmt_ops, a additional argument was added for a pointer tonet_if. This api is not directly exposed to the application, so only out-of-tree drivers need to be updated. (GitHub #106086)
Bluetooth
Bluetooth Audio
BAP
bt_bap_stream.codec_cfgis nowconst, to better reflect that it is a read-only value. Any non-read uses of it will need to be updated with the appropriate operations such asbt_bap_stream_config(),bt_bap_stream_reconfig(),bt_bap_stream_enable()orbt_bap_stream_metadata(). (GitHub #104219)bt_bap_stream.qosis nowconst, to better reflect that it is a read-only value. Any non-read uses of it will need to be set with the appropriate operations such asbt_bap_unicast_group_create(),bt_bap_unicast_group_reconfig(),bt_bap_broadcast_source_create()orbt_bap_broadcast_source_reconfig(). (GitHub #104887)Almost all API uses of
struct bt_bap_qos_cfg *are nowconst, which means that once theqoshas been stored in a parameter struct likebt_bap_broadcast_source_paramorbt_bap_unicast_group_stream_param, then the parameter’s pointer cannot be used to modify theqos, and the actual definition of the struct should be modified instead. (GitHub #104219)bt_bap_unicast_group_info.sink_pdandbt_bap_unicast_group_info.source_pdnow reflect the local values defined for the group, and not the values configured for any remote ASEs. (GitHub #104887)bt_bap_unicast_client_discover()andbt_bap_broadcast_assistant_discover()now require that the connection has already gone through the pairing process and meets the security requirements of BAP before doing any discovery. In most cases this requires a call tobt_conn_set_security()for new devices. Bonded devices that reconnect should not require anything.Almost all API uses of
struct bt_audio_codec_cfg *are nowconst, which means that once thecodec_cfghas been stored in a parameter struct likebt_bap_streamorbt_bap_broadcast_source_subgroup_param, then the parameter’s pointer cannot be used to modify thecodec_cfg, and the actual definition of the struct should be modified instead. (GitHub #104219)
CAP
bt_cap_commander_broadcast_reception_start()now waits for the CAP acceptors to sync to the broadcast before completing. This means that if the broadcast source is offline, including colocated broadcast sources like the ones created bybt_cap_handover_unicast_to_broadcast(), shall be active and have the periodic advertising enabled with a configured BASE. Forbt_cap_handover_unicast_to_broadcast()the newly addedbt_cap_handover_cb.unicast_to_broadcast_createdcan be used to configure the BASE. This also means that any current checks implemented by an application to wait for receive state updates indicating successful sync can be removed, asbt_cap_commander_broadcast_reception_start()now ensures this whenbt_cap_commander_cb.broadcast_reception_startis called. This also applies forbt_cap_commander_broadcast_reception_stop()in a similar manner. (GitHub #101070)
CCP
bt_tbs_client_cb.technologyhas changed thevalueparameter fromuint32_ttoenum bt_bearer_tech. Applications using this application should switch the type. (GitHub #102430)All
BT_TBS_TECHNOLOGY_*values likeBT_TBS_TECHNOLOGY_3Gare renamed toBT_BEARER_TECH_*likeBT_BEARER_TECH_3G. Applications can do search-and-replace fromBT_TBS_TECHNOLOGYtoBT_BEARER_TECH. Additionally the values are now defined in include/zephyr/bluetooth/assigned_numbers.h instead of include/zephyr/bluetooth/audio/tbs.h. (GitHub #102430)
CSIP
Optional CSIS characteristics have been made configurable via Kconfig and must be enabled explicitly:
Coordinated Set Size →
CONFIG_BT_CSIP_SET_MEMBER_SIZE_SUPPORTSet Member Lock →
CONFIG_BT_CSIP_SET_MEMBER_LOCK_SUPPORTSet Member Rank →
CONFIG_BT_CSIP_SET_MEMBER_RANK_SUPPORT
Bluetooth Classic
The BR/EDR specific callbacks
role_changedandbr_mode_changedinbt_conn_cbhave been moved into a new sub-structbt_conn_br_cb, accessible via thebrmember. Application code using these callbacks must update the designated initializers:.role_changed→.br.role_changed.br_mode_changed→.br.mode_changed
Bluetooth HCI
The devicetree compatible
bflb,bl70x-bt-hcihas been renamed tobflb,bt-hci, now that a single binding covers all Bouffalo Lab on-chip BLE controllers (BL60x/BL70x/BL70XL). Out-of-tree boards and shields must update their devicetree nodes accordingly.
Networking
Ethernet
CONFIG_NET_DEFAULT_IF_ETHERNETnow allows to get the first ethernet interface, instead of the first between ethernet and wifi.
Other subsystems
Demand paging (
subsys/demand_paging) is moved under Memory Management intosubsys/mem_mgmt/demand_paging. Custom backing store and eviction algorithm code need to be moved there.The ring buffer “item” API in
<zephyr/sys/ring_buffer.h>has been deprecated in favor of the new fixed-size queue API in<zephyr/sys/ringq.h>.Code storing fixed-size items should migrate to
sys_ringq(see sys_ringq Data Structure). Code that only used the item API at the byte level should switch to the byte-mode functionsring_buf_put()/ring_buf_get()calls on the samering_buf. (GitHub #98255)
Modules
Support for the CANopenNode protocol stack was moved to an external module.
hal_nxp
S32K344: The pinmux header file for this SoC was renamed from
S32K344-172MQFP-pinctrl.htoS32K344_K324_K314_172HDQFP-pinctrl.h. Out-of-tree boards must update their include directive accordingly:#include <nxp/s32/S32K344_K324_K314_172HDQFP-pinctrl.h>
Mbed TLS
CONFIG_MBEDTLS_SSL_EARLY_DATAis now an explicit opt-in and is no longer implicitly enabled byCONFIG_MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED. Out-of-tree applications or board configurations that rely on TLS 1.3 PSK early data (0-RTT) must now explicitly enableCONFIG_MBEDTLS_SSL_EARLY_DATA.
Architectures
A new architecture primitive,
arch_cpu_irqs_are_enabled(), has been added. It returns the current interrupt-enable state of the calling CPU without modifying it, complementingarch_irq_unlocked()which inspects a saved key. Out-of-tree architecture ports must provide an implementation.