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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Tests should depend on the the module, so if we do not have the module,
we should not be building the test.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Make sure the underlying allocation system can support an allocation
request generated by the new operator which has stricter alignment
requirements than the default. For G++, this ends up using the 'memalign'
function which is not part of any C standard.
Signed-off-by: Keith Packard <keithp@keithp.com>
Add test suite for the DT fixed-partitions API. It is verified on two
kinds of MTD nodes, one of which is meant to represent external memory.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
This seems to be failing fairly persistently in CI runs. Filed an issue
for having it checked, let's exclude it from the test run until it's
fixed.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Update uoscore-uedhoc repository to the latest revision.
Align uoscore tests with the API changes.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
It was overlooked somehow, that usocore tests did not have testcase.yaml
file, and therefore were not executed by Twister. This commit fixes it.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This change fixes a file descriptor leak that snuck-in
undetected in the original `gsoc-2022-thrift` project.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
There is no need to pass a second parameter to `pthread_join()`
if it is unused. Just use `NULL` instead.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Variant of JSON_OBJ_DESCR_ARRAY_ARRAY that can be used when the
structure and JSON field names differ.
Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
The 'zephyr,memory-region-mpu' property was addede gqas a
convenient way to create and configure MPU regions using information
coming from DT. It has been used a lot since it was introduced so I
guess we can consider it a Zephyr success story ™ .
Unfortunately it has been proved to be a bit limited and with some
important limitations:
1. It was introduced as a property of the compatible
zephyr,memory-region that is used to create linker regions and
sections from DT data. This means that we can actually create MPU
regions only for DT-defined regions and sections.
2. The naming is unfortunate because it is implying that it is used only
for MPU.
3. It is misplaced being in include/zephyr/linker/devicetree_regions.h
and still it has nothing to do with the linker at all.
4. It is exporting a function called LINKER_DT_REGION_MPU that again has
nothing to do with the linker.
Point (1) is also particularly limiting because it is preventing us to
characterize memory regions that are not generated using the
'zephyr,memory-region' compatible, like generic mmio-sram regions.
While we fix all the issues, we also want to extend a bit the range of
usefulness of this property. We are renaming it 'zephyr,memory-attr' and
it is now carrying information about the type of memory the property is
attached to (cacheable, non-cacheable, IO, eXecutable, etc...). The user
can use this property and the DT API coming with it to act on the memory
node it is accompanied by.
We are still providing the DT_MEMORY_ATTR_APPLY() macro that can be used
to create the MPU regions as before, but we are adding also a
DT_MEMORY_ATTR_FOREACH_NODE() macro that can be used to cycle through
the memory nodes and act on those.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Double promotion warnings are generated with the flag -Wdouble-promotion
Exponent was defined as a float, but was really be used a double here
Change the type of exponent in sqrt from float to double.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Limit the testcase to targets with more than 32KB RAM
Because of the CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE 8192,
the RAM used by the testcase on a too small target might fail
at runtime. For example on a nucleo_l073rz target:
RAM: 15292 B 20 KB 74.67%
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Add tests for both extra objects and extra arrays nested in JSON objects.
Fields in extra nested objects should be ignored and also not manipulate
subsequent fields with the same name.
Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
Changed initial guess from a simple x/3 to dividing the exponent by 2.
This makes large or small numbers like 10e10 and 01e-10 converge in a few
loops.
Added a loop counter to ensure that the algorithm breaks out of the loop in
the case that the algorithm doesn't converge (toggling between two
numbers).
Added test cases for sqrt and sqrtf in libc. Tested with a range of numbers
between 10e10 and 10e-10. Verify good accuracy in test case.
Closes: #55962
Signed-off-by: Lawrence King <lawrencek52@gmail.com>
Load the default screen before the deleting the newly created one.
This used to work in LVGL 8.2.0 but was not intended according to the
discussion in https://github.com/zephyrproject-rtos/zephyr/pull/53974.
Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
Add the _VARGS variant of DT_FOREACH_NODE and
DT_FOREACH_STATUS_OKAY_NODE for when we want to do some kind of
operation on all the nodes in the tree.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Add tests for encoding and decoding nested arrays of objects located
inside a parent object at a non-zero offset.
Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
Add tests for encoding and decoding two-dimensional arrays as described by
the JSON_OBJ_DESCR_ARRAY_ARRAY() macro.
Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
Fix encoded JSON string in test_json_decoding_array_array() test so it
matches the described array object and add a test case for encoding
arrays of arrays.
Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
Switch the non-ascii text in the tests to use octal escape sequences
to avoid potential compiler issues on platforms not defaulting to
utf-8 text encodings.
Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
The POSIX arch now also supports embedded libCs for some
targets. Narrow the test filter accordingly.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Usage of 64-bit address constants from devicetree without a
UINT64_C wrapping macro results in the following warning and the
cut-off of the address value:
"warning: integer constant is so large that it is unsigned"
This change extends devicetree API adding few wrappers over the
address constant getters which add ULL size suffix to an
address integer literal when the appearance of 64-bit address
values is possible
Signed-off-by: Alexander Razinkov <alexander.razinkov@syntacore.com>
Device dependencies are not always required, so make them optional via
CONFIG_DEVICE_DEPS. When enabled, the gen_device_deps script will run so
that dependencies are collected and part of the final image. Related
APIs will be also made available. Since device dependencies are used in
just a few places (power domains), disable the feature by default. When
not enabled, a second linking pass will not be required.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
- Add integration_platforms to avoid excessive filtering
- Make sure integration platforms are actually part of the filter
- Fix some tags and test meta data
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
mem_protect and sprintf stacks both need to be slightly larger than
currently defined in order to avoid stack overflow when using picolibc.
Signed-off-by: Keith Packard <keithp@keithp.com>
Picolibc has two floating point output modules, the default, "exact",
module which meets the ISO/IEC 9899:2011 specification and a smaller
"inexact" version which does not meet those specifications. Add a test for
this latter version to make sure it meets some modest Zephyr requirements.
Signed-off-by: Keith Packard <keithp@keithp.com>
Picolibc needs more than 1024 bytes of stack when printing floating point
values exactly. Increase the stack to 2048 bytes.
Signed-off-by: Keith Packard <keithp@keithp.com>
There's no reason to limit testing floating point printf to platforms with
an FPU; neither the minimal C library nor picolibc even use floating point
instructions for printf. And even if they did, the toolchain should have
soft float support.
However, we do need to restrict picolibc testing to configurations with
floating point printf enabled.
Signed-off-by: Keith Packard <keithp@keithp.com>
Analog to json_obj_encode vs. json_calc_encoded_len which
calculates the object len using json_obj_encode, introduce
json_calc_encoded_arr_len which calculates the length using
json_arr_encode. That is needed when the object to be encoded
is array on the root level.
Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
Verify expected results for every permissible argument type, including
with a phandle and a string in an inferred binding from /zephyr,user.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
It will be convenient to treat these respectively as degenerate cases
of 'phandles' and 'string-array'. Add support for this and regression
tests. (There's nothing to do in the case of 'phandle' beyond
documenting the guarantee.)
For the record, the other DT_PROP_LEN() tests for each type are in:
type test case property
------------ -------------------- ------------
array test_arrays a
string-array test_path_props compatible
uint8-array test_arrays b
phandles test_phandles phs
phandle-array test_phandles pha-gpios
phandle test_phandles ph
Update docstrings and fix some issues in them.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Instead of detecting that the minimal C library is in use before running
the malloc failure tests, check for the common malloc being in use as that
will also allow this test to run with picolibc.
Signed-off-by: Keith Packard <keithp@keithp.com>
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Test had 2 timeout entries (90, 120). Left 120 to be safe, as it's the
larger value.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Rather than the rings, which weren't shared between userspace and kernel
space in Zephyr like they are in Linux with io_uring, use atomic mpsc
queues for submission and completion queues.
Most importantly this removes a potential head of line blocker in the
submission queue as the sqe would be held until a task is completed.
As additional bonuses this avoids some additional locks and restrictions
about what can be submitted and where. It also removes the need for
two executors as all chains/transactions are done concurrently.
Lastly this opens up the possibility for a common pool of sqe's to
allocate from potentially saving lots of memory.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
With picolibc moving to using the common malloc implementation, samples and
tests with picolibc-specific settings need to switch to using the common
malloc settings instead.
Signed-off-by: Keith Packard <keithp@keithp.com>
Some tests were filtering by explicitly listing
all posix arch boards.
Filter by the arch instead.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
add boards/nucleo_c031c6.conf with
CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=4096
to avoid twister issue due to a too low heap size on the co31c6
Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
add boards/nucleo_c031c6.conf with
CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=4096
to avoid twister issue due to a too low heap size on the co31c6
Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
With the minimal C library malloc implementation moving to libc/common, all
of the related Kconfig variables have also changed. Update uses within the
tree.
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit adds a new libcxx testcase that tests the host standard
C++ library.
Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
The C language says that use of a NULL FILE pointer with stdio functions is
undefined behavior. Let's just remove them instead of expecting the minimal
C library to exhibit a specific behavior in this case.
This also avoids problems when not using -ffreestanding as in that case,
the C compiler may generate warnings, or even cause undefined behavior on
its own.
Signed-off-by: Keith Packard <keithp@keithp.com>