Commit graph

5615 commits

Author SHA1 Message Date
Ryan Grachek
47b4e4c2fb UF2: Enable support for Raspberry Pi RP2350
Add UF2 Family ID for Raspberry Pi 2350 and build
UF2 image by default for Pico 2 board

Signed-off-by: Ryan Grachek <grachek@gmail.com>
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2024-12-23 23:57:57 +01:00
Øyvind Rønningstad
617df3b5c1 scripts: Remove zcbor requirement from requirements-extras.txt
lwm2m_README: Add instructions to install zcbor when needed

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-12-23 17:09:43 +01:00
Peter Johanson
27615a7cf1 west: runners: bossac: Honor --erase flag
Instead of unconditionally erasing the whole target, add
support for using the common --erase flag.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2024-12-22 18:20:30 +00:00
Hake Huang
15edce26e4 twister: add dt_node_prop_enabled support
using "dt_node_prop_enabled" to filter out supported platforms
1. check node existing.
2. check prop in node.
3. check the prop is True.

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-12-20 18:30:43 +01:00
Benjamin Cabé
eacd5527aa Revert "cmake: remove enforcement of DWARF v4"
This reverts commit 9d849d92bf that seems to
be causing dozens of basic kernel test failures across various platforms.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-12-20 16:05:23 +01:00
Benedikt Schmidt
9d849d92bf cmake: remove enforcement of DWARF v4
Remove the enforcement of DWARF v4 as pyelftools is able
to parse DWARF v5.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-12-20 12:36:46 +01:00
Benedikt Schmidt
895db44388 scripts: logging: dictionary: fix parsing of DWARF v5
Fix parsing of DWARF v5 in database_gen.py.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-12-20 12:36:46 +01:00
Pieter De Gendt
b65a97ef0c modules: nanopb: Move pip dependencies to optional module
The west packages extension can be used to install module dependencies.

Upstream nanopb has added the pip package dependencies to the
zephyr/module.yml file. Remove in-tree pip package dependencies.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-19 15:20:11 +01:00
Josuah Demangeon
5847e04be8 west: runner: add support for ecpprog
The ecpprog command is an utility written by Greg Davill for flashing
FPGAs such as ECP5 or CrossLink-NX series. Devkits typically have an
FTDI interface chip to access the external flash. FPGA image is
typically at flash offset 0x00000000 flash offset, and the Zephyr
image offset can be set via CONFIG_FLASH_LOAD_OFFSET.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2024-12-19 08:38:55 +01:00
James Roy
4553a21fe5 devicetree: Add DT_FOREACH_ANCESTOR macro
Add 'DT_FOREACH_ANCESTOR' macro to get a list of
ancestor node of a given node_id.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-12-18 10:17:09 +01:00
James Roy
ab959d5a3b scripts: dts: Use better string concatenation
Replace string concatenation operator with f-string.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-12-18 08:33:13 +01:00
Mathieu Choplain
4dc8acc6d1 scripts: west: runners: stm32cubeprogrammer: add start address argument
Add new '--start-address' argument to the STM32CubeProgrammer west runner.
This argument can be used to specify an address from which the MCU should
start executing, instead of relying on the default value in CubeProgrammer.

