Commit graph

4775 commits

Author SHA1 Message Date
Guennadi Liakhovetski 024bd41efb llext: xtensa: add support for the xt-clang toolchain
To build LLEXT images using the xt-clang toolchain from Cadence
linker flags have to be set similar to other toolchains. Add the
missing cmake files.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-29 10:49:40 -07:00
Bjarki Arge Andreasen 79640aea09 drivers: console: remove uart_mux and gsm_mux
Remove the deprecated uart_mux and gsm_mux modules and all of
their configurations/dependencies across zephyr.

Optimally uart_mux and gsm_mux would be removed in their own
respective PRs, but the two modules are directly coupled, so
to preserve bisectability, they must be removed together.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-29 10:49:08 -07:00
Tomasz Moń e136f02ea6 scripts: west_commands: runners: nrfutil: Only flash with J-Links
The nrfutil runner calls "nrfutil --json device list" which outputs
information about all connected serial ports. The list includes not only
actual boards but also any ttyACM instance. If the ttyACM instance does
not have serial number, then the nrfutil runner will fail on matching
serial number regexp on NoneType.

Fix the issue by limiting nrfutil runner board output to only devices
that have trait jlink set.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-05-29 08:31:01 -07:00
Arkadiusz Cholewinski 5cfb4bd3f5 CI: Fix Coverage Analysis
The coverage_analysis.py while generating report, duplicates
files and functions of components.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2024-05-29 07:33:45 +02:00
Yong Cong Sin 0dac6c132b build: namespace autoconf.h with zephyr/
Namespace the generated `autoconf.h` file with `zephyr/`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
Yong Cong Sin bbe5e1e6eb build: namespace the generated headers with zephyr/
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
Michał Szprejda 7c084b6649 West: Add west robot command
Introduce `robot` command for running Robot Framework test suites.
Initial implementation consists of one runner dedicated for renode-test,
which is a Renode wrapper for running Robot tests.

Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>
2024-05-28 12:54:52 +02:00
Michał Szprejda 80900cbc3b West: Add west simulate command
Introduce `simulate `command for running samples on a simulator of
choice. Initial implementation consists of one runner, dedicated for
Renode.

Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>
2024-05-28 12:54:52 +02:00
Michał Szprejda f155ff596c West: runners: Add explicit capabilities
Add explicit capabilities to nios2, nsim and openocd runners to prevent
them from having potentially unwanted ones (for example when new
capabilities are added to Zephyr).

Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>
2024-05-28 12:54:52 +02:00
Michał Szprejda 73b73c91f4 West: Add option to supress elf/bin/hex file params
Add capability allowing to suppress the --file parameters that can be
passed to a west command runner.

Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>
2024-05-28 12:54:52 +02:00
Michał Szprejda 7bc9a98a70 Twister: Rework integration with renode-test
Initial integration with renode-test was introduced in commit bdf02ff,
which added support for calling the `renode-test` command from both west
and twister.

This commit removes the custom run_renode_test target used for running
Robot tests with the `west build` command and makes twister call
`renode-test` directly instead.

Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>
2024-05-28 12:54:52 +02:00
Francois Ramu d490616d08 scripts: west flash with stm32CubeProgrammer testing
Add the option "--extload" for the "extload" argument.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-05-27 01:34:51 -07:00
Francois Ramu 94d93af91f scripts: west flash with stm32CubeProgrammer and ext-loader
Add the option to support an external loader for flashing
hex file to internal and external NOR flash using
the STM32CubProgrammer CLI with a  board_runner_args
"--extload=MX25LM51245G_STM32U585I-IOT02A.stldr"
The absolute path of the stldr file is added to the
stm32CubeProgrammer command.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-05-27 01:34:51 -07:00
Francois Ramu 76c0e2cf51 scripts: west flash with stm32CubeProgrammer error line
Correct the error "F541 f-string is missing placeholders"
when ruuning Flake

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-05-27 01:34:51 -07:00
Maciej Perkowski 3a3f25c9a6 requirements: Set min version of pylint to 3
PR #72592 made pylint to use json2 output format. However, this
format is introduced in pylint v3. This commit adds an appropriate
setting in the requirements file.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2024-05-26 21:02:21 +03:00
Maciej Perkowski 48665f2636 scripts: Allow using quarantine mechanism with test_plan.py script
In twister, applying quarantine is a part of apply_filters() function.
However, this function is not called when --load-test is used.
Therefore, if one wants to use quarantines in combination with
dynamic scope from the test_plan.py script, one has to pass such
info through the script.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2024-05-24 08:25:20 -04:00
Valerio Setti e58ebe12f4 mbedtls: add configuration file for PSA features
Adding a Kconfig and a header file to control which PSA features
are to be used from MbedTLS:

- new kconfig symbols are placed in a separate header file
  (Kconfig.psa) and are guarded by MBEDTLS_PSA_CRYPTO_CLIENT. The
  reason for this is that TLS/X509 can either rely on PSA functions
  provided by MbedTLS (when MBEDTLS_PSA_CRYPTO_C is defined) or
  TFM (when BUILD_WITH_TFM is selected). Therefore we could
  not make these new Kconfigs depending on MBEDTLS_PSA_CRYPTO_C.

- by default all PSA symbols are enabled, but they can be
  disabled by respective Kconfigs in order to reduce the image
  size.

- the new header file (config-psa-generic.h) mimics what
  config-tls-generic.h does for MbedTLS builtin symbols: it
  enables a build symbol for every Kconfig one. The name is
  kept identical in the 2 cases (a part from the initial CONFIG_
  in order to simplify the mechanism).

- MBEDTLS_PSA_CRYPTO_CONFIG is finally enabled whenever there
  is any PSA crypto provider (either MBEDTLS_PSA_CRYPTO_C or
  TFM)

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 11:53:02 -04:00
Yong Cong Sin e1ce0aefff debug: implement symtab generation
Use pyelftools to extract the symbol table from the
link stage executable. Then, filter out the function names
and sort them based on their offsets before writing into the
`symtab.c`, this is similar to how the `isr_tables` works.

To access the structure, simply include the new header:
```c
#include <zephyr/debug/symtab.h>
```

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-23 11:52:08 -04:00
Mike Szczys 7eaca455fa twister: fix serial connection for flash_before
The --flash-before flag allows devices to be flashed before the serial
connection is established. However, the implementation was incomplete and
only worked if the port address already existed at the start of the run.
This is incompatible with devices that implement the USB in software
(eg: USB-CDC).

This commit fixes the implementation to delay setting up the connection
until after the device is flashed, and to retry the connection for two
seconds after flashing to give the device time to enumerate as a USB
device.

