Zephyr 4.1.1

This is a bugfix release for Zephyr 4.1.0.

Issues fixed

The following issues are addressed by this release:

  • GitHub #70344 - Current Atmel SAM flash driver will not erase last page

  • GitHub #84842 - STM32WBA: zephyr/drivers/flash/flash_stm32wba_fm.c: flash_stm32_erase: unexpected erase size

  • GitHub #85025 - tests/drivers/udc/drivers.usb.udc fails on rpi_pico

  • GitHub #86062 - samples/hello_world not working on intel_socfpga_agilex_socdk/agilex

  • GitHub #86609 - net: dhcpv4: deadlock during client stop

  • GitHub #86735 - frdm_mcxw71 Button is not working.

  • GitHub #86776 - drivers: retained_mem: Compilation error when using multiple nRF retained memory regions

  • GitHub #86930 - NXP LPSPI Multi byte word formation incorrect

  • GitHub #86954 - sample.smf.hsm_psicc2 is flaky on SMP platforms

  • GitHub #87108 - tests: tests/drivers/spi/spi_loopback: mimxrt1170_evk@A/mimxrt1176/cm7: failed: Failed harness:’Testsuite failed’

  • GitHub #87223 - net: if: NET_EVENT_L4_CONNECTED is no longer sent when !IPV4_ACD and/or !IPV6_DAD

  • GitHub #87224 - drivers: counter: nrfx_timer: High current consumption after stopping

  • GitHub #87323 - Network buffer leak if sending IPv4 TTL 0 or IPv6 hop limit 0 packets

  • GitHub #87739 - Build of ICE40 bitbang driver fails with PINCTRL

  • GitHub #87947 - Check possible recursion when parsing DNS response

  • GitHub #88109 - drivers: nrfx_uarte: pm_device_runtime_put() locks irqs for >500us

  • GitHub #88233 - net: coap_client library asserts on boot

  • GitHub #88319 - i2c_mcux_lpi2c_rtio does not build for MCXN947

  • GitHub #88434 - mbedtls: update to 3.6.3 in 4.1 branch

  • GitHub #88558 - disco_l475_iot1/arduino_r3_connector.dtsi arduino_i2c should be i2c1

  • GitHub #89295 - drivers: gpio: adp5585: fix wrong output register during pin configure

  • GitHub #89331 - Many threads locking two mutexes can cause a crash

  • GitHub #89342 - mgmt: hawkbit: hawkbit_autohandler_wait() returns to early

  • GitHub #89349 - Flash Map: Bounds checking not immune to integer overflow

  • GitHub #89413 - Zephyr SPDX does not pass validation

  • GitHub #89530 - mgmt: hawkbit: cancellation of action failed

  • GitHub #89641 - net: dhcp: current DHCP client implementation does not follow RFC2131 and RFC2132

  • GitHub #89645 - ASSERTION FAIL: prepare_cb: Actual EVENT_OVERHEAD_START_US

  • GitHub #89990 - STM32: USB: USB CDC IN Endpoint stuck forever after receiving Clear feature - endpoint halt request

  • GitHub #90005 - net: dns: OOB memory write

  • GitHub #90103 - http_server: Wildcard resource matching reports incorrect path length

  • GitHub #90688 - coap_resource_parse_observe returns 0 (register) instead of 1 (deregister) upon a deregister of an unknown observer

  • GitHub #90738 - wrong lvgl initialization sequence

  • GitHub #90777 - arch.shared_interrupt.lto.speed compile fail on apollo5 platform

  • GitHub #90989 - gpio: gpio_adp5585_gpio incorrect gpio gaps handling

  • GitHub #91118 - Zephyr 4.1 Socket zsock_connect() Fails Immediately with errno 116 (ETIMEDOUT)

  • GitHub #91428 - soc_flash_nrf: flash_write timeout after bt_disable

  • GitHub #91799 - Docs version switcher always displays “v: latest”

  • GitHub #92397 - Missing fallback to a base board.dts when using a board variant without specific dts file

  • GitHub #93011 - stm32u0: interrupt vectors for lpuart1 and lpuart2 are wrong in device tree

  • GitHub #93424 - Missing break after IPV6_MULTICAST_IF option processing

  • GitHub #93594 - Nicla Vision has bad I2C address for VL53L1X sensor

  • GitHub #93943 - Unable to build LVGL samples on Ubuntu 22.04 for native_sim

  • GitHub #93986 - Unable to build LVGL with picolibc from source/module

  • GitHub #94047 - Shell device name tab completion for regulator parents show incorrect names

  • GitHub #94924 - mbedtls: update to 3.6.4 in 4.1 branch

  • GitHub #95297 - Links to the pyOCD repository are outdated

  • GitHub #95768 - Possible TCP connection leak when creating a socket

  • GitHub #95850 - Applications do not watch MCUboot key file for changes

  • GitHub #96172 - arch: arm: switch to privilege stack in SVC handler

  • GitHub #96841 - FRDM_K64F: arch.arm.user.stack.float test fail

  • GitHub #97304 - arch: arm: start threads on privileged stack

  • GitHub #98231 - Build System: defconfig: Base defconfig not used on fully qualified oot board

  • GitHub #98469 - drivers: bluetooth: h4: insufficient buffer for header + payload

  • GitHub #98668 - drivers: entropy: non-stop RNG ISR firing on STM32WB09

  • GitHub #98936 - net: ICMPv4 packets can be reported to ICMPv6 handlers (and vice versa)

Mbed TLS

Mbed TLS was updated to version 3.6.4 (from 3.6.2). The release notes can be found at: https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.4 https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.3

Mbed TLS 3.6 is an LTS release that will be supported with security and bug fixes until at least March 2027.

Trusted Firmware-M (TF-M)

TF-M was updated to version 2.1.2 (from 2.1.1). The release notes can be found at: https://trustedfirmware-m.readthedocs.io/en/tf-mv2.1.2/releases/2.1.2.html

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.

Security Vulnerability Related

The following CVEs are addressed by this release:

More detailed information can be found in: https://docs.zephyrproject.org/latest/security/vulnerabilities.html

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 CAN_STD_ID_MASK) and CAN_MAX_EXT_ID (replaced by CAN_EXT_ID_MASK) CAN API macros have been removed.

  • The can_get_min_bitrate() (replaced by can_get_bitrate_min()) and can_get_max_bitrate() (replaced by can_get_bitrate_max()) 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 video_bits_per_pixel() 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 bt_le_set_auto_conn() API function. Application developers can achieve the same functionality in their application code by reconnecting to the peer when the bt_conn_cb.disconnected callback is invoked.

  • CONFIG_NATIVE_APPLICATION has been deprecated.

  • Deprecated the stream_flash_erase_page() from Stream Flash API. The same functionality can be achieved using flash_area_erase() or flash_erase(). 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 DEVICE_API_IS 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.