Instead of re-implementing or assuming that POPCOUNT is available
we now use the generic function from Zephyr.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds a generic function that will count the number of bits set in
a value.
It uses POPCOUNT (e.g. __builtin_popcount for GCC) if available,
or else it will use Brian Kernighan’s Algorithm to count bits.
POPCOUNT will likely always support unsigned ints, but the function
was implemented to use it with uint8_t for the sake of simplicity
and compatibility with Brian Kernighan’s Algorithm.
A generic solution was chosen rather than a macro/function per
type (e.g. uint8_t, uint16_t, etc.) as that is easier to maintain
and also supports array types (e.g. counting the number of bits
in 128 or 256 octet arrays).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a test case for the alignment support in loadable extensions. This
test case creates a set of constants with specific alignment requirements
and verifies that they are placed in memory as expected.
Fix the detached section test to use a more standard syntax for the
section attribute, avoiding issues with different toolchains.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Previously the net_linkaddr struct had pointers to the link address.
This is error prone and difficult to handle if cloning the packet as
those pointers can point to wrong place. Mitigate this issue by
allocating the space for link address in net_linkaddr struct. This will
increase the size of the net_pkt by 4 octets for IEEE 802.15.4 where the
link address length is 8, but there no increase in size if link address
is 6 bytes like in Ethernet/Wi-Fi.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make sure that source and destination link addresses are correct
after cloning and pulling net_pkt.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
- Allocate source in PBP first time adv is created
- Only set_adv_data in adv_setup if ext_adv already exists
- Fixes regression in PTS for PBP tests
Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
The thread metric cooperative benchmark had a subtle flaw on
SMP enabled systems. The reporting/main thread was running at
a higher priority than the "cooperative" threads. When that
reporting thread woke up from its 30 second sleep, there was a
chance that it would change the ordering of the "cooperative"
threads before the test expected it.
This ordering change is not present on UP systems as the current
thread is always in the ready queue. However, on SMP systems the
current thread is not in the ready queue and is re-added to the
end of the list when it is preempted by a higher priority thread.
To work around this, we make the priority of the main/reporting
thread to be the same as the "cooperative" threads. Thus when
the reporting thread wakes, it is added to the end of list and
no longer introduces an unexpected schedule point.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
- Make sure the align-and-rewind feature is explicitly tested.
- Add sub-unit allocations to the mix.
- Rely on some heap internal facilities to determine heap boundaries
(32- vs 64-bit builds do cause a difference).
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Clarify that all max limit on RTOS objects set by Kconfig only apply
to objects whose control blocks were dynamically allocated. The
CMSIS-RTOSv2 impl layer itself does not restrict the number of
statically created RTOS objects.
Signed-off-by: Utsav Munendra <utsavm@meta.com>
Clarify thread Kconfigs to denote the maximum number of dynamically
allocated control blocks and stacks for threads. Allow application to
create any number of threads with statically allocated control block
and stack.
Signed-off-by: Utsav Munendra <utsavm@meta.com>
Improve naming of the scheduler and call it what it is: simple. Using
'dumb' for the default scheduler algorithm in Zephyr is a bad idea.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The ke17z overlay for this test is incorrect in that the chip select
line sent to the spi pins on the header is PCS1, not PCS0. This is
having no functional effect on the test right now but soon I am trying
to implement a chip select test, and regardless it helps to have the CS
actually toggle right now for debugging purposes.
Also, I checked the frdm_ke17z512 and it looks like the board pinctrl
file is configuring for PCS2, so I fixed that as well because it looks
also like the same mistake, but I don't have that hardware.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
When CONFIG_KERNEL_COHERENCE is enabled, pend_locked() asserts
when wait_q is not in coherent memory. The k_pipes used in
the pipe_api tests are declared locally within the test. They
are located within the thread stacks and those wait_q inside
k_pipe struct are thus not considered in coherent memory.
To make them work, replace the local ones with a global
k_pipe object. Since each test initializes the pipe object
locally, the tests are not functionally changed.
Fixes#84235
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The zbus hlp_priority_boost test requires thread priority
boosting. If it is running SMP, it is possible that
the message has already been processed before the check
for priority boosting is done, thus failing the test.
So change the test to use 1 CPU only.
Fixes#79197
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Remove the overlay files for many of the NXP platforms, because they
were doing two things that are no longer relevant:
1) CONFIG_SPI_ASYNC=n -> LPSPI driver used to not work with
CONFIG_SPI_ASYNC, now it does, so we should test it.
2) CONFIG_SPI_MCUX_LPSPI_DMA=y -> This is redundant with the
testcase.yaml
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
On top of enabling and allowing test entropy sources, enable
CONFIG_ENTROPY_GENERATOR so that a real driver and entropy source gets
used if available.
This is needed for some PSA Crypto implementations that have random number
generation conditionally compiled in.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Some implementations require more stack than others.
Increase the Ztest and main stack sizes to accommodate them.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Use dynamic allocation for key material for
better compatibility as a fully static key store is a new
feature that not all PSA Crypto implementations support.
Explicitly enable CONFIG_MBEDTLS_ENABLE_HEAP to ensure that Mbed TLS uses
heap for the PSA keys' data (instead of failing at runtime).
This will turn off CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS, making the
implementation default to dynamic key slots.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Explicitly enable CONFIG_ENTROPY_GENERATOR instead of relying on the
build system's defaults.
This:
- Makes sure the filtering works properly between entropy_driver and
entropy_not_secure test scenarios for the samples.
- Helps with TF-M builds in certain scenarios where key generation (via
`psa_generate_key()`) would fail due to the RNG functionality being
disabled.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
The psa_key_attributes_t type is implementation-defined according to
the PSA Crypto spec.
Compare its fields individually instead of doing a memcmp() over the
entire struct.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Explicitly set the TF-M profile to not rely on the build system defaults
which might differ.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
- add driver for Vishay VEML6031 High Accuracy Ambient Light Sensor.
- add new compatible "vishay,veml6031".
- read and write consecutive 8 bit registers as bulk operation.
- add driver to build all test of sensors.
- support fetch and get.
- triggered mode and interrupt is not yet supported.
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
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 <sebastian.glab@nordicsemi.no>
Adding a test case for stepper driver implementation of
allegro a4979 microstepping programmable stepper motor driver.
Signed-off-by: Verena Schweinstetter <verena.schweinstetter@zeiss.com>
IUT works as a SDP Client. The peer device, SDP server, is a PC with
running `bumble` on it.
Add shell command `discovery` to discover specific SDP record
according to specific UUID.
In the test suite, there are three groups test cases,
Group 1 is for Service Search Attribute transaction.
Group 2 is for Service Search transaction.
Group 3 is for Service Attribute transaction.
For each test group, there are four test cases,
Case 1, No SDP record is registered on PC. IUT should not find any SDP
record.
Case 2, A2DP source SDP record is registered on PC. IUT can find SDP
record. And the discovered PSM and version should be same with
registered.
Case 3, A2DP source and HFP HF SDP Records are registered. IUT can
find SDP record. And the discovered RFCOMM channel and HFP version
should be same with registered. This case is used to test the
"continuation state information".
Case 4, Multiple SDP Records are registered. This case is used to test
the "continuation state information". And also it used to test the
total length exceeds the ACL RX Buffer Size.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
btp_bap_broadcast_local_source_free used &source, but since
source was already a pointer, it should just use source.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
When the only changes are nrf_wifi module the twister runs with tag
"nrf_wifi" and restricts tests, and that excludes this test as well.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Some CAP BSIM could not be built after some commits were merged.
One CAP test was missing a call to backchannel_sync_send_all
A change in the controller and/or timing seems to have triggered
an old issue on a bunch of tests. Theses tests have been disabled
while the issue is pending investigation.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Renamed BT_CSIP_SET_MEMBER_NOTIFIABLE to
BT_CSIP_SET_MEMBER_SIRK_NOTIFIABLE to be more specific.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
To add the functionality conform rfc6762 chapter 6.7 the interface for
setup_dst_addr(...) has changed. This patch fixes the interface mismatch
Signed-off-by: Vincent van der Locht <vincent@synchronicit.nl>
When the BT Tester gets the write response, it should not send
the state change event, as the write response may come
before the notifications, and in which case the state may
not have changed.
The BT Tester should always wait for the state change notification
before sending the event.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Some GATT services and profiles define specific behavior
based on whether the remote device is bonded or not.
The internal function, bt_addr_le_is_bonded, is the
only function to do this, but it was kept internal,
and could thus not be used for those services
without including hci_core.h.
The function has been moved to the public API
so that application can determine if a remote
address is bonded or not, and has been renamed
to not use the bt_addr namespace, but rather the
bt_le.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The cap_broadcast test has been split into 3 tests:
1) Regular test
2) Regular test with metadata update
3) Test for invalid parameters
This will make it easier to use the regular cap_broadcast test
for other test cases, as it does less now.
It also makes each test run faster seperately and reduce their
scopes.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add TX and RX verification for the audio configuration tests.
This requires modifying some of the underlying structures
used in those tests, as well as initializating and triggering
TX, and with verification of RX as well.
These tests were implemented to ensure that the streams are not
just established, but can send ISO data without issues.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The existing implemented only attempted to send all notifications,
but if host was out of ATT TX buffers the notifications would fail
and the client may miss out on important information, and would be
a spec violation.
This commit refactors notificatios in TBS so that they are always
sent.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>