Signed-off-by: Mike Szczys <mike@golioth.io>
2024-05-22 21:39:13 -04:00
Henrik Brix Andersen 519813b3ce scripts: west: commands: build: fix pylint issue
Do not end except block with a useless return, use a pass instead. This
fixes pylint R1711: "Useless return at end of function or method
(useless-return)".

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-21 16:47:24 -04:00
Henrik Brix Andersen be14f9802a scripts: west: commands: completion: bash: support shield argument
Add Bash completion support for "west build" shield argument.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-21 16:47:24 -04:00
Henrik Brix Andersen 5197660073 scripts: west: commands: build: add argument for specifying shields
Add "west build" argument for specifying shields. This saves users from
having to do "west build ... -- -DSHIELD=...", making shields a much better
integrated feature.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-21 16:47:24 -04:00
Henrik Brix Andersen 888900f979 scripts: west: commands: completion: bash: add "west shields" completion
Add Bash completion for the "west shields" command.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-21 16:47:24 -04:00
Henrik Brix Andersen f3e4c9685c scripts: west: commands: shields: add cmd for listing supported shields
Add "west shields" command for listing supported shields.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-21 16:47:24 -04:00
Henrik Brix Andersen a6a3891691 scripts: list_shields: add script for listing the supported shields
Add Python script for listing the supported shields.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-21 16:47:24 -04:00
Henrik Brix Andersen 7aadd19d38 scripts: west: completion: bash: add snippet arguments to build command
Add snippet arguments to the "west build" command completion.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-21 16:47:24 -04:00
Henrik Brix Andersen b93361e89c scripts: west: build: add snippet argument to usage output
Add example snippet argument to usage output of the "west build" command
and use the singular "SNIPPET" in the generated help text.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-05-21 16:47:24 -04:00
Piotr Kosycarz a7cb8659bd scripts: ci: test_plan: add parameter for no of testcase roots
Allow to provide from CLI, threshold value for number of test case roots
selected for execution base on changed files.
When such threshold will be exceeded, full scope will be executed.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-05-21 16:43:28 -04:00
Piotr Kosycarz 65703a80af scripts: ci: test_plan: fix usage with files
When modified files list is used instead of commit range,
repo object was incorrect.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-05-21 16:43:28 -04:00
Jordan Yates 44f5a5d5d4 scripts: twisterlib: handlers: early QEMU timeout
Terminate QEMU earlier if the test finishes and no output data is
received for 1 second. This new timeout operates in parallel with the
global test timeout.

For coverage testing, this can reduce the time spent running individual
tests by up to 29 seconds, while still giving the full 30 extra seconds
to dump gcov data if needed.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-05-20 18:04:42 +02:00
Benjamin Gwin 723a8fcf36 twister: Add logging of stderr for BinaryHandlers
In the case where a test causes the test executor to crash, the stderr
is currently lost, making it hard to debug failures. This changes it
so that the process' stderr gets captured to 'handler_stderr.log' for
inspection.

Signed-off-by: Benjamin Gwin <bgwin@google.com>
2024-05-19 10:57:16 +03:00
Ederson de Souza 967168a536 subsys/llext: Generate syscalls stubs for EDK exclusively for userspace
A new Kconfig option which generates syscall stubs assuming that
extensions will always run on userspace, thus simplifying linking
them, as there's no need for z_impl_ stubs (used for direct syscalls),
CONFIG_LLEXT_EDK_USERSPACE_ONLY.

While defining __ZEPHYR_USER__ could have the same effect for optmised
builds, people building extensions on debug environments - thus
non-optimised - would suffer, as they'd need to somehow make the stubs
available (by either exporting the symbol or implementing dummy stubs).

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-05-17 16:21:48 +01:00
Evgeniy Paltsev 0af51b072c ARC: nSIM: west: launch cores in direct order for simulation run
We've reversed core launch order to workaround issue of
ARConnect initialization interfere with secondary cores
startup (we don't want to workaround it in runtime as it's
only possible in case of debug session).

However it bring us new issues with the simulation run:
 - mismatch arcnum (core ID) with ARConnect ID
 - mismatch arcnum (core ID) with CPU name in nSIM instruction traces

To avoid these issues let's use direct core order for simulation
runs.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-05-17 12:40:52 +02:00
Maciej Perkowski 7d3dc4e7e3 twister: Fix path to binary location for unit_testing board
PR #72100 broke execution of unit type tests. This commit fixes
it by bringing back the "old" logic for selecting a binary path
for unit type tests.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2024-05-16 14:27:06 +02:00
Dmitrii Golovanov 0887986b88 west: twister: Fix default options setup
Fix missing change to run Twister with default options setup.

Should be implemented together with #72399

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-16 09:21:35 +02:00
Dmitrii Golovanov 4efc035209 twister: Fix default command line dependency on --device-testing
Fix default command line options check dependency on `--device-testing`
when it is provided to run Twister and turn device command options
as mandatory.

Fixes after changes introduced with #72399.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-15 15:13:19 -04:00
Lukasz Mrugala f71a4184f3 scripts: twister: Fix Unit Tests on Windows systems
Unit tests currently are not runnable on Windows systems, failing
on two testfiles: test_jobserver.py and test_testsuite.py.

