Skip to content

Conversation

@Damian-Nordic
Copy link
Contributor

...which calculates the maximum number of times a single
ZMS sector has been recycled. This is to enable estimation
of an RRAM lifetime based on a set of tests.

manifest-pr-skip

nordic-segl and others added 30 commits February 17, 2025 12:08
…pported peripherals

Enable Twister tests of PWM driver on nrf54l20pdk.
Overlays were already added to PWM tests.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit ecd53f9)
Define PWM LED at nRF54L20pdk board definition.

Set status=okay for pwm20 node.
Add pincontrol for pwm20:OUT0 at P1.07 (LED1).
Add pwm_led1 node.
Add alias pwm-led0.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 23e6854)
All needed configuration was moved to the board definition.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 8f39cea)
… and nRF54L09 PDKs

Add support for nRF54L20 and nRF54L09 PDKs in temp_sensor
twister tests.

Signed-off-by: Michał Stasiak <[email protected]>
(cherry picked from commit 2a642f1)
…4L09 PDK.

Added further support for nRF54L09 PDK in watchdog twister
tests.

Signed-off-by: Michał Stasiak <[email protected]>
(cherry picked from commit a0303d3)
Added support for nRF54L20 PDK in SPIM twister tests.

Signed-off-by: Michał Stasiak <[email protected]>
(cherry picked from commit 04df6de)
Added support for nRF54L20 PDK in tests involving
multiple instances. Corrected pin assignements in
spi_error_cases test.

Upstream PR #: 84672

Signed-off-by: Michał Stasiak <[email protected]>
Added support for nRF54L09 PDK in SPIM twister tests.

Signed-off-by: Michał Stasiak <[email protected]>
(cherry picked from commit ccd2fd6)
Extend current adc gains with new entry 2/7.

Signed-off-by: Karol Lasończyk <[email protected]>

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 057de45)
Added the test configuration for nRF54L20 for the following tests:
- adc_api
- adc_error_cases

Signed-off-by: Rafał Kuźnia <[email protected]>

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit f78742f)
Select Reference voltage of 900mV for ADC on nRF54L20pdk.

Add ADC to the list of supported peripherals.

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 99c3988)
…mple

Adds a configuration to this sample that is optimised for
testing/usage with the nRF5340 which enables the Bluetooth
transport, enables most management groups, has a static partition
manager file with secondary partitions on QSPI flash, configures
MCUboot in overwrite only mode with network core update support

Signed-off-by: Jamie McCrae <[email protected]>
Adds support for prefixing files with the target of bl2 or tfm

Signed-off-by: Jamie McCrae <[email protected]>
(cherry picked from commit f804469)
Add Nordic platforms and rename the defines
to avoid redefining a nrf driver internal symbols

Signed-off-by: Piotr Krzyzanowski <[email protected]>
(cherry picked from commit 09d5b9d)
Improve test stability in 54l15 case
by measuring duty cycle after two periods

Signed-off-by: Piotr Krzyzanowski <[email protected]>
(cherry picked from commit cb7690a)
…ration for nrf54h20

Extend CONFIG_SKIP_EDGE_NUM.

Signed-off-by: Piotr Kosycarz <[email protected]>
(cherry picked from commit e3e4548)
…BT_HCI_RAW

In zephyrproject-rtos/zephyr#84268
the ability to use the controller for ECDH was removed from
the host.

This means that BT_CTLR_ECDH is now only useful when using
BT_HCI_RAW.

Signed-off-by: Sean Madigan <[email protected]>
(cherry picked from commit 706938d)
Recently I have had to debug issues with PSA and having
the returns values from PSA is very useful in order to
find the root cause of the issue.

Signed-off-by: Sean Madigan <[email protected]>
(cherry picked from commit 8cff70a)
…baudrate enum

Add faster baudrates (2M, 4M and 8M).

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit e737895)
Rename UARTE_ANY_FAST to UARTE_ANY_FAST_PD. There are 2 types of
'fast' UARTE instances. In nrf54h20 instance uart120 is in fast
power domain that requires additional power and clock management
of that domain. In nrf54lx fast uart00 instance does not require
that. Add _PD to indicate fast power domain.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 1573be5)
…udrates

