Commit Graph

4157 Commits

Author SHA1 Message Date
Alberto Escolar Piedras 04a16f21e4 valgrind: Update suppression file to align with updated POSIX arch
Things have moved around so we need to update the
suppression file so the callstack and types of
leaks valgrind reports still match.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-07-05 07:01:19 -04:00
Alberto Escolar Piedras 850fc2f22f Native simulator: Add first version in-tree
Add the first version of the native simulator.
The simultaor is taken as is from
https://github.com/BabbleSim/native_simulator/
sha: 74986abfe088a1780e604dae65f87470b4c2a0eb

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-07-05 07:01:19 -04:00
Fabio Baltieri 9de541b9c2 scripts: ci: check_compliance: add a no-modules Kconfig check
Add a variation of the basic Kconfig check that runs with no modules,
catches symbols that are used in the main repository but are defined
only in modules, which are potentially problematic if a downstream
project is not using the specific module.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-07-05 09:11:02 +02:00
Carles Cufi ff2d9cfcb6 scripts: compliance: Fix handling of integer node items
Some node items in Kconfig can be kconfiglib.MENU or kconfiglib.COMMENT.
Those are integers and thus do not contain a node.item.name field.
Handle those separately to avoid hitting the followig exception:

Traceback (most recent call last):
  File "/home/runner/work/zephyr/zephyr/./scripts/ci/check_compliance.py",\
  line 1307, in main
    n_fails = _main(args)
  File "/home/runner/work/zephyr/zephyr/./scripts/ci/check_compliance.py",\
  line 1242, in _main
    test.run()
  File "/home/runner/work/zephyr/zephyr/./scripts/ci/check_compliance.py",\
  line 277, in run
    self.check_no_redefined_in_defconfig(kconf)
  File "/home/runner/work/zephyr/zephyr/./scripts/ci/check_compliance.py",\
  line 445, in check_no_redefined_in_defconfig
    Kconfig node '{node.item.name}' found with prompt or help in\
    {node.filename}.
AttributeError: 'int' object has no attribute 'name'

Seen in #58454.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-07-04 08:23:02 +02:00
Michael Jones 30c3ce4a92 doc: Update requirements-doc.txt to use docleaf
Instead of breathe.

I'm not sure of the best version comparison to use. There is no
intention to break the API for docleaf but it is also still young
in some ways and there might be adjustments to the configuration values
that would need to be reflected in the version number as it is still
pre-1.0 that would only be a minor version change.

Signed-off-by: Michael Jones <m.pricejones@gmail.com>
2023-07-03 10:05:52 +00:00
Roberto Medina 6622735ea8 arch: arm64: add support for coredump
* Add support for coredump on ARM64 architectures.
* Add the script used for post-processing coredump output.

