Skip to content

Conversation

@lstnl
Copy link
Contributor

@lstnl lstnl commented Dec 19, 2024

PavelVPV and others added 30 commits December 5, 2024 12:16
… CDP0 and 1

This commits puts in order log messages when unpacking CDP0 and CDP1 so
that it a bit more clear where the error happens.

Signed-off-by: Pavel Vasilyev <[email protected]>
(cherry picked from commit 1eeee01)
Signed-off-by: Håvard Reierstad <[email protected]>
(cherry picked from commit 7d31b72)
…et_idx != 0

Initializes the `net_idx` field of the ack context properly for KRP
functions in the Config Client.

This fixes a problem where `bt_mesh_cfg_cli_krp_get` and
`bt_mesh_cfg_cli_krp_set` would always fail the ack ctx comparison if
`key_net_idx` was != 0.

Signed-off-by: Ludvig Jordet <[email protected]>
(cherry picked from commit 88f62a1)
Signed-off-by: Håvard Reierstad <[email protected]>
(cherry picked from commit 48cdbac)
The PEM Kconfig symbols is non-standard and isn't available for nRF
security, for now add a check to enable that only for MbedTLS builtin
which is not applicable for nRF security.

Fixes NCSDK-30762.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit c21cc96)
Switch to released version with all of the Zephyr build fixes

Signed-off-by: Keith Packard <[email protected]>
(cherry picked from commit d5b6539)
(cherry picked from commit 126440b)
…d final build

Currently, the linker that is used when performing various cmake checks
(check_c_compiler_flag, for example) may be different than the linker that
will be used during the actual build. This happens as we currently specify
'-fuse-ld' to force the appropriate linker a) after many such checks have
already happened and b) in a way which is not automatically propagated to
check_c_compiler_flag (and friends). As a result, the toolchain's default
linker will generally be used for such checks regardless of which linker
was selected in Zephyr.

This can lead to a number of surprises when building Zephyr, particularly
when building with clang. For example:

- If the linker is misconfigured, where the build will fail can vary
  depending on whether the linker is the toolchain's default. When the
  configured linker happens to be the toolchain's default, the build
  (helpfully) fails quickly on the checks for a basic working toochain.
  When the configured linker isn't the default, the build won't fail until
  the final link steps.
- The build can fail due to issues with a linker other than the one
  configured by the user in Zephyr. For example, LLVM toolchains without
  lld will generally fail to build Zephyr (the checks for a basic
  working toochain will fail) for targets where lld is the default in LLVM
  even if GNU ld is configured in Zephyr and would otherwise be used in the
  final build.
- Flags which are only added if check_c_compiler_flag (or similar) succeeds
  may be unexpectedly omitted during the final build if the flag is
  supported in the configured linker but is unsupported in the toolchain's
  default linker (as check_c_compiler_flag will test using the default
  one).

Note that this isn't limited to clang--even when we are building with
Zephyr's SDK and force ld.bfd, we seem to use the 'ld' variant during the
cmake checks (though this generally seems fairly harmless compared to
mixing ld/lld or other proprietary linkers).

To fix this, ensure the appropriate 'fuse-ld' is set early enough and in
such a way that the same linker will be used throughout the entire build.

Signed-off-by: Jonathon Penix <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 9fe6c5e)
(cherry picked from commit d90a2c5)
Zephyr is a bare metal build where standard libs are disabled.

This means that c and runtime libraries must manually be linked in.

This has generally been handled by using CMake's link libraries handling
but the issue with that is both de-duplication but also library link
order.

Standard libraries must be linked at last location to ensure symbols
are always available, however this is not optimal with
target_link_libraries() because this would ultimately require every
library to know the c library to link with, which is not desired.

Therefore, setup standard C and runtime library linking in linker
CMake files for toolchains where this is required.

This commit expands the principle introduced with toolchain abstraction,
see PR#24851.

This means that a toolchain implementation may specify standard C,
runtime, C++, etc libraries, as well as their link order.
Because a property approach is used, then Zephyr modules, such as the
Picolibc module can adjust such properties.

An optional `zephyr_linker_finalize()` macro is called at the end of
Zephyr's CMakeList process and can be used by the toolchain
implementation to define the final linker invocation.

This aligns the linker handling flow to the principle introduced in
PR#24851 and improves the flexibility and robustness of Zephyr build
system.

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 2e3873a)
(cherry picked from commit a5c6e0a)
…nk libraries

Extend zephyr_link_libraries to allow an optional value together with
the `zephyr_link_libraries(PROPERTY <property> [<value>])`.

This allow setting linker property combined with a value when linking
Zephyr. The value will only be applied if the property is defined.

Extend zephyr_compile_options to support the same PROPERTY flag that
has been introduced for zephyr_link_libraries().
This remove the need for developers to write complex generator
expressions for compiler flags and thus minimizes mistakes.

The following syntax is now supported in addition to the existing
syntax: `zephyr_compile_options(PROPERTY <property> [<value>])`

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 718b726)
(cherry picked from commit f819df8)
The `check_set_linker_property()` and `set_linker_property()` takes a
target argument. Make the target argument optional and use the target
`linker` as default target.

The function name `set_linker_property()` already implies that we are
setting a property and the linker target.

Remove the need to specify `TARGET linker` when using the default linker
property target.

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 102b3fc)
(cherry picked from commit 185ea88)
…in properties

Moving specs argument to compiler and linker properties so that the
compiler and linker in use can decide how the flags are mapped / handled
for the compiler and linker in use.

This avoids specifying `--specs=spec.picolibc` for clang which prints a
warning about an unused argument.

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 9d835fe)
(cherry picked from commit e14af53)
… property

This commit updates picolibc module to remove the need for hard-coding
linking with `-lgcc`.

Instead it sets the c_library linker property and thereby allows the
Zephyr toolchain infrastructure to properly handle the linking of
C and runtime libraries.

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit b2eeef4)
(cherry picked from commit e5f3261)
Newlib or Picolibc libraries for LLVM may be compiled or installed from
pre-built sources independently of LLVM itself.

This means that always indicating that TOOLCHAIN_HAS_NEWLIB=OFF and
TOOLCHAIN_HAS_PICOLIBC=OFF are wrong. But it could be just as wrong to
always indicate suport for newlib or picolibc.

Some pre-built LLVM toolchains are provided with default picolibc
support, such as LLVM for Arm embedded, but can also be used with newlib
be installing newlib add-on package.

Unfortunately it's not possible to query LLVM regarding newlib or
picolibc support.

Developers have the option of `-DTOOLCHAIN_HAS_<NEWLIB|PICOLIBC>=ON`,
but this is not widely known and cumbersome to do for each build.

An indication of newlib or picolibc support is the presence of library
specific headers, so to improve current situation we check for library
specific headers, and if those are present we assume support for the
library.

This commit improves the current support for LLVM in Zephyr when
cross-compiling, especially for users of LLVM for Arm embedded.

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 0274bcb)
(cherry picked from commit ce6eaf3)
Store informations regarding the current Zephyr build.
The following informations are stored during CMake configure:
- Board information
- Application source directory
- Application configuration directory
- Toolchain information
- Devicetree files
- Kconfig config files
- Zephyr version

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 09faf53)
(cherry picked from commit a9ba90a)
…le used.

Save information regarding SVD file in use in vendor-specific section
of the build info file.

Information is stored under Nordic section.

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 46a3e61)
(cherry picked from commit 22c1920)
Update build_info() calls to use `PATH` argument when values passed to
`build_info()` are user specified and thereby might use native path
separator, such as a single `\`.

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 2c1eae2)
(cherry picked from commit 7c1c2f4)
…specific gap fill

Deprecate BUILD_NO_GAP_FILL as it gives a false impression that gap
filling can be disabled in binary files.
Binary files are always gap filled due to the fact they contain no
address information. Only option for binary files is to control the gap
fill pattern. When no gap fill is enabled in binary files, then a
default pattern is used by the tool, which usually is 0x00.

Generally the pattern 0x00 leads to unnecessary flash writes, as a
flash generally contains 0xFF after an erase.
Therefore provide a gap fill pattern Kconfig setting instead, with
default value of 0xFF.

For hex-files, intel hex and s19, then gap filling is generally not
needed but in order to still support cases where gap filling is required
then this commit introduces BUILD_OUTPUT_HEX_GAP_FILL and
BUILD_OUTPUT_S19_GAP_FILL. Both settings are disabled per default.

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 2e8868c)
(cherry picked from commit d62198c)
The llvm-objcopy doesn't support a gap-fill argument, therefore clear
the property to remove the error:
> llvm-objcopy: error: unknown argument '--gap-fill'

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 71fd4d9)
(cherry picked from commit b249f97)
…0 bus lib

The nrf wifi drivers include code related to qspi/spi bus. This work
moves bus related files to a new nrf70 bus library which is now
independent of the core driver and facilitlates building applications
directly using the bus APIs, agnostic to enabling wifi configs.

Upstream PR #: 82372

Signed-off-by: Bansidhar P.M <[email protected]>
(cherry picked from commit b515453)
Add ztests for nrf70 bus lib to help validate functional integrity
of the QPSI/SPI interface to nRF70 device via appropriate reads/writes
from host processor to relevant memory blocks of nrf70 device.
Note that this will NOT serve as a memory test for nrf70 device,
rather just a functional verification of the wiring between the host
processor and the nrf70 device.

Upstream PR #: 82372

Signed-off-by: Bansidhar P.M <[email protected]>
(cherry picked from commit bf4df4a)
…nnect

This fixes an issue that occurred if deferred_work is queued by another
procedure before we run bt_conn_set_state(BT_CONN_DISCONNECTED).
bt_conn_set_state yields to the system work queue in bt_conn_tx_notify,
and then deferred_work runs and handles the disconnected callbacks.
bt_conn_set_state then enqueues another deferred_work which calls the
disconnected callbacks again and causes an assert. k_work_cancel_delayable
will clear queued deferred work when we call
bt_conn_set_state(BT_CONN_DISCONNECTED), guaranteeing that the disconnect
callbacks will only be called once.

Upstream PR #: 82543

Signed-off-by: Timothy Keys <[email protected]>
(cherry picked from commit 833b6d2)
…presence

Common symbol is defined by SoCs that support RAM control helper.

Upstream PR #: 82262

Signed-off-by: Nikodem Kastelik <[email protected]>
(cherry picked from commit 2e974fb)
…icit

Updated retained_mem driver variant exposes vendor-specific API,
rather than executing implicitly during boot.

Upstream PR #: 82262

Signed-off-by: Nikodem Kastelik <[email protected]>
(cherry picked from commit 0819c8e)
RAM retention is disabled for all RAM blocks
before entering System OFF to achieve lowest power consumption.
RAM retention can still be enabled using retained_mem driver.

Upstream PR #: 82262

Signed-off-by: Nikodem Kastelik <[email protected]>
(cherry picked from commit b0d7a30)
…argets

Using bare-metal approach for retention configuration
is no longer compatible with sys_poweroff() implementation.

Upstream PR #: 82262

Signed-off-by: Nikodem Kastelik <[email protected]>
(cherry picked from commit 15ffa30)
Updated manifest to include separate security types for 802.1X
in display of scan results when APs have EAP and PMF enabled.
BSS display limit based on user-configured non-zero values
set via CMD_INIT, along with support for few other regulatory
domain updates in firmware.

Upstream PR #: 81514

Signed-off-by: Karun Kumar Eagalapati <[email protected]>
EAP_TLS_SHA256 was being identified as EAP_TLS in display scan
results. Identify the security type in scan results sent by
RPU and display accordingly.

Upstream PR #: 81514

Signed-off-by: Ravi Dondaputi <[email protected]>
i2c_slave tests can now be run on nRF54H20 cpuppr target.

Upstream PR #: 82538

Signed-off-by: Michał Stasiak <[email protected]>
Add module for managing multiple requests for MRAM latency.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 980e0ac)
Add test for MRAM latency.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 20e28d2)
This reverts commit 8027617.

Signed-off-by: Krzysztof Chruściński <[email protected]>
…request no latency

Add CONFIG_MRAM_LATENCY_AUTO_REQ. When option is enabled then module
requests no latency during the initialization. This option might be
useful for cases where we want to achieve maximum performance and
want to avoid controlling MRAM in the code.

Upstream PR #: 82465

Signed-off-by: Krzysztof Chruściński <[email protected]>
maass-hamburg and others added 27 commits January 14, 2025 09:41
Fix image confirmed for Direct XIP.

Signed-off-by: Fin Maaß <[email protected]>
(cherry picked from commit e3f9356)
Fix failing tests for nRF54H20 target.

Upstream PR #: 82252

Signed-off-by: Adam Kondraciuk <[email protected]>
Fix platform radio state machine to be compliant with one shown in
OpenThread's `include/openthread/platform/radio.h`

Align twister tests to verify proper behavior of the
state machine.

Signed-off-by: Maciej Baczmanski <[email protected]>
(cherry picked from commit b46f720)
Add possibility to set channel in diag mode by implementing
`platformRadioChannelSet` API.

Signed-off-by: Maciej Baczmanski <[email protected]>
(cherry picked from commit 712da72)
After openthread/openthread#11055,
platform is not required to check diagnostics mode while
processing commands.

Signed-off-by: Maciej Baczmanski <[email protected]>
(cherry picked from commit 74bbbdc)
…ines

Simplify string building and reduce line length.

Signed-off-by: Pieter De Gendt <[email protected]>

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 9ca1b0f)
…ace command

Latest version of nrfutil trace doesn't support setting
uart baudrate.
Remove --baudrate {baudrate_val} from command that executes nrfutil.

Also, combine pytest script for:
- samples.boards.nordic.coresight_stm,
- tests.boards.nrf.coresight_stm,
to minimize code duplication (fix compliance check R0801).

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 153f5b6)
In order to ensure that watchdog channels are freed in proper
driver state, synchronization in form of simple loop needs
to be added after stopping. In no irq variant, it is already done
on nrfx level. NRFY function can be replaced by NRFX one in
the future.

Signed-off-by: Michał Stasiak <[email protected]>
(cherry picked from commit b578ffa)
…ers.

When RISCV_SOC_HAS_ISR_STACKING is used, it may
be needed to initialize custom hw stacked esf members.
Some initial values may need to be aligned with
hw stacking mechanism to avoid any side effects.

Upstream PR #: 84076

Signed-off-by: Łukasz Stępnicki <[email protected]>
…n nrf54*

Add test that checks reset cause reported by HWINFO.

Check that hwinfo_get_supported_reset_cause() returns
expected value.

Check that hwinfo_get_reset_cause() correctly detects:
- RESET_PIN,
- RESET_SOFTWARE,
- RESET_WATCHDOG.

Check that reset cause can be cleared
with hwinfo_clear_reset_cause().

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 8f83267)
…iable"

fixup! [nrf noup] cmake: modules: kconfig: Add hide child/parent variable

This reverts commit 2483870.

Signed-off-by: Jamie McCrae <[email protected]>
…ns twister

Enables forcing use of sysbuild to build nrf5340dk/nrf9160dk
non-secure board targets when using twister

Upstream PR #: 82907

Signed-off-by: Jamie McCrae <[email protected]>
Fixes some issues with samples/tests by adding configuration
files to satisfy TF-M requirements

Signed-off-by: Jamie McCrae <[email protected]>
fixup! [nrf noup] tree-wide: support NCS Partition Manager (PM) definitions

Removes a condition in the partition manager enabled check which
was for child/parent images and keeps the sysbuild one only

Signed-off-by: Jamie McCrae <[email protected]>
Write-back cache after copying VPR's code and data to the destination
memory. It allows VPRs to run from RAM regions cacheable by its host.

It allows to use FLPR in nRF54H20.

Upstream PR #: 84104

Signed-off-by: Hubert Miś <[email protected]>
EngB+ uses 32bit bus-width stacking sequence for all VPR cores.

Signed-off-by: Karsten Koenig <[email protected]>
(cherry picked from commit 6201882)
…ing the first timeout

Ref: NCSDK-31290

This ensures that the system clock is correctly updated when the first
timeout is aborted, preventing unexpected early wake-up by the system clock
programmed previously.

Signed-off-by: Dong Wang <[email protected]>
(cherry picked from commit dd5f11c)
… responses

Adds a new error code that can be used to signify that a query was
valid but the response was not valid

Signed-off-by: Jamie McCrae <[email protected]>
(cherry picked from commit 5871037)
Update the HW models module to:
71bcaa88c97977647d387217dab99f7d6f026815

Including the following:
71bcaa8 hal/nrf_cracen_rng.c: Disable until released
69e9037 hal cracen_rng: Add replacements for proposed cracen_rng hal
71c2507 CRACEN RNG: Corrected one comment
dfbc93a 54 ECB: Corrected behaviour with premature end of input joblist
a46101f 54 AAR, ECB, CCM: Correct a few notes and ECB ERRORSTATUS
74aa2de 54L15: Correct IRQ 261 name
e12ab9c Add CRACEN RNG model
91066e7 docs: UART add PTY backend to shortlist of backends

Signed-off-by: Alberto Escolar Piedras <[email protected]>
(cherry picked from commit 86adcb6)
Signed-off-by: Herman Berget <[email protected]>
Update the HW models module to:
1069743a7fc06362e8f8d7f57225b8c7940da9f0

Including the following:
1069743 Fix in cracen hal conditional compile condition
3bbd3bd Enable build of hal/nrf_cracen_*.c
506da1f hal cracen_cm: Add const to prototype
b02d927 BLECrypt_if: For new aes_ecb scramble data if no libCrypto
e41f101 RRAMC nrf hal: Add replacements for new incoming RRAM APIs
4e933cf UART: Do not warn on invalid/unconfigured framesize
716b20c hal cracen_cm: Add replacements for new cracen_cm hal
fc597a4 CRACEN: Add CryptoMaster & CM AES (ECB only)
129f16c CRACEN RNG HAL: Remove senseless static inline

Signed-off-by: Alberto Escolar Piedras <[email protected]>
(cherry picked from commit a2d202f)
Signed-off-by: Herman Berget <[email protected]>
Update the HW models to the provisional branch zephyr_2025_01_14
which enables the use the not yet released CRACEN RNG & CM HAL

Signed-off-by: Alberto Escolar Piedras <[email protected]>
(cherry picked from commit ec17cc0)
Signed-off-by: Herman Berget <[email protected]>
…en HAL

Update the HW models to the provisional branch zephyr_2025_01_22
which enables the use the not yet released CRACEN RNG & CM HAL
while enabling the latest nrf HAL 3.10

Including the following:
4aac556 Support latest nrf HAL 3.10 / MDK 8.69.1 for 54L15 builds
2e75940 UART: Correct UART names printed out to the users

Signed-off-by: Alberto Escolar Piedras <[email protected]>
(cherry picked from commit 492ad96)
Signed-off-by: Herman Berget <[email protected]>
…request/release

Makes 802.15.4 use the API under CONFIG_CLOCK_CONTROL_NRF2
in nrf_clock_control.h to request/release HFCLK.

Previous HFCLK requesting/releasing on nRF54H20 was more
of a workaround and could produce issues when
comes to sharing the resources.

Signed-off-by: Piotr Koziar <[email protected]>
(cherry picked from commit b6ca9db)
…4 RD

Selects CLOCK_CONTROL config whenever nRF 802.15.4 Radio Driver
is enabled.

The driver requires HFCLK api available under the config switch.

Signed-off-by: Piotr Koziar <[email protected]>
(cherry picked from commit f6892a4)
Some time ago three Kconfigs dedicated for the child timeouts
configuration were added, but changing them does not apply when
using OpenThread libraries. Added setting these values using
openthread API on openthread start.

Signed-off-by: Kamil Kasperczyk <[email protected]>
(cherry picked from commit 2534dc1)
This commit adds a test that checks if disconnecting
and restarting the IPC session works correctly. The
test is also focused on the "unbound" callback.

Signed-off-by: Dominik Kilian <[email protected]>
Co-authored-by: Radoslaw Koppel <[email protected]>
In some cases, CPUs that may need to reset or
temporary stop communication. This commit adds "unbound"
functionality that provides a callback to IPC service user
when connection was interrupted for some reason, e.g.
expected or unexpected CPU reset, closing the
endpoint. The "unbound" callback is optional to implement
by endpoints. This commit implements it in the ICMsg
backend.

Signed-off-by: Dominik Kilian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.