Also update STM32CubeProgrammer runner tests to support new argument.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-12-17 23:15:13 +01:00
Dmitrii Golovanov
26e0aa268f twister: handlers: Pass harness reason to instance
Pass a test failure reason text from harness to the instance
to convey more details on the failure.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-12-17 11:37:40 +00:00
Dmitrii Golovanov
ea3f105f82 twister: binaryhandler: Fix None status on test fail
Set missing TestCase statuses when a test under the BinaryHandler failed
(crashed), so remaining 'STARTED' and 'NONE' are now 'BLOCK' instead.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-12-17 11:37:40 +00:00
Guennadi Liakhovetski
733241d737 west: rimage: generate TOML with all LLEXTs included
"west sign" uses the C preprocessor to generate a TOML configuration
file, needed for rimage. When creating LLEXTs rimage also uses a
configuration file where all supporting components are configured as
LLEXT. This adds such a file generation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-12-17 11:35:32 +00:00
Declan Snyder
cc620a312c kconfig: Add dt_compat_any_not_has_prop function
Add preprocessor function that returns 'y' if any enabled node with
compat does NOT have a certain property. This is different from using
dt_compat_any_has_prop to check that they ALL don't have the property.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-12-16 13:09:14 +01:00
Benjamin Cabé
9d4c027993 twister: reports: use Path instead of PosixPath
Directly instantiating a PosixPath is not allowed on Windows, use
Path instead.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-12-16 13:08:22 +01:00
Dmitrii Golovanov
2c5195c814 twister: reports: Pretty print XML reports
Pretty print XML reports with tab identation on levels for better
readability and ease text diff there as well.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-12-16 08:35:34 +01:00
Dmitrii Golovanov
c5c4165f68 twister: reports: Long testcase.classname XML properties
The testcase.classname properties in `twister_report.xml` and
`twister_suite_report.xml` now contain the full testsuite name
(without its path prefix) instead of just two its dot-separated
leftmost components. This way `twister_report.xml` testsuite container
has no duplicate testcase elements with the same `classname` and `name`
properties executing with --no-detailed-test-id for a project with same
testcase names in its 'sibling' suites, for example`tests/kernel/sleep`.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-12-16 08:35:34 +01:00
Dmitrii Golovanov
b69a8d1deb twister: ztest: short test case names on --no-detailed-test-id
Extend `--no-detailed-test-id` command line option: in addition to its
current behavior to exclude from a test Suite name its configuration path
prefix, also don't prefix each Ztest Case name with its Scenario name.

