Migration guide to Zephyr v4.1.0 (Working Draft)

This document describes the changes required when migrating your application from Zephyr v4.0.0 to Zephyr v4.1.0.

Any other changes (not directly related to migrating applications) can be found in the release notes.

Build System

Kernel

Boards

Devicetree

STM32

  • MCO clock source and prescaler are now exclusively configured by the DTS as it was introduced earlier. The Kconfig method for configuration is now removed.

Modules

Mbed TLS

  • If a platform has a CSPRNG source available (i.e. CONFIG_CSPRNG_ENABLED is set), then the Kconfig option CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG is the default choice for random number source instead of CONFIG_MBEDTLS_PSA_CRYPTO_LEGACY_RNG. This helps in reducing ROM/RAM footprint of the Mbed TLS library.

  • The newly-added Kconfig option CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT allows to specify the number of key slots available in the PSA Crypto core. Previously this value was not explicitly set, so Mbed TLS’s default value of 32 was used. The new Kconfig option defaults to 16 instead in order to find a reasonable compromise between RAM consumption and most common use cases. It can be further trimmed down to reduce RAM consumption if the final application doesn’t need that many key slots simultaneously.

Trusted Firmware-M

LVGL

  • The config option CONFIG_LV_Z_FLUSH_THREAD_PRIO is now called CONFIG_LV_Z_FLUSH_THREAD_PRIORITY and its value is now interpreted as an absolute priority instead of a cooperative one.

Device Drivers and Devicetree

ADC

  • Renamed the compatible from nxp,kinetis-adc12 to nxp,adc12.

Controller Area Network (CAN)

Display

  • Displays using the MIPI DBI driver which set their MIPI DBI mode via the mipi-mode property in devicetree should now use a string property of the same name, like so:

    /* Legacy display definition */
    
    st7735r: st7735r@0 {
        ...
        mipi-mode = <MIPI_DBI_MODE_SPI_4WIRE>;
        ...
    };
    
    /* New display definition */
    
    st7735r: st7735r@0 {
        ...
        mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE";
        ...
    };
    

Enhanced Serial Peripheral Interface (eSPI)

Entropy

  • BT HCI based entropy driver now directly sends the HCI command to parse random data instead of waiting for BT connection to be ready. This is helpful on platforms where the BT controller owns the HW random generator and the application processor needs to get random data before BT is fully enabled. (GitHub #79931)

GNSS

I2C

  • Renamed the compatible from nxp,imx-lpi2c to nxp,lpi2c.

Input

Interrupt Controller

LED Strip

MMU/MPU

  • Renamed the compatible from nxp,kinetis-mpu to nxp,sysmpu and added its corresponding binding.

  • Renamed the Kconfig option CPU_HAS_NXP_MPU to CPU_HAS_NXP_SYSMPU.

Pin Control

  • Renamed the compatible from nxp,kinetis-pinctrl to nxp,port-pinctrl.

  • Renamed the compatible from nxp,kinetis-pinmux to nxp,port-pinmux.

  • Silabs Series 2 devices now use a new pinctrl driver selected by silabs,dbus-pinctrl. This driver allows the configuration of GPIO properties through device tree, rather than having them hard-coded for each supported signal. It also supports all possible digital bus signals by including a binding header such as include/zephyr/dt-bindings/pinctrl/silabs/xg24-pinctrl.h.

    Pinctrl should now be configured like this:

    #include <dt-bindings/pinctrl/silabs/xg24-pinctrl.h>
    
    &pinctrl {
      i2c0_default: i2c0_default {
        group0 {
          /* Pin selection(s) using bindings included above */
          pins = <I2C0_SDA_PD2>, <I2C0_SCL_PD3>;
          /* Shared properties for the group of pins */
          drive-open-drain;
          bias-pull-up;
        };
      };
    };
    

Sensors

Serial

  • Renamed the compatible from nxp,kinetis-lpuart to nxp,lpuart.

Stepper

SPI

  • Renamed the compatible from nxp,imx-lpspi to nxp,lpspi.

  • Renamed the compatible from nxp,kinetis-dspi to nxp,dspi.

Regulator

Video

  • The include/zephyr/drivers/video-controls.h got updated to have video controls IDs (CIDs) matching the definitions in the Linux kernel file include/uapi/linux/v4l2-controls.h. In most cases, removing the category prefix is enough: VIDEO_CID_CAMERA_GAIN becomes VIDEO_CID_GAIN. The new video-controls.h source now contains description of each control ID to help disambiguating.

Watchdog

  • Renamed the compatible from nxp,kinetis-wdog32 to nxp,wdog32.

Bluetooth

Bluetooth HCI

  • The BT_CTLR has been deprecated. A new HAS_BT_CTLR has been introduced which should be selected by the respective link layer Kconfig options (e.g. a HCI driver option, or the one for the upstream controller). It’s recommended that all HCI drivers for local link layers select the new option, since that opens up the possibility of indicating build-time support for specific features, which e.g. the host stack can take advantage of.

Bluetooth Mesh

Bluetooth Audio

Bluetooth Classic

Bluetooth Host

Bluetooth Crypto

Networking

Other Subsystems

Flash map

hawkBit

MCUmgr

Modem

Architectures

  • Common

  • native/POSIX

    • CONFIG_NATIVE_APPLICATION has been deprecated. Out-of-tree boards using this option should migrate to the native_simulator runner (GitHub #81232). For an example of how this was done with a board in-tree check GitHub #61481.

    • For the native_sim target CONFIG_NATIVE_SIM_NATIVE_POSIX_COMPAT has been switched to n by default, and this option has been deprecated. Ensure your code does not use the CONFIG_BOARD_NATIVE_POSIX option anymore (GitHub #81232).

  • x86