If we are doing a sysbuild get_elf_file needs to return the default
domain's build_dir. The standard build_dir will not any ELF builds
in it so will error out.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
This is usually used only when doing size calculation, but now it is
being used for extracting symbols from the ELF for testing purposes and
some issues arise with multiple ELF files found.
Simplify the code a bit to make it easy to maintain a lists of things to
exclude.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The DeviceHandler class method monitor_serial() has time-of-check
to time-of-use (TOCTOU) race condition possible on its serial port
which might be closed and its file descriptor cleared in between
of isOpen() and is_waiting status checks.
The issue is alleviated with controlled exception handling.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Fixes an issue when DeviceHandler awaited for a suitable DUT infinitely.
It was possible if the device map has no devices with required platform,
or no devices with fixture needed for the test case, or devices without
serial connection. A trivial case is a typo in platform name.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Invoking `west sign` in `west build` accelerates twister because `west
build` is run in parallel, see rationale in superseded and very
different (CMake-based) PR #52942.
To maximize backwards compatibility:
- `west sign` is optional in `west build`
- `west flash` will sign (again) if any rimage --option is passed
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Moving `west sign` from `west flash` to `west build` for rimage has
multiple advantages (including a bit more consistency with
imgtool). However it makes `west build` fail when rimage is missing.
To avoid forcing every CI and developer who never used it before to
install rimage, make signing optional when passing new `west sign`
option --if-tool-available. A clear warning is printed.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Make RIMAGE_SIGN_KEY a CMake CACHE variable so `west sign` can find it
and use it as a default value.
Fixes https://github.com/thesofproject/sof/issues/6917
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Reduce duplication, no functional change except for a shorter log
statement with slightly less information.
This is required by the next commits.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The --tool parameter is not required anymore thanks a [sign] entry in
west config like this one:
```
[sign]
tool = imgtool
```
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
For ztest twister would parse the symbol information that was
generated as part of the build (zephyr.symbols). However the format
of the zephyr.symbols files is highly dependant on the toolchain.
Move to using pyelf to parse the symbol information directly from
zephyr.elf instead so that this works regardless of toolchain.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
On native platforms we typically have CONFIG_BUILD_OUTPUT_EXE set so
we end up with both zephyr.elf and zephyr.exe. This would cause a
call to get_elf_file() to fail. There isn't any reason to error out
since zephyr.elf and zephyr.exe should be identical. So allow it
if the platform type is native.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
Use explicit flash command execution timeout at DeviceHandler
instead of the hardcoded value of 60 sec.
When a HW platform executes test cases right after the flash command,
the test case remaining timeout is affected by how much time the flash
operation consumes. Some simulation platforms need to spend significant
amount of time on each 'flash' cycle, usually adding the same delay on
each test case.
This improvement adds two new command line options and device map fields:
--device-flash-timeout - for the flash operation timeout
('flash-timeout' device map field).
--device-flash-with-test - to indicate that the platform flash
command also runs a test case, so the overall timeout should be
calculated as a sum of the flash timeout and the current test case
timeout to receive all console output from the platform
('flash-with-test' device map field).
The device map field values override command line values for the
particular platform where configured.
Default behavior is backward compatible: flash operation fixed timeout
is 60 sec. not including the test case timeout.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
An explicit import of edtlib is not required when using
pickle.load() and creates a duplicate module object.
Local testing shows that pickle.load() throws the ModuleNotFoundError if
the sys.path cannot find the edtlib or associated modules.
Signed-off-by: Keith Short <keithshort@google.com>
An explicit import of edtlib is not required when using
pickle.load() and creates a duplicate module object.
Retrieve the correct module object directly from the pickle file
using inspect.getmodule().
Signed-off-by: Keith Short <keithshort@google.com>
An explicit import of edtlib is not required when using
pickle.load() and creates a duplicate module object.
Also eliminate the check for the EDTError, as this exception cannot be
raised by pickle.load().
Signed-off-by: Keith Short <keithshort@google.com>
An explicit import of edtlib is not required when using
pickle.load() and creates a duplicate module object.
Signed-off-by: Keith Short <keithshort@google.com>
This refactors the script to introduce a SectionKind enum that
represents each of the kinds of sections handled by this system (text,
data, rodata or bss), using that to improve the code structure by
reducing the use of strings in favor of indicating the use of values by
their types.
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
When using code_data_relocation the script identifies sections that
should be relocated, but cannot guarantee that section names are unique
across all linked files. If a section name is not unique then matching
all sections with that name across all input files will relocate more
data than intended.
As a simple example, if both file1 and file2 contain .rodata.strings
sections, then if gen_relocate_app inspects only file1 it will generate
a linker script fragment `*(.rodata.strings)` that matches both object
files.
This commit changes gen_relocate_app to make the linker match on object
files as well (`*file1.o(.rodata.strings)`) to ensure unwanted sections
don't get relocated.
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Rather than having to add 'armclang' to every <BOARD>.yaml, just list
it as a generally supported toolchain if the architecture is 'arm'.
Signed-off-by: Kumar Gala <kumar.gala@intel.com>
Add an escape hatch so users can insert a customizable delay
between asking the board to reboot into bootloader mode and
trying to program the new image. This lets people account for
OS-specific enumeration time done after the board resets.
Fixes: #56540
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
When a test start, mark it as such, if we do not get any results due to
a timeout, it will be finally marked as failed. Previously such tests
causing a freeze were marked as blocked (or not run), which is not
exactly right.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Skips due to overflows on integration_platforms during integretion
mode should be treated as errors.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
`self.instances[filtered_instance.name]` and `filtered_instance`
are already referancing the same object.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
If canonical zephyr base is already ended by trailing slash, then it
should not be added redundantly.
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
In some cases built binary files have different names than "zephyr.hex"
files, and for those cases, information about names of file to keep
should be taken from runners.yaml file.
Moreover if in runners.yaml file exist absolute files paths to binary
files, then they should be changed to relative ones.
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
This moves CONFIG_LLVM_USE_LD into cmake/toolchain/llvm as this
is a toolchain kconfig. Also make it a choice to allow the use
of LLVM's lld as linker.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Adds a Kconfig for MCUboot which is used in the documentation to
the CI Kconfig check allow list.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Uses linux style path output instead of windows style to prevent
issues with cmake assuming the slashes are for escape code
sequences.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Both the requests and pyserial Python packages are used by west commands
(west fetch and west build -b esp* respectively) so move them to the
requirements-base.txt file.
Fixes#56215.
Fixes#56224.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Writing '-S foo' is a convenience shorthand for adding snippets at
CMake time without having to add '-- -DSNIPPET=foo' to the west build
command line. It is worth adding a new one-letter command line option
because snippets are anticipated to be a very commonly used feature.
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
This key may appear in a module.yml's 'settings' map, and works
analogously to the already existing 'board_root', 'dts_root', etc.
keys: if set, its value is interpreted as a directory that will be
added to SNIPPET ROOT.
For example, if a module.yml contains:
settings:
snippet_root: foo
Then 'foo', relative to the module's base directory, will be added to
SNIPPET_ROOT. This then means that any snippets in foo/snippets will
be discovered by the build system.
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
Add a new script, snippets.py, which is responsible for searching
SNIPPET_ROOT for snippet definitions, validating them, and informing
the build system about what needs doing as a result.
Use this script in snippets.cmake to:
- validate any discovered snippet.yml files
- error out on undefined snippets
- add a 'snippets' build system target that prints all snippet
names (analogous to 'boards' and 'shields' targets)
- handle any specific build system settings properly,
by include()-ing a file it generates
With this patch, you can define or extend a snippet in a snippet.yml
file anywhere underneath a directory in SNIPPET_ROOT. The snippet.yml
file format has a schema whose initial definition is in a new file,
snippet-schema.yml.
This initial snippet.yml file format supports adding .overlay and
.conf files, like this:
name: foo
append:
DTC_OVERLAY_FILE: foo.overlay
OVERLAY_CONFIG: foo.conf
boards:
myboard:
append:
DTC_OVERLAY_FILE: myboard.overlay
OVERLAY_CONFIG: myboard.conf
/my-regular-expression-over-board-names/:
append:
DTC_OVERLAY_FILE: myregexp.overlay
OVERLAY_CONFIG: myregexp.conf
(Note that since the snippet feature is intended to be extensible, the
same snippet name may appear in multiple files throughout any
directory in SNIPPET_ROOT, with each addition augmenting prior ones.)
This initial syntax aligns with the following snippet design goals:
- extensible: you can add board-specific support for an existing
snippet in another module
- able to combine multiple types of configuration: we can now apply a
.overlay and .conf at the same time
- specializable: this allows you to define settings that only apply
to a selectable set of boards (including with regular expression
support for matching against multiple similar boards that follow
a naming convention)
- DRY: you can use regular expressions to apply the same snippet
settings to multiple boards like this: /(board1|board2|...)/
This patch is not trying to design and implement everything up front.
Additional features can and will be added to the snippet.yml format
over time; using YAML as a format allows us to make
backwards-compatible extensions as needed.
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
This automates much of the drudgery of enumerating changes to
devicetree bindings at release time. Some customizations and
release-specific tweaks to the script will probably always be needed,
but it's a good starting point.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Currently in binary handler and qemu handler we have status `failed`
in case of test timeout, but in device handler we have status `error`
This not only adds inconsistency between handlers, but also prevents
us from usage test retry functionality for the runs on HW.
Fix timeout status by changing it to `failed` instead of `error`.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
WebP images are smaller for similar resolutions and quality while being
compatible with web browsers and other image processing tools.
For higher resolution images, be sure to limit the display size to make
the rendered pages look reasonable.
This was approved by Benjamin Cabé (@kartben) in this discussion thread:
https://github.com/zephyrproject-rtos/zephyr/pull/55488#issuecomment-1461792751
Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
the options --verify and --verify-only where only used when flashing elf
files and were ignored for flashing hex files for example when using
openocd runner.
The command to verify the image is now dependant on the presence of
--verify or --verify-only, and the load command is not executed if
--verify-only is provided.
Signed-off-by: Nicolas VINCENT <nicolas.vincent@vossloh.com>
Add hostlink-awareness to mdb-hw runner. The mdb-nsim and arc-nsim
runners (as well as cmake scripting for nSIM boards) doesn't require
any changes.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
I was using a source file provided by TDK for a sensor driver
and the file was (originally) not encoded as UTF-8. When the read()
function was called, the build would fail but I had no idea why.
This change wrapps the 'read()' call and prints the error with
the file name as context.
Signed-off-by: Yuval Peress <peress@google.com>