For example: 'kernel.common.timing' Scenario name, the same Suite name,
and 'sleep.usleep' test Case (where 'sleep' is its Ztest suite name
and 'usleep' is Ztest test name.

This way both TestSuite and TestCase names follow the same principle
having no parent object name prefix.

There is no information loss in Twister reports with this naming:
TestSuite is a container object for its TestCases, whereas TestSuite
has its configuration path as a property.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-12-16 08:35:34 +01:00
Anas Nashif
82f7857a94 twister: debug: change skipped -> filtered
Change debug message to say filtered instead of skipped.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-12-13 09:12:59 +01:00
Anas Nashif
63caa67f52 twister: plan: unify messaging, testsuite vs testcase
Many places use test case instead of testsuite or testsuite scenario.
Unify to avoid confusion.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-12-13 09:12:59 +01:00
Marcin Niestroj
fc73447acb scripts: pytest: log msec with leading zeros
Milliseconds are logged as is, without leading zeros. This means that
following log content is produced, which is not aligned by columns:

  12:54:27.972:INFO:root: Test message
  12:54:27.992:INFO:root: Test message
  12:54:28.12:INFO:root: Test message
  12:54:28.32:INFO:root: Test message
  12:54:28.52:INFO:root: Test message
  12:54:28.73:INFO:root: Test message
  12:54:28.93:INFO:root: Test message
  12:54:28.113:INFO:root: Test message
  12:54:28.133:INFO:root: Test message

Change milliseconds logging to include leading zeroes. This allows to print
nicely aligned log messages:

  12:54:27.972:INFO:root: Test message
  12:54:27.992:INFO:root: Test message
  12:54:28.012:INFO:root: Test message
  12:54:28.032:INFO:root: Test message
  12:54:28.052:INFO:root: Test message
  12:54:28.073:INFO:root: Test message
  12:54:28.093:INFO:root: Test message
  12:54:28.113:INFO:root: Test message
  12:54:28.133:INFO:root: Test message

Additionally it is much easier to configure programs simplifying
timestamped log browsing (like in logview-mode for Emacs), as it is more
standard and does not require custom regex matching.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-12-13 03:03:07 +01:00
Pieter De Gendt
4d1d8a77a7 scripts: west_commands: runners: openocd: Fix debugging with TUI
Prevent server output when running gdb with --tui to prevent garbled
console output.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-12 19:59:35 +01:00
Grzegorz Chwierut
c4d884cc65 twister: Pass extra test args to pytest
Pass additional args to test binary. Twister
passes it only for native_sim.
Fixes #82463

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2024-12-12 10:20:55 -05:00
Luca Burelli
78ae035f89 llext: fix link order for weak syscall symbols
The weak syscall symbols generated by gen_syscalls.py are currently
compiled in the LLEXT subsystem library, which is then linked among all
other Zephyr libraries in an unspecified order. This can cause the weak
symbols to override the actual syscall implementations, leading to
undefined behaviour.

To fix this, the currently generated file is split in two elements:

- syscall_exports_llext.c contains the EXPORT_SYMBOL directives for all
  syscalls. This part can be compiled with the LLEXT library and linked
  among all other Zephyr libraries, and ensures all syscalls symbols
  are preserved by the linker.

- syscall_weakdefs_llext.c contains the weak definitions for all syscalls.
  This file is compiled in a separate library that is linked last, so
  that the weak symbols are only used if no other implementation is
  available.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-12-10 20:38:48 +01:00
Félix Turgeon
9cdb07cb52 scripts: coredump: Fix loading coredumps when thread info is enabled.
When loading a coredump with an an elf built using
'CONFIG_DEBUG_THREAD_INFO=y', gdbstubs assumes that the thread info
memoryblock populated by 'CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_THREADS=y'
will be present in the coredump. This is not always true and causes an
error, and a failure to load the coredump. Add a default value for the
threads_metadata variable in CoredumpLogFile which can be used to detect
when the memory block is not present. This allows the coredump to load
successfully.

Signed-off-by: Félix Turgeon <felixturgeon@meta.com>
2024-12-09 22:06:23 +00:00
Anas Nashif
072a430cea twister: handler: open files using with statement
Use with statement to open stdout/stderr and resolve current warning
when running twister:

	ResourceWarning: unclosed file....

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-12-09 15:10:19 +01:00
Anas Nashif
30ad1901f3 twister: testplan: do not verify_platforms_existence again
We already sanitize those lists very early on, no need to call this
check again on the same lists.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-12-09 09:49:46 +01:00
Anas Nashif
c0dbcdab10 twister: error on invalid platforms
In case of unknown platforms in filters such as plaform_allow,
integration_plaforms or platform_exclude, report an error and exit.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-12-09 09:49:46 +01:00
Artur Dobrynin
f84dadde59 scripts: twister: adding default cmake/config arguments for bsim
Bsim tests need some addtional kconfig arguments enabled by default.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
2024-12-07 02:03:31 +01:00
Thomas Günther
20409ca2cc doc: add get_filtered_output method documentation
Add documentation for the get_filtered_output method in both the Python
implementation and the Integration with pytest chapter. The method is used
to filter command outputs by removing prompts and log messages, making it
easier to process shell command results.

Signed-off-by: Thomas Günther <thomas.guenther@limatica.com>

removed traling whitespace
2024-12-05 20:00:47 -05:00
Hake Huang
6996436ed6 tests: twister: add quit-on-failure option
in CI, we may need to quit if there is any failure
to save time, so add this --quit-on-failure so that
any failure will quit the test.

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-12-05 22:10:28 +01:00
Andy Ross
82c5f548d9 scripts/west/sign: Auto-detect rimage ELF files
This code had a growing "enumerate all the platforms" wart.  In point
of fact only intel_adsp is special here.  Other rimage platforms don't
have a bootloader and use zephyr.elf directly.

Don't hard code platform names (especially since they aren't the same
as board/soc names!).  Just autodetect which scheme we have at
runtime.

Signed-off-by: Andy Ross <andyross@google.com>
2024-12-05 22:08:55 +01:00
Armin Kessler
443afd421a scripts: twister: add esp32 runner
Adds support for the `esp32` runner when using the hardware-map feature.

