When using the LLEXT buffer loader we now avoid copying extensions
from storage to allocated memory by pointing directly into the stored
image. We then also perform linking and relocation in that memory,
which modifies its contents. However, this is impossible if that
storage is read-only. Add a Kconfig flag to distinguish between
writable and read-only storage types. Also use that flag to decide,
whether the extension image in test_llext_simple.c should be defined
as const or not.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Extensions should be able to selectively export their global symbols.
Add a LL_EXTENSION_SYMBOL() macro for that. Change the present
.sym_tab to be a temporary symbol table of all global symbols in an
extensions, used only during linking for internal purposes. Add a new
.exp_tab symbol table to store symbols, exported by an extension
permanently.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Extend the llext_load() / llext_unload() API to let it be called
repeatedly for the same extension to increment or decrement its
reference counter respectively. We use a mutex to protect the counter
and make both llext_load() and llext_unload() return the use-count to
let the caller identify when the first loading and the last unloading
took place.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Some applications can decide to link their loadable objects for
exactly the same addresses, where they will be loaded. In those cases
local relocations aren't needed any more and can in fact break the
object if applied while the object is in a temporary storage. Add a
parameter to skip such local relocations.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The zbus_chan_read with K_NO_WAIT was generating a fail in the
qemu_riscv32_smp board. This fix replaces the K_NO_WAIT with a K_FOREVER
on the test, which would not affect the test execution for other
platforms/boards.
Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
Before picolibc version 1.8.5, the only version of printf available with
long long output support was the version including full support for
floating point numbers and positional parameters. That version uses more
stack space than the limited version causing an overflow.
Increase the ztest stack space by 128 bytes.
Signed-off-by: Keith Packard <keithp@keithp.com>
Enable this test which runs in native_posix_64 in native_sim,
Switch from native_posix_64 to native_sim_64 as default test platform
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable all these tests which run in native_posix in native_sim,
Switch from native_posix to native_sim as default test platform
And switch native_posix overlays to native_sim.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable these test 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>
For all tests which were enabled for native_posix
enable them also for native_sim.
For those with native_posix as integration_platform,
set native_sim instead.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
* Simplify the test definition by using an EXTRA DTC overlay
so we don't need one test per board
* Move native_posix overlays to native_sim
* Switch the default integration platform to native_sim
from native_posix
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable all these tests which run in native_posix in native_sim,
For those with native_posix as default test platform,
which it to native_sim.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable these test which run in native_posix in native_sim,
And set native_sim as default test platform
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable these tests which run in native_posix also in native_sim,
And add native_sim as default test platform.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
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>
Add fixture to test suite to allow for and signal that the test
must be run on real hardware.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
By making short inputs optional, the user can bypass short-events all
together if necessary (e.g. custom button-press listener).
Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
Test expects that there are no other backends enabled and some
may be enabled by default.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Enable all 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>
Switch from native_posix to native_sim as default test platform
And switch overlays to native_sim.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable all these tests which run in native_posix in native_sim
And add native_sim as default test platform
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable all these tests which run in native_posix in native_sim,
Switch from native_posix to native_sim as default test platform
And switch native_posix overlays to native_sim.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable all these tests which run in native_posix in native_sim,
Switch from native_posix to native_sim as default test platform
And switch native_posix overlays to native_sim.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable native_sim for this test.
Switch from native_posix to native_sim as default test platform
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Switch from native_posix to native_sim as default test platform
And switch overlays to native_sim.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable native_sim for these tests (platform_allow filter)
Switch from native_posix to native_sim as default test platform
And switch overlays from native_posix to native_sim
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Switch from native_posix to native_sim as default test platform
And switch overlays to native_sim.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Switch from native_posix to native_sim as default test platform
Switch overlays from native_posix to native_sim.
And move overlays into a boards/ directory
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
When using picolibc before 1.8.5, the only way to get 'long long' support
was to use the full version, including floating point support. This is too
large for this testcase.
Reduce the size of the printf code by switching to the version without
64-bit integer support. This allows the test to pass when using older
picolibc versions, such as that included with SDK version 0.16.3.
Signed-off-by: Keith Packard <keithp@keithp.com>
The UART backend test suite performs 9 iterations of:
1. Open UART backend pipe
2. Transmit 8192 bytes of pseudo random data
3. Receive and validate bytes
4. close UART backend pipe
The test is run on real hardware, with the TX/RX pins
connected to each other to provide loopback functionality.
The test suite has been run on a STM32 and an nRF5340 board.
The test suite tests both the UART interrupt driven and
async APIs.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
On xtensa architectures the string "ZEPHYR FATAL ERROR"
comes after the coredump itself. The ordered regex will
incorrectly fail for this arch.
Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
The test should work on any boards with UART console, so
increase the test coverage by adding `CONFIG_UART_CONSOLE`
filter and using `qemu_x86` as `integration_platforms` instead
of `platform_allow`.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
On SoC series s32ze, Zephyr application cannot run with MPU
disabled, skipping relevant samples/tests
Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
The debug.coredump.backends.logging testcase did use 'console'
Twister harness whereas the test suite itself and the rest of
the testcases are implemented as Ztest. This misalignment
allowed to check basic output expected from the logging backend,
but caused inconsistency of the test suite results because
the 'console' Twister Harness can't use test cases' ID provided
by the 'Ztest' Twister Handler.
It is decided to focus the debug.coredump.backends.* suite
on the coredump backend API testing with Ztest.
The logging backend's resulting output should be tested
by its dedicated test suite debug.coredump.logging_backend
(tests/subsys/debug/coredump).
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Extend coredump_backend tests:
* fix COREDUMP_CMD_VERIFY_STORED_DUMP test was not executed.
* add tests for these coredump commands:
- COREDUMP_QUERY_GET_STORED_DUMP_SIZE,
- COREDUMP_CMD_INVALIDATE_STORED_DUMP,
- COREDUMP_CMD_ERASE_STORED_DUMP,
- COREDUMP_CMD_CLEAR_ERROR.
* extend the out-of-the-treee example 'empty' backend to
execute the new tests.
* fix the test's cmake project name.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Set the backend's context to its control block's context
instead of NULL when doing `log_backend_enable`, as the log
backend UART uses that later.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Add test to verify SDIO subsystem. Note that due to the nature of SDIO
cards, this test only reads from common registers and does not verify
extended reads or writes.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Unify spelling of CAN Flexible Data-rate abbreviation to "CAN FD" instead
of "CAN-FD". The former aligns with the CAN in Automation (CiA)
recommendation.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Userspace test was using native_posix which does not support
userspace. Change to qemu_x86.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Added some new APIs to get the backend instances more easily,
so that dev does not need to rely on `shell_backend_*_get_ptr`,
which looks more like a hack to access a local variable.
These APIs are basically copied from the log backend
implementation.
Added testcase for the APIs.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
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>
Two substests cannot be run in the posix architecture
as they require userspace.
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>
These tests cannot be run in this architecture as it does not
support coredump.
Today it is 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>
Add a testcase to run the same test application and GDB script
which we use for Zephyr GDB stub testing, but now with
the GDB stub enabled at QEMU itself using it as a reference
RDP backend implementation. This allows to check the Zephyr's
gdbstub implementation has similar behavior as the reference.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Add `gdb_target_remote` test parameter for GDB `target remote`
command instead of its hardcoded value to allow different types
of gdbstub serial interfaces as well as different TCP ports in
gdbstub test suites possibly run in parallel on the same host.
Move all GDB log configuration parameters from GDB script to
the fixture code.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Gdbstub test improvements: using pytest fixtures, parametrization, and
expected pattern matching on outputs from GDB and the test application.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Clone samples/subsys/debug/gdbstub to tests and convert it back
to a build-only sample aligned with documentation.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
This change slightly simplifies the configuration of a CSL receiver and
generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive
across several timing-sensitive IEEE 802.15.4 standard sub-protocols
(namely BE-PANs/DSME/CSL/RIT/TSCH).
This API change is based on the rules outlined in RFC #61227.
Fixes: #62918
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
When relocating section symbol addresses the value where the
relocation is to be written is an offset into the section to load.
Simply rewriting it with the section address is not enough, we need
to write the address of the section with the offset into it.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
This commit increases the buffer used for commands
in the control channel within an instance of the
modem_cmux module. The buffer was not large enough to
store an MSC command if the optional break signals
where included. This commit fixes the issue and
updates the test suite to use the max size MSC message.
Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
Better group for logging tests removing verbosity and redundancy in
identifiers and making the sub-component a bit more uniform and clear.
Signed-off-by: Anas Nashif <anas.nashif@intel.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 commit sets the C/R (command/response) bit when UIH
CMUX frames are sent from the modem_cmux module. This bit
is ignored by some modems like the Quectel BG95, as there
is no defined response to this specific CMUX frame type.
However, other modems, like the TELIT ME910, require the
bit to be set (command). If the bit is not set, the modem
will simply ignore the frame completely.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
This has been tested on the following boards. The result is PASS on all.
- qemu_leon3
- generic_leon3
- gr716a_mini
Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
This change fixes a regression on `qemu_riscv64_smp` and
`qemu_riscv32_smp` that arose because debug logging was
enabled. My guess is that subtle races exist and that
debug logging exacerbates the condidtions for those
races.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
This is initial patch to add tests for new USB device support.
The test uses USB host support and virtual USB bus by default,
but should work on real hardware as well. For now, only the
Get Configuration and Set Interface requests are tested by default.
More tests will follow.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This PR adds a mechanism to avoid calling open() or close()
on pipes which are already opened or closed respectively.
This optimization can help simplify backends implementing
the modem_pipe API by avoiding duplicated boilerplate code.
The TTY backend test suite has been updated to match the
new behavior.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
Adds a very simple hello world test case for llext. The loadable
extension is built and then included as a binary array into the test
making it very easy to load, debug, and inspect. The extension is
built using the same toolchain as the base image by default.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
A little refactoring that simplifies dealing with nanosecond timestamp
values in packets and further decouples calling code from PTP:
Benefits:
- simplifies calling code by removing redundant conversions.
- prepares for removing PTP dependencies from net_pkt.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Added tests for the bindesc subsystem, testing definition of
binary descriptors on several qemu architectures, and using
several C standards (c99, c11, etc.).
Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
Replaces the previous approach to define bands via hardware capabilities
by the standard conforming concept of channel pages.
In the short term this allows us to correctly calculate the PHY specific
symbol rate and several parameters that directly depend from the symbol
rate and were previously not being correctly calculated for some of the
drivers whose channel pages could not be represented previously:
* We now support sub-nanosecond precision symbol rates for UWB. Rounding
errors are being minimized by switching from a divide-then-multiply
approach to a multiply-then-divide approach.
* UWB HRP: symbol rate depends on channel page specific preamble symbol
rate which again requires the pulse repetition value to be known
* Several MAC timings are being corrected based on the now correctly
calculated symbol rates, namely aTurnaroundTime, aUnitBackoffPeriod,
aBaseSuperframeDuration.
In the long term, this change unlocks such highly promising functional
areas as UWB ranging and SUN-PHY channel hopping in the SubG area (plus
of course any other PHY specific feature).
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduce PRI style formatting for DSP values. These require the use
of another separate macro to set up the argument (PRIq_arg).
Signed-off-by: Yuval Peress <peress@google.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>
Synchronizes with the new upstream RX/TX timestamp definition in
OpenThread based on the standard's SFD.
This change is synchronized with the upstream OpenThread implementation
via west.yml.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Fixed broken MCUmgr client unit test.
Added test_ -prefix to tests.
Added testcase.yaml to test trigger test run.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
Rework RAM disk driver to be configured using devicetree and
support multiple instances.
This patch also removes a copy of the RAM disk driver,
tests/subsys/fs/fat_fs_dual_drive/src/disk_access_test_drv.c,
that was there for testing multiple disk drivers support.
Bonus: one SYS_INIT() less and a memory region can be exported to the
host.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>