Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Zephyr Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-zephyr-knowledge-patch)
---
name: zephyr-knowledge-patch
description: Zephyr RTOS
version: "4.5.0"
license: MIT
metadata:
author: Nevaberry
---
# Zephyr Compatibility Guidance
Load this skill when migrating Zephyr applications, board definitions, drivers,
Devicetree overlays, Kconfig fragments, build commands, or tests. It also covers
runtime API contracts, persistent-data compatibility, and subsystem integration.
Read the relevant reference for the release-specific scope of each change.
## Reference index
| Reference | Topics |
| --- | --- |
| [Build, boards, and testing](references/build-boards-and-testing.md) | Toolchains, CMake, sysbuild, board targets, flashing, simulation, Twister, SBOMs, release support |
| [Devicetree and hardware](references/devicetree-and-hardware.md) | Binding syntax, macros, includes, pin control, clocks, partitions, interrupts, CPU descriptions |
| [Kernel, runtime, and utilities](references/kernel-runtime-and-utilities.md) | Pipes, scheduling, memory, exceptions, POSIX, Zbus, RTIO, state machines, logs, tracing, shell |
| [Drivers and peripherals](references/drivers-and-peripherals.md) | Driver lifecycle, power management, buses, ADC, GPIO, sensors, steppers, timers, USB, MCTP |
| [Display, input, and media](references/display-input-and-media.md) | Input callbacks, keyboards, displays, LVGL, video, audio, USB media, multimedia pipelines |
| [Bluetooth](references/bluetooth.md) | HCI, connections, security, GATT, Classic, LE Audio, Channel Sounding, Mesh |
| [Networking and IoT](references/networking-and-iot.md) | Sockets, Ethernet, routing, HTTP, TLS, CoAP, DNS, LwM2M, MQTT, OpenThread, Wi-Fi, modems |
| [Security, storage, and updates](references/security-storage-and-updates.md) | PSA Crypto, Mbed TLS, TF-M, Secure Storage, filesystems, flash, MCUboot, MCUmgr, hawkBit |
## Breaking changes and deprecations
### Build prerequisites and generated configuration
- Upgrade to Python 3.12 or later and Zephyr SDK 1.0.0 or later. C17 is the
default minimum C standard; toolchains without C17 can still select deprecated
`CONFIG_STD_C99` or `CONFIG_STD_C11`.
- The application source directory is no longer added to `SNIPPET_ROOT`
automatically. Set `snippet_root` in `zephyr/module.yml` or add the directory
in application CMake code before finding Zephyr.
- `BOARD_QUALIFIERS` omits its leading slash. Construct a qualified target with
`${BOARD}/${BOARD_QUALIFIERS}` and add `full_name` to new `board.yml` entries.
- If a CMake library including `<zephyr/kernel.h>` can compile before
`zephyr/heap_constants.h` exists, give it a dependency on
`zephyr_generated_headers`.
- Replace OpenOCD runner `--use-hex`, `--use-elf`, and `--use-bin` with
`--file-type=hex`, `--file-type=elf`, and `--file-type=bin`. Hex remains default.
### Devicetree and board migrations
- Replace `status = "ok";` with `status = "okay";`. Binding defaults for
`status`, `#address-cells`, and `#size-cells` are rejected; put required values
in the affected nodes.
- `DT_*_REG_ADDR`, `DT_REG_SIZE`, and size variants emit unsigned C literals.
Use `DT_REG_ADDR_RAW` variants for addresses used as Devicetree indices;
only address macros provide raw variants.
- Use `power-domains` instead of `power-domain`, provide `#power-domain-cells`
on the provider, and use `power-domain-names` to name consumer entries.
- Migrate HWMv1 boards and SoCs to HWMv2. Board target renames, SoC include
moves, and peripheral compatible migrations are detailed in the references.
- With a mapped `zephyr,code-partition`, remove `CONFIG_FLASH_LOAD_OFFSET` and
`CONFIG_FLASH_LOAD_SIZE`; use nested mapped partitions with `ranges`.
### Kernel, POSIX, and callback contracts
- Replace `k_pipe_put()` and `k_pipe_get()` with `k_pipe_write()` and
`k_pipe_read()`. Both return transferred bytes and omit `min_xfer`; callers
handle minimum-transfer requirements. Use caller-provided storage.
- Replace both pipe flush calls with `k_pipe_reset()`, which discards buffered
data without blocking. `k_pipe_close()` wakes pending readers and writers
with an error, permits draining buffered data, and requires `k_pipe_init()`
before further writes or reads beyond that data.
- Replace `CONFIG_SCHED_DUMB` and `CONFIG_WAITQ_DUMB` with
`CONFIG_SCHED_SIMPLE` and `CONFIG_WAITQ_SIMPLE`.
- `device_init()` returns negative errno values for initialization failures.
Update code that checks for or negates the former positive values.
- Replace `<zephyr/posix/time.h>` and `<zephyr/posix/signal.h>` with `<time.h>`
and `<signal.h>`. Obtain POSIX limits through `<limits.h>` or `sysconf()`.
- RTIO callbacks take an additional argument carrying the first chain error.
They run even after an earlier submission fails; check that result before
processing chain data.
- State Machine Framework run actions return `enum smf_state_result`:
`SMF_EVENT_HANDLED` replaces `smf_set_handled()`; `SMF_EVENT_PROPAGATE`
permits a parent run action to handle the event. Flat machines ignore it.
### Crypto and persistent-data compatibility
- TinyCrypt has been removed. Use PSA Crypto for new code and migrations.
`CONFIG_PSA_CRYPTO` selects TF-M when `CONFIG_BUILD_WITH_TFM=y`, otherwise
Mbed TLS; an application provider uses `CONFIG_PSA_CRYPTO_PROVIDER_CUSTOM`.
- Mbed TLS supplies TLS and X.509; cryptography comes from the separate
TF-PSA-Crypto module. Run `west update` to fetch it. TF-M still builds with
Mbed TLS 3.6.5 in the documented migration; retain that product distinction.
- Migrate removed cipher, digest, and public-key selections to required PSA
capabilities. Use `CONFIG_MBEDTLS_CONFIG_FILE`, `CONFIG_MBEDTLS_CUSTOM`, and
a separate `CONFIG_TF_PSA_CRYPTO_USER_CONFIG_FILE` where applicable.
- The Secure Storage default UID width changed from 64 to 30 bits, causing
authentication of previously stored entries to fail with the new default.
Set `CONFIG_SECURE_STORAGE_64_BIT_UID=y` to retain existing entries.
- For persistent Bluetooth Mesh data, unprovision before a TinyCrypt-to-Mbed
TLS PSA or TinyCrypt-to-TF-M PSA upgrade and reprovision afterward: the stored
key formats are incompatible. Mesh DFU uses `BT_MESH_DFU_EFFECT_UNPROV`.
- MCUboot defaults to swap using offset. Rebalance move-optimized layouts so
the secondary slot has one more sector than the primary, or use equal slots.
Keep an existing move layout with `SB_CONFIG_MCUBOOT_MODE_SWAP_USING_MOVE=y`.
- Use signed secure and non-secure BIN artifacts for TF-M firmware updates.
Updated images are unconfirmed by default; call `psa_fwu_accept()` after
successful boot to prevent rollback on the next reboot.
### Bluetooth migrations
- Initialize the `struct bt_conn *` output variable to `NULL` before
`bt_conn_le_create()` or `bt_conn_le_create_synced()`.
- Implement automatic reconnection in the application from
`bt_conn_cb.disconnected`; `bt_le_set_auto_conn()` has been removed.
- Use `CONFIG_BT_BUF_ACL_RX_COUNT_EXTRA` for additional ACL receive buffers.
The default allocation is `CONFIG_BT_MAX_CONN + 1`; the extra count is the
former total minus this baseline. The legacy total-count symbol is removed.
- Enable LE Audio dependencies explicitly as listed in the Bluetooth reference.
Call `bt_pacs_register()` before `bt_ascs_register()`.
- Use `bt_conn_le_info.interval_us` and convert calculations from 1.25 ms units
to microseconds. Select `CONFIG_POLL=y` explicitly for application `k_poll()`.
- Legacy LE passkey entry no longer provides authenticated MITM protection.
On loading, stored bonds made with this method are downgraded to unauthenticated.
- Request outgoing CIS security with `bt_conn_set_security()` on the ACL
connection before `bt_iso_chan_connect()`; remove ISO security-level fields.
### Networking and HTTP migrations
- Network management event and request handler values change from `uint32_t`
to `uint64_t`. Treat event command values as bit masks; the layer stays an enum.
- Use networking-header `net_`, `NET_`, and `ZSOCK_` identifiers, or temporarily
include `<zephyr/net/net_compat.h>`. Include POSIX headers directly for POSIX
APIs. Use `socklen_t`, now always `uint32_t`, for socket length variables.
- Switch to `<zephyr/net_buf.h>` and replace `net_buf_put()` and `net_buf_get()`
with `k_fifo_put()` and `k_fifo_get()`. Socket-service callbacks take
`struct net_socket_service_event *`; use `CONFIG_ZVFS_POLL_MAX` for poll slots.
- HTTP callbacks obtain payload, length, and headers from `http_request_ctx`.
Dynamic resource callbacks accept `enum http_transaction_status`; reset state
on `HTTP_SERVER_TRANSACTION_COMPLETE` after the response has been sent.
- HTTP service macros enforce `_concurrent` and `_backlog` and honor `_config`.
Pass `NULL` for `_res_fallback` when a service needs no fallback resource.
- The protocol passed to `zsock_socket()` sets the minimum TLS version.
Explicitly select TLS versions and cipher suites with
`CONFIG_NET_SOCKETS_SOCKOPT_TLS` builds.
- Migrate direct `openthread_context` access to the module API. The OpenThread
reference records initialization, locking, callback, and storage migrations.
### Peripheral and media migrations
- Declare out-of-tree upstream-class driver API tables with `DEVICE_API()`.
Move DMA API calls into supervisor-mode code; DMA no longer has user syscalls.
- Check `uart_irq_tx_ready(dev) > 0`: a positive result is a lower bound on
bytes `uart_fifo_fill()` can accept without truncation.
- Move SPI chip-select timing to `spi-cs-setup-delay-ns` and
`spi-cs-hold-delay-ns`; drop deprecated delay arguments from SPI initializers.
- Call `stepper_ctrl_*` motion APIs on the controller. Move `step-gpios`,
`dir-gpios`, `invert-direction`, and `counter` to
`zephyr,gpio-step-dir-stepper-ctrl` and link the driver with `stepper-driver`.
H-bridge and TMC layouts have separate migration details.
- Configure timeouts and start watchdogs explicitly in the application:
`CONFIG_WDT_DISABLE_AT_BOOT=n` no longer starts them automatically.
- Rename keyboard `poll-period-ms` and `stable-poll-period-ms` to
`poll-period-us` and `stable-poll-period-us`, multiplying values by 1,000.
- Size video buffers with `video_format.size`; the former minimum and maximum
line-count fields are removed. `CONFIG_VIDEO_BUFFER_POOL_HEAP_SIZE` sizes the
entire pool in bytes. Use `video_import_buffer()` for existing buffers.
- Replace `uvc_set_video_dev()` and `uvc_add_format()` with `uvc_device_init()`
and `uvc_device_add_format()`. Device lifecycle uses `uvc_device_enable()`
and `uvc_device_shutdown()`.
## Frequently used capabilities
### Storage, devices, and application messaging
- Secure Storage exposes PSA Secure Storage and persistent PSA Crypto keys on
all board targets. ZMS supports NOR flash and media such as MRAM and RRAM
that can be written without a separate erase operation.
- Resolve NVMEM cells with `NVMEM_CELL_GET_BY_NAME` or `NVMEM_CELL_GET_BY_IDX`,
check readiness with `nvmem_cell_is_ready()`, and read or write with the cell APIs.
- The UDC-based USB device stack is the default and supports multiple active
controllers and runtime configuration. The USB host stack is experimental.
- Zbus supports dynamic, static-pool, and caller-supplied runtime observer nodes.
Async listeners execute in workqueue context; proxy agents that forward
channel data across domains are experimental.
- The experimental `mpipe` subsystem connects source, transform, and sink
elements into a zero-copy media pipeline.
### Networking and remote interfaces
- Enable MQTT 5.0 with `CONFIG_MQTT_VERSION_5_0=y`; set
`mqtt_transport.if_name` to choose the transport interface.
- Use `COAPS_SERVICE_DEFINE` for CoAP over DTLS and
`CONFIG_COAP_CLIENT_MULTICAST` for client multicast requests.
- Enable WireGuard with `CONFIG_WIREGUARD=y`. The HTTP server supports HTTP/3,
and Zephyr exposes a QUIC transport interface.
- SSH supports client and server endpoints and a remote shell backend. The MCP
server lets applications expose device tools that agents can call.
### Diagnostics and verification
- Use dtdoctor for Devicetree build errors and `west build -t traceconfig`
in a configured build to inspect Kconfig origins and final values.
- Enable `CONFIG_LOG_RATELIMIT=y` for per-call-site rate limiting.
`CONFIG_LOG_RATELIMIT_FALLBACK` controls logging or dropping all such calls
when rate limiting is disabled.
- Compiler instrumentation supports call graphs and statistical profiles;
tracing adds a terminal viewer, Perfetto export, shell support, and ITM.
- Select `CONFIG_SYS_HEAP_SANITIZER_ASAN=y` on `native_sim` or
`CONFIG_SYS_HEAP_KASAN=y` on hardware for heap memory error detection.
- Twister supports power and display harnesses, multiple devices under test,
and multiple toolchains. Use YAML sequences for list-valued configuration.
- Upgrade HTTP static-filesystem deployments and WireGuard endpoints to 4.4.2
for the documented path-traversal and receive-side fixes. Upgrade devices
mounting externally supplied ext2 images for the mount-validation fixes.