nrf54x devices have UARTE instance capable of using baudrate higher
than 1M. Higher baudrates does not have predefined values for
BAUDRATE register. A formula can be used to calculate BAUDRATE
value that shall be used for desired baudrate. Add UARTE_ANY_HIGH_SPEED
macro which is set when high speed is enabled (uart00 in nrf54lx or
uart120 in nrf54h20). For high speed instance use formula for getting
value that shall be written to BAUDRATE register.

When runtime configuration is not used then same formula is used to
calculate fixed BAUDRATE value.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 972ec82)
Fast instance in nrf54h (uart120) can generate a spurious RXTO event
some time after RXTO event that indicates that RX path is disabled.
The time when event is generated depends on baudrate and when slower
baudrates are used peripheral is disabled on time to not notice it
in the test but with higher baudates issue become visible. In order
to avoid spurious interrupt, RXTO interrupt is disabled during RXTO
event handling and enabled when RX is enabled. This workaround is
applied only for fast instance to avoid unnecessary register
accesses for slower instances.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit e235e7b)
…abort test

Test was staring a TX transfer and aborting it after 300 us from
the timer handler. Test was assuming that ongoing transfer will
not finish in those 300 us. This might not be true for higher
baudrates. Instead of using fixed timeout, a value is calculated
from the baudrate and targets to abort the transfer after approx.
20 bytes of 95 byte long transfer.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 38c129d)
…rf54h20dk uart120

Use high baudrate when testing uart120 on nrf54h20dk/nrf54h20/cpuapp.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit fe6a4d0)
Changes the priority of imgtool so that the preferred version is
the one inside of the MCUboot directory

Signed-off-by: Jamie McCrae <[email protected]>
(cherry picked from commit 6db2c86)
Uses imgtool which has already been located by zephyr

Signed-off-by: Jamie McCrae <[email protected]>
(cherry picked from commit 8b7beff)
…lection

Adds API for Advertising Coding Selection.

Introduces two new advertising options to configure the advertiser's
requirement concerning coding scheme when LE Coded PHY is configured.
While the Bluetooth v6.0 specification makes a distinction betweeen
preferred and required advertising PHY options, a simplification is
made to only expose the required PHY options. Inline with how LE Coded
PHY is implemented; this API will set both the primary and secondary
advertising PHY's to the same coding scheme.

The support is enabled by CONFIG_BT_EXT_ADV_CODING_SELECTION, and requires
a controller that selects CONFIG_BT_CTLR_ADV_EXT_CODING_SELECTION_SUPPORT.

Signed-off-by: Thomas Deppe <[email protected]>
(cherry picked from commit f3bdd2b)
…ng Selection

Extends the API for Advertising Coding Selection.

The API is extended to set the Advertising Coding Selection
(Host Support) bit. With this feature, the primary and
secondary PHY can now explicitly report S=2 or S=8 coding
in the extended advertising report. Previously, the report
only indicated LE Coded regardless of whether S=2 or S=8
data coding was used. The API now sets the host support bit
and ensures that the advertising PHY coding scheme is
conveyed to the application via the scan callback.

The support is enabled by CONFIG_BT_EXT_ADV_CODING_SELECTION,
and requires a controller that selects
CONFIG_BT_CTLR_ADV_EXT_CODING_SELECTION_SUPPORT.

Signed-off-by: Thomas Deppe <[email protected]>
(cherry picked from commit dcbcbe8)
This adds temporary entropy driver simulation for
nRF54l09 device since final entropy source is not
available yet.

TODO: Remove this commit when proper solution will
be available.

Signed-off-by: Rafał Kuźnia <[email protected]>
…opback too

A test is going to use this UART also, so we'll need it.

Signed-off-by: Alberto Escolar Piedras <[email protected]>
(cherry picked from commit dc87bb0)
kartben and others added 24 commits March 7, 2025 14:44
…uide docs for 4.2

This introduces the release notes and migration guide for Zephyr 4.2.0
earlier so that people have a placeholder to start adding content as
they line up pull requests for the 4.2 release.

Signed-off-by: Benjamin Cabé <[email protected]>
(cherry picked from commit 3ef9540)
Nordic has a new tool, nRF Util (`nrfutil`) which is replacing the
previous set of command-line tools (particularly `nrfjprog`) that Zephyr
had been using by default in many of the boards to flash the firmware
onto the device.

