Commit Graph

119483 Commits

Author SHA1 Message Date
Mathieu Choplain
cba9dceff4 Revert "arch: arm: cortex_m: Add API for scb save and restore"
This reverts commit a90a47b1c9.

This commit was written with CMSIS 5 in mind, where some Cortex-M cores
have "SHP" in the SCB_Type, and some have "SHPR". This is not correct as
Zephyr is *supposed* to be using CMSIS 6 for Cortex-M... but CI actually
picks up CMSIS 5 instead (it includes both with CMSIS 5 taking priority).

The end result is that Zephyr's CI builds this happily but it causes build
failures on downstream users (e.g., example-application).

Revert the commit now, as it is not used yet by anyone. The revised version
using only "SHPR" shall be reintroduced once the CI issue has been fixed.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2025-07-25 11:20:12 +01:00
Travis Lam
6413185619 drivers: flash: nordic: fix nrf-mramc indentation
Fix soc_mramc_nrf_mram space indentation

Signed-off-by: Travis Lam <travis.lam@nordicsemi.no>
2025-07-24 17:02:20 +01:00
Martin Stumpf
860f9c8ef5 spi_nxp_lpspi: Fix underflow in lpspi sck calculation
If `desired_delay_ns` is `0`, it is much saner to set the delay to `0x00`
than to underflow and set it to `0xff`, which is the current behavior.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2025-07-24 17:02:10 +01:00
Lorenz Clijnen
be38568577 net: openthread: Fix build with CONFIG_OPENTHREAD_INTERFACE_EARLY_UP
When building with CONFIG_OPENTHREAD_INTERFACE_EARLY_UP enabled,
`is_up` is undefined (since 596844a).

Signed-off-by: Lorenz Clijnen <github@lorc.be>
Signed-off-by: Lorenz Clijnen <l.clijnen@edna.eu>
2025-07-24 17:01:59 +01:00
Dominik Ermel
02db89e052 doc: Remove chapter on backporting MCUmgr fixes to 2.7
2.7 is EOL; the page is pointless.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2025-07-24 17:01:51 +01:00
Tomasz Moń
943fc6fd88 samples: usb: uac2: implicit: Stop processing micophone data
Stop processing microphone data on error or when streaming ends. This
avoids I2S read timeouts due to audio data not being available while
streaming.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-07-24 17:01:38 +01:00
Robert Lubos
1e77663c87 net: lwm2m: Optimize value attributes verification
As lwm2m_notify_observer_path() now reads attributes for the updated
resource, value_conditions_satisfied() does not need to read the
attributes again, it can just reuse the already available data.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 17:01:07 +01:00
Robert Lubos
b633f3a9de net: lwm2m: Verify pmin for updated resource on notify check
When updating a resource, the LwM2M library verified pmin attribute on
all resources/objects in the observer path list and chose the smallest
value. While this make sense for determining the lower-boundary for the
next notification time, it could lead to unnecessary notifications being
generated too early if the updated resource had a higher pmin value
configured on it.

Therefore, when checking notification criteria for an updated resource,
check the pmin value for that resource path and if set and higher than
the lowest pmin value evaluated for the observer list, use it instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 17:01:07 +01:00
Arkadiusz Cholewinski
d021851182 CI: Coverage: Fix: Get component name from testsuite name.
Get component name from testsuite name instead of
testcase identifier.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2025-07-24 17:00:48 +01:00
Sebastian Głąb
5cc26013d7 modules: hal_nordic: nrfx: Remove workaround for TAMPC setup
Skip of TAMPC setup is no longer needed on nRF54L* boards.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-07-24 17:00:33 +01:00
Sebastian Głąb
878ddbe2f6 boards: nordic: nrf54l20pdk: Remove obsolete board
Board nrf54l20pdk was renamed to nrf54lm20dk.
Remove obsolete board definition.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-07-24 17:00:33 +01:00
Chaitanya Tata
90717047e0 drivers: nrf_wifi: Fix deadlock in display scan and recovery
When running Zperf traffic + scan in the background eventual we hit a
deadlock:

 * sysworkq: recovery->stop_zep->vif_lock->hal_disable->wait lock_rx
 * nrf70_bh_wq: event_tasklet->lock_rx->disp_scan_done->
             disp_scan_res_get_zep-> waiting on vif_lock

