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
The Kconfig options
CONFIG_SRAM_SIZEandCONFIG_SRAM_BASE_ADDRESShave been deprecated, boards should instead use the devicetreezephyr.sramchosen node to specify the RAM node which will be used (whose values populated the Kconfig values). If either option is manually adjusted, it will causeCONFIG_SRAM_DEPRECATED_KCONFIG_SETto be set which indicates this deprecation.The internal Nordic SoC platform Kconfig symbols
NRF_PLATFORM_HALTIUMandNRF_PLATFORM_LUMOSare no longer used by in-tree code, which now relies on explicitCONFIG_SOC_SERIES_NRF54H,CONFIG_SOC_SERIES_NRF92,CONFIG_SOC_SERIES_NRF54LandCONFIG_SOC_SERIES_NRF71checks. Both symbols are kept as deprecated stubs that default toywhen the corresponding SoC series is selected, so existingCONFIG_NRF_PLATFORM_*=ylines anddepends on NRF_PLATFORM_*clauses keep building with a Kconfig deprecation warning. Out-of-tree Kconfig, CMake and code using these symbols should be updated:The
CONFIG_NRF_PLATFORM_HALTIUMwithCONFIG_SOC_SERIES_NRF54HorCONFIG_SOC_SERIES_NRF92.The
CONFIG_NRF_PLATFORM_LUMOSwithCONFIG_SOC_SERIES_NRF54LorCONFIG_SOC_SERIES_NRF71.
The Nordic sysbuild Kconfig option
SB_CONFIG_NRF_HALTIUM_GENERATE_UICRhas been renamed toSB_CONFIG_NRF_GENERATE_UICR. Update sysbuild configurations to use the new name.The Nordic SoC headers
<haltium_power.h>and<haltium_pm_s2ram.h>have been renamed to<soc_power.h>and<soc_pm_s2ram.h>respectively. Forwarder headers under the old names remain available and emit a#warningpointing to the new include paths. Out-of-tree code that includes the old paths should be updated:#include <haltium_power.h>with#include <soc_power.h>.#include <haltium_pm_s2ram.h>with#include <soc_pm_s2ram.h>.
The system clock on STM32H7RS-based boards (stm32h7s78_dk and nucleo_h7s3l8) has been increased to 600 MHz. This is achieved by increasing the PLL1 frequency to 300 MHz, which also affects the bus and kernel clocks, resulting in slightly higher frequencies.
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.
The
DEVICE_APImacro is now mandatory for declaring device driver API instances of any upstream driver class, including in out-of-tree drivers.DEVICE_API_GETnow asserts that the API belongs to the requested class, which requires the instance to live in the class’s iterable section. Out-of-tree driver classes that embed an upstream API as their first member must also declare the relationship withDEVICE_API_EXTENDS, so thatDEVICE_API_GETfor the parent class succeeds on devices implementing the child API. See Driver APIs for details.
ADC
The
girqsandpcrsproperties (array type) ofmicrochip,xec-adchave been replaced by encodedgirqs(usingMCHP_XEC_ECIA_GIRQ_ENCmacros) andpcr-scr(int type) for encoded PCR register index and bit position (GitHub #105658).
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.
Devicetree
intandarraytyped devicetree properties whose DTS source uses a negative literal (e.g.<(-1)>) now expand to a negative value instead of the two’s-complement unsigned value used previously. Code that relied on the old unsigned representation, for example unsigned comparisons orBUILD_ASSERT(DT_PROP(node, foo) > 0, ...)checks, must be updated to use signed types or signed-aware checks (GitHub #107271).
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.
Display
The Kconfig options
CONFIG_SDL_DISPLAY_DEFAULT_PIXEL_FORMAT_*for SDL display pixel-format selection have been removed in favour of setting the pixel-format property directly in devicetree on the SDL pseudo-device node using the PANEL_PIXEL_FORMAT_* macros from include/zephyr/dt-bindings/display/panel.h. (GitHub #104099)
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)port_generate_random_macof thedsa_apigot removed. Alsodsa_port_confignow usesnet_eth_mac_configto set the MAC address.mac_addranduse_random_mac_addrmembers ofdsa_port_configwere removed. Out-of-tree DSA drivers must update their port configuration code to use the new API and structures. (GitHub #108952)The Kconfig option
CONFIG_ETH_NATIVE_TAP_PTP_CLOCKhas been replaced byCONFIG_PTP_CLOCK_NATIVE. A new compatiblezephyr,native-ptp-clockhas been added for the native_sim PTP clock driver.CONFIG_PTP_CLOCK_NATIVEis enabled by default when thezephyr,native-ptp-clockcompatible is present.
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)
Input
The
no-disconnectproperty ofgpio-keyshas been replaced by enumeration propertyzephyr,suspend-action. The new property currently has three values, two of which are direct replacements for the old situations:zephyr,suspend-action = "none";is the remplacement for the behavior when whenno-disconnectwas present. Users of theno-disconnectproperty should replace it withzephyr,suspend-action = "none";.zephyr,suspend-action = "disconnect-with-pupd";is the replacement for the behavior whenno-disconnectwas not present. This is selected by default for backwards compatibility with the previous behavior.zephyr,suspend-action = "full-disconnect";is a new value. (Refer tothe bindingfor more details)
Users of the default configuration are advised to reconsider whether it really is appropriate; migration to
zephyr,suspend-action = "full-disconnect";is recommended. (GitHub #108294)Kconfig options for the ft6146, ft5336, and cst8xx input drivers have been renamed to be consistent with the other input drivers. Applications using the following Kconfig options must update their configurations accordingly:
CONFIG_INPUT_FT5336_PERIOD→CONFIG_INPUT_FT5336_PERIOD_MSCONFIG_INPUT_CST8XX_PERIOD→CONFIG_INPUT_CST8XX_PERIOD_MSCONFIG_INPUT_FT6146_PERIOD→CONFIG_INPUT_FT6146_PERIOD_MS
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.
PWM
The
pcrsproperty (array type) ofmicrochip,xec-pwmhas been replaced bypcr-scr(int type) to use encoded PCR register index and bit position macros (GitHub #104570).STM32 PWM DT bindings macro
PWM_STM32_COMPLEMENTARYthat is deprecated since Zephyr v3.3.0 is no more defined. One shall useSTM32_PWM_COMPLEMENTARYinstead.
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.litex,mmcnow uses thedma-coherentdevicetree property to indicate that the controller’s DMA accesses are coherent with the CPU.CONFIG_SDHC_LITEX_LITESDCARD_NO_COHERENT_DMAis automatically set based on that property and is no longer user-configurable. (GitHub #108411)
Sensor
The
girqsandpcrsproperties (array type) ofmicrochip,xec-tachhave been replaced bypcr-scr(int type) to use encoded PCR register index and bit position macros. GIRQ configuration is now handled via themicrochip,dmec-ecia-girqbinding include (GitHub #104808).
Serial
The return type of
uart_irq_update()is nowvoidinstead ofint. (GitHub #105231)
STM32
gpio-keysdevices will fail to suspend unless propertyzephyr,suspend-actionis present in Devicetree with value"none"or"full-disconnect". Refer to the migration guide entry related to this binding for more details. (GitHub #104690 / GitHub #108294)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.
USB
On STM32N6, the
clockscell which configures the USBPHYC clock mux has been moved fromusbotg_hsNtousbphycNnodes at SoC DTSI level. Boards which use an STM32N6 SoC with custom clock mux configuration must now set theclocksproperty onusbphycNinstead ofusbotg_hsN. (GitHub #107813)
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)The Espressif Wi-Fi driver Kconfig option
CONFIG_ESP32_WIFI_STA_AUTO_DHCPV4has been removed in favor of the genericCONFIG_WIFI_STA_AUTO_DHCPV4. Applications that previously disabled the Espressif-specific option must now disable the generic option to retain manual DHCPv4 or static IP behavior after STA connection.
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)bt_tbs_register_param.supported_featureshas been renamed tobt_tbs_register_param.optional_opcodes. Applications can do a simple search-and-replace forsupported_featurestooptional_opcodes. Additionally theBT_TBS_FEATURE_*macros have been changed toBT_TBS_OPTIONAL_OPCODE_*. Applications can do a simple search-and-replace forBT_TBS_FEATURE_toBT_TBS_OPTIONAL_OPCODE_. (GitHub #103350)
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
Various IP routing related Kconfig options will have now
IPV6prefix added to them. This is done so that we can have IPv4 routing symbols that provide same functionality as IPv6 ones but can be controlled separately.IPv4 and IPv6 unicast route-table support is now exposed through the
CONFIG_NET_IPV4_ROUTEandCONFIG_NET_IPV6_ROUTEoptions.These options control the per-family unicast route tables that are used by static route management, networking shell route commands, and host-side route selection for locally originated traffic such as VPN-bound packets. They do not, by themselves, enable packet forwarding between interfaces.
The Kconfig options
CONFIG_NET_IPV4_ROUTINGandCONFIG_NET_IPV6_ROUTINGhave been renamed toCONFIG_NET_IPV4_FORWARDINGandCONFIG_NET_IPV6_FORWARDING.The renamed options explicitly describe IP forwarding between interfaces. Applications that only need route-table lookups or static routes should enable
CONFIG_NET_IPV4_ROUTEorCONFIG_NET_IPV6_ROUTEand leave forwarding disabled. Applications acting as routers should enable both the route-table option and the corresponding forwarding option.Out-of-tree IPv6 configurations should also migrate away from the deprecated legacy aliases
CONFIG_NET_ROUTE,CONFIG_NET_ROUTING,CONFIG_NET_MAX_ROUTES, andCONFIG_NET_MAX_NEXTHOPSand use theCONFIG_NET_IPV6_*symbols directly.
Ethernet
CONFIG_NET_DEFAULT_IF_ETHERNETnow allows to get the first ethernet interface, instead of the first between ethernet and wifi.The
CONFIG_ETH_QEMU_EXTRA_ARGSandCONFIG_NET_QEMU_USER_EXTRA_ARGSoptions can no longer be used to specify the MAC address for the QEMU Ethernet device. Instead,CONFIG_NET_QEMU_DEVICE_EXTRA_ARGScan be used. This is because we are no longer using the-nicoption for QEMU, but the-netdevand-deviceoptions. (GitHub #107326)
PTP
The PTP UDP protocol Kconfig symbols have been renamed for consistent capitalization:
CONFIG_PTP_UDP_IPv4_PROTOCOLtoCONFIG_PTP_UDP_IPV4_PROTOCOLCONFIG_PTP_UDP_IPv6_PROTOCOLtoCONFIG_PTP_UDP_IPV6_PROTOCOL
gPTP
Converted
int porttouint16_t gptp_portinethernet_contextto make it clear that the field used only by the gPTP stack to store the gPTP port number.Used
uint16_tfornb_portsingptp_default_dsper IEEE 1588 standard.Removed
net_eth_get_ptp_portandnet_eth_set_ptp_port. Newgptp_get_port_number()andgptp_set_port_number()can be used instead.
LoRaWAN
The native LoRaWAN backend (
CONFIG_LORA_MODULE_BACKEND_NATIVE) now requireslorawan_start()before the following runtime configuration APIs are accepted:lorawan_set_datarate()andlorawan_set_conf_msg_tries()return-EPERMif called before start.lorawan_enable_adr()(which has avoidreturn type) logs a warning and drops the call if invoked before start.
Configuration values previously latched by these APIs before
lorawan_start()are no longer retained. Applications that called them during initialization must move the calls to after start. They may still run before or after a successfullorawan_join().lorawan_set_channels_mask()is unaffected and remains callable any time afterlorawan_start(), since the channel mask influences the Join-Request channel selection itself.These ordering requirements do not apply to the LoRaMac-node backend (
CONFIG_LORA_MODULE_BACKEND_LORAMAC_NODE).
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)The
ZTEST_BENCHMARK_SETUP_TEARDOWN()andZTEST_BENCHMARK_TIMED_SETUP_TEARDOWN()macros have been removed. Their setup/teardown signature has been folded intoZTEST_BENCHMARK()andZTEST_BENCHMARK_TIMED(), which now require explicitsetup_fnandteardown_fnarguments at every call site. PassNULLwhen a benchmark genuinely needs neither.Update existing call sites as follows:
/* Before */ ZTEST_BENCHMARK(suite, my_bench, 100) { /* ... */ } ZTEST_BENCHMARK_TIMED(suite, my_bench, 1000) { /* ... */ } ZTEST_BENCHMARK_SETUP_TEARDOWN(suite, my_bench, 100, setup, teardown) { /* ... */ } ZTEST_BENCHMARK_TIMED_SETUP_TEARDOWN(suite, my_bench, 1000, setup, teardown) { /* ... */ } /* After */ ZTEST_BENCHMARK(suite, my_bench, 100, NULL, NULL) { /* ... */ } ZTEST_BENCHMARK_TIMED(suite, my_bench, 1000, NULL, NULL) { /* ... */ } ZTEST_BENCHMARK(suite, my_bench, 100, setup, teardown) { /* ... */ } ZTEST_BENCHMARK_TIMED(suite, my_bench, 1000, setup, teardown) { /* ... */ }
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.CONFIG_PSA_CRYPTO_CLIENThas been removed as it was a duplicate ofCONFIG_PSA_CRYPTO. If you were using it, useCONFIG_PSA_CRYPTOinstead. (GitHub #108960)
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.