Migration guide to Zephyr v4.6.0 (Working Draft)
This document describes the changes required when migrating your application from Zephyr v4.5.0 to Zephyr v4.6.0.
Any other changes (not directly related to migrating applications) can be found in the release notes.
Common
Build System
Kernel
Boards
On the Nordic nRF54L and nRF71 Series SoCs, the push area that the Key Management Unit (KMU) of CRACEN uses to push keys is now reserved at the start of the SRAM by the
kmu_push_areadevicetree node of the SoC. Thezephyr,sramchosen node of the in-tree boards is nowcpuapp_sram_app, a child node ofcpuapp_sramthat starts after the push area. The nodes are not present whenUSE_NON_SECURE_ADDRESS_MAPis used. Out-of-tree boards that use the CRACEN KMU key push should be updated, as otherwise the application RAM overlaps the push area without any diagnostic. Boards that do not use it can keep using the whole RAM:Replace
zephyr,sram = &cpuapp_sramwithzephyr,sram = &cpuapp_sram_app.To limit the SRAM available to the application, resize
cpuapp_sram_appand keep its offset, for examplereg = <0x60 (DT_SIZE_K(184) - 0x60)>. Changingregofcpuapp_sramno longer changes the SRAM thatzephyr,sramrefers to.If the memory layout deletes and redefines
cpuapp_sram, assign the redefined node tozephyr,sramand leave the first0x60bytes of the SRAM free.Remove custom nodes and linker sections that reserve the push area, such as
nrf_kmu_reserved_push_area. They would overlap thekmu_push_areanode.
STM32 Minimum Development Board now declares two SoCs, so the SoC qualifier is mandatory. Applications and test configurations that used
stm32_min_dev,stm32_min_dev@blueorstm32_min_dev@blackmust usestm32_min_dev@blue/stm32f103x8orstm32_min_dev@black/stm32f103x8instead.stm32_min_dev_defconfigwas renamed accordingly tostm32_min_dev_stm32f103x8_defconfig.
Device Drivers and Devicetree
ADC
nxp,lpc-lpadcchannels that useADC_GAIN_1_2for the 30/64 partial scale should useADC_GAIN_15_32: withADC_GAIN_1_2, which still selects that scale, the conversions ofadc_raw_to_millivolts_dt()andadc_raw_to_millivolts()are 6.25% too low.
Audio Codec
The
wolfson,wm8904binding now requires theclocksandclock-namesproperties. The MCLK input must always be described in devicetree, either by a clock controller or by afixed-clocknode when it is not backed by a controllable clock source. The driver no longer falls back to computing MCLK asfs-ratio * <sample rate>.The
fs-ratioproperty has been replaced byfll-sysclk-fs-ratio, which now only sets the SYSCLK to sample rate ratio generated by the FLL whenclock-sourceis"FLL". It is ignored whenclock-sourceis"MCLK".Out-of-tree boards and overlays must be updated, for example:
mclk: mclk { compatible = "fixed-clock"; clock-frequency = <12288000>; #clock-cells = <0>; }; &wm8904 { clocks = <&mclk>; clock-names = "mclk"; };
When using a
fixed-clocknode,CONFIG_CLOCK_CONTROL_FIXED_RATE_CLOCKmust be enabled.
Ethernet
CONFIG_ETH_PHY_DRIVERis no longer enabled by default. It is now selected by the Ethernet drivers that need a PHY driver. Out-of-tree Ethernet drivers that use a PHY driver must select it as well. (GitHub #120871)The Kconfig option
CONFIG_ETH_INTEL_IGC_NET_MTUhas been removed. The Intel IGC Ethernet driver now always uses the standard Ethernet MTU of 1500 bytes, as the Ethernet L2 does not support jumbo frames. (GitHub #122863)
OPAMP
The NXP OPAMP drivers (
nxp,opampandnxp,opamp-fast) hold a power state constraint while the device is active, and the OPAMP nodes declarezephyr,disabling-power-states. WithCONFIG_PM_POLICY_DEVICE_CONSTRAINTSan enabled OPAMP therefore keeps the system out of Power Down and Deep Power Down for as long as it is active, which withoutCONFIG_PM_DEVICE_RUNTIMEis from init onwards. Enable device runtime PM for the node, or suspend it explicitly, to let the system reach those states. (GitHub #122135)nxp,opamp-fastno longer enables an instance marked withis-reference-sourcefrom its init function; the instance follows its own power state like every other instance. WithCONFIG_PM_DEVICE_RUNTIMEan application has to hold a runtime reference on the reference source while it measures an amplifier fed by it. Builds without device runtime PM are unaffected: the device is resumed at init and the instance comes up enabled as before. (GitHub #122135)
Bluetooth
Bluetooth Classic
The L2CAP BR/EDR ECHO API is now only available with
CONFIG_BT_TESTING:bt_l2cap_br_echo_cb,bt_l2cap_br_echo_cb_register(),bt_l2cap_br_echo_cb_unregister(),bt_l2cap_br_echo_req()andbt_l2cap_br_echo_rsp(). The stack answers a received ECHO request with an ECHO response without data, unless a registeredreqcallback handles it.
Bluetooth Host
The ATT prepare write buffers (
CONFIG_BT_ATT_PREPARE_COUNT) are now shared equally between connections: a single connection holds at mostCONFIG_BT_ATT_PREPARE_COUNT_PER_CONNof them, which defaults toCONFIG_BT_ATT_PREPARE_COUNT / CONFIG_BT_MAX_CONNbut at least 1 (a pool smaller thanCONFIG_BT_MAX_CONNtherefore stays over-subscribed), and its further Prepare Write Requests are rejected with Prepare Queue Full. Applications withCONFIG_BT_MAX_CONNabove 1 whose long or reliable writes need more buffers than that share must either raiseCONFIG_BT_ATT_PREPARE_COUNTor setCONFIG_BT_ATT_PREPARE_COUNT_PER_CONNexplicitly, accepting in the latter case that one connection can hold buffers the others need. The recommended sizing isCONFIG_BT_ATT_PREPARE_COUNT= buffers needed by one client multiplied byCONFIG_BT_MAX_CONN, which keeps every connection’s capacity independent of the other connections.
Networking
Other subsystems
Shell
Calling a shell command with an unknown subcommand, such as
kernel foo, now returns-ENOEXECinstead ofSHELL_CMD_HELP_PRINTED(1). The help is still printed. Update code that checks the return value ofshell_execute_cmd()for this case.