Skip to content

Conversation

@frkv
Copy link
Contributor

@frkv frkv commented Mar 18, 2025

Macro additions for PSA core lite.

For PSA core lite, see PRs:

nordic-segl and others added 30 commits March 13, 2025 07:23
…of .bss and .data

In some configurations, code is copied from non-volatile memory
to RAM before a core (using that code) is booted.
When that core is reset by expired watchdog, variables shall be
restored to "initial" values.

This is problematic because the core is aware of copy in RAM.
It may not know address in non-volatile memory, where "original"
code is stored.

Add tests which verifiest that .bss and .data sections are
correct when core boots from reset caused by expired watchdog.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 81df84a)
…uency(nrf54l09pdk)

 Test test_one_tick_timer_train was failing due not being able to
 execute enough 1 tick timeouts. Decrease system ticks frequency
 to make the test pass.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 5e2b998)
Fix checking of shiphold active level.

Signed-off-by: Audun Korneliussen <[email protected]>
(cherry picked from commit db4d24d)
Extend mfd_npm2100_hibernate function with pass_through argument,
which is used to differentiate between hibernate and hibernate_pt
modes.

Signed-off-by: Audun Korneliussen <[email protected]>
(cherry picked from commit 7fd3472)
Align formatting of defines at the top of the mfd_npm2100.c file

Signed-off-by: Sergei Ovchinnikov <[email protected]>
(cherry picked from commit 5aeae41)
Do not reconfigure the SHPHLD button behavior by writing to the sticky
register in drivers: mfd, regulator: npm2100. This is removed to avoid
unexpected behaviors during or after the ship or hibernation modes.

Signed-off-by: Sergei Ovchinnikov <[email protected]>
(cherry picked from commit 1d8ef88)
Added queue for memory slab addresses to ensure that they
are released in correct order. Improved formula for frequency
scaling for nRF54H20. Fixed alternative channel mapping.

Signed-off-by: Michał Stasiak <[email protected]>

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 8260e1f)
Improves readability by removing the need to check the table
to figure out how many antennas devices A and B are using.

Signed-off-by: Olivier Lesage <[email protected]>
(cherry picked from commit 6f33793)
…_LOCKUP

Extend test code with scenario that checks if:
- RESET_CPU_LOCKUP is detected;
- RESET_CPU_LOCKUP can be cleared.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit ee9d6b7)
Added additional analog channels for ADC and COMP/LPCOMP and new pin
functionality mapping for TDM.

Signed-off-by: Karsten Koenig <[email protected]>

(cherry picked from commit b900ed5)
Upstream not ready yet, revert once applied there.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
Signed-off-by: Karsten Koenig <[email protected]>

(cherry picked from commit 6384b58)
…peripherals

Enable Twister tests of SPI peripheral on nRF54L20pdk.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 321fcaf)
… on nrf54l15

Enable execution of dmic_api test on nrf54l15:
- add 'dmic' to the list of supported peripherals;
- add overlay for nrf54l15;
- align Nordic's implementation of PDM driver to pass the test.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 2e23dfd)
…ss CLOCK_CONTROL

Do not start the LF clock unless CONFIG_CLOCK_CONTROL_NRF is enabled.
This is similar to how it's done in Nordic's GRTC driver.

Authored-by: Krzysztof Chruściński <[email protected]>
Signed-off-by: Emanuele Di Santo <[email protected]>
(cherry picked from commit cdc2f2a)
Allows erasing secondary slot which is marked for test or confirmed.
This is safe as bootloader doesn't make any action on boot-setup yet.

Erase of such pending image might considered like the case when it
was never downloaded as well.

This allow user to not stuck with pending irremovable image.

Signed-off-by: Andrzej Puzdrowski <[email protected]>

Upstream PR #: 87042
Add Kconfig options for TDM130 and TDM131.

Upstream PR #: 82144

Signed-off-by: Adam Kondraciuk <[email protected]>
Add HAL glue Kconfig options for TDM130 and TDM131.

Upstream PR #: 82144

Signed-off-by: Adam Kondraciuk <[email protected]>
Add support for configuring pins of the nRF TDM peripheral.

Upstream PR #: 82144

Signed-off-by: Adam Kondraciuk <[email protected]>
Add TDM support for nRF54H20 and nRF54L20

Upstream PR #: 82144

Signed-off-by: Adam Kondraciuk <[email protected]>
Add a shim that allows using the nRF TDM
(Time division multiplexed audio interface) HAL by I2S Zephyr API.

Upstream PR #: 82144

Signed-off-by: Adam Kondraciuk <[email protected]>
Some of nRF54's has TDM peripheral instead of I2S.

Upstream PR #: 82144

Signed-off-by: Adam Kondraciuk <[email protected]>
Configure SDP MSPI pins to switch their control to VPR core