Since nRF Util is already mature and is going to be replacing the existing
tools, including `nrfjprog`, it is now a good time to change the default
flash tool to reflect this fact.

Note that `nrfjprog` support is not being removed at all, but this may
be a breaking change for users that do not have nRF Util installed. For
this reason we also add a note in the migration guide.

More info:
https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-util-unified-command-line-utility

Installation:
https://www.nordicsemi.com/Products/Development-tools/nrf-util

Documentation:
https://docs.nordicsemi.com/bundle/nrfutil/page/README.html

Upstream PR #: 86729

Signed-off-by: Carles Cufi <[email protected]>
nrf-squash! [nrf noup] tests: drivers: mspi: api: Add nRF54L15 overlay file

Custom overlay is now in `nrf/tests/zephyr/...`

Signed-off-by: Marcin Szymczyk <[email protected]>
Add USB variant config files for esp32c3 boards.

Signed-off-by: Raffael Rostagno <[email protected]>

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 8048a6a)
Enable flash samples for s32z board

Signed-off-by: Cong Nguyen Huu <[email protected]>

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 8627063)
…k board

The tests for settings will not work properly with just provided config
file for mimxrt1020:
west build -p always -b mimxrt1020_evk samples/subsys/settings

as there the settings_save_one() would return -2 (-ENOENT) as by default
the CONFIG_SETTINGS_NONE is defined for mimxrt1020 configuration.

For proper operation (i.e. to have a memory medium to store settings
values) the NVS backend needs to be enabled.

Signed-off-by: Lukasz Majewski <[email protected]>

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 8719aba)
S2 has 12-bit ADC.

Signed-off-by: Marek Matej <[email protected]>

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 37f2f7e)
Remove ADC2 support (identified as adc1 entry)
for additional ESP32-C3 based board targets.
Other boards have those instances already deleted.

Signed-off-by: Sylvio Alves <[email protected]>

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 40b474c)
Added build configuration for nRF54L09.

Signed-off-by: Rafał Kuźnia <[email protected]>

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 5064401)
Move overlays and conf from boards to socs in following samples :
- samples/drivers/adc/adc_dt
- samples/drivers/counter/alarm
- samples/drivers/dac
- samples/subsys/settings

Signed-off-by: Marek Matej <[email protected]>

add more samples

Signed-off-by: Marek Matej <[email protected]>

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit b58c424)
Almost all overlays only enable NVS and SETTINGS_NVS, something that
should be enabled in sample directly. Remove all overlays and make the
sample more genenric.

Use filter on storage partition to enable testing the sample on more
plaforms.

Signed-off-by: Anas Nashif <[email protected]>

Signed-off-by: Sebastian Głąb <[email protected]>
(cherry picked from commit 270c4e4)
…eripheral

Fix mistake in host implementation of Advertising Coding Selection.

The host should only try set the BT_LE_FEAT_BIT_ADV_CODING_SEL_HOST
when the observer role is enabled. If a broadcaster enables the
CONFIG_BT_EXT_ADV_CODING_SELECTION Kconfig option bluetooth will
fail to initialise.

Upstream PR #: 86731

Signed-off-by: Thomas Deppe <[email protected]>
…ction"

This reverts commit 14d166f.

Signed-off-by: Riadh Ghaddab <[email protected]>
…emory Storage)"

This reverts commit 88e9f91.

Signed-off-by: Riadh Ghaddab <[email protected]>
…orage)

This adds the initial backend support for the ZMS storage system.

Signed-off-by: Riadh Ghaddab <[email protected]>
(cherry picked from commit ef4e8dd)
This adds a on target performance test for Settings SS. Using this test
performance of the Setting SS + NVS/ZMS backend can be benchmarked.

The test repeatedly write 128 settings entries. Each setting entry
has a size of 4 bytes, and path length of 16 bytes (excluding the
null-terminator).

The test has two variants, with and without Bluetooth scan running.
This is useful to benchmark performance along with some component
of BT subsystem activated.

The test could be enhanced in future to include or create combinations
of different functionalities running, when agreesive store operations
are happening.