The traffic triggers recovery (another bug) and conflicts with display
scan.

Fix by moving scan results processing to system workqueue instead of
doing it in the FMAC event callback context, this is how supplicant scan
also works.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-24 17:00:17 +01:00
Bjarki Arge Andreasen
825dea6832 shell: exchange k_mutex for k_sem
The mutex is being used as a simple binary semaphore. It is not
recursed so we don't need to track thread ownership nor lock count.

Exchange the mutex for a binary semaphore to save resources and
speed up shell.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-07-24 17:00:07 +01:00
Michele Sardo
a90a47b1c9 arch: arm: cortex_m: Add API for scb save and restore
Add two API to save SCB context and restore it, typically
used in suspend to RAM use case.

The scb_context_t and the backup/restore functions are designed to only
handle SCB registers that are:
- Mutable: Their values can be changed by software.
- Configurable: They control system behavior or features.
- Stateful: Their values represent a specific configuration that an
            application might want to preserve and restore.

Register excluded from backup/restore are:
1.	CPUID (CPUID Base Register)
	Motivation for Exclusion: This is a read-only identification register.
2.	ICSR (Interrupt Control and State Register)
	Motivation for Exclusion (from restoration): While its current value
	can be read, directly restoring a saved	ICSR value is highly
	dangerous and generally unsafe in an RTOS context.
	Contains Read-Only Status Bits: A significant portion of ICSR
	consists of read-only bits (VECTACTIVE, VECTPENDING, ISRPREEMPT,
	TSRUNPEND). These bits reflect the current state of the exception
	system (e.g., which exception is active, which are pending) and are
	managed dynamically by the CPU and the RTOS.
	Forcing a previous state onto these bits would corrupt the live
	system's interrupt handling.
	Contains Write-Only Set/Clear Bits: Some bits are write-only to set
	or clear a pending interrupt (PENDSVSET, PENDSVCLR, SYSTICKSET,
	SYSTICKCLR). If these bits were set in the saved context, restoring
	them might immediately trigger an interrupt or change its pending state
	unexpectedly, outside the RTOS's control.
	RTOS Management: In Zephyr (and other RTOSes), the kernel tightly
	manages the interrupt and exception state.
	Direct manipulation of ICSR's volatile bits could conflict with the
	RTOS's internal state machine, leading to crashes or unpredictable
	behavior.
3.	CFSR (Configurable Fault Status Register)
	Motivation for Exclusion: This is a read-only status register that
	reports the current state of Memory Management, Bus Fault, and Usage
	Faults. It's used by fault handlers to determine the cause of a fault.
4.	HFSR (HardFault Status Register)
	Motivation for Exclusion: Similar to CFSR, this is a read-only status
	register that reports the current state	of HardFaults. It's for
	reporting, not for configuration or restoration.
5.	DFSR (Debug Fault Status Register)
	Motivation for Exclusion: This is a read-only status register that
	reports debug-related faults. It's primarily used by debuggers and
	is not part of the application's runtime context to be saved/restored.
6.	MMFAR (MemManage Fault Address Register)
	Motivation for Exclusion: This is a read-only register that stores the
	address that caused a Memory Management	fault. It's a diagnostic
	register, not a configurable parameter.
7.	BFAR (BusFault Address Register)
	Motivation for Exclusion: Similar to MMFAR, this is a read-only
	register that stores the address that caused a BusFault. It's a
	diagnostic register.