Signed-off-by: Jakub Zymelka <[email protected]>
(cherry picked from commit 2540f7b)
… instead of JSON

Instead of pre-generating the JSON batch to then execute it, use
command-line arguments and --x-append-batch to generate the JSON file
tht will then be passed to x-execute-batch.

Signed-off-by: Carles Cufi <[email protected]>
(cherry picked from commit 6e9e839)
In commit 6e9e839, an indirection via
the new `options` dictionary was missed in the SUIT handling.

Signed-off-by: Carles Cufi <[email protected]>
(cherry picked from commit 51661ef)
…ling

This is no longer necessary, because thanks to sysbuild we no longer
invoke a runner with a .hex file that is the result of merging builds
for more than one core.

Signed-off-by: Carles Cufi <[email protected]>
(cherry picked from commit aaefaad)
These are used to detect if the firmware image contains any values
inside the UICR for additional handling.

Signed-off-by: Carles Cufi <[email protected]>
(cherry picked from commit fa66984)
This is no longer used at all.

Signed-off-by: Carles Cufi <[email protected]>
(cherry picked from commit 4e8ec16)
The `erase` command was being used but there was no "backend"
implementation for it in nrfutil nor nrfjprog. Simplify the syntax and
implement it for both tools.

Signed-off-by: Carles Cufi <[email protected]>
(cherry picked from commit dc7d8bb)
krish2718 and others added 10 commits April 2, 2025 09:19
Using TLS credentials library add support for run-time certificates where
the installed certs are retrieved from the credential store (as of now
only volatile backend is tested).

This helps in production environments.

Implements #79564.

Upstream PR #: 87656

Signed-off-by: Chaitanya Tata <[email protected]>
The volatile backend stores the credentials on the heap, so, explicitly
add a config option that can be overridden in case there are more certs
than the default.

Upstream PR #: 87656

Signed-off-by: Chaitanya Tata <[email protected]>
Instead of having an overlay move the Enterprise configurations to a
dedicated snippet so that it can be enabled with any sample.

Can be used along with Wi-Fi snippet e.g., `-S
"wifi-ipv4;wifi-enterprise"`.

Upstream PR #: 87656

Signed-off-by: Chaitanya Tata <[email protected]>
…ials

Enable TLS credentials shell to manager Wi-Fi enterprise certs.

Upstream PR #: 87656

Signed-off-by: Chaitanya Tata <[email protected]>
Deletion of credential should use the pointer from the reference slot
not the temporary buffer, this causes a crash (unknown error).

Upstream PR #: 87656

Signed-off-by: Chaitanya Tata <[email protected]>
Certificates usage depends on STA/AP mode, but we don't have that
information at a build time, so, make all certs as optional and if a
file isn't found then generate an empty header so that corresponding C
code will be built.

Any missing mandatory certificates will be validated before connection
and connection is failed.

Upstream PR #: 87656

Signed-off-by: Chaitanya Tata <[email protected]>
RSA3K based certs are not supported on all platforms, so, keep both
variants, rsa2k (the older certs but with longer expiry 9999 days) and
rsa3k (latest ones) and we can have more variants in this folders.

Also, add a cmake variable to override the path with default as rsa3k.

Upstream PR #: 87656

Signed-off-by: Chaitanya Tata <[email protected]>
The command should work with existing certs rather than a generic
example, also fix the key-management.

Upstream PR #: 87656

Signed-off-by: Chaitanya Tata <[email protected]>
For enterprise mode we need to install multiple certs to the TLS
credentials store, so, add a helper script.

Upstream PR #: 87656

Signed-off-by: Chaitanya Tata <[email protected]>
RAM power configuration is preserved through soft reset,
meaning that there is a risk of accessing powered off RAM blocks
when booting in different application (i.e. bootloader).
Add option to force all RAM blocks to be powered on
before triggering soft reset to prevent this from happening.

Signed-off-by: Nikodem Kastelik <[email protected]>
(cherry picked from commit c3646a3)
nordic-krch and others added 2 commits April 2, 2025 12:24
nrf54h20 device requires device runtime PM to be enabled when
device PM is in use.

Upstream PR #: 87807

Signed-off-by: Krzysztof Chruściński <[email protected]>
Upstream PR #: 87962

MODULE_EXT_ROOT allows Zephyr modules to provide glue code for Zephyr
modules using `cmake-ext: True` and/or `kconfig-ext:True`.

A module ext root provides a `modules.cmake` file which defines
variables like: `set(ZEPHYR_FOO_CMAKE_DIR  <glue-code-path>/foo)`

It is intended that a downstream module can replace Zephyr's default
glue code, which again can be replaced further downstream.

