Commit graph

981 commits

Author SHA1 Message Date
Aastha Grover
283a9ef959 tests: cpp: Exclude cpp2B testcase for xt-clang toolchain
c++2B standard is not supported for xt clang compiler so
exclude cpp2B testcase for xt-clang toolchain.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-30 10:07:00 +01:00
Peter Mitsis
77abd6f89d tests: Allow thrd test to run on xtensa
On some SMP platforms (such as intel_adsp_ace15_mtpm) it is not
safe to access the stack of a thread that is currently executing
on another CPU. This requires that tests be written such that
objects and data that are shared between threads that may execute
concurrently on different CPUs be placed into memory that is not
a thread's stack.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-11-28 14:46:15 -05:00
Alberto Escolar Piedras
fd095c36b9 tests/lib/gui/lvgl: Enable for native_sim
Enable this test which runs in native_posix_64 in
native_sim(_64), and set default test platform
to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Alberto Escolar Piedras
70e0d1e04e tests/lib/devicetree: Enable for native_sim
Enable these tests which run in native_posix in native_sim,
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Alberto Escolar Piedras
18c71868a5 tests/lib/mpsc_pbuf: Switch to native_sim
Enable this test which runs in native_posix in native_sim,
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Christopher Friedt
2fc19aa033 tests: lib: c_lib: tests for C11 call_once()
Add tests for C11 call_once().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00
Christopher Friedt
44a431bbba tests: lib: c_lib: tests for C11 thread-specific storage
Add tests for C11 thread-specific storage.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00
Christopher Friedt
70b03111eb tests: lib: c_lib: tests for C11 condition variables
Add tests for C11 condition variables.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00
Christopher Friedt
0c2da383d3 tests: lib: c_lib: add tests for C11 mutexes
Add tests to cover C11 mutexes

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00
Christopher Friedt
ded97fd5b3 tests: libc: add tests for iso c11 threads
Add tests to verify functionality of the C11 `<threads.h>` API.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00
Christopher Friedt
dd27dff492 tests: lib: c_lib: separate libc tests into smaller suites
C library testing is mainly there to support what is
necessary to support Zephyr. We do test a variety of libcs
currently, which is where YAML comes in handy.

However, the main libc testsuite can be overkill for testing
some things, and might not be suitable for testing optional
features.

Create a 'common' subdirectory for common libc tests.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00
Maximilian Deubel
386b658008 boards: arm: add nrf9131ek_nrf9131
This patch adds the nRF9131-EK board.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2023-11-08 10:06:03 +01:00
Keith Packard
6d38ecae1d tests/c_lib: Test picolibc module configurations
Make sure the picolibc module builds and runs in both TLS
and non-TLS variants.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-11-07 09:42:19 +01:00
Johan Hedberg
149b00f70c acpi: Fix acpi_get_irq_routing_table() rt_size parameter meaning
The acpi_get_irq_routing_table() takes a pointer to an array of
ACPI_PCI_ROUTING_TABLE elements rather than a generic buffer pointer
(e.g. void *).

Because of the above, it makes sense to specify the array size as an
actual ARRAY_SIZE() value, since it makes no sense to accept buffers
which are not a multiple of sizeof(ACPI_PCI_ROUTING_TABLE) long.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-06 12:32:31 +01:00
Moritz Fischer
016a113eb5 boards: xtensa: Add support for Lolin S2 Mini
Add support for LOLIN S2 Mini board, a cheap board
also sold as Wemos S2 Mini.

Signed-off-by: Moritz Fischer <moritzf@google.com>
2023-11-06 10:12:36 +01:00
Johan Hedberg
caf299ca23 boards: x86: Indicate ACPI support where applicable
There are several x86 boards that support ACPI, so indicate it in their
yaml files.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-02 14:04:07 +00:00
Johan Hedberg
a77871b2e5 tests: Add ACPI test application
Add basic ACPI test application. Initially there are only tests for one
ACPI table (MCFG) and fetching the ACPI PRT, but this is already a good
start for caching regressions on the supported boards.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-11-02 14:04:07 +00:00
Yong Cong Sin
1782011d2c tests: devicetree: api: add tests for new DT APIs
Add tests for new DT APIs added in the previous commit:
- `DT_IRQN_BY_IDX`
- `DT_INST_IRQN_BY_IDX`

