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

Security

  • New options for stack canaries have been added, providing users with finer control over stack protection. With this change, CONFIG_STACK_CANARIES no longer enables the compiler option -fstack-protector-all. Users who wish to use this option must now enable CONFIG_STACK_CANARIES_ALL.

Boards

Devicetree

  • The microchip,cap1203 driver has changed its compatible to microchip,cap12xx and has been updated to support multiple channels. The number of available channels is derived from the length of the devicetree array property input-codes. The CONFIG_INPUT_CAP1203_POLL has been removed: If the devicetree property int-gpios is present, interrupt mode is used otherwise, polling is used. The CONFIG_INPUT_CAP1203_PERIOD has been replaced with the devicetree property poll-interval-ms. In interrupt mode, the devicetree property repeat is supported.

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

PWM

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;
        };
      };
    };
    

PWM

  • Renamed the compatible from nxp,kinetis-ftm-pwm to nxp,ftm-pwm.

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

RTC

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

Timer

  • Renamed the compatible from nxp,kinetis-ftm to nxp,ftm and relocate it under dts/bindings/timer.

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

Wi-Fi

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

  • The config options CONFIG_NXP_WIFI_BUILD_ONLY_MODE and CONFIG_NRF_WIFI_BUILD_ONLY_MODE are now unified under CONFIG_BUILD_ONLY_NO_BLOBS making it a common entry point for any vendor to enable builds without blobs.

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

LoRa

  • The function lora_recv_async() and callback lora_recv_cb now include an additional user_data parameter, which is a void pointer. This parameter can be used to reference any user-defined data structure. To maintain the current behavior, set this parameter to NULL.

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