8.	AFSR (Auxiliary Fault Status Register)
	Motivation for Exclusion: This register is implementation-defined and
	read-only.

Signed-off-by: Michele Sardo <msmttchr@gmail.com>
2025-07-24 16:59:59 +01:00
Raffael Rostagno
7c30d7a9b9 tests: drivers: spi_loopback: Update DTS settings for DMA
Update DTS settings to add DMA configuration to devices which
support GDMA peripheral, in order to perform operations via DMA
driver instead of HAL functions.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-07-24 16:58:48 +01:00
Raffael Rostagno
83f0e228bb dts: spi: esp32: Remove unused property
Remove unused DMA clock property from device tree. Clock will
be managed by DMA driver for devices with GDMA peripheral.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-07-24 16:58:48 +01:00
Raffael Rostagno
1d84c8ba8e drivers: spi: esp32: DMA operations via GDMA driver
Perform DMA operations using GDMA driver instead of relying on
HAL functions. Prevents eventual conflicts between SPI and GDMA
drivers when other peripherals also use DMA.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-07-24 16:58:48 +01:00
Josuah Demangeon
366c64eca0 usb: uvc: respect setup->wLength in responses
Due to the alignment and granularity requirements of memory allocation,
setup->wLength is shorter than the allocated buffer size.
This lead to responses larger than what the host requested, which it
rejected. Fix it by using the minimum between the allocated size, the
struct size, and the wLength requested.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-07-24 16:58:20 +01:00
Josuah Demangeon
ed9327dec2 usb: uvc: allow the host to use short probe/commit messages
Some OSes like MacOS use shorter UVC 1.1 probe/commit messages even when
UVC 1.5 is supported, without bUsage, bBitDepthLuma, bmSettings,
bMaxNumberOfRefFramesPlus1, bmRateControlModes bmLayoutPerStream.
Accept messages of arbitrary size to safely be processed, ignoring all
missing fields, improving standard compliance.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-07-24 16:58:20 +01:00
Robert Lubos
7b73998e96 tests: net: lwm2m: content_plain_text: Check for overflows
Add checks for int64_t overflows when parsing.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Robert Lubos
e172f72e89 tests: net: lwm2m: content_json: Check for overflows
Add checks for int64_t overflows when parsing.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Robert Lubos
d7e2c1b819 tests: net: lwm2m: client: Fix stack memory corruptions
LwM2M client context was defined on stack in the test function, however
it could still be in use when the test ended, as the actual LwM2M
teardown took place in a common "after" test function. In result, the
Lwm2M context content could be corrupted.

Additionally, increase the system work queue stack size, as the stack
overflowed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Robert Lubos
6bfeb4fe45 net: lwm2m: senml_cbor: Verify data len before calling memcpy
Check if there actually is data to copy before calling memcpy() to
prevent potentially calling memcpy() with NULL value pointer.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Robert Lubos
779d8521a8 net: lwm2m: oma_tlv: Fix UBSAN warnings about signed integers
* Simplify the logic of the get_number() function to address the corner
  cases reported by UBSAN regarding byte-swapping signed integer values.

  The existing logic was actually only valid for little-endian systems,
  as it expected that the bytes written from the packet buffer will be
  stored at the beginning of the int64_t memory, plus the actual
  byte-swapping with signed integer casts inside was hard to follow.
  Switch to a plain uint8_t buffer for integer readout, and use
  dedicated system function to convert the big-endian data in the buffer
  into unsigned integer in the system endianness, followed by the final
  cast to a signed value.

* Add explicit cast to uint32_t in put_objlnk() to prevent warning about
  not-fitting integer after byte shift, and update the result type to
  uint32_t as well.

* Switch to buffer with sys_put_be16/32/64 when writing integers due to
  similar warnings about byte-swapping signed values.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Robert Lubos
