Zephyr 4.1.0

We are pleased to announce the release of Zephyr version 4.1.0. Major enhancements with this release include:

Performance improvements

Multiple performance improvements of core Zephyr kernel functions have been implemented, benefiting all supported hardware architectures.

An official port of the thread_metric RTOS benchmark has also been added to make it easier for developers to measure the performance of Zephyr on their hardware and compare it to other RTOSes.

Experimental support for IAR compiler

IAR Arm Toolchain can now be used to build Zephyr applications. This is an experimental feature that is expected to be improved in future releases.

Initial support for Rust on Zephyr

It is now possible to write Zephyr applications in Rust. Rust Language Support is available through an optional Zephyr module, and several code samples are available as a starting point.

USB MIDI Class Driver

Introduction of a new USB MIDI 2.0 device driver, allowing Zephyr devices to communicate with MIDI controllers and instruments over USB.

Expanded Board Support

Support for 70 new boards and 11 new shields has been added in this release.

This includes highly popular boards such as Raspberry Pi Pico 2 and WCH CH32V003EVT, several boards with CAN+USB capabilities making them good candidates for running the Zephyr-based open source CANnectivity firmware, and dozens of other boards across all supported architectures.

An overview of the changes required or recommended when migrating your application from Zephyr v4.0.0 to Zephyr v4.1.0 can be found in the separate migration guide.

The following sections provide detailed lists of changes by component.

API Changes

Removed APIs and options

  • The legacy Bluetooth HCI driver API has been removed. It has been replaced by a Bluetooth HCI APIs that follows the normal Zephyr driver model.

  • The CAN_MAX_STD_ID (replaced by ) and CAN_MAX_EXT_ID (replaced by ) CAN API macros have been removed.

  • The can_get_min_bitrate() (replaced by ) and can_get_max_bitrate() (replaced by ) CAN API functions have been removed.

  • The can_calc_prescaler() CAN API function has been removed.

  • The CONFIG_NET_SOCKETS_POSIX_NAMES option has been removed. It was a legacy option and was used to allow user to call BSD socket API while not enabling POSIX API. This removal means that in order to use POSIX API socket calls, one needs to enable the CONFIG_POSIX_API option. If the application does not want or is not able to enable that option, then the socket API calls need to be prefixed by a zsock_ string.

  • Removed video_pix_fmt_bpp() function that was returning a byte count and only supported 8-bit depth to returning the bit count and supporting any color depth.

  • The video_stream_start() and video_stream_stop() driver APIs have been replaced by video_set_stream().

  • CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO

  • The CONFIG_PM_DEVICE_RUNTIME_EXCLUSIVE option has been removed after being deprecated in favor of CONFIG_PM_DEVICE_SYSTEM_MANAGED.

  • The z_pm_save_idle_exit() PM API function has been removed.

  • Struct z_arch_esf_t has been removed. Use struct arch_esf instead.

  • The following networking options have been removed:

    • CONFIG_NET_PKT_BUF_DATA_POOL_SIZE

    • CONFIG_NET_TCP_ACK_TIMEOUT

Deprecated APIs and options

  • the API function. Application developers can achieve the same functionality in their application code by reconnecting to the peer when the callback is invoked.

  • CONFIG_NATIVE_APPLICATION has been deprecated.

  • Deprecated the from Stream Flash API. The same functionality can be achieved using or . Nevertheless erasing of a device, while stream flash is supposed to do so, as configured, will result in data lost from stream flash. There are only two situations where device should be erased directly:

    1. when Stream Flash is not configured to do erase on its own

    2. when erase is used for removal of a data prior or after Stream Flash uses the designated area.

  • The pipe API has been reworked. The new API is enabled by default when CONFIG_MULTITHREADING is set.

    • Deprecates the CONFIG_PIPES Kconfig option.

    • Introduces the k_pipe_close(..) function.

    • k_pipe_put(..) translates to k_pipe_write(..).

    • k_pipe_get(..) translates to k_pipe_read(..).

    • k_pipe_flush(..) & k_pipe_buffer_flush() can be translated to k_pipe_reset(..).

    • Dynamic allocation of pipes is no longer supported.

      • k_pipe_alloc_init(..) API has been removed.

      • k_pipe_cleanup(..) API has been removed.

    • Querying the number of bytes in the pipe is no longer supported.

      • k_pipe_read_avail(..) API has been removed.

      • k_pipe_write_avail(..) API has been removed.

  • For the native_sim target CONFIG_NATIVE_SIM_NATIVE_POSIX_COMPAT has been switched to n by default, and this option has been deprecated.

  • CONFIG_BT_BUF_ACL_RX_COUNT

  • All HWMv1 board name aliases which were added as deprecated in v3.7 are now removed (GitHub #82247).

  • The TinyCrypt library has been deprecated as the upstream version is no longer maintained. PSA Crypto API is now the recommended cryptographic library for Zephyr.

  • The CONFIG_BT_DIS_MODEL and CONFIG_BT_DIS_MANUF have been deprecated. Application developers can achieve the same configuration by using the new CONFIG_BT_DIS_MODEL_NUMBER_STR and CONFIG_BT_DIS_MANUF_NAME_STR Kconfig options.

New APIs and options

New Boards

New shields

New Drivers

New Samples

Other notable changes

  • A header file has been introduced to allocate ID ranges for persistent keys in the PSA Crypto API. It defines the ID ranges allocated to different users of the API (application, subsystems…). Users of the API must now use this header file to construct persistent key IDs. See include/zephyr/psa/key_ids.h for more information. (GitHub #85581)

  • Space-separated lists support has been removed from Twister configuration files. This feature was deprecated a long time ago. Projects that do still use them can use the scripts/utils/twister_to_list.py script to automatically migrate Twister configuration files.

  • Test case names for Ztest now include the Ztest suite name, meaning the resulting identifier has three sections and looks like: <test_scenario_name>.<ztest_suite_name>.<ztest_name>. These extended identifiers are used in log output, twister.json and testplan.json, as well as for --sub-test command line parameters.

  • The --no-detailed-test-id command line option can be used to shorten the test case name by excluding the test scenario name prefix which is the same as the parent test suite id.

  • Added support for HTTP PUT/PATCH/DELETE methods for HTTP server dynamic resources.

  • Driver API structures are now available through iterable sections and a new macro has been introduced to allow to check if a device supports a given API. Many shell commands now use this to provide “smarter” auto-completion and only list compatible devices when they expect a device argument.

  • Zephyr’s interactive board catalog has been extended to allow searching for boards based on supported hardware features. A new zephyr:board-supported-hw Sphinx directive can now be used in boards’ documentation pages to automatically include a list of the hardware features supported by a board, and many boards have already adopted this new feature in their documentation.