Migration guide to Zephyr v4.4.0 (Working Draft)
This document describes the changes required when migrating your application from Zephyr v4.3.0 to Zephyr v4.4.0.
Any other changes (not directly related to migrating applications) can be found in the release notes.
Build System
Zephyr now officially defaults to C17 (ISO/IEC 9899:2018) as its minimum required C standard version. If your toolchain does not support this standard you will need to use one of the existing and now deprecated options:
CONFIG_STD_C99orCONFIG_STD_C11.
Kernel
Boards
m5stack_fire: Removed unused pinctrl entries for UART2, and updated the UART1 pin mapping from GPIO32/GPIO33 to GPIO16/GPIO17 to match the documented Grove PORT.C wiring.
Compile definitions ‘XIP_EXTERNAL_FLASH’, ‘USE_HYPERRAM’ and ‘XIP_BOOT_HEADER_XMCD_ENABLE’ are only used in boards/nxp/mimxrt1180_evk/xip/evkmimxrt1180_flexspi_nor_config.c and boards/nxp/mimxrt1170_evk/xmcd/xmcd.c, we have changed them to local scope in the respective board CMakeLists.txt files. Applications that depended on these definitions being globally available may need to be updated. (GitHub #101322)
Device Drivers and Devicetree
ADC
The
renesas,ra-adccompatible has been replaced byrenesas,ra-adc12. Applications using the old compatible must update their devicetree nodes.The
renesas,ra-adc16compatible was added. This must be used when working with the EK-RA2A1 board, which provides a 16-bit ADC resolution.Renamed the
CONFIG_ADC_MCUX_SAR_ADCtoCONFIG_ADC_NXP_SAR_ADC.Renamed the driver file from
adc_mcux_sar_adc.cto drivers/adc/adc_nxp_sar_adc.c.Applications using the SAR ADC driver need to update the nodes in the devicetree to include
zephyr,input-positiveto specify the hardware channel. For SoCs that currently support SAR ADC, the reference voltage should useADC_REF_VDD_1instead ofADC_REF_INTERNAL. This driver update also corrects this issue, so users also need to update the value of this property in the devicetree accordingly. (GitHub #100978)
Controller Area Network (CAN)
Removed
CONFIG_CAN_MAX_FILTER,CONFIG_CAN_MAX_STD_ID_FILTER,CONFIG_CAN_MAX_EXT_ID_FILTER(GitHub #100596). These are replaced by the following driver-specific Kconfig symbols, some of which have had their default value increased to meet typical software needs:CONFIG_CAN_NATIVE_LINUX_MAX_FILTERSforzephyr,native-linux-canCONFIG_CAN_SJA1000_MAX_FILTERSforkvaser,pcicanandespressif,esp32-twaiCONFIG_CAN_STM32_BXCAN_MAX_EXT_ID_FILTERSforst,stm32-bxcanCONFIG_CAN_STM32_BXCAN_MAX_STD_ID_FILTERSforst,stm32-bxcanCONFIG_CAN_STM32_FDCAN_MAX_EXT_ID_FILTERSforst,stm32-fdcanCONFIG_CAN_STM32_FDCAN_MAX_STD_ID_FILTERSforst,stm32-fdcanCONFIG_CAN_XMC4XXX_MAX_FILTERSforinfineon,xmc4xxx-can-node
Replaced Kconfig option
CONFIG_CAN_MAX_MBfornxp,flexcanandnxp,flexcan-fdwith per-instancenumber-of-mbandnumber-of-mb-fddevicetree properties (GitHub #99483).
Counter
The NXP LPTMR driver (
nxp,lptmr) has been updated to fix incorrect prescaler and glitch filter configuration:The
prescale-glitch-filterproperty valid range changed from[0-16]to[0-15]. The value16was invalid for pulse counter mode and has been removed. Device trees using value16must be updated to use values in the range[0-15].A new boolean property
prescale-glitch-filter-bypasshas been introduced to explicitly control prescaler/glitch filter bypass. Previously, settingprescale-glitch-filter = <0>implicitly enabled bypass mode, which was ambiguous.In v4.4 and later, bypass is controlled only by the presence of
prescale-glitch-filter-bypass. If the property is absent, the prescaler/glitch filter is active andprescale-glitch-filteris applied.The prescaler/glitch filter behavior has been clarified:
In Time Counter mode: prescaler divides the clock by
2^(prescale-glitch-filter + 1)In Pulse Counter mode: glitch filter recognizes change after
2^prescale-glitch-filterrising edges (value 0 is not supported for glitch filtering)
All in-tree device tree nodes have been updated to use
prescale-glitch-filter-bypass;instead ofprescale-glitch-filter = <0>;. Out-of-tree boards should be updated accordingly.If both
prescale-glitch-filter-bypassandprescale-glitch-filterare set, bypass mode takes precedence and theprescale-glitch-filtervalue is ignored.
Example migration:
/* Old (deprecated) */ lptmr0: counter@40040000 { compatible = "nxp,lptmr"; /* Implicitly bypassed */ prescale-glitch-filter = <0>; }; /* New (correct) */ lptmr0: counter@40040000 { compatible = "nxp,lptmr"; /* Explicitly bypassed */ prescale-glitch-filter-bypass; };
Examples of using
prescale-glitch-filterNote
prescale-glitch-filter-bypassis a boolean. If present, bypass is enabled. If absent, bypass is disabled andprescale-glitch-filteris applied.In Pulse Counter mode,
prescale-glitch-filter = <0>is not a supported glitch filter configuration. To request no filtering, useprescale-glitch-filter-bypass;.Time Counter mode: divide the counter clock
In Time Counter mode the prescaler divides by
2^(N + 1)./* Divide by 2^(0+1) = 2 */ lptmr0: counter@40040000 { compatible = "nxp,lptmr"; /* Time Counter mode */ timer-mode-sel = <0>; clk-source = <1>; clock-frequency = <32768>; /* /2 */ prescale-glitch-filter = <0>; resolution = <16>; }; /* Divide by 2^(3+1) = 16 */ lptmr1: counter@40041000 { compatible = "nxp,lptmr"; /* Time Counter mode */ timer-mode-sel = <0>; clk-source = <1>; clock-frequency = <32768>; /* /16 */ prescale-glitch-filter = <3>; resolution = <16>; };
Time Counter mode: explicit bypass (no division)
lptmr0: counter@40040000 { compatible = "nxp,lptmr"; /* Time Counter mode */ timer-mode-sel = <0>; clk-source = <1>; clock-frequency = <32768>; /* no prescaler */ prescale-glitch-filter-bypass; resolution = <16>; };
Pulse Counter mode: glitch filtering
In Pulse Counter mode the glitch filter recognizes a change after
2^Nrising edges. Value0is not supported for glitch filtering; use bypass if you want no filtering./* Recognize change after 2^2 = 4 rising edges */ lptmr0: counter@40040000 { compatible = "nxp,lptmr"; /* Pulse Counter mode */ timer-mode-sel = <1>; clk-source = <1>; input-pin = <0>; prescale-glitch-filter = <2>; resolution = <16>; }; /* No filtering (explicit bypass) */ lptmr1: counter@40041000 { compatible = "nxp,lptmr"; /* Pulse Counter mode */ timer-mode-sel = <1>; clk-source = <1>; input-pin = <0>; prescale-glitch-filter-bypass; resolution = <16>; };
Ethernet
Driver MAC address configuration support using
net_eth_mac_confighas been introduced for the following drivers:drivers/ethernet/eth_sam_gmac.c (GitHub #96598)
Removed
CONFIG_ETH_SAM_GMAC_MAC_I2C_EEPROMRemoved
CONFIG_ETH_SAM_GMAC_MAC_I2C_INT_ADDRESSRemoved
CONFIG_ETH_SAM_GMAC_MAC_I2C_INT_ADDRESS_SIZERemoved
mac-eepromproperty fromatmel,sam-gmacandatmel,sam0-gmac
The
fixed-linkproperty has been removed fromethernet-phy. Use the newethernet-phy-fixed-linkcompatible instead, if that functionality is needed. There you need to specify the fixed link parameters using thedefault-speedsproperty (GitHub #100454).The
reset-gpiosproperty ofmicrochip,ksz8081has been reworked to be used as active low, you may have to set the pin asGPIO_ACTIVE_LOWin devicetree (GitHub #100751).
Infineon
Infineon driver file names have been renamed to remove
cat1from their names to support reusability across multiple device categories. The following drivers have been renamed (GitHub #99174):adc_ifx_cat1.c→adc_ifx.cclock_control_ifx_cat1.c→clock_control_ifx.ccounter_ifx_cat1.c→counter_ifx.cdma_ifx_cat1.c→dma_ifx.cdma_ifx_cat1_pdl.c→dma_ifx_pdl.cflash_ifx_cat1.c→flash_ifx.cflash_ifx_cat1_qspi.c→flash_ifx_qspi.cflash_ifx_cat1_qspi_mtb_hal.c→flash_ifx_qspi_mtb_hal.cgpio_ifx_cat1.c→gpio_ifx.ci2c_ifx_cat1.c→i2c_ifx.ci2c_ifx_cat1_pdl.c→i2c_ifx_pdl.cmbox_ifx_cat1.c→mbox_ifx.cpinctrl_ifx_cat1.c→pinctrl_ifx.crtc_ifx_cat1.c→rtc_ifx.cifx_cat1_sdio.c→ifx_sdio.csdio_ifx_cat1_pdl.c→sdio_ifx_pdl.cserial_ifx_cat1_uart.c→serial_ifx_uart.cspi_ifx_cat1.c→spi_ifx.cspi_ifx_cat1_pdl.c→spi_ifx_pdl.cuart_ifx_cat1.c→uart_ifx.cuart_ifx_cat1_pdl.c→uart_ifx_pdl.cwdt_ifx_cat1.c→wdt_ifx.c
Corresponding Kconfig symbols and binding files have also been updated:
CONFIG_*_INFINEON_CAT1→CONFIG_*_INFINEONcompatible: "infineon,cat1-adc"→compatible: "infineon,adc"
MDIO
The
mdio_bus_enable()andmdio_bus_disable()functions have been removed. MDIO bus enabling/disabling is now handled internally by the MDIO drivers. (GitHub #99690).
QSPI
st,stm32-qspicompatible nodes configured withdual-flashproperty now need to also include thessht-enableproperty to reenable sample shifting. Sample shifting is configurable now and disabled by default. (GitHub #98999).
Radio
The following devicetree bindings have been renamed for consistency with the
radio-prefix:generic-fem-two-ctrl-pinsis nowradio-fem-two-ctrl-pinsgpio-radio-coexis nowradio-gpio-coex
A new
radio.yamlbase binding has been introduced for generic radio hardware capabilities. Thetx-high-power-supportedproperty has been renamed toradio-tx-high-power-supportedfor consistency.Device trees and overlays using the old compatible strings must be updated to use the new names.
Shell
The
shell_set_bypass()now requires a user data pointer to be passed. And accordingly theshell_bypass_cb_tnow has a user data argument. (GitHub #100311)
Stepper
For
adi,tmc2209, the propertymsx-gpiosis now replaced bym0-gpiosandm1-gpiosfor consistency with other step/dir stepper drivers.Since GitHub #91979, All stepper-drv driver APIs have been refactored out of the stepper API. The following APIs have been moved from Stepper to Stepper-Drv:
stepper_enable()is replaced bystepper_drv_enable().stepper_disable()is replaced bystepper_drv_disable().stepper_set_micro_step_res()is replaced bystepper_drv_set_micro_step_res().stepper_get_micro_step_res()is replaced bystepper_drv_get_micro_step_res().
stepper_micro_step_resolutionis replaced bystepper_drv_micro_step_resolution.STEPPER_DRV_EVENT_STALL_DETECTEDandSTEPPER_DRV_EVENT_FAULT_DETECTEDevents have been refactored tostepper_drv_event.zephyr,gpio-step-dir-stepperimplements Stepper for controlling stepper motors via GPIO step and direction signals. Refer to Individual Stepper Motion Controller and Driver for more details.step-gpios,dir-gpios,invert-directionandcounterproperties are removed fromadi,tmc2209,ti,drv84xxandallegro,a4979, these are now are implemented byzephyr,gpio-step-dir-stepper.stepper_move_by(),stepper_move_to(),stepper_run(),stepper_stop(),stepper_is_moving(),stepper_set_microstep_interval()andstepper_set_event_callback()APIs are removed fromadi,tmc2209,ti,drv84xxandallegro,a4979.adi,tmc2209,ti,drv84xxandallegro,a4979implement Stepper-Drv.
stepper_enable(),stepper_disable(),stepper_set_micro_step_res()andstepper_get_micro_step_res()APIs are removed fromzephyr,h-bridge-stepper.en-gpiosproperty is removed fromzephyr,h-bridge-stepper.micro-step-resproperty is replaced bylut-step-gapproperty inzephyr,h-bridge-stepper.adi,tmc50xxandadi,tmc51xxdevices are now modeled as MFDs.adi,tmc50xx-stepperandadi,tmc51xx-stepperdrivers implement Stepper.adi,tmc50xx-stepper-drvandadi,tmc51xx-stepper-drvdrivers implement Stepper-Drv.
STM32
STM32 power supply configuration is now performed using Devicetree properties. New bindings
st,stm32h7-pwr,st,stm32h7rs-pwrandst,stm32-dualreg-pwrhave been introduced, and all Kconfig symbols related to power supply configuration have been removed:CONFIG_POWER_SUPPLY_LDOCONFIG_POWER_SUPPLY_DIRECT_SMPS,CONFIG_POWER_SUPPLY_SMPS_1V8_SUPPLIES_LDOCONFIG_POWER_SUPPLY_SMPS_2V5_SUPPLIES_LDO,CONFIG_POWER_SUPPLY_SMPS_1V8_SUPPLIES_EXT_AND_LDOCONFIG_POWER_SUPPLY_SMPS_2V5_SUPPLIES_EXT_AND_LDOCONFIG_POWER_SUPPLY_SMPS_1V8_SUPPLIES_EXTCONFIG_POWER_SUPPLY_SMPS_2V5_SUPPLIES_EXTCONFIG_POWER_SUPPLY_EXTERNAL_SOURCE
The ST-specific chosen property
/chosen/zephyr,ccmis replaced by/chosen/zephyr,dtcm. Attribute macros__ccm_data_section,__ccm_bss_sectionand__ccm_noinit_sectionare deprecated, but retained for backwards compatibility; they will be removed in Zephyr 4.5. The generic__dtcm_{data,bss,noinit}_sectionmacros should be used instead. (GitHub #100590)STM32 platforms now use the default MCUboot operating mode
swap using offset(SB_CONFIG_MCUBOOT_MODE_SWAP_USING_OFFSET). To support this bootloader mode, some changes to the board devicetrees are required. Several boards already support this mode (see GitHub #100385). The previousswap using movemode can still be selected in sysbuild by enablingSB_CONFIG_MCUBOOT_MODE_SWAP_USING_MOVE.
USB
maxim,max3421e_spihas been renamed tomaxim,max3421e-spi.
Video
CONFIG_VIDEO_OV7670 is now gone and replaced by CONFIG_VIDEO_OV767X. This allows supporting both the OV7670 and 0V7675.
CONFIG_VIDEO_BUFFER_POOL_SZ_MAXis replaced byCONFIG_VIDEO_BUFFER_POOL_HEAP_SIZEwhich represent the size in byte allocated for the whole video buffer pool.
Bluetooth
Bluetooth Host
CONFIG_BT_SIGNINGhas been deprecated.BT_GATT_CHRC_AUTHhas been deprecated.bt_conn_le_info.intervalhas been deprecated. Usebt_conn_le_info.interval_usinstead. Note that the units have changed:intervalwas in units of 1.25 milliseconds, whileinterval_usis in microseconds.Legacy Bluetooth LE pairing using the passkey entry method no longer grants authenticated (MITM) protection as of the Bluetooth Core Specification v6.2. Stored bonds that were generated using this method will be downgraded to unauthenticated when loaded from persistent storage, resulting in a lower security level.
Networking
Networking APIs found in
and relevant code in
subsys/netetc. is namespaced. This means that eithernet_,NET_orZSOCK_prefix is added to the network API name. This is done in order to avoid circular dependency with POSIX or libc that might define the same symbol. A compatibility header file include/zephyr/net/net_compat.h is created that provides the old symbols allowing the user to continue use the old symbols. External network applications can continue to use POSIX defined network symbols and include relevant POSIX header files likesys/socket.hto get the POSIX symbols as Zephyr networking header files will no longer include those. If the application or Zephyr internal code cannot use POSIX APIs, then the relevant network API prefix needs to be added to the code calling a network API.
Modem
Modem HL78XX
The Kconfig options related to HL78XX startup timing have been renamed in
CONFIG_MODEM_HL78XX_DEV_*as follows:MODEM_HL78XX_DEV_POWER_PULSE_DURATION→MODEM_HL78XX_DEV_POWER_PULSE_DURATION_MSMODEM_HL78XX_DEV_RESET_PULSE_DURATION→MODEM_HL78XX_DEV_RESET_PULSE_DURATION_MSMODEM_HL78XX_DEV_STARTUP_TIME→MODEM_HL78XX_DEV_STARTUP_TIME_MSMODEM_HL78XX_DEV_SHUTDOWN_TIME→MODEM_HL78XX_DEV_SHUTDOWN_TIME_MS
The default startup timing was changed from 1000 ms to 120 ms to improve initialization reliability across all supported boards.
Applications depending on the previous defaults must update their configuration.
Other subsystems
Cache
Use
CONFIG_CACHE_HAS_MIRRORED_MEMORY_REGIONSinstead ofCONFIG_CACHE_DOUBLEMAPas the former is more descriptive of the feature.
JWT
Previously deprecated
CONFIG_JWT_SIGN_RSA_LEGACYis removed. This removal happens before the usual deprecation period of 2 releases because it has been agreed (see GitHub #97660) that Mbed TLS is an external module, so normal deprecation rules do not apply in this case.
Libsbc
Libsbc (sbc.c and sbc.h) is moved under the Bluetooth subsystem. The sbc.h is in include/zephyr/bluetooth now.
Tracing
CTF: Changed uint8_t id to uint16_t id in the CTF metadata event header. This doubles the space used for event IDs but allows 65,535 events instead of 255.
With this change, existing CTF traces with 8-bit IDs won’t be compatible.
Settings
CONFIG_SETTINGS_TFM_ITShas been renamed toCONFIG_SETTINGS_TFM_PSA.
Modules
Trusted Firmware-M
The
SECURE_UART1TF-M define is now controlled by Zephyr’sCONFIG_TFM_SECURE_UART. This option will override any platform values previously specified in the TF-M repository.
Architectures
Renamed
CONFIG_ARCH_HAS_COHERENCEtoCONFIG_CACHE_CAN_SAY_MEM_COHERENCEas the feature is cache related so move it under cache.Use
sys_cache_is_mem_coherent()instead ofarch_mem_coherent().