a09fae571e net: lwm2m: plain_text: Check for int64_t overflow when parsing integer
Verify if the integer value being parsed does not overflow int64_t type
and report an error in such cases.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Robert Lubos
d9395d8502 net: lwm2m: json: Check for int64_t overflow when parsing integer
Verify if the integer value being parsed does not overflow int64_t type
and report an error in such cases.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Robert Lubos
c1aa7f57c2 net: lwm2m: registry: Validate value pointer before use
Check if value pointer is not NULL before passing it to memcmp() inside
lwm2m_engine_set(). As the function actually expects that the value
pointer can be NULL in case resource value is cleared (there is a test
case for such behavior), validate that len value is actually 0 if NULL
value is provided, to avoid unexpected behavior in other parts of the
function.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-24 16:58:05 +01:00
Håkon Amundsen
7697eff4fb soc: nrf54h: don't boot radio core if VTOR is not programmed
Booting the radio core when it is not programmed will typically
cause a reset loop. This can happen when programming multiple
images to a device, and the app core image is programmed before
the radio core.

With this change we avoid the reset loop in that case.

Signed-off-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Jonathan Nilsen
78a61579d8 west: runners: nrf: don't recover twice on nrf54h
Update the recover mechanism for nrf54h to only call recover
once. Using nrfutil device recover with both --core Network and
--core Application is redundant with IronSide SE as both of these
map to the same operation which does a full erase of the device MRAM.

Additionally, recovering twice in a row specifically in a nrfutil
batch file (which is used by this runner implementation) triggers some
odd behavior with the current latest version of
nrfutil device + IronSide SE, which can cause the device to enter a
reset loop and appear unresponsive and preventing 'west flash --recover'
from working properly.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Jonathan Nilsen
eb7239c6a8 west: runners: nrf: Program UICR/PERIPHCONF artifacts if present
Program the new UICR and PERIPHCONF artifacts if they are generated.
These are required for the application to operate properly if they
are in use.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Jonathan Nilsen
56b6e57521 soc: nordic: add IronSide SE compatible UICR support
Add support for generating UICR and associated artifacts in a
format compatible with IronSide SE, to be used for Nordic SoCs
in the Haltium family.

The main feature added with this is the ability to configure certain
global domain peripherals that are managed by the secure domain
through setting UICR.PERIPHCONF. This register points at a blob of
(register address, register value) pairs which are loaded
into the peripherals by IronSide SE ahead of the application boot.

The added helper macros in uicr.h can be used to add register
configurations to the PERIPHCONF. Entries added through these macros
are then extracted by a script, post-processed and placed in a blob
located at specific part of MRAM.

A default PERIPHCONF configuration has been added for the nrf54h20
soc to support the standard BLE use case (matching the configuration
in the soc devicetree).

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Jonathan Nilsen
b43ae17fdd dts: nordic: update UICR definition on nrf54h20
With IronSide SE there is only one defined UICR which is at
the location of the APPLICATION UICR. Update the devicetree
definition accordingly, and use the "nordic,nrf-uicr" compatible
on the node since the domain distinction added by the v2 compatible
is no longer relevant.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Jonathan Nilsen
38e60025b0 boards: nordic: nrf54h20dk: refactor RAM memory map
Refactor the default RAM memory map on nrf54h20dk:

Removes use of "nordic,owned-memory" which is no longer needed on
nrf54h20. Reserved memory nodes that were under "nordic,owned-memory"
have been moved directly under reserved-memory.

The memory shared between cpuapp-cpusec and cpurad-cpusec in RAM0x
is no longer used with IronSide, since IPC buffers toward the secure
domain are at new fixed locations. The cpuapp_data region
has been expanded to fill the available space in RAM0x when removing
these shared memory regions.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Jonathan Nilsen
7324eea7c9 boards: nordic: update nrf54h20dk memory map
Update memory map to be compatible with latest IronSide.

180kB MRAM is reserved.