Signed-off-by: Marcelo Ruaro <marcelo.ruaro@huawei.com>
Signed-off-by: Rodrigo Cataldo <rodrigo.cataldo@huawei.com>
Signed-off-by: Roberto Medina <roberto.medina@huawei.com>
2023-07-03 09:32:26 +02:00
Grzegorz Chwierut 4045bab1b7 twister: pytest: Parse report file to get testcases
Extended parsing of report.xml file - produced by pytest-twister-harness
plugin. Now testcases are properly extracted and added to twister
report. Added unit tests.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2023-06-25 02:44:49 -04:00
Anas Nashif b8fc1c3607 twister: run slow tests only
We have many tests that are marked as slow that do not run in CI and any
known workflow, to isolate them and be able to run them on their own,
add a new option --enable-slow-only which causes only those tests to build
and execute.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-22 17:14:02 -04:00
Lucas Tamborrino eb028ccf55 debug: coredump: xtensa: Add esp32s3
Add coredump support for esp32s3.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-06-21 16:06:06 -04:00
Lucas Tamborrino ba3766a75f debug: coredump: xtensa: add esp32s2
Add coredump support for esp32s2.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-06-21 16:06:06 -04:00
Lucas Tamborrino fbbb82d6ac debug: coredump: esp32: Fix registers index for current toolchain
The current toolchain version for espressif SoCs does not
have the same limitation on registers indexing as the previous
one, enabling sending the correct A0-A15 register values directly

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-06-21 16:06:06 -04:00
Gerard Marull-Paretas b6d5d246b7 scripts: build: gen_device_deps: s/--dynamic-handles/--dynamic-deps
Align naming of the CLI option with recent changes in handles naming.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-06-21 09:32:05 +02:00
Gerard Marull-Paretas d93586f831 device: s/__devicehdl_/__devicedeps_/
Rename the device dependencies array variable to use the "deps" name, in
line with latest renamings in device.h

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-06-21 09:32:05 +02:00
Gerard Marull-Paretas 4eb406e093 device: s/DEVICE_HANDLE/DEVICE_DEPS/
Rename multiple internal device macros to use the DEVICE_DEPS naming, so
that it is clear they belong to the device dependencies APIs.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-06-21 09:32:05 +02:00
Gerard Marull-Paretas e5f82cb5dc device: hide DEVICE_HANDLE_SEP/ENDS
These macros are used internally by the device dependencies functions.
There's no need to expose them publicly, so prefix them with Z_ and add
them under INTERNAL_HIDDEN docs section.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-06-21 09:32:05 +02:00
Gerard Marull-Paretas 8bee39edff device: s/device_handles/device_deps/ in linker scripts
Use the "device_deps" naming scheme to emphasize we are storing device
dependencies. The fact we are using device handles to store them is an
implementation detail.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-06-21 09:32:05 +02:00
Gerard Marull-Paretas 92707866d1 device: s/gen_handles/gen_device_deps
Rename the gen_handles script and all of its references/associated files
to gen_device_deps. The new new makes things more clear, because the
script just take care of generating, for each device, an array of device
dependencies. While device handles are used internally to store this
information, it is in reality an implementation detail.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-06-21 09:32:05 +02:00
Grzegorz Chwierut 732dd4843d twister: pytest: Simplify interface to pytest-twister-harness
Add DeviceAbstract class to default imports from pytest-twister-harness
package to simplify importing DUT package, when creating tests.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2023-06-20 14:46:55 -04:00
Björn Stenberg 234fec579a scripts: gen_relocate_app.py: Give sections unique names
The code_relocation feature creates generic section names that sometimes
conflict with already existing names.

This patch adds a '_reloc_' word to the created names to reduce the risk
of conflict.

This solves #54785.

Signed-off-by: Björn Stenberg <bjorn@haxx.se>
2023-06-20 16:33:49 +02:00
Krzysztof Chruściński 9c2d1c8e99 scripts: logging: dictionary: Fix database generation
I noticed that not all strings were put into database. That is because
algorithm was searching for any null terminated byte arrays in the
section (e.g. rodata) and then attempting to decode it to string.
However, section may contain other static const variable and if a
string is preceded by a variable that has non-printable bytes and no
zero at the end then algorithm was picking a candidate that started
with non-printable characters followed by the string. Such candidate
was discarded because it was not a valid string.

Algorithm is changed to treat as string candidate any sequences that
contains printable bytes followed by 0.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-06-19 15:03:07 +02:00
Jamie McCrae 12e8de71b1 scripts: build: parse_syscalls: Fix duplicate paths on windows
Fixes an issue on windows where there would be many permutations
of paths with different folder separators by converting to
posix-style path separators.

Issue was introduced by
https://github.com/zephyrproject-rtos/zephyr/pull/58351

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-06-19 14:57:39 +02:00
Marc Herbert 07f2c7a1df west: sign.py: give rimage a key placeholder when there's none
rimage always requires a key argument even when it does not use it.

Some configurations (IMX) use rimage only for "stitching" the image but
not for signing. These were failing to build directly from west with
pretty cryptic stack trace, see below. This has never been a problem for
the SOF project because it has always worked around this rimage
limitation by providing a bogus -k argument - very much like the one
added by this commit.

