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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>