Signed-off-by: Armin Kessler <ake@espros.com>
2024-12-05 15:17:18 +01:00
Ilya Tagunov
ab8c035fbe scripts: build: gen_app_partitions: enquote archive name wildcards
Some linkers (e.g. the ARC MWDT one) don't recognize wildcards in file
names if they are not enclosed in quotes. Looks like the quotes have
no negative effect on the GNU ld linker, so just do it unconditionally.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
2024-12-05 09:41:28 +01:00
Dat Nguyen Duy
1069f57f5c twister: fix issue twister with --device-testing on Windows
There is an incorrect logic that causes twister with
--device-testing to skip all tests on Windows. Correct
the logical condition.

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2024-12-04 18:19:23 -05:00
Anas Nashif
e873d503a9 twister: testplan: do not error on missing or unsatisfied env
bsim requires a special setup for it to be usuable and run by twister.
If this environment is not available, we should not error when the
platform is an integration platform.

Most developers and users of twister will not have the babblesim setup
and reporting errors is misleading and confusing. So if such env. is not
available, just filter as usual and do not error.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-12-04 14:37:58 -05:00
Gerard Marull-Paretas
714e193340 scripts: twister: drop support for space-separated lists
Support for space-separated lists was deprecated a long time ago
a91620f5bb so it is time to remove
support for them.

Any project that has not migrated can still use
`scripts/utils/twister_to_list.py` to automatically migrate twister
files.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-04 14:14:53 -05:00
Grzegorz Chwierut
5cd8ef8529 twister: allow using empty board revision
Allow providing an empty board revision. Fixes issue
found in PR #81857

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2024-12-04 14:14:22 -05:00
Hake Huang
afba775304 twister: test: update test case
update test cases for twister
1. test_errors.py add protection.
2. test_handlers.py change call to status
3. test_testsuite.py change call to status

The log traces for TwisterException objects only.
And the stack trace output follow the same rules for all exceptions,
but StatusAttributeError with its dedicated handlers.

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-12-04 02:03:33 +01:00
Hake Huang
798768e40d twister: add trace print in exception
add trace print when exception happens

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-12-04 02:03:33 +01:00
Anas Nashif
440659878d twister: do not create overlays/run_id for filtered cases
Avoid creating directories and files for instances that are filtered.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-12-04 02:02:52 +01:00
Pieter De Gendt
f2b51887a4 scripts: Update and lock ruff
The ruff linter and formatter should get a locked version to be installed
for compliance. This prevents new linter issues because of ruff updates
itself.

Ruff version 0.8.0 removed the deprecated UP027 rule so it's removed from
the ignore list.

Update the excludes file to match the actual reported issues.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-03 23:30:00 +00:00
Pieter De Gendt
9e4f8616e1 scripts: west_commands: runners: teensy: Replace printf with f-string
Fix linter warning UP037 for teensy runner.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-12-03 23:30:00 +00:00
Benjamin Cabé
029f807689 CODEOWNERS: drop CODEOWNERS file as it's not used anymore
There's no need for the CODEOWNERS file anymore as figuring out
maintainership and performing reviewer assignment is done via the
MAINTAINERS file now

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-12-03 04:01:27 +01:00
Tomasz Chyrowicz
866e690dda scripts: nrf_common: Move MPI to sysbuild Kconfig
Use sysbuild to build and configure SUIT Manifest Provisioning
Information.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2024-12-02 22:05:27 +00:00
Tomasz Chyrowicz
811ff1f209 compliance: Remove SUIT MPI symbols
Remove SUIT MPI symbols from compliance exclusion list.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2024-12-02 22:05:27 +00:00
Grzegorz Swiderski
f76c7e3a9a scripts: ci: check_compliance: Account for board & SoC extensions
When a given board or SoC is extended, it has more than one directory
associated with it, where the build system can look for Kconfig files.
Make sure all of them are also included for Kconfig compliance checks.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-12-02 22:05:10 +00:00
Anas Nashif
00f620870e twister: config: increase min_ram to 16k
Increase default to 16k, this can be overidden in the test configuration
where needed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-30 18:33:10 +01:00