```
File "zephyrproject/zephyr/scripts/west_commands/sign.py",  in sign
  extra_ri_args += [ '-k', str(sof_src_dir / 'keys' / cmake_default_key) ]
TypeError: unsupported operand type(s) for /: 'PosixPath' and 'NoneType'
ninja: build stopped: subcommand failed.
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-06-19 08:38:48 +02:00
Daniel Leung 80e78208e6 kernel: syscalls: no need to include all syscalls in binary
The syscall generation phase parses all header files to look
for potential syscalls, and emits all the relevant files to
enable syscalls. However, this results in all the syscall
marshalling functions being included in the final binary.
This is due to these functions being referred to inside
the dispatch list, resulting in ineffective garbage
collection during linking. Previous commits allows each
drivers and subsystems to specify which header files
containing syscalls are relevant. So this commit changes
the syscall generation to only include the syscalls needed
for the build in the syscall dispatch list and removing
various bits related to that. This allows the linker to
garbage collect unused syscall related function, and thus
reducing final binary size.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-06-17 07:57:45 -04:00
Grzegorz Chwierut c37deeb0c4 twister: Use natural sort when generating hardware map
Use the natural sort of list when generating a hardware map. The
list is sorted with a serial port as a key. When more than 10 ports
are active and some of devices use more than one port, the ports
of one device may be listed in wrong sequence, which may cause
futher problems with selecting the right port for listening to
the device.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2023-06-17 07:54:46 -04:00
Gerard Marull-Paretas e5335f345a device: dynamic device handles were declared as const
When CONFIG_HAS_DYNAMIC_DEVICE_HANDLES is selected, devices handles are
placed in RAM region so that they can be modified at runtime. However,
the gen_handles.py script added the `const` attribute to the device
handle arrays regardless of this setting, leading to faults when running
the application. This may be an indicator that this feature is not
actively used.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-06-14 13:48:02 -04:00
Anas Nashif 7f0aff9045 ci: testplan: do not start more runners than needed
We have been launching 10 runners up a certain number of tests, although
we only neeed half of that for some scenarios.
Too many runners started that have to execute just a small number of
tests wastes times on setup and blocks the queue. Just start the number
of nodes needed based on initial calculation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-08 07:33:56 -04:00
Jamie McCrae 65c9058ed4 sysbuild: Fix value propagation of signature type to MCUboot
Fixes an issue whereby the type of the signature was not passed
to MCUboot.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-06-08 06:51:33 -04:00
Piotr Golyzniak 4f77883043 scripts: twister: add timeout for pytest process
Add protection timeout for pytest subprocess, to avoid situation of
suspending whole Twister in case of internal pytest test problem.

Co-authored-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
2023-06-02 18:55:27 -04:00
Grzegorz Chwierut ab5b48beed twister: pytest: Wrap iter_stdout
Added waiting for prompt instead of calling time.sleep,
to fix issue with longer setting up platforms with TF-M
enabled. Wrapped iter_stdout generator, to avoid issues
when generator is created and called multiple times
in test scenarios.
Fixes: #58747

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2023-06-02 18:55:27 -04:00
Jordan Yates 86dd23e1eb scripts: build: gen_handles: exit on relocatable files
Print a clean error message when provided a relocatable file, instead
of generating a source file which will cause compilation errors further
away from the source.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-06-02 18:53:06 -04:00
Jordan Yates 60aa9e1857 scripts: build: elf_parser: fix relocatable data offsets
Based on investigations with relocatable `.elf` files, the symbol table
data in relocatable files is not shifted by the section address. Remove
the shift from these files to ensure that data can be pulled from the
symbol table.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-06-02 18:53:06 -04:00
Jordan Yates 4d181d6395 scripts: build: elf_parser: retrieve section directly
Retrieve the section holding the symbol data directly from the symbol
information, instead of trying to find a section that contains data at
the correct address. The later approach does not work for relocatable
files, which contain multiple sections all containing data in
overlapping temporary memory addresses (usually starting at 0).

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-06-02 18:53:06 -04:00
Carles Cufi d2fff07b4a scripts: size_report: Use default encoding to process filenames
The linker generates an .elf file wth encoded strings containing
filenames. If those filenames contain non-ASCII characters we need to
know which encoding was used by the linker to store those filenames. Use
the system's preferred encoding for that purpose.

Fixes #55148.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-06-02 15:44:36 -04:00
Carles Cufi fde1a239c9 scripts: snippets: Use UTF-8 to write CMake files
UTF-8 is not always the default encoding on some platforms, but it's the
only reliable way to store encoded strings for filenames using
non-ASCII characters.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-06-02 15:44:36 -04:00
Fabio Baltieri 44e691e20e scripts: check_init_priorities: add extra verbose output
Add support for more verbose output enabling debugging output and add a
first debug print to output the file to device path mapping. Found this
to be extremely useful to find what file is instantiating a specific
device for non obvious cases.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-06-02 04:47:24 -04:00
Anas Nashif 432eefca05 ci: tags: add mcumgr to tags file
Filter based on changes in pull request and do not build mcumgr on
unrelated changes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-02 04:47:06 -04:00
Anas Nashif 9cef0451ba ci: tags: add networking to tags file
If we are not changing the network subsystem, do not build samples and
tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-02 04:47:06 -04:00
Anas Nashif cec8fd1c6e tests: ztest: fix tags for testsuite and unify them
Use test_framework as unified tag so we can filter tests in a consistent
way.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-02 04:47:06 -04:00
Anas Nashif 4e8cdb8bc3 ci: manage when to build testsuite tests
Do not build test framework tests on every change, use tag filtering to
improve CI performance.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-02 04:47:06 -04:00
Anas Nashif 522624d6c6 west: build: keep kconfig quotes from testcase.yaml
When parsing extra configs from the yaml file, keep quotes.

Fixes #56248

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-05-31 10:02:28 -04:00
Carles Cufi 462dc9746b scripts: footprint: Fix size_report on freestanding apps
os.path.commonpath() throws a ValueError exception when paths in the
list provided share nothing in common (like for example two Windows
paths on different drive letters). Handle that special case properly
instead of letting the exception propagate up.

Fixes #51549.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-05-30 15:00:52 -04:00
Anas Nashif dae79cefaa twister: coverage: set coverage platforms default to an empty list
When calling twister with --coverage and no platform specified on the
command line, set the the value of coverage platforms to an empty list.

Fixes #57534

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-05-30 06:30:39 -04:00
Lukasz Mrugala 164c26ff18 scripts: Typo in the word 'platform' fix
testinstance.py contains a string literal comparison to the
word 'platform', which has been misspelled as 'plaform'.

The change is verified by a test expansion.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2023-05-29 14:34:33 -04:00
Keith Short dfa992c596 twister: Remove newline suffix in BinaryHandler
Update the code that removes newline suffix in BinaryHandler for
compatibility with python 3.8.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/58335

Signed-off-by: Keith Short <keithshort@google.com>
2023-05-26 14:59:03 -04:00
Madhurima Paruchuri a19d905cc4 USB-C: genVIF: Cleanup and add support to pick static data from input
Removed few VIF properties which are being hardcoded
Updated the script to parse source VIF XML and add information to
the output
Added optional Kconfig option to configure custom source VIF XML path
Cleaned up the code

Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com>
2023-05-26 13:54:43 -04:00
Grzegorz Chwierut f1f305f4ae scripts: twister: adaptation for pytest plugin
Making the necessary changes to enable the new pytest plugin.
By default Twister should work without the pytest-twister-harness
plugin installed. To achieve this, each time Twister calls pytest,
the PYTHONPATH environment variable is expanded and the
`-p twister_harness.plugin` option is added to the pytest command.

Co-authored-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2023-05-26 13:52:15 -04:00
Piotr Golyzniak 8c4bfcf324 scripts: add pytest plugin
Adding pytest plugin dedicated to running pytest tests in Zephyr
project. This plugin provides a dut fixture which allows to handle
bidirectional communication with the device under test. This version
of plugin can be used for tests dedicated to real hardware, QEMU and
native_posix simulator.

Co-authored-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
Co-authored-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Co-authored-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
2023-05-26 13:52:15 -04:00
Yuval Peress ca5bf10143 sensor_shell: Update to new sensor_read API
Update the sensor shell logic to use the new sensor_read() APIs and
make triggers an option of the sensor_shell sample (this avoids the
trigger stealing the interrupt status from one-shot reads).

Signed-off-by: Yuval Peress <peress@google.com>
2023-05-26 11:04:54 -05:00
Yuval Peress ed380de152 sensors: Add new async one-shot reading API
Add a new async API based on the RTIO subsystem. This new API allows:
1. Users to create sampling configs (telling the sensor which channels
   they want to sample together).
2. Sample data in an asynchronous manner which provides greater control
   over the data processing priority.
3. Fully backwards compatible API with no driver changes needed for
   functionality (they are needed to improve performance).
4. Helper functions for processing loop.

Signed-off-by: Yuval Peress <peress@google.com>
2023-05-26 11:04:54 -05:00
Michał Szprejda bdf02ff5d6 Twister: Add integration with renode-test
Add support for calling the `renode-test` command from west and twister.
Enable running Robot Framework tests suites in Renode.

Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>
Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
2023-05-26 09:43:49 -04:00