Co-authored-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no>
Signed-off-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no>
Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Grzegorz Swiderski
835649acdc modules: hal_nordic: Remove nrf-regtool support for nRF54H
nrf-regtool will not be used as part of IronSide SE compatible builds.
It will remain in use for the nRF92 series, until that too undergoes a
switch from SDFW to IronSide SE.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Grzegorz Swiderski
b7b8b27338 boards: nrf54h20dk: Limit app core FLASH_LOAD_SIZE
CONFIG_USE_DT_CODE_PARTITION had to be disabled to add MCUboot support.
As a result, CONFIG_FLASH_LOAD_SIZE was left at zero, which means that
the linker would claim all available MRAM for the app core.

For now, we can't allow that, because the default nRF54H20 DK memory map
divides MRAM between multiple cores in order to support various samples.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Grzegorz Swiderski
b4c18e8999 boards: nrf54h20dk: Merge iron variants into the base variants
This replaces the legacy SDFW compatible board configuration with the
IronSide SE compatible one, thus removing support for running samples
and tests on nRF54H20 devices with the old firmware.

All applications are expected to work on `nrf54h20dk/nrf54h20/cpuapp`
out of the box. For other board targets, all applications are expected
to boot, but may require additional peripheral configuration in UICR.
Build system support for the new UICR format is to be added separately.

Co-authored-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Grzegorz Swiderski
559ace1cdf tests: boards: nrf: nrfs: Build main image for app core only
Update this multi-core test to always run the `main` and `remote` images
on cpuapp and cpurad respectively.

This is to prepare the test for running with IronSide SE, in which case
keeping cpurad as the main board target wouldn't make as much sense,
because cpurad would have to be started by cpuapp.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Jonathan Nilsen
d6673e1acd samples: drivers: mbox: switch nrf54h20 cpuapp and cpurad remotes
Switch which board is the remote in the test case for
mbox communication between nrf54h20dk/nrf54h20/cpuapp and
nrf54h20dk/nrf54h20/cpurad, making cpurad the remote instead.
This is done to prepare the sample for executing with IronSide SE,
where using cpurad as the main board doesn't make as much sense,
since cpuapp has to start cpurad.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Fin Maaß
edaafb5dd1 drivers: ethernet: phy: microchip_vsc8541: use default speeds
use default speeds dt prop

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
365297fabb drivers: ethernet: phy: dp83867: use default speeds
use default speeds from dt to configure phy on init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
46599fe34e drivers: ethernet: phy: dp83825: use default speeds
use default speeds from dt to configure phy on init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
156d0479cf drivers: ethernet: phy: rtl8211f: use default speeds
use default speeds from dt to configure phy on init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
db6b1782c2 drivers: ethernet: phy: ar8031: use default speeds
use default speeds from dt to configure phy on init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
d8711bba5a drivers: ethernet: phy: ksz8081: use default speeds
use default speeds from dt to configure phy on init.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
e0587ada7f drivers: ethernet: phy: put shared macro in shared header
put the macro to get the default speeds into a
shared header for the phys.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
c069fb0961 drivers: ethernet: remove phy_configure_link() usage
remove the use of phy_configure_link() in the ethernet drivers.
The user can now select the default speeds via DT prop, doing
another phy_configure_link() in the eth driver would overwrite
that.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
139bf24353 drivers: ethernet: phy: dts: split ethernet-phy.yaml
split ethernet-phy.yaml, so that parts, that are used
by other phys are separated.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
f473806777 drivers: ethernet: phy: ar8031: remove fixed link mode
fixed link mode is a mode where we don't comunicate with the phy,
therefore we don't need it in other phys as the generic phy_mii one.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00
Fin Maaß
038583104c dts: bindings: ethernet: move adi,adin*11*.yaml
move adi,adin1110.yaml adi,adin2111.yaml
from the phy subdir back into the ethernet dir.
They are ethernet controller bindings, not phy bindings.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-24 16:57:04 +01:00