Signed-off-by: Omkar Kulkarni <[email protected]>
(cherry picked from commit c795596604ea06f3d463bf36c4c1106b83165e72)
This resolves some addressed comments in this PR zephyrproject-rtos#77930
as well as this PR zephyrproject-rtos#80407

Signed-off-by: Riadh Ghaddab <[email protected]>
(cherry picked from commit 5f7cda5)
To avoid collisions between IDs used by settings and IDs used directly
by subsystems using ZMS API, the MSB is always set to 1 for Setting's
name ID written to ZMS backend

Add as well a recovery path if the hash linked list is broken.

Signed-off-by: Riadh Ghaddab <[email protected]>
(cherry picked from commit 40fbffe8196b263ae786a8eb4ba75db4ab682862)
adding a lookup cache improves write and delete operation as it doesn't
look for the name in the storage if no hash collision exists or if the
entry is deleted.

Signed-off-by: Riadh Ghaddab <[email protected]>
When deleting a settings entry the linked list is updated by removing
the deleted node. This operation is time consuming and add some delays.
For applications that use almost the same set of Setting entries, add an
option to make this operation faster at a cost of having some empty
nodes in the linked list.
These empty nodes can be used later when the deleted entry is written
again.
Each empty node occupies 16B of storage.

Signed-off-by: Riadh Ghaddab <[email protected]>
To measure the performance, add a delete operation after each write.

Signed-off-by: Riadh Ghaddab <[email protected]>
When the CONFIG_ZMS_NO_DOUBLE_WRITE is not enabled there is no need to
search in the cache for matching ID

Signed-off-by: Riadh Ghaddab <[email protected]>
Settings subsystem is storing the name ID and the linked list node ID
with only one bit difference at BIT(0).
Settings subsystem is also storing the name ID and the data ID in two
different ZMS entries at an exact offset of ZMS_DATA_ID_OFFSET.
Using the regular lookup function could result in many cache misses.

Therefore, to assure the least number of collisions in the lookup cache,
the BIT(0) of the hash indicates whether the given ZMS ID represents a
linked list entry or not, the BIT(1) indicates whether the ZMS ID is a
name or data and the remaining bits of the hash are set to a truncated
part of the original hash generated by Settings.

Signed-off-by: Riadh Ghaddab <[email protected]>
...which calculates the maximum number of times a single
ZMS sector has been recycled. This is to enable estimation
of an RRAM lifetime based on a set of tests.

Signed-off-by: Damian Krolik <[email protected]>
return ret;
}

uint32_t zms_get_num_cycles(struct zms_fs *fs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need to read all cycle_counts for all sectors ?
Reading the full_cycle_cnt of the current sector should be enough as it holds the maximum number of cycle_cnt.
I don't see scenarios where some closed sectors will have a full_cycle_cnt bigger than the current open sector.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it may happen if GC is interrupted and must be restarted.

Copy link
Contributor

Choose a reason for hiding this comment

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

We increase the cycle only after erasing a sector which is the last operation after the GC has finished.
If the GC got interrupted, next time we won't find a GC_DONE ATE and we restart the GC, the cycle_cnt is increased only at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But if you start copying entries from sector N+1 to sector N, and GC is interrupted, then, after reboot, you must erase N again (even though this was erased before GC). This is what https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/fs/zms/zms.c#L1284 implements, no?

Copy link
Contributor

@rghaddab rghaddab Mar 24, 2025

Choose a reason for hiding this comment

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

you are right, we do this for the current sector and the next one, only in this case.
I will cherry-pick yours in my PR.
Please go ahead and push it upstream along with its documentation. It is a nice feature to have

@omkar3141
Copy link
Contributor

This is great small feature addition that will have long lasting effect, to benchmark and predict the application's usage of Flash/RRAM.

union {
/** data offset within sector */
uint32_t offset;
/** full cycle count (for empty ATE) */
Copy link
Contributor

Choose a reason for hiding this comment

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

what does "full" indicate here? I think this is causing a bit of confusion for me.

Copy link
Contributor Author

@Damian-Nordic Damian-Nordic May 5, 2025

Choose a reason for hiding this comment

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

full as opposed to "modulo 256" that is normally stored in each ATE

Copy link
Contributor

Choose a reason for hiding this comment

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

the cycle_cnt is truncated (only 8 bits)
The full cycle_cnt is uint32_t

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

Labels

None yet