This commit removes code dependency on Windows-unavailable
elements on Windows systems via skipping the offending tests.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-05-15 17:08:06 +02:00
Dmitrii Golovanov d45dbc26f0 twister: Add Twister execution options to twister.json
Store Twister command line options in twister.json report as
`environment.options` object. It allows to keep the actual
execution context for test results analysis and history comparison.

A new command line option `--report-all-options` enables to report all
command line options applied, including these set as default values.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-15 14:56:59 +02:00
Hake Huang 248b66dfe3 twister: handler: optimize handler testsuite check
in many platforms, before  the debuger flash, the former testsuite
many already executed, so we will see some old testsuite name.
and we should not compare them directly, instead if we compare in
reversed order them we can avoid such mis-judge.

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-05-15 14:56:24 +02:00
Grzegorz Chwierut 59212c198c twister: Allow to run sysbuild with native_sim
Fix issue 72083. Update path to zephyr.exe binary using
default domain from domains.yaml file.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2024-05-15 13:16:39 +02:00
Kamil Paszkiet 85c6ce69ca scripts: tests: Blackbox test expansion - report summary
add test for report summary switch

Signed-off-by: Kamil Paszkiet <kamilx.paszkiet@intel.com>
2024-05-15 09:29:05 +02:00
Kamil Paszkiet a411ae93b7 twister: add --report-summary switch
Added a switch that show failed/error report from the last run.
Default shows all items found. However, you can specify the number of items
(e.g. --report-summary 15).
It also works well with the --outdir switch

Signed-off-by: Kamil Paszkiet <kamilx.paszkiet@intel.com>
2024-05-15 09:29:05 +02:00
Carles Cufi ae9096fe62 scripts: compliance: handle multi-line output from pylint
Switch from plain text to JSON output in the pylint compliance check in
order to handle multi-line messages, which were so far being dropped
by the regex.

Fixes #68037.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-05-14 18:20:41 -04:00
Dmitrii Golovanov 11de74c11f twister: pytest: Enable recording for Pytest Harness
Extend Pytest Harness to support 'recording' feature to parse
test log by a regular expression and collect as records the same
way as Console Harness do.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-14 18:20:12 -04:00
Dmitrii Golovanov 1230640076 twister: Refactor 'recording' feature
Refactor Twister 'recording' feature moving it from Handler class
to TestInstance class and enable it also for other Harness child
classes other than Console.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-14 18:20:12 -04:00
Dmitrii Golovanov 2005deddb4 scripts: size_report: Fix tree build for symbol copies
Fix the memory footprint tree build for symbols with copies,
e.g. static inline functions which are local per each compilation
unit. Copies have the same path and symbol name, but different
memory blocks associated, so they have to have separate nodes.
Before the fix, these copies were merged into one node, with
summary size and memory address of one of the symbols.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-13 16:04:59 -04:00
Dmitrii Golovanov b438a74bd0 scripts: size_report: Report section name for symbols
Report section name for symbols: both at json and text reports.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-13 16:04:59 -04:00
Dmitrii Golovanov 8e6a921104 scripts: size_report: Don't set non-terminal node address
Don't set 'address' property for non-terminal nodes which are
also shown in JSON footprint reports, thus to avoid confusion
that a file or directory node has a continuous memory area allocated
at some address and with the total size of all its associated child
nodes which are likely scattered over different memory sections.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-13 16:04:59 -04:00
Dmitrii Golovanov 272731169c scripts: size_report: Optimize ELF headers reading
Read ELF headers only once for the size_report scirpt called
for 'all' memory areas, consequently it executes 30-50% faster.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-13 16:04:59 -04:00
Dmitrii Golovanov 55ebc691cd scripts: size_report: Fix pylint warning on unused import
Remove unused import to resolve pylint warning.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-13 16:04:59 -04:00