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_area devicetree node of the SoC. The zephyr,sram chosen node of the in-tree boards is now cpuapp_sram_app, a child node of cpuapp_sram that starts after the push area. The nodes are not present when USE_NON_SECURE_ADDRESS_MAP is 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_sram with zephyr,sram = &cpuapp_sram_app.

    • To limit the SRAM available to the application, resize cpuapp_sram_app and keep its offset, for example reg = <0x60 (DT_SIZE_K(184) - 0x60)>. Changing reg of cpuapp_sram no longer changes the SRAM that zephyr,sram refers to.

    • If the memory layout deletes and redefines cpuapp_sram, assign the redefined node to zephyr,sram and leave the first 0x60 bytes 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 the kmu_push_area node.

  • 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@blue or stm32_min_dev@black must use stm32_min_dev@blue/stm32f103x8 or stm32_min_dev@black/stm32f103x8 instead. stm32_min_dev_defconfig was renamed accordingly to stm32_min_dev_stm32f103x8_defconfig.

Device Drivers and Devicetree

ADC

Audio Codec

  • The wolfson,wm8904 binding now requires the clocks and clock-names properties. The MCLK input must always be described in devicetree, either by a clock controller or by a fixed-clock node when it is not backed by a controllable clock source. The driver no longer falls back to computing MCLK as fs-ratio * <sample rate>.

    The fs-ratio property has been replaced by fll-sysclk-fs-ratio, which now only sets the SYSCLK to sample rate ratio generated by the FLL when clock-source is "FLL". It is ignored when clock-source is "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-clock node, CONFIG_CLOCK_CONTROL_FIXED_RATE_CLOCK must be enabled.

Ethernet

  • CONFIG_ETH_PHY_DRIVER is 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_MTU has 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,opamp and nxp,opamp-fast) hold a power state constraint while the device is active, and the OPAMP nodes declare zephyr,disabling-power-states. With CONFIG_PM_POLICY_DEVICE_CONSTRAINTS an enabled OPAMP therefore keeps the system out of Power Down and Deep Power Down for as long as it is active, which without CONFIG_PM_DEVICE_RUNTIME is 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-fast no longer enables an instance marked with is-reference-source from its init function; the instance follows its own power state like every other instance. With CONFIG_PM_DEVICE_RUNTIME an 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

Bluetooth Host

  • The ATT prepare write buffers (CONFIG_BT_ATT_PREPARE_COUNT) are now shared equally between connections: a single connection holds at most CONFIG_BT_ATT_PREPARE_COUNT_PER_CONN of them, which defaults to CONFIG_BT_ATT_PREPARE_COUNT / CONFIG_BT_MAX_CONN but at least 1 (a pool smaller than CONFIG_BT_MAX_CONN therefore stays over-subscribed), and its further Prepare Write Requests are rejected with Prepare Queue Full. Applications with CONFIG_BT_MAX_CONN above 1 whose long or reliable writes need more buffers than that share must either raise CONFIG_BT_ATT_PREPARE_COUNT or set CONFIG_BT_ATT_PREPARE_COUNT_PER_CONN explicitly, accepting in the latter case that one connection can hold buffers the others need. The recommended sizing is CONFIG_BT_ATT_PREPARE_COUNT = buffers needed by one client multiplied by CONFIG_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 -ENOEXEC instead of SHELL_CMD_HELP_PRINTED (1). The help is still printed. Update code that checks the return value of shell_execute_cmd() for this case.

Modules

Architectures