`fork()` is defined by POSIX and for creating a new child process.
It is the preferred method of doing so on systems with virtual memory and
the symbol should not be used outside of the context defined by the
POSIX standard.
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fork.html
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
The display harness initial documentation was a separate, stale (had
references to a personal Github repo), README.rst buried in the
twister/scripts folder.
Move the docs to be a "first class" part of the Twister documentation
alongside other harnesses.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Update the ruff version to the latest 0.14.2 and update the excluded files
to match with the last checks for linter and formatting issues.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Instead of relying on various exceptions that can happen when one tries
to execute a program that is not installed in the system (typically
FileNotFoundError but sometimes PermissionError), use shutil.which() to
ensure the npx executable is available before running it.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Collect filter commands into a single location and sort them in the
order: arch, vendor, platform, pattern, filter, tag. This enhances
the readability of help information and reduces the time spent
searching for filter command options.
Signed-off-by: WenBin Zhang <freey7955@gmail.com>
Collect device-testing commands into a single location to enhance
readability of help information and reduce the time spent
locating device-testing options.
Signed-off-by: WenBin Zhang <freey7955@gmail.com>
reworked run_tests.py script:
- removed obsolete arguments from commands called by this script
- avoid code duplication by using a for-loop
Signed-off-by: Thorsten Klein <thorsten.klein@bshg.com>
added pyproject.toml config file which allows to set paths for tools
like mypy or pytest. With this config file it becomes possible to
directly run those tools in a local zephyr tree.
Signed-off-by: Thorsten Klein <thorsten.klein@bshg.com>
This PR fixes incorrect error message when dts-linter is not installed
and provide a proper message instead of:
`Failed to parse dts-linter JSON output: ...`
Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
Fixes an oversight of only checking files that are exactly named
CMakeLists.txt - this includes the directory name, so that it
actually checks any file in the tree with this name
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
When debugging boards with external Flash, to make it accessible for
read and write by the debugger, we need the --external-init option
together with --extload <file_path> option.
It allows the ST-LINK GDB server to make external memory accessible
after reset without any need for the app to set it up.
The external memory must be memory mapped and directly accessed because
normal memory read/write is used by gdb.
Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
Add support for the Tigard multi-protocol hardware hacking tool from
SecuringHardware.com.
More information available at https://github.com/tigard-tools/tigard
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
The optional --output-bin parameter instructs the IntelHex class to
save the content as a binary file instead of the Intel Hex format.
Signed-off-by: BUDKE Gerson Fernando <gerson.budke@leica-geosystems.com>
build.dir-fmt format string arguments are extended. New format args are
'west_topdir' (absolute path to the west workspace directory) and
'source_dir_workspace' (relative path of the source directory to
west_topdir).
Signed-off-by: Thorsten Klein <thorsten.klein@bshg.com>
Relax the `Missing a blank line after declarations` checkpatch error by
loosening the requirements for a macro to be treated as one that
declared a variable.
Currently the regex matches the pattern `DECLARE` or `DEFINE`, as long
as there are between 1 and 6 trailing `_FOO` components to the macro
name (e.g. `DECLARE_MY_TYPE()`). Zephyr however contains many macros
that don't have the trailing components but still resolve to variables
(e.g. `ATOMIC_DEFINE`, `K_MUTEX_DEFINE, etc`).
By changing `{1,6}` to `{0,6}`, we remove the requirement for the
trailing `_FOO` component(s) while still allowing them. This stops
checkpatch from erroring on patterns like this:
```
struct driver_data {
uint16_t some_value;
ATOMIC_DEFINE(some_atomic, 16);
};
```
Signed-off-by: Jordan Yates <jordan@embeint.com>
this path only provides autocompletion for the `west` command
itself, not for its subcommands. (i.e. `west [tab]` rather than
`west packages [tab]`). However, it remains highly userful,
significantly reducing typing time and errors when using longer
commands like `west packages`.
Signed-off-by: WenBin Zhang <freey7955@gmail.com>
this path only provides autocompletion for the `west` command
itself, not for its subcommands. (i.e. `west [tab]` rather than
`west packages [tab]`). However, it remains highly userful,
significantly reducing typing time and errors when using longer
commands like `west packages`.
Signed-off-by: WenBin Zhang <freey7955@gmail.com>
this path only provides autocompletion for the `west` command
itself, not for its subcommands. (i.e. `west [tab]` rather than
`west packages [tab]`). However, it remains highly userful,
significantly reducing typing time and errors when using longer
commands like `west packages`.
Signed-off-by: WenBin Zhang <freey7955@gmail.com>
multiprocessing no longer defaults to fork, so force it to maintain pre
3.14 behavior. We will need to revisit the implementation and at some
point move to forkserver
Fixes#95058
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
In order to allow for users to invoke "west flash" without actual
hardware connected but still running the logic and pregeneration of
commands, specifically the json file.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Until now, for historical reasons (see
f42cef9c81 and
58e0e31c7e), the use of the --erase-mode
command-line switch was reserved for the nRF54L family. But in fact this
can be used (instead of --erase) for any of the Nordic ICs. This patch
extends the usage of this switch regardless of family.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add a new 'west bindesc extract' subcommand that dumps all binary
descriptors into a separate binary file. It will also report the range
(offset and length) of the dumped data within the original image.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Enhance the `size_report` script to correctly categorize static C++
variables in the memory report.
Static C++ variables are currently listed under the "No paths"
category in the size report. This occurs because the script's
address-based mapping logic is designed for functions, which
occupy an address range, but fails to handle variables that
have only a single memory address.
This commit improves the `do_address_range_matching` function
to handle single-address mappings. The updated logic now correctly
identifies and assigns static C++ variables to their corresponding
source file paths in the report tree, providing a more accurate and
comprehensive memory footprint analysis for C++ applications.
This enhancement ensures that all symbols, regardless of their
linkage or type, are correctly placed in the report, providing a
more accurate overview of memory usage.
Signed-off-by: Nilesh Vyas <nileshvyas1112@gmail.com>
Set the environment:os tag to the return value of platform.system(),
which is more useful than os.name() which always returns "posix".
Signed-off-by: Keith Short <keithshort@google.com>
Align with native_simulator's upstream main
95f560a2140aacb03a74b8c933f3b27a59c56d50
Which includes:
95f560a: nct: fix possible redefinition of GNU_SOURCE
Signed-off-by: Andreas Kurz <info@akurz.net>
The new 'traceconfig' target generates a Markdown file listing all
configuration symbols, their values, and where those values originated
(user assignment, default, selection, implication, or unset).
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Collect and save trace data for all symbols in the merged configuration.
This includes information about where each symbol was defined or
assigned, which can be useful for debugging complex Kconfig setups.
The trace data includes the following information for each symbol:
- Name
- Visibility
- Type
- Value
- Kind and location of value origin (as defined in kconfiglib)
The trace data is saved for later use in two formats: a binary pickle
file and a human-readable JSON file.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Track information about what caused a value to be set in the 'origin'
property of Symbol. 'imply' and 'select' dependencies do not have a
location associated with them, so in those cases the location is
a string representation of the dependency expression. For defaults and
user values, the location in the Kconfig file is stored.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Store the location (filename and line number) where a 'select', 'imply',
'range' or 'default' was added to a Symbol or Choice.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
The 'user_loc' stores the location (filename and line number) where a
symbol or choice was last set via a direct user selection.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Replace filename and linenr parameters to _warn() with a single loc
element, which is a constant (filename, linenr) tuple that can be more
efficiently passed and stored.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Replace 'filename' and 'linenr' usages with a single 'loc' attribute,
which is a (filename, linenr) tuple. This simplifies code dealing with
locations, and makes it explicitly constant. The original attributes are
now provided via properties for compatibility.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Instead of using a mutually exclusive group for sysbuild/no-sysbuild
argparse arguments, use the argparse.BooleanOptionalAction to allow passing
multiple arguments, where the last one is applied.
This is consistent with for example gcc compiler flags.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
The ZVFS_OPEN_ADD_SIZE_ is used as a prefix for matching specific
Kconfig option names, i.e. it's not a real option in itself.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When analyzing Zephyr coredumps from ARM Cortex M, sometimes the GDB
server fails with the error 'binascii.Error: Odd-length string'.
This happens because the GDB packet parsing logic does not correctly
handle the '=' separator in register write packets containing register
identifiers with more than one letter/digit. Fix it by properly
locating the '=' character and slicing the packet string accordingly.
Signed-off-by: Tomas Pajurek <tomas.pajurek@spotflow.io>
detect_version() used os.environ["ZEPHYR_BASE"],
which raises a KeyError when the variable is
absent, preventing the fallback path from running.
Switch to os.environ.get("ZEPHYR_BASE") and use
Path(__file__).resolve() for the fallback so the
path is absolute/canonical.
Signed-off-by: Paul Oberosler <paul.oberosler@raspberrypi.com>
The linter is super fast, no need to limit to only changed files.
For example if the linter configuration changes, all Python files need to
be validated.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Update workflow to use the new version of Vermin to enrich the Python
minimum version checks in the CI pipelines.
Signed-off-by: Morten Kristensen <me@mortens.dev>
Add a west config option to skip rebuilds by default or not when doing
west flash. Also add corresponding symmetrical CLI options.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Fix for collecting and presenting measured data.
During verify measured values, the test skipped all results
after the first incorrect one. Furthermore, it duplicated
already collected data on the output list. So in this case the
result list include wrong data.
Signed-off-by: Artur Wilczak <arturx.wilczak@intel.com>
Partially revert 1bcc0652241af70d0b28aee155f260cd9ca0fc74
This change impacts all other scripts that import those modules, while
those weren't updated.
It will be hard to maintain this list, whilst keeping the entire tree
compliant.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Add --permit-permanently-transitioning-device-to-deployed safety flag
to gen_uicr.py, required when enabling both UICR.LOCK and
UICR.ERASEPROTECT together. This prevents accidental permanent locking
of devices since this combination makes the configuration irreversible.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>