Added additional tests for the following existing DT APIs when
`CONFIG_MULTI_LEVEL_INTERRUPTS` is enabled:
- `DT_IRQN`
- `DT_INST_IRQN`

Added `qemu_riscv32` for the multi-level interrupt tests.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-30 11:43:39 -04:00
Benedikt Schmidt
aa25e212d1 tests: fix thread function signatures
Fix thread function signatures to avoid stack corruption on thread exit.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-10-30 12:24:34 +01:00
Keith Packard
51fee43122 tests/c_lib: Run tests on native/posix targets
With a few minor adjustments, these tests now run fine on native
targets.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-26 10:06:35 -04:00
Keith Packard
8780bd2b70 test/c_lib: Make sure time_t is at least 64-bits
Check to ensure that the C library doesn't have obvious 2038 issues.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-26 10:06:35 -04:00
Keith Packard
83db6ee7f5 test/c_lib: Skip strerror invalid input test for EXTERNAL_LIBC
Passing an invalid errno value to strerror is undefined behavior in
POSIX. While all Zephyr-specific C libraries may be required to return a
specific value, we can't hold an external C library to that standard.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-26 10:06:35 -04:00
Keith Packard
e4681a0634 test/c_lib: Don't fail to compile tests with 32-bit time_t
The native library may use a 32-bit time_t, so we need to avoid
having the compiler generate an error during compilation.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-26 10:06:35 -04:00
Keith Packard
dfd584204c test/c_lib: Skip 'abort' test for EXTERNAL_LIBC
The native C library abort function isn't trapped within Zephyr.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-26 10:06:35 -04:00
Keith Packard
8283f8ca09 test/c_lib: Skip 'exit' test for EXTERNAL_LIBC
The native C library exit function does not do what we want.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-26 10:06:35 -04:00
Alberto Escolar Piedras
b3de643206 tests cmsis_dsp filtering: Do not run filtering.misc.fpu on mps3_an547
Merging 565c9376f1
exposed an issue in this test, which causes an assert in the
mps3_an547.
For more information check
https://github.com/zephyrproject-rtos/zephyr/issues/64387

The issue needs further analysis.
With this platform being an integration
platform for this test, it gets triggered in CI by unrelated
PRs, causing CI failures and blocking development.

As an interim measure, to unblock development in the main branch,
let's exclude this platform from this test.

This commit should be reverted once the underlaying issue is
indentified and addressed.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-26 13:52:23 +02:00
Alberto Escolar Piedras
c83c8df26a tests/lib/time: Fix for posix architecture
* Select always PICOLIBC. This is anyhow the default for all
  but the posix architecture. And for the posix architecture
  we need it as POSIX_CLOCK does not work with the host C
  library.
* Fix the testcase filtering. This sample works fine
  in native_sim (when not using the host libC),
  but does not work for native_posix(_64), as those can
  only be built with the host libC, and in that case,
  the POSIX_CLOCK provided functions will not be properly
  linked to.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-25 09:58:07 +02:00
Keith Packard
565c9376f1 tests: Switch from NEWLIB_LIBC to REQUIRES_FULL_LIBC
Instead of forcing use of NEWLIB_LIBC, select any available complete C
library implementation. Add CONFIG_REQUIRES_FLOAT_PRINTF where needed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-25 08:32:06 +02:00
Alberto Escolar Piedras
4060f1d390 tests newlib: Exclude in posix architecture
These tests cannot be run in this architecture as it does not
support this toolchain.
Today they are filtered by kconfig, which works but spends
time running cmake.
As native_posix is a default test platform it is better
to filter it alltogether by arch, which saves quite a lot
of time.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 09:05:29 +02:00
Robert Lubos
822a82d619 tests: lib: thrift: Fix timing issues with TCP
The test delegates putting the server socket into listening (i. e.
calling listen() on the socket) to a separate thread, which did have a
chance to run before client attempted to establish TCP connection.

This was not visible before, as we did not reply with RST to a
connection attempt on a closed port, so the connection was eventually
establish after SYN retransmission. But as we do reject such a
connection now with RST, the connection attempt failed. Therefore, a
small delay was added after spawning the server thread, to give it a
chance to configure the server socket.

Additionally, lower the CONFIG_NET_TCP_TIME_WAIT_DELAY value so that TCP
contexts are released earlier, and add a respective delay in the test
teardown function. Not doing so also triggered unneeded SYN
retransmissions, as there were no enough TCP context to accept the
incoming connection, before freeing the resources allocated for the
previous one.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-20 15:13:22 +02:00
Anas Nashif
e77a659698 cmsis_dsp: remove handling of old ztest API
Old ztest API is deprecated, so no need for the conditional code here.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Anas Nashif
345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Anas Nashif
f7456cb7cd tests: spsc_pbuf/ringbuffer: fix test meta data and components
Fix meta data and standarize components in test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 14:19:40 +03:00
Anas Nashif
3a81c76b3a tests: fdtable: fix test meta data and components
Fix meta data and standarize components in test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 14:19:40 +03:00
Anas Nashif
1164e33e0f tests: mpsc: fix test meta data and components
Fix meta data and standarize components in test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 14:19:40 +03:00
Anas Nashif
38a480c20e tests: cbprintf: fix test meta data and components
Fix meta data and standarize components in test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 14:19:40 +03:00
Gerard Marull-Paretas
a19c7f2294 tests: lib: hash_map: fix libc heap size setting
The malloc arena/heap size setting can be adjusted using different
Kconfig options, depending on the libc implementation. This means
prj.conf can't be used to set this value on projects that can be built
for multiple libcs without generating a Kconfig warning.

Note: similar fix was applied for the hash_map sample, see
7ef8911e8c

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-10-10 12:26:15 -04:00
Flavio Ceolin
e7bd10ae71 random: Rename random header
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.

Rename it to random.h and get consistently with other
subsystems.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-10 14:23:50 +03:00
Fabio Baltieri
cf75c88a61 tests: newlib/thread_safety: exclude acrn_ehl_crb from more tests
This was already excluded from
libraries.libc.newlib_nano.thread_safety.userspace.stress and it's now
failing in libraries.libc.newlib.thread_safety.userspace.stress as well.

The issue is being rootcaused to a toolchain issue but a proper fix has
not been identified yet, exclude that test as well in the meantime.

Link: https://github.com/zephyrproject-rtos/zephyr/issues/61129
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-10-10 09:05:02 +01:00
Peter Mitsis
baea37aeb4 kernel: Re-factor sys_mem_blocks definition
Rearranges the sys_mem_blocks fields so that information that describes
how much of the memory block is used is co-located. This will allow
easier of its statistics into the object core statistics reporting
framework.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Anas Nashif
34e16225eb neural_net: remove unused experimental API
Experimental API is not being used anymore, remove it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-29 20:48:33 -04:00
Henrik Brix Andersen
9783ed56d9 dts: bindings: can: deprecate the sjw and sjw-data properties
Update the descriptions for the various CAN devicetree timing properties
specified in Time Quanta (TQ) to make it clear that these, if present, are
only used for the initial timing parameters.

Deprecate the (Re-)Synchronization Jump Width (SJW) devicetree properties
for both arbitration and data phase timing as these are now only used in
combination with the other TQ-based CAN timing properties, which are all
deprecated.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-09-28 16:28:56 +02:00
Anas Nashif
6d23a960db lib: os: build fdtable conditionally
Stop building fdtable by default, make it conditional and build it only
when needed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-28 06:25:16 -04:00
Fabian Blatz
c7f8033f2b modules: lvgl: simplify sys_heap memory size configs
Changes the Kconfig symbols for the sys_heap based memory management option
and removes the notion of `BLOCKS` with a more concise single
`LV_Z_MEM_POOL_SIZE` option. Also adds `LV_MEM_CUSTOM` to the lv_conf.h,
since in any option the memory management is considered to be custom.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-09-27 09:54:08 +02:00
Ryan McClelland
b092094815 modules: cmsis-nn: add cmsis-nn module
This adds the cmsis-nn module since it moved to its own realm.
This also adds a kconfig for the long short-term memory.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-09-25 09:46:33 +02:00
Ryan McClelland
104ea2ccca modules: cmsis-dsp: add cmsis-dsp module
Use CMSIS-DSP from its new realm. This also changes change how you
initialize FFT tables as well to use arm_cfft_init_64_f32 if you
know the FFT size in advance rather than the generic initialization
arm_cfft_init_f32.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-09-25 09:46:33 +02:00
Carlo Caione
e4a125b6a4 dt: Make zephyr,memory-attr a capabilities bitmask
This is the final step in making the `zephyr,memory-attr` property
actually useful.

The problem with the current implementation is that `zephyr,memory-attr`
is an enum type, this is making very difficult to use that to actually
describe the memory capabilities. The solution proposed in this PR is to
use the `zephyr,memory-attr` property as an OR-ed bitmask of memory
attributes.

With the change proposed in this PR it is possible in the DeviceTree to
mark the memory regions with a bitmask of attributes by using the
`zephyr,memory-attr` property. This property and the related memory
region can then be retrieved at run-time by leveraging a provided helper
library or the usual DT helpers.

The set of general attributes that can be specified in the property are
defined and explained in
`include/zephyr/dt-bindings/memory-attr/memory-attr.h` (the list can be
extended when needed).

For example, to mark a memory region in the DeviceTree as volatile,
non-cacheable, out-of-order:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_VOLATILE |
			       DT_MEM_NON_CACHEABLE |
			       DT_MEM_OOO )>;
   };

The `zephyr,memory-attr` property can also be used to set
architecture-specific custom attributes that can be interpreted at run
time. This is leveraged, among other things, to create MPU regions out
of DeviceTree defined memory regions on ARM, for example:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-region = "NOCACHE_REGION";
       zephyr,memory-attr = <( DT_ARM_MPU(ATTR_MPU_RAM_NOCACHE) )>;
   };

See `include/zephyr/dt-bindings/memory-attr/memory-attr-mpu.h` to see
how an architecture can define its own special memory attributes (in
this case ARM MPU).

The property can also be used to set custom software-specific
attributes. For example we can think of marking a memory region as
available to be used for memory allocation (not yet implemented):

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_NON_CACHEABLE |
			       DT_MEM_SW_ALLOCATABLE )>;
   };

Or maybe we can leverage the property to specify some alignment
requirements for the region:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_CACHEABLE |
			       DT_MEM_SW_ALIGN(32) )>;
   };

The conventional and recommended way to deal and manage with memory
regions marked with attributes is by using the provided `mem-attr`
helper library by enabling `CONFIG_MEM_ATTR` (or by using the usual DT
helpers).

When this option is enabled the list of memory regions and their
attributes are compiled in a user-accessible array and a set of
functions is made available that can be used to query, probe and act on
regions and attributes, see `include/zephyr/mem_mgmt/mem_attr.h`

Note that the `zephyr,memory-attr` property is only a descriptive
property of the capabilities of the associated memory  region, but it
does not result in any actual setting for the memory to be set. The
user, code or subsystem willing to use this information to do some work
(for example creating an MPU region out of the property) must use either
the provided `mem-attr` library or the usual DeviceTree helpers to
perform the required work / setting.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-09-15 12:46:54 +02:00
TOKITA Hiroshi
87209984f3 devicetree: rename and publish DT_COMPAT_ON_BUS_INTERNAL
Rename `DT_COMPAT_ON_BUS_INTERNAL` to
`DT_HAS_COMPAT_ON_BUS_STATUS_OKAY` to make it a public DT API.

It is helpful for code that handles multiple DT_DRV_COMPAT in one file,
such as in the following cases.

```
 #if (DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(some_sensor, i2c) || \
      DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(another_sensor, i2c)
 ...
 #endif

 #define DT_DRV_COMPAT some_sensor
 DT_INST_FOREACH_STATUS_OKAY(DEFINE_SOME_SENSOR)

 #undef DT_DRV_COMPAT
 #define DT_DRV_COMPAT another_sensor
 DT_INST_FOREACH_STATUS_OKAY(DEFINE_ANOTHER_SENSOR)
```

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2023-09-13 14:23:24 -07:00
Martin Kiepfer
d453c21384 boards: m5stack_core2: Exclude board from device tree test
m5stack_core2 enables i2c by default for regulator usage which
conflicts with the test and is therefore excluded from the test.

Signed-off-by: Martin Kiepfer <mrmarteng@teleschirm.org>
2023-09-11 11:06:36 +02:00
Ryan McClelland
8ea58fc43b tests: lib: cmsis_dsp: binary: fix double-promotion warning
Double promotion warnings are generated with the flag -Wdouble-promotion

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-09-08 16:38:52 +02:00