Setting values in first modules.cmake (Zephyr's) are replaced by later
processed modules.cmake (downstream) when the setting name is identical.

Therefore the module ext root list should not be reversed, and Zephyr
itself should be placed as first entry in the list.

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit 83976563b4175e72841b002d35350abb16c6aea8)
nordic-krch and others added 7 commits April 3, 2025 07:40
…default"

This reverts commit 23d0c95.

Signed-off-by: Krzysztof Chruściński <[email protected]>
…B for examples

-This avoids compliance-errors when using the term CONFIG_BAR e.g. in
 API documentation.
-This avoids compliance-errors when using the terms CONFIG_FLAG_A
 and CONFIG_FLAG_B in API documentation.

NOTE: CONFIG_BAR, CONFIG_FLAG_A, and CONFIG_FLAG_B are not real
configurations

Upstream PR #: 87026

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
(cherry picked from commit 7847bf210af5de3b09c0eb40f4cdf30c284ce79a7)
…tements

-Adding specialized matching for default label to allow macros being
 used in swich-statements.
 Before this commit, any code that makes use of a macro above default:
 in a switch-statement will cause issues complaining about spaces

 Example:
    switch (a) {
        SOME_MACRO(A)
        default:
             break;
    }

 ... would complain on the colon of the default case, regardless of
 the content of the macro

Upstream PR #: 87026

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
(cherry picked from commit ce50a78375d9241a074f72bbb42c27a476fc73e9)
-Added macro IS_ENABLED_ALL to check multiple macro definitions to see
 if ALL of them are define and set to 1. The result of calling this macro
 is compiler-visible expressions resolving to "1" if true, otherwise
 "0".
-Added macro IS_ENABLED_ANY to check multiple macro definitions to see
 if ANY of them are defined and set to 1. The result of calling this
 macro is compiler-visible expressions resolving to "1" if true,
 otherwise "0".
-Added unit tests for IS_ENABLED
-Added unit tests for IS_ENABLED_ALL and IS_ENABLED_ANY

Both macros utilize the same strategy as the IS_ENABLED macro, but
supports variable number of arguments

Upstream PR #: 87026

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
(cherry picked from commit a17af065ae9ae16fd8e38392e6efeff0d20692dd)
-Added macro IF_ENABLED_ALL to emit code if all flags are defined to 1,
 otherwise an empty token is emitted.
-Added macro IF_ENABLED_ANY to emit code if any flags are defined to 1,
 otherwise an empty token is emitted.
-Added unit tests for IF_ENABLED_ALL and IF_ENABLED_ANY

Both macros utilize the same strategy as the IF_ENABLED macro, but
supports a list of flags as a single argument. The flags to check must
be wrapped in parentheses.

Upstream PR #: 87026

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
(cherry picked from commit 7131122bca3100267fa1ec0edff6e7c98afccf31)
…ED_<ALL/ANY>

-Added macro CASE_IF_ENABLED to emit a case in a switch-statement
 if the given flag is define to 1.
-Added macro CASE_IF_ENABLED_ALL to emit code if all flags are defined
 to 1, otherwise an empty token is emitted.
-Added macro CASE_IF_ENABLED_ANY to emit a case code if any flags
 are defined to 1, otherwise an empty token is emitted.
-Added unit tests for CASE_IF_ENABLED, CASE_IF_ENABLED_ALL,
 CASE_IF_ENABLED_ANY

These macros utilize the same strategy as the IF_ENABLED macro

Upstream PR #: 87026

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
(cherry picked from commit 4ee6ef8708d0126afe9f990b505222e6529bc687)
-Add macro UTIL_CONCAT_AND which does a concatenation of a variable
 list of arguments with && between the arguments.
 This macro uses primitive concatenation and doesn't try to process
 them in the preprocessor
-Add macro UTIL_CONCAT_OR which does a concatenation of a variable
 list of arguments with && between the arguments.
 This macro uses primitive concatenation and doesn't try to process
 them in the preprocessor
-Added unit tests for UTIL_CONCAT_AND and UTIL_CONCAT_OR

Upstream PR #: 87026

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
(cherry picked from commit f69266b8b529a9fe751e50767e745e696c216003)
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 3, 2025

@tomi-font tomi-font requested a review from carlescufi April 3, 2025 10:06
Copy link
Contributor

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the changes in include/zephyr/sys are way too invasive with no current agreement upstream. @bjarki-andreasen and @nordic-krch, what do you think we should do here?

@bjarki-andreasen
Copy link
Contributor

the changes in include/zephyr/sys are way too invasive with no current agreement upstream. @bjarki-andreasen and @nordic-krch, what do you think we should do here?

I already stated I don't think this amount of logic should be in macros at all, kconfig should be used for conditional and programmatic defines, not macros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet