Migration guide to Zephyr v4.2.0
This document describes the changes required when migrating your application from Zephyr v4.1.0 to Zephyr v4.2.0.
Any other changes (not directly related to migrating applications) can be found in the release notes.
Build System
HWMv1 support has been removed, any out-of-tree boards or SoCs in HWMv1 format must be migrated to HWMv2 to work with Zephyr v4.2 onwards.
Kernel
Boards
All boards based on Nordic ICs that used the
nrfjprogNordic command-line tool for flashing by default have been modified to instead default to the new nRF Util (nrfutil) tool. This means that you may need to install nRF Util or, if you prefer to continue usingnrfjprog, you can do so by invoking west while specifying the runner:west flash -r nrfjprog. The full documentation for nRF Util can be found here.All boards based on a Nordic IC of the nRF54L series now default to not erasing any part of the internal storage when flashing. If you’d like to revert to the previous default of erasing the pages that will be written to by the firmware to be flashed you can set the new
--erase-modecommand-line switch when invokingwest flashtoranges. Note that RRAM on nRF54L devices is not physically paged, and paging is only artificially provided, with a page size of 4096 bytes, for an easier transition of nRF52 software to nRF54L devices.The config option
CONFIG_NATIVE_POSIX_SLOWDOWN_TO_REAL_TIMEhas been deprecated in favor ofCONFIG_NATIVE_SIM_SLOWDOWN_TO_REAL_TIME.The DT binding
zephyr,native-posix-cpuhas been deprecated in favor ofzephyr,native-sim-cpu.Zephyr now supports version 1.11.6 of the NEORV32. NEORV32 processor (SoC) implementations need to be updated to this version to be compatible with Zephyr v4.2.0.
The NEORV32 now targets NEORV32 processor (SoC) templates via board variants. The old
neorv32board target is now namedneorv32/neorv32/up5kdemo.arduino_uno_r4_minima,arduino_uno_r4_wifi, andmikroe_clicker_ra4m1have migrated to new FSP-based configurations. While there are no major functional changes, the device tree structure has been significantly revised. The following device tree bindings are now removed:renesas,ra-gpio,renesas,ra-uart-sci,renesas,ra-pinctrl,renesas,ra-clock-generation-circuit, andrenesas,ra-interrupt-controller-unit. Instead, use the following replacements: -renesas,ra-gpio-ioport-renesas,ra-sci-uart-renesas,ra-pinctrl-pfs-renesas,ra-cgc-pclk-blockNucleo WBA52CG board (
nucleo_wba52cg) is not supported anymore since it is NRND (Not Recommended for New Design) and it is not supported anymore in the STM32CubeWBA from version 1.1.0 (July 2023). The migration to Nucleo WBA55CG (nucleo_wba55cg) is recommended and it could be done without any change.Espressif boards
esp32_devkitc_wroomandesp32_devkitc_wrovershared almost identical features. The differences are covered by the Kconfig options so both boards were merged intoesp32_devkitc.STM32 boards should now add OpenOCD programming support by including
openocd-stm32.board.cmakeinstead ofopenocd.board.cmake. Theopenocd-stm32.board.cmakefile extends the default OpenOCD runner with manufacturer-specific configuration like STM32 mass erase commands.STM32N6570-DK boards’s default variant (
stm32n6570_dk/stm32n657xx) is now supposed to be a chainloaded application and should be built using--sysbuild. The old default, which built applications to run as First Stage BootLoader, is now available as a dedicated variant (stm32n6570_dk/stm32n657xx/fsbl) that must be selected explicitly. See board documentation for more information about these variants.STM32 boards that embed TF-M BL2 boot stage (
b_u585i_iot02a//ns,nucleo_l552ze_q//nsandstm32l562e_dk//ns) do not embed HW crypto accelerator drivers in BL2 as they previously did, now relying on Mbed TLS software implementation. This is related to the upgrade to TF-M v2.2. HW crypto accelerators are still supported in TF-M, but only in the runtime secure firmware.
Device Drivers and Devicetree
Audio
The binding file for
cirrus,cs43l22has been renamed to have a name matching the compatible string.
Counter
counter_native_posixhas been renamedcounter_native_sim, and with it its kconfig options and DT binding.zephyr,native-posix-counterhas been deprecated in favor ofzephyr,native-sim-counter. AndCONFIG_COUNTER_NATIVE_POSIXand its related options withCONFIG_COUNTER_NATIVE_SIM(GitHub #86616).
DAI
Renamed the devicetree property
dai_idtodai-id.Renamed the devicetree property
afe_nametoafe-name.Renamed the devicetree property
agent_disabletoagent-disable.Renamed the devicetree property
ch_numtoch-num.Renamed the devicetree property
mono_inverttomono-invert.Renamed the devicetree property
quad_chtoquad-ch.Renamed the devicetree property
int_oddtoint-odd.
DMA
Renamed the devicetree property
nxp,a_ontonxp,a-on.Renamed the devicetree property
dma_channelstodma-channels.The binding files for Xilinx DMA controllers have been renamed to use the proper vendor prefix (
xlnxinstead ofxilinx) and to match their compatible string.
Devicetree
Many of the vendor-specific and arch-specific files that were in dts/common have been moved to more specific locations. Therefore, any dts files which
#include <common/some_file.dtsi>a file from in the zephyr tree will need to be changed to just#include <some_file.dtsi>.Silicon Labs SoC-level dts files for Series 2 have been reorganized in subdirectories per device superfamily. Therefore, any dts files for boards that use Series 2 SoCs will need to change their include from
#include <silabs/some_soc.dtsi>to#include <silabs/xg2[1-9]/some_soc.dtsi>.The
DT_ENUM_HAS_VALUEandDT_INST_ENUM_HAS_VALUEmacros are now checking all values, when used on an array, not just the first one.Property names in devicetree and bindings use hyphens(
-) as separators, and replacing all previously used underscores(_). For local code, you can migrate property names in bindings to use hyphens by running thescripts/utils/migrate_bindings_style.pyscript.
Display
On STM32 devices, the LTDC driver (
st,stm32-ltdc) RGB565 formatPIXEL_FORMAT_RGB565has been replaced byPIXEL_FORMAT_BGR565to match the format expected by Zephyr. This change ensures proper behavior of both display and video capture samples.
EEPROM
ti,tmp116-eepromhas been renamed toti,tmp11x-eeprombecause it supports both tmp117 and tmp119.
Enhanced Serial Peripheral Interface (eSPI)
Renamed the devicetree property
io_girqtoio-girq.Renamed the devicetree property
vw_girqstovw-girqs.Renamed the devicetree property
pc_girqtopc-girq.Renamed the devicetree property
poll_timeouttopoll-timeout.Renamed the devicetree property
poll_intervaltopoll-interval.Renamed the devicetree property
consec_rd_timeouttoconsec-rd-timeout.Renamed the devicetree property
sus_chk_delaytosus-chk-delay.Renamed the devicetree property
sus_rsm_intervaltosus-rsm-interval.
Entropy
fake_entropy_native_posixhas been renamedfake_entropy_native_sim, and with it its kconfig options and DT binding.zephyr,native-posix-rnghas been deprecated in favor ofzephyr,native-sim-rng. AndCONFIG_FAKE_ENTROPY_NATIVE_POSIXand its related options withCONFIG_FAKE_ENTROPY_NATIVE_SIM(GitHub #86615).
Ethernet
Removed Kconfig option
ETH_STM32_HAL_MII(GitHub #86074). PHY interface type is now selected via thephy-connection-typeproperty in the device tree.The
st,stm32-ethernetdriver now requires thephy-handlephandle to be set to the according PHY node in the device tree (GitHub #87593).The Kconfig options
ETH_STM32_HAL_PHY_ADDRESS,ETH_STM32_CARRIER_CHECK,ETH_STM32_CARRIER_CHECK_RX_IDLE_TIMEOUT_MS,ETH_STM32_AUTO_NEGOTIATION_ENABLE,ETH_STM32_SPEED_10M,ETH_STM32_MODE_HALFDUPLEXhave been removed, as they are no longer needed, and the driver now uses the ethernet phy api to communicate with the phy driver, which is responsible for configuring the phy settings (GitHub #87593).ethernet_native_posixhas been renamedethernet_native_tap, and with it its kconfig options:CONFIG_ETH_NATIVE_POSIXand its related options have been deprecated in favor ofCONFIG_ETH_NATIVE_TAP(GitHub #86578).NuMaker Ethernet driver
eth_numaker.cnow supportsgen_random_mac, and the EMAC data flash feature has been removed (GitHub #87953).The enum
ETHERNET_DSA_MASTER_PORTandETHERNET_DSA_SLAVE_PORTin include/zephyr/net/ethernet.h have been renamed toETHERNET_DSA_CONDUIT_PORTandETHERNET_DSA_USER_PORT.Enums for the Ethernet speed have been renamed to be more independent of the used medium.
LINK_HALF_10BASE_T,LINK_FULL_10BASE_T,LINK_HALF_100BASE_T,LINK_FULL_100BASE_T,LINK_HALF_1000BASE_T,LINK_FULL_1000BASE_T,LINK_FULL_2500BASE_TandLINK_FULL_5000BASE_Thave been renamed toLINK_HALF_10BASE,LINK_FULL_10BASE,LINK_HALF_100BASE,LINK_FULL_100BASE,LINK_HALF_1000BASE,LINK_FULL_1000BASE,LINK_FULL_2500BASEandLINK_FULL_5000BASE.ETHERNET_LINK_10BASE_T,ETHERNET_LINK_100BASE_T,ETHERNET_LINK_1000BASE_T,ETHERNET_LINK_2500BASE_TandETHERNET_LINK_5000BASE_Thave been renamed toETHERNET_LINK_10BASE,ETHERNET_LINK_100BASE,ETHERNET_LINK_1000BASE,ETHERNET_LINK_2500BASEandETHERNET_LINK_5000BASErespectively (GitHub #87194).ETHERNET_CONFIG_TYPE_LINK,ETHERNET_CONFIG_TYPE_DUPLEX,ETHERNET_CONFIG_TYPE_AUTO_NEGand the relatedNET_REQUEST_ETHERNET_SET_LINK,NET_REQUEST_ETHERNET_SET_DUPLEX,NET_REQUEST_ETHERNET_SET_AUTO_NEGOTIATIONhave been removed.phy_configure_link()together withnet_eth_get_phy()should be used instead to configure the link (GitHub #90652).phy_configure_link()got aflagsparameter. Set it to0to preserve the old behavior (GitHub #91354).
Flash
Renamed the file from
flash_hp_ra.htosoc_flash_renesas_ra_hp.h.Renamed the file from
flash_hp_ra.ctosoc_flash_renesas_ra_hp.c.Renamed the file from
flash_hp_ra_ex_op.ctosoc_flash_renesas_ra_hp_ex_op.c.The Flash HP Renesas RA dual bank mode Kconfig symbol
CONFIG_DUAL_BANK_MODEhas been removed.The Flash HP Renesas RA Kconfig symbol
CONFIG_RA_FLASH_HPhas been renamed toCONFIG_SOC_FLASH_RENESAS_RA_HP.The Flash HP Renesas RA write protect Kconfig symbol
CONFIG_FLASH_RA_WRITE_PROTECThas been renamed toCONFIG_FLASH_RENESAS_RA_HP_WRITE_PROTECT.Separate the file
renesas,ra-nv-flash.yamlinto 2 filesrenesas,ra-nv-code-flash.yamlandrenesas,ra-nv-data-flash.yaml.Separate the
compatiblefromrenesas,ra-nv-flashtorenesas,ra-nv-code-flash.yamlandrenesas,ra-nv-data-flash.yaml.
GPIO
To support the RP2350B, which has many pins, the Raspberry Pi-GPIO configuration has been changed. The previous role of
raspberrypi,rpi-gpiohas been migrated toraspberrypi,rpi-gpio-port, andraspberrypi,rpi-gpiois now left as a placeholder and mapper. The labels have also been changed along, so no changes are necessary for regular use.arduino-nano-header-r3is renamed toarduino-nano-header. Because the R3 comes from the Arduino UNO R3, which has changed the connector from the former version, and is unrelated to the Arduino Nano.Moved file
include/zephyr/dt-bindings/gpio/nordic-npm1300-gpio.hto include/zephyr/dt-bindings/gpio/nordic-npm13xx-gpio.h and renamed all instances ofNPM1300toNPM13XXin the definesRenamed
CONFIG_GPIO_NPM1300toCONFIG_GPIO_NPM13XX,CONFIG_GPIO_NPM1300_INIT_PRIORITYtoCONFIG_GPIO_NPM13XX_INIT_PRIORITY
I2S
The
nxp,mcux-i2sdriver added propertymclk-output. Set this property toconfigure the MCLK signal as an output. Older driver versions used the macro
I2S_OPT_BIT_CLK_SLAVEto configure the MCLK signal direction. (GitHub #88554)
LED
Renamed
CONFIG_LED_NPM1300toCONFIG_LED_NPM13XX
MFD
Moved file
include/zephyr/drivers/mfd/npm1300.hto include/zephyr/drivers/mfd/npm13xx.h and renamed all instances ofnpm1300/NPM1300tonpm13xx/NPM13XXin the enums and function namesRenamed
CONFIG_MFD_NPM1300toCONFIG_MFD_NPM13XX,CONFIG_MFD_NPM1300_INIT_PRIORITYtoCONFIG_MFD_NPM13XX_INIT_PRIORITY
Misc
Moved file
drivers/memc/memc_nxp_flexram.hto include/zephyr/drivers/misc/flexram/nxp_flexram.h so that the file can be included using<zephyr/drivers/misc/flexram/nxp_flexram.h>. Modification to CMakeList.txt to use include this driver is no longer required.All memc_flexram_* namespaced things including kconfigs and C API have been changed to just flexram_*.
Select
CONFIG_ETHOS_UinsteadCONFIG_ARM_ETHOS_Uto enable Ethos-U NPU driver.Rename all configs that have prefix
CONFIG_ARM_ETHOS_U_toCONFIG_ETHOS_U_.
Modem
Removed Kconfig option
CONFIG_MODEM_CELLULAR_CMUX_MAX_FRAME_SIZEin favor ofCONFIG_MODEM_CMUX_WORK_BUFFER_SIZEandCONFIG_MODEM_CMUX_MTU.
Regulator
Moved file
include/zephyr/dt-bindings/regulator/npm1300.hto include/zephyr/dt-bindings/regulator/npm13xx.h and renamed all instances ofNPM1300toNPM13XXin the definesRenamed
CONFIG_REGULATOR_NPM1300toCONFIG_REGULATOR_NPM13XX,CONFIG_REGULATOR_NPM1300_COMMON_INIT_PRIORITYtoREGULATOR_NPM13XX_COMMON_INIT_PRIORITY,CONFIG_REGULATOR_NPM1300_INIT_PRIORITYtoCONFIG_REGULATOR_NPM13XX_INIT_PRIORITYnordic,npm1300-regulatorBUCK and LDO node GPIO properties are now specified as an integer array without a GPIO controller, removing the requirement for anordic,npm1300-gpionode to be present and enabled for GPIO control of the output rails. For example,enable-gpios = <&pmic_gpios 3 GPIO_ACTIVE_LOW>;is now specified asenable-gpio-config = <3 GPIO_ACTIVE_LOW>;.
SPI
Renamed
CONFIG_SPI_MCUX_LPSPItoCONFIG_SPI_NXP_LPSPI, and similar for any child configs for that driver, includingCONFIG_SPI_NXP_LPSPI_DMAandCONFIG_SPI_NXP_LPSPI_CPU.Renamed the device tree property
port_seltoport-sel.Renamed the device tree property
chip_selecttochip-select.The binding file for
andestech,atcspi200has been renamed to have a name matching the compatible string.
Sensors
ltrvendor prefix has been renamed toliteon, and with it theltr,f216aname has been replaced byliteon,ltrf216a. The choiceDT_HAS_LTR_F216A_ENABLEDhas been replaced withDT_HAS_LITEON_LTRF216A_ENABLED(GitHub #85453)ti,tmp116has been renamed toti,tmp11xbecause it supports tmp116, tmp117 and tmp119.meas,ms5837has been replaced bymeas,ms5837-30baandmeas,ms5837-02ba. In order to use one of the two variants, the status property needs to be used as well.The
we,wsen-itdsdriver has been renamed towe,wsen-itds-2533020201601. The Device Tree can be configured as follows:&i2c0 { itds:itds-2533020201601@19 { compatible = "we,wsen-itds-2533020201601"; reg = <0x19>; odr = "400"; op-mode = "high-perf"; power-mode = "normal"; events-interrupt-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; drdy-interrupt-gpios = < &gpio1 2 GPIO_ACTIVE_HIGH >; }; };
The binding file for
raspberrypi,pico-temp.yamlhas been renamed to have a name matching the compatible string.Moved file
include/zephyr/drivers/sensor/npm1300_charger.hto include/zephyr/drivers/sensor/npm13xx_charger.h and renamed all instances ofNPM1300toNPM13XXin the enumsRenamed
CONFIG_NPM1300_CHARGERtoCONFIG_NPM13XX_CHARGER
Serial
uart_native_posixhas been renameduart_native_pty, and with it its kconfig options and DT binding.zephyr,native-posix-uarthas been deprecated in favor ofzephyr,native-pty-uart.CONFIG_UART_NATIVE_POSIXand its related options withCONFIG_UART_NATIVE_PTY. The choiceCONFIG_NATIVE_UART_0has been replaced withCONFIG_UART_NATIVE_PTY_0, but now, it is also possible to select if a UART is connected to the process stdin/out instead of a PTY at runtime with the command line option--<uart_name>_stdinout.CONFIG_NATIVE_UART_AUTOATTACH_DEFAULT_CMDhas been replaced withCONFIG_UART_NATIVE_PTY_AUTOATTACH_DEFAULT_CMD.CONFIG_UART_NATIVE_WAIT_PTS_READY_ENABLEhas been deprecated. The functionality it enabled is now always enabled as there is no drawbacks from it.CONFIG_UART_NATIVE_POSIX_PORT_1_ENABLEhas been deprecated. This option does nothing now. Instead users should instantiate as manyzephyr,native-pty-uartnodes as native PTY UART instances they want. (GitHub #86739)
Stepper
Refactored the
stepper_enable(const struct device * dev, bool enable)function tostepper_enable()&stepper_disable().
Timer
native_posix_timerhas been renamednative_sim_timer, and so its kconfig optionCONFIG_NATIVE_POSIX_TIMERhas been deprecated in favor ofCONFIG_NATIVE_SIM_TIMER, (GitHub #86612).andestech,machine-timer,neorv32-machine-timer,telink,machine-timer,lowrisc,machine-timer,niosv-machine-timer, andscr,machine-timerhave been unified underriscv,machine-timer.The addresses of both
MTIMEandMTIMECMPregisters must now be explicitly specified using theregandreg-namesproperties. Thereg-namesproperty is now required, and must list names corresponding one-to-one with each entry inreg. (GitHub #84175 and GitHub #89847)Example:
mtimer: timer@d1000000 { compatible = "riscv,machine-timer"; interrupts-extended = <&cpu0_intc 7>; reg = <0xd1000000 0x8 0xd1000008 0x8>; reg-names = "mtime", "mtimecmp"; };
It is now possible to use a
timebase-frequencyproperty in the cpus DTS group to provide the value forCONFIG_SYS_CLOCK_HW_CYCLES_PER_SECinstead of using a value: GitHub #91296
Video
8 bit RAW Bayer formats BGGR8 / GBRG8 / GRBG8 / RGGB8 have been renamed by adding a S prefix in front:
VIDEO_PIX_FMT_BGGR8becomesVIDEO_PIX_FMT_SBGGR8VIDEO_PIX_FMT_GBRG8becomesVIDEO_PIX_FMT_SGBRG8VIDEO_PIX_FMT_GRBG8becomesVIDEO_PIX_FMT_SGRBG8VIDEO_PIX_FMT_RGGB8becomesVIDEO_PIX_FMT_SRGGB8On STM32 devices, the DCMI driver (
st,stm32-dcmi) now relies on endpoint based video-interfaces.yaml bindings for sensor interface properties (such as bus width and synchronization signals). Also thecapture-rateproperty has been replaced by the usage of the frame interval APIvideo_set_frmival(). See (GitHub #89627).video_endpoint_idhas been dropped. It is no longer a parameter in any video API.video_buf_typehas been added. It is a required parameter in the following video APIs:set_stream(),video_stream_start(),video_stream_stop()video_format.pitchhas been updated to be set explicitly by the driver, a task formerly required by the application. This update enables the application to correctly allocate a buffer size on a per driver basis. Existing applications will not be broken by this change but can be simplified as performed in the sample in the commit33dcbe37cfd3593e8c6e9cfd218dd31fdd533598.Samples and projects using the native simulator now require specifying the
--snippetvideo-sw-generator to build correctly.video_query_ctrl()now takes a single argument with thevideo_ctrl_query, which now contains avideo_ctrl_query.devfield to specify and read back which device is being queried (GitHub #91265).
Watchdog
Renamed
CONFIG_WDT_NPM1300toCONFIG_WDT_NPM13XX,CONFIG_WDT_NPM1300_INIT_PRIORITYtoCONFIG_WDT_NPM13XX_INIT_PRIORITY
qSPI/oSPI/xSPI
On STM32 devices, external memories device tree descriptions for size and address are now split in two separate properties to comply with specification recommendations.
For instance, following external flash description
reg = <0x70000000 DT_SIZE_M(64)>; /* 512 Mbits /is changed toreg = <0>;size = <DT_SIZE_M(512)>; / 512 Mbits */.Note that the property gives the actual size of the memory device in bits. Previous mapping address information is now described in xspi, ospi or qspi nodes at SoC dtsi level.
Bluetooth
Bluetooth Audio
CONFIG_BT_CSIP_SET_MEMBER_NOTIFIABLEhas been renamed toCONFIG_BT_CSIP_SET_MEMBER_SIRK_NOTIFIABLE`. (GitHub #86763`)bt_csip_set_member_get_sirkhas been removed. Usebt_csip_set_member_get_info()to get the SIRK (and other information). (GitHub #86996)BT_AUDIO_CONTEXT_TYPE_PROHIBITEDhas been renamed toBT_AUDIO_CONTEXT_TYPE_NONE. (GitHub #89506)
Bluetooth Classic
The parameters of HFP AG callback
sco_disconnectedof the structbt_hfp_ag_cbhave been changed to SCO connection objectstruct bt_conn *sco_connand the disconnection reason of the SCO connectionuint8_t reason.
Bluetooth HCI
The buffer types passing through the HCI driver interface are now indicated as H:4 encoded prefix bytes as part of the buffer payload itself. The bt_buf_set_type() and bt_buf_get_type() functions have been deprecated, but are still usable, with the exception that they can only be called once per buffer.
The
bt_hci_cmd_create()function has been deprecated and the newbt_hci_cmd_alloc()function should be used instead. The new function takes no parameters because the command sending functions have been updated to do the command header encoding.
Bluetooth Host
The symbols
BT_LE_CS_TONE_ANTENNA_CONFIGURATION_INDEX_<NUMBER>in include/zephyr/bluetooth/conn.h have been renamed toBT_LE_CS_TONE_ANTENNA_CONFIGURATION_A<NUMBER>_B<NUMBER>.The ISO data paths are not longer setup automatically, and shall explicitly be setup and removed by the application by calling
bt_iso_setup_data_path()andbt_iso_remove_data_path()respectively. (GitHub #75549)BT_ISO_CHAN_TYPE_CONNECTEDhas been split intoBT_ISO_CHAN_TYPE_CENTRALandBT_ISO_CHAN_TYPE_PERIPHERALto better describe the type of the ISO channel, as behavior for each role may be different. Any existing uses/checks forBT_ISO_CHAN_TYPE_CONNECTEDcan be replaced with an||of the two. (GitHub #75549)The
struct _bt_gatt_cccin include/zephyr/bluetooth/gatt.h has been renamed to structbt_gatt_ccc_managed_user_data. (GitHub #88652)The macro
BT_GATT_CCC_INITIALIZERin include/zephyr/bluetooth/gatt.h has been renamed toBT_GATT_CCC_MANAGED_USER_DATA_INIT. (GitHub #88652)The
CONFIG_BT_ISO_TX_FRAG_COUNTKconfig option was removed as it was completely unused. Any uses of it can simply be removed. (GitHub #89836)
Networking
The struct
net_linkaddr_storagehas been renamed to structnet_linkaddrand the old structnet_linkaddrhas been removed. The structnet_linkaddrnow contains space to store the link address instead of having pointer that point to the link address. This avoids possible dangling pointers when cloning structnet_pkt. This will increase the size of structnet_pktby 4 octets for IEEE 802.15.4, but there is no size increase for other network technologies like Ethernet. Note that any code that is using structnet_linkaddrdirectly, and which has checks likeif (lladdr->addr == NULL), will no longer work as expected (because the addr is not a pointer) and must be changed toif (lladdr->len == 0)if the code wants to check that the link address is not set.TLS credential type
TLS_CREDENTIAL_SERVER_CERTIFICATEwas renamed to more genericTLS_CREDENTIAL_PUBLIC_CERTIFICATEto better reflect the purpose of this credential type.The MQTT public API function
mqtt_disconnect()has changed. The function now accepts additionalparamparameter to support MQTT 5.0 case. The parameter is optional and not used with older MQTT versions - MQTT 3.1.1 users should pass NULL as an argument.The
AF_PACKET/SOCK_RAW/IPPROTO_RAWsocket combination is no longer supported, asAF_PACKETsockets should only accept IEEE 802.3 protocol numbers. As an alternative,AF_PACKET/SOCK_DGRAM/ETH_P_ALLorAF_INET(6)/SOCK_RAW/IPPROTO_IPsockets can be used, depending on the actual use case.The HTTP server now respects the configured
_concurrentand_backlogvalues. Check that you provide applicable values toHTTP_SERVICE_DEFINE_EMPTY,HTTPS_SERVICE_DEFINE_EMPTY,HTTP_SERVICE_DEFINEandHTTPS_SERVICE_DEFINE.CONFIG_NET_ZPERFno longer includes server support by default. To use the server commands, enableCONFIG_NET_ZPERF_SERVER. If server support is not needed,CONFIG_ZVFS_POLL_MAXcan possibly be reduced.The L2 Wi-Fi shell now supports interface option for most commands, to accommodate this change some of the existing options have been renamed. The following table summarizes the changes:
Command(s)
Old option
New option
wifi connectwifi ap enable-i-gwifi twt setup-i-pwifi ap config-i-twifi modewifi channelwifi packet_filter--if-index--ifaceThe
http_response_cb_tHTTP client response callback signature has changed. The callback function now returnsintinstead ofvoid. This allows the application to abort the HTTP connection. Existing applications need to update their response callback implementations. To retain current behavior, simply return 0 from the callback.The API signature of
net_mgmtevent handlernet_mgmt_event_handler_tand request handlernet_mgmt_request_handler_thas changed. The management event type is changed fromuint32_ttouint64_t. The change allows event number values to be bit masks instead of enum values. The layer code still stays as a enum value. TheNET_MGMT_LAYER_CODEandNET_MGMT_GET_COMMANDcan be used to get the layer code and management event command from the actual event value in the request or event handlers if needed.The socket options for
net_mgmttype sockets cannot directly be network management event types as those are nowuint64_tand the socket option expects a normal 32 bit integer value. Because of this, a newSO_NET_MGMT_ETHERNET_SET_QAV_PARAMandSO_NET_MGMT_ETHERNET_GET_QAV_PARAMsocket options are created that will replace the previously usedNET_REQUEST_ETHERNET_SET_QAV_PARAMandNET_REQUEST_ETHERNET_GET_QAV_PARAMoptions.The DNS server resolver configuration functions
dns_resolve_reconfigure()anddns_resolve_reconfigure_with_interfaces()now require that the user supplies the source of the DNS server information. For example when DNS server information is received via DHCPv4, thenDNS_SOURCE_DHCPV4needs to be specified.
LwM2M
Accelerometer object: optional resources Y value, Z value, min range value, max range value can now be used optionally as per the accelerometer object’s specification. Users of these resources will now need to provide a read buffer.
OpenThread
The OpenThread stack integration in Zephyr has undergone a major refactor. The implementation has been moved from the Zephyr networking layer (
subsys/net/l2/openthread/) to a dedicated module (modules/openthread/).OpenThread is now a standalone module in Zephyr. It can be used independently of Zephyr’s networking stack (L2 and IEEE802.15.4 shim layers). This enables new use cases, such as applications that use OpenThread directly with their own IEEE802.15.4 driver, or that do not need the full Zephyr networking stack.
Most functions in the include/zephyr/net/openthread.h file have been deprecated. These deprecated APIs are still available for backward compatibility, but new applications should use the new APIs provided by the OpenThread module. The following list summarizes the changes:
Mutex handling:
Previously:
openthread_api_mutex_lockopenthread_api_mutex_try_lockopenthread_api_mutex_unlock
Now use:
openthread_mutex_lock()openthread_mutex_try_lock()openthread_mutex_unlock()
OpenThread starting:
Previously:
openthread_startNow use:
openthread_run()
Callback registration:
Previously:
openthread_state_changed_cb_registeropenthread_state_changed_cb_unregister
Now use:
openthread_state_changed_callback_register()openthread_state_changed_callback_unregister()
Callback structure:
Previously:
openthread_state_changed_cbNow use:
openthread_state_changed_callback
The following
openthread_contextstruct fields are deprecated and shall not be used in new code anymore:instanceapi_lockwork_qapi_workstate_change_cbs
The new functions that were not present before:
openthread_init()to initialize the OpenThread stack.openthread_stop()to stop and disable the OpenThread stack.openthread_set_receive_cb()to set the receive callback for the OpenThread stack.
The OpenThread-related Kconfig options from
subsys/net/l2/openthread/Kconfighave been moved to modules/openthread/Kconfig. All Kconfig options remain the same. You can still use them in the same way as before, but to modify them, use the new path in the menuconfig or guiconfig.If the
CONFIG_NET_L2_OPENTHREADKconfig option is enabled, Zephyr’s L2 layer will use the new OpenThread module API as its backend. The L2 layer no longer implements OpenThread itself, but delegates the implementation to the module.For existing applications using OpenThread through Zephyr’s networking stack:
Your application should continue to work, as the old APIs are still available for compatibility. However, you are encouraged to migrate to the new APIs for future-proofing and use the new modular structure.
Update any references to OpenThread Kconfig options to use the new path (
modules/openthread/Kconfig) in your configuration tools.
For applications using
openthread_contextor other deprecated APIs:Begin migrating to the new APIs. The deprecated APIs will be removed in a future release.
Avoid direct use of
openthread_contextand related fields; use the new initialization and callback registration functions instead.
For new applications or those using OpenThread without Zephyr L2:
Use the new initialization (
openthread_init()), run (openthread_run()), and callback registration APIs (openthread_state_change_callback_register()).You can now use OpenThread directly, without enabling Zephyr’s L2 or IEEE802.15.4 layers, if your use case allows.
Other subsystems
Modbus
The
client_stop_bitsfield inmodbus_serial_paramhas been renamed intostop_bits. The setting is valid in both client and server modes.Custom stop-bit settings are disabled by default and should be enabled by
CONFIG_MODBUS_NONCOMPLIANT_SERIAL_MODE.
State Machine Framework
smf_set_handled()has been removed.State run actions now return an
smf_state_resultvalue instead of void. and the return code determines if the event is propagated to parent run actions or has been handled. A run action that handles the event completely should returnSMF_EVENT_HANDLED, and run actions that propagate handling to parent states should returnSMF_EVENT_PROPAGATE.Flat state machines ignore the return value; returning
SMF_EVENT_HANDLEDwould be the most technically accurate response.
hawkBit
When
CONFIG_HAWKBIT_CUSTOM_DEVICE_IDis enabled, device_id will no longer be prepended withCONFIG_BOARD. It is the user’s responsibility to write a callback that prepends the board name if needed.
Modules
CMSIS
Cortex-M boards/socs now require the
CMSIS_6module to build properly (instead ofcmsiswhich was CMSIS 5.9.0). If trying to build a Cortex-M board, do awest updateto make sure thatCMSIS_6module is available before runningwest buildor other commands.Boards or SOCs or modules using the older
cmsismodule either with a local copy or via theCONFIG_ZEPHYR_CMSIS_MODULE_DIRare requested to move to theCMSIS_6module which can be accessed via theCONFIG_ZEPHYR_CMSIS_6_MODULE_DIRconfiguration.Note: Zephyr will continue using the older
cmsismodule for Cortex-A and Cortex-R targets.
Architectures
Moved
CONFIG_SRAM_VECTOR_TABLEfromzephyr/Kconfig.zephyrtozephyr/arch/Kconfigand added dependency toCONFIG_XIP,CONFIG_ARCH_HAS_VECTOR_TABLE_RELOCATIONandCONFIG_ROMSTART_RELOCATION_ROMto support relocation of vector table in RAM.Renamed
CONFIG_DEBUG_INFOtoCONFIG_X86_DEBUG_INFOto better reflect its purpose. This option is now only available for x86 architecture.