There are use cases where --use-elf is given and the hex file does not
exist. Handle them.
Fixes: #31944
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Commit 3204554841 (" scripts: runners: error on missing
non-elf outputs") created the possibility of None bin_file and
hex_file attributes in the RunnerConfig without updating pyocd
appropriately. Fix that.
Fixes: #31921
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
As of today we unconditionally call 'stty sane' that leads to
lots of error messages
'stty: standard input: Inappropriate ioctl for device'
when output isn't connected to tty (for example when we launch
twister in Jenkins)
Fix that by check if output is really connected to tty before
'stty sane' call.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
We can't trust that a python file is executable on Windows, regardless
of what the mode bits say.
When we find that imgtool is a .py file, run 'python imgtool.py'
instead of 'imgtool.py' on that platform.
Fixes: #31876
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Have it return a list, which is prepended to the final arguments list
passed to subprocess. No behavioral changes expected, but this enables
making it contain multiple strings instead of just one.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The RunnerConfig class stores the locations of the Zephyr output files
in various formats (elf, hex, bin). A longstanding issue with the
representation is that these might not exist if the corresponding
Kconfig options are not set. For example, if
CONFIG_BUILD_OUTPUT_BIN=n, there is no .bin file.
Change this so the type system knows these are Optional[str], not str.
Fix the runners that use non-ELF outputs so they check for the
existence of the relevant file before using it, mostly using a new
ZephyrBinaryRunner.ensure_output helper.
I'm not going to bother with checking for the ELF file itself; that's
always there as far as I can tell.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Mark the option BT_FIXED_PASSKEY as an insecure option.
During Legacy pairing the passkey is used as encryption key, and
brute-forcing this is easy.
During LE Secure Connections the passkey is checked one bit at a time,
so when it is fixed the passkey can be deduced with series of pairing
attempts.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit lets the Kconfig compliance check run from top of current
git repo instead of only executing inside ZEPHYR_BASE.
This extends the usability of the Kconfig compliance check.
Together with this possibility, a KconfigBasic mode has been added which
will execute the same verification for symbols in the Kconfig tree but
will not check for undefined symbols outside Kconfig.
This is needed as running Kconfig undef check outside the tree in
non-Zephyr repos might pickup `CONFIG_` named symbols in other code.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Change the sorting of test instances if --device-testing is used
within subsets. Test instances are sored depending on the context.
For CI runs the execution order is: "platform1-testA, platform1-testB,
..., platform1-testZ, platform2-testA, ...". For hardware tests, were
multiple platforms can run the tests in parallel, it is more efficient
to run in the order: "platform1-testA, platform2-testA, ...,
platform1-testB, platform2-testB, ..."
This can significantly reduce the tests execution time
for setups with multiple different platforms connected.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Changes to .buildkite/daily.yml don't make any sense to run twister
for since issues will only be seen when the daily builds run so add
it to the twister_ignore.txt list.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
West has introduced support for group tags in:
https://github.com/zephyrproject-rtos/west/pull/454
This means that manifest files might start containing groups.
Zephyr itself only requires west>=0.7.2 where groups are not supported
but other Zephyr based projects might start using the group feature.
When using a west version with group support, then only active projects
will be processed as Zephyr modules.
West versions without group support will consider all projects active.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The _save_old() to return early if <filename> is not file (or symlink
to a file).
This is simplest alternative to avoid attempt to rename /dev/null
(which could succeed).
This also keeps fifos (perhaps nonexistent potential usage but
this is nicer).
If <filename> were directory or socket, after shutil.copyfile(),
writing to the file (by caller, _write_config()), would fail.
Fixes#31362
Co-authored-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
Signed-off-by: Tomi Ollila <tomi.ollila@iki.fi>
If we do not have the configuration path via cmake, then check if the
configuration path was provided on the command line and use it instead,
if both fail, bail out and die.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
rimage signing tool requires the path to the configuration directory.
This can be fetched using cmake cache if we are building with a module
that has rimage integrated like the sof module, however, we should be
able to sign images that were built standalone and without SOF, so
support this new option to provide the location of the configuration
files for the tool.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
While using the encoded path to a device tree node guarantees a unique
identifier for the corresponding device there is a limit on the number
of characters of that name that can be captured when looking up a
device by name from user mode, and the path can exceed that limit.
Synthesize a unique name from the node dependency ordinal instead, and
update the gen_defines script to record the name associated with the
full path in the extern declaration.
Add a build-time check that no device is created with a name that
violates the user mode requirement.
Also update the network device DTS helper functions to use the same
inference for dev_name and label that the real one does, since they
bypass the real one.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Calling cmake/pristine.cmake now requires SOURCE_DIR and BINARY_DIR as
arguments.
This ensures that pristine.cmake can evaluate if pristine is requested
on in-source builds, and bail out in such case with an error message.
All uses of `pristine.cmake` has been updated to use the new arguments.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This removes the z_ prefix those (functions, enums, etc.) that
are being used outside the coredump subsys. This aligns better
with the naming convention.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
get_mem_region() may return None for a non-existent memory region
so we need to check first before looking at its properties.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Following the idiom used for system calls, add script support to read
the initial application binary to identify which devices are defined,
and to use their offset in the device array as their unique handle
rather than the externally-defined ordinal from devicetree. The
device dependency arrays are updated to use these handles.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The introduction of Zephyr module glue code in the Zephyr repository
introduces a Kconfig variable in the form of:
`config ZEPHYR_<MODULE_NAME>_MODULE`.
All Kconfig variables go into `autoconf.h`, therefore it is necessary
to sanitize the Kconfig variable, so that it does not contain special
characters. To ensure consistent variable name, then the module name
will be sanitized in all variable use in both Kconfig and CMake.
The sanitization is done be replacing all special characters with an
underscore, `_`.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Fixes: #28847
This commit fixes two places that was causing gen_relocate_app to fail
in windows.
gen_relocate_app.py now splits only on first `:` in
`<MEM_REGION>:<file>`.
Windows contains `:` in path, thus only first `:` is valid for splitting
mem region and file path.
Second part of the issue is fixed in CMake where `'` was used for
quoting of command arguments.
This causes a file not found on Windows because the final `'` would be
treated as part of the filename. Similar the first `'` would be treated
as path of the mem region name.
This is fixed by using `"` for quoting, which works correctly on all
platforms.
gen_relocate_app.py:403: UserWarning: File: .../kernel/sem.c' Not found
Note the stray `'` ^^^
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Fixes: #31436
This fix adds ZEPHYR_<MODULE_NAME>_KCONFIG variable to compliance check.
This ensures that Zephyr Kconfig glue code is included in the
compliance check, and thus remove the issue reported in #31436.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The folder name of a Zephyr module is also used as its module name
when integrating it into the build system.
This means that a Zephyr module, BAR, located in:
<workspace>/modules/foo
|--- zephyr
|--- CMakeLists.txt
|--- Kconfig
will be referred to as FOO in the build system, that is:
ZEPHYR_FOO_MODULE_DIR==<workspace>/modules/foo
ZEPHYR_FOO_CMAKE_DIR==<workspace>/modules/foo/zephyr
The `name` field allows the module to specify its module name,
independent of its location like:
<workspace>/modules/foo/zephyr/module.yml
```
name: bar
build:
cmake: zephyr
```
will instead be referred to as BAR in the build system, that is:
ZEPHYR_BAR_MODULE_DIR==<workspace>/modules/foo
ZEPHYR_BAR_CMAKE_DIR==<workspace>/modules/foo/zephyr
This allows for greater flexibility of relocating Zephyr modules in
other folders and at the same time be guaranteed that other modules
depending on `ZEPHYR_BAR_MODULE_DIR` is still working.
If `name` field is not specified in `module.yml`, then the existing
behavior of using the folder name will be used.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit introduces MODULE_EXT_ROOT which allows CMake and Kconfig
glue code to be placed outside of the Zephyr module repository.
This allows for placing glue code in Zephyr, but also allows users to
specify custom MODULE_EXT_ROOTs for glue code using either
`-DMODULE_EXT_ROOT` or `zephyr/module.yml` with
`build:settings:module_ext_root` settings.
MODULE_EXT_ROOT' is a list of directories, similar to other roots such
as BOARD_ROOT, DTS_ROOT, etc.
The Zephyr repo folder ${ZEPHYR_BASE} is always to the MODULE_EXT_ROOT
list as lowest priority.
For each MODULE_EXT_ROOT, the file
`<module_ext_root>/modules/modules.cmake` will be processed.
In Zephyr repo, the folder `modules/<module>/` contains CMakeLists.txt
and Kconfig glue code for the Zephyr module.
A Zephyr module can specify that CMakeLists.txt and Kconfig glue code is
placed in an external module root by specifying:
```
build:
cmake-ext: True
kconfig-ext: True
```
It is still possible to place the CMakeLists.txt and Kconfig files
directly in the Zephyr module using the existing:
```
build:
cmake: <path>
kconfig: <file>
```.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This is always the same, so we might as well just remove it for now and
save some space since it is the default anyways. Type can be added later
when it provides more value.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Before we had a bindings index in the documentation, the generated
header file was (somewhat unfortunately) often our best reference for
what a particular binding or property within a binding ends up doing,
so it made good sense to put the description in the generated file.
Now that we have HTML documentation that's a bit more digestible than
the generated file, though, we can just point users at that. Do that
and remove the inline description from the generated file.
This makes it possible to put C-style multiline comments in the
descriptions themselves, which will be done in subsequent patches.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This macro returns a node's full path, given its node identifier.
The entire path to a node is useful information for the user which can
be added to build-time error messages.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Remove the boards and shields lists from the 'usage' target output.
That might have been readable at some point long ago in Zephyr's
history, when only a few boards were available, but right now it's
obscuring the high level targets we really want 'usage' to print.
Instead, add 'boards' and 'shields' targets which the user can run to
get those lists, and reference them from the 'usage' output. This
makes 'usage' squintable again. We use the new list_boards.py script
from the 'boards' target.
Reference the 'help' target from 'usage' as well, and drop the
recommendation that people run '--target help' from the 'west build
--help' output for the 'west build --target' option. The canonical
place to look is 'usage' now.
Use the new list_boards.py code from 'west boards' as well, which
allows us to add the board's directory as a format string key, in
addition to its name and architecture.
Keep west-completion.bash up to date. While doing that, I noticed that
a bunch of references to this file refer to a stale location, so fix
those too.
Finally, the 'usage' output is what we print for a failed board or
shield lookup, so that needs to be updated also. Handle that by
invoking boards.cmake and a new shields.cmake in CMake script mode to
print the relevant output.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This script is essentially a Python rewrite of the CMake code we're
using to print boards in cmake/boards.cmake, plus some extra features.
Having this in Python will simplify some later adjustments to our
'usage' build system target in ways that will make its output easier
to read, while simultaneously making 'west boards' more useful.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Generate a header (device_extern.h) that handles extern of possible
device structs that would come from devicetree. This removes the need
for DEVICE_DT_DECLARE and DEVICE_DT_INST_DECLARE which we can remove.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Logic for scope of platforms to be checked was changed and this options
now only applies to limited scope, fix this and reset scope when a
testcase declares it needs to build on available platforms.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
junitparser version 2 is incompatible with check_compliance.py, it fails
like this:
File "./scripts/ci/check_compliance.py", line 295, in parse_kconfig
self.skip("Not a Zephyr tree (ZEPHYR_BASE unset)")
File "./scripts/ci/check_compliance.py", line 141, in skip
self.case.result = Skipped(msg, "skipped")
File "/usr/local/lib/python3.9/site-packages/junitparser/junitparser.py"
line 682, in result
for entry in value:
TypeError: 'Skipped' object is not iterable
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Likely an accident when commit 288ae28c13 moved the script to the main
repo. Stayed unnoticed because this handler rarely ever runs.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
rimage dropped its "-m" parameter and switched over to using "-c"
for a configuration file, including a target name.
Add support for extended manifest for all cAVS versions.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The commit
531fe89e80 (sanitycheck: use multiprcoessing instead of threads)
introduce regression for ARC nsim_hs_smp platform.
The regression is that verification on nsim_hs_smp hangs. That
happens because now we don't call try_kill_process_by_pid()
in the 'with' scope of the 'subprocess.Popen' when we spawning
BinaryHandler thread. Previously it was called via `terminate`
method of `BinaryHandler` but it was changed in 531fe89e80.
So if we can't terminate the simulator in a normal way
(which is expected for 'mdb' which is used for nsim_hs_smp
simulation) we will hang forever - we will never return from
'with' scope of the 'subprocess.Popen' as we are waiting for
process termination but the try_kill_process_by_pid() is located
latter and we never reach it.
Fix that.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
There are some drivers in the tree that support devices on multiple
different buses, although so far this has not been represented in
device tree using the bus concept. In order to convert these drivers &
bindings to refer to a formal bus in device tree we need to be able to
match bindings which lack an explicit "on-bus: ..." value against any
parent bus. This will also be needed for any external bindings, since
those would not be aware of on-bus (as it's a Zephyhr-specific
extension).
The two drivers I'm particularly targeting is the ns16550 UART driver
(drivers/serial/uart_ns16550.c) and the DW I2C driver
(drivers/i2c/i2c_dw.c). They both support devices with a fixed MMIO
address as well as devices connected and discovered over PCIe. The
only issue is that instead of encoding the bus information the proper
DT way these bindings use a special "pcie" property in the DT node
entries to indicate whether the node is on the PCIe bus or not.
Being able to convert the above two drivers to use the DT bus concept
allow the removal of "hacks" like this:
if DT_INST_PROP(0, pcie) || \
DT_INST_PROP(1, pcie) || \
DT_INST_PROP(2, pcie) || \
DT_INST_PROP(3, pcie)
to the more intuitive:
if DT_ANY_INST_ON_BUS_STATUS_OKAY(pcie)
This also has the benefit that the driver doesn't need to make any
arbitrary assumptions of how many matching devices there may be but
works for any number of matches. This is already a problem now since
e.g. the ns16550 driver assumes a maximum of 4 nodes, whereas
dts/x86/elkhart_lake.dtsi defines up to 9 different ns16550 nodes.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
It's fine to flash an image with UICR data as long as the user has
given any of the --erase, --recover, or --force options. Silence the
error correctly.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
With the earlier version of Git, git describe command will
use the default 7 hexadecimal digits as the abbreviated
object name. But currently the Linux kernel project needs
11 to 12 hexdigits to stay unique.So it's necessary to add
--abbrev=12 to ensure twister always generate the same tags.
In https://testing.zephyrproject.org/daily_tests/versions.json,
all tags have 10 hexadecimal digits.
Signed-off-by: Jingru Wang <jingru@synopsys.com>
Require Sphinx<3.4.0 to avoid the issue described in:
https://github.com/sphinx-doc/sphinx/issues/8603
This requirement can be relaxed once a new sphinx-rtd-theme is
released.
Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
As of today we check for gdb presence in 'do_create' method and
raise an exception in case of gdb is missing. That makes nsim
runner unusable without gdb even for the commands which don't use
it (like 'flash' command).
Fix that.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
The DTS language permits zeroing out phandles in a phandle array to
say "there's nothing at this index", and dtlib manages that correctly,
but edtlib and gen_defines.py aren't equipped to do so.
Fix this by allowing None elements in the lists of ControllerAndData
values returned by edtlib for such properties.
Handle that in gen_defines.py by setting the generated
DT_N_<node>_P_<prop>_IDX_<i>_EXISTS macro to 0 in such cases.
The DT_N_<node>_P_<prop>_LEN macro still accounts for the entire
length of the phandle-array; it's just that some indexes may be
missing data.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Do not store shared memory variables into yaml and check for validity of
imported hardware map before attempting to modify it.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add exception check for psutil when running CI with nSIM
Sometimes nSIM random failures may turn nsimdrv process into zombie
process, parent process can't terminate it by calling proc.wait(0.1)
and kill command doesn't apply to zombie process
Signed-off-by: Jingru Wang <jingru@synopsys.com>
These are likely enough defined by mistake to emit a warning for.
Adjust tests to match, tweaking the test_warnings() setup: now that
we've got several test cases, it's a bit cleaner not to have to
copy/paste the ('edtlib', WARNING, ...) part of every expected log
record tuple.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The edtlib strategy for emitting warnings is to print directly to
standard error. This in turn requires hacks to drop stored references
to stderr in various _warn_file attributes so the EDT objects can be
pickled.
In general, I think it's not really appropriate for library modules
like edtlib to be printing to stderr directly. The user should be able
to configure logging for general utility data munging modules like
this as they please, and not just deciding what file to print to.
Move this around so the standard logging module is used instead. We
can preserve backwards compatibility in gen_defines by customizing the
'edtlib' logging module behavior so it prints the exact same thing it
always has.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Whenever a devicetree binding defines a string property whose
enumerated values are all tokenizable, generate C macros for each
property value that are the corresponding tokens.
Note that "token" is distinct from "identifier": both 'foo' and '123'
are valid tokens, but only 'foo' is a valid identifier. We permit some
strings which are not valid identifiers in anticipation that the
generalization may be useful, e.g. when defining macros that paste the
token onto a prefix that makes the whole thing an identifier.
Fixes: #21273
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add enum_tokenizable and enum_upper_tokenizable to PropertySpec. These
allow a PropertySpec to declare that it both has an enumeration of
values and all of them are strings which are "tokenizable". Don't
bother extending Property with these; the user can access the
information through Property.spec now, so the extra delegation is
unnecessary.
See the docstrings for details on what "tokenizable" means. The basic
idea is that we should be able to use the DT binding's enum values as
C 'enum' enumerators in a "reasonable way".
Add val_as_token to Property. This produces a canonical token for the
property value.
Add tests for this feature in particular and property enumerations in
general.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
In the 'normal' case of a property whose definition is taken from a
binding YAML file, a fair number (three at present) of the attributes
available on Property objects are directly taken from the
corresponding PropertySpec object.
Refactor the internals of how a Property gets initialized so that it
has a direct reference to its PropertySpec, and make those attributes
properties which just delegate to the PropertySpec (which in turn just
delegate to the binding). Additionally, expose the PropertySpec
directly.
This will make it easier to extend the Property class with additional
attributes that normally come from the PropertySpec without having to
touch all the locations where Property.__init__ is called.
In the case of the 'default' properties, we handle this by dummying
out some PropertySpec objects. These dummy PropertySpecs in turn
require a dummy Binding.
This change has the advantage that it improves the degree to which
these defaults are checked, e.g. it makes sure that 'status' is one of
the permitted values.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Now we create plaform reports for each enabled platform, this is time
consuming, especially if you are not using those reports for anything.
Make this an option and enable only if the generated reports are going
to be used.
Individual reports can also be generated from the JSON file if needed.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Runner implementations are only allowed to unconditionally import
modules in the python standard library. They are not allowed to import
anything that comes from pip or other third party sources unless they
catch the ImportError and gracefully do nothing.
Fix the imports in the mdb runner accordingly, sorting the imports
into sections to make it clearer what's stdlib, what's runners, and
what's third party while we're here.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add a simpel wrapper script called 'sanitycheck' to be removed after
Zephyr 2.5.
This script has a warning and a 5 sec delay to get the attention of the
caller.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move the "module" classes used by sanitycheck into a new location under
pylib, where we can have other python libraries reside instead of having
them all over the place.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move the CSV files with release related data out of the python directory
into scripts/releases, which is more appropriate.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move yaml schemas into one single location. We have quite a few schema
used across the tree, one common place will make them easier to find and
reference.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Rework the runner to improve various issues.
Every board.cmake file for an nRF SoC target is repeating boilerplate
needed for the nrfjprog runner's --nrf-family argument. The
information we need to decide the --nrf-family is already available in
Kconfig, so just get it from there instead. Keep the --nrf-family
argument around for compatibility, though.
This cuts boilerplate burden for board maintainers.
We also need to revisit how this runner handles recovery to fix it
in nRF53 and keep things consistent everywhere else.
To cleanly handle additional readback protection features in nRF53,
add a --recover option that does an 'nrfjprog --recover' before
flashing. Keep the behavior consistent across SoCs by supporting it on
those too. Because this is expected to be a bit tricky for users to
understand, check if a --recover is needed if the 'nrfjprog --program'
fails because of protection, and tell the user how to fix it.
Finally, instead of performing a separate 'nrfjprog --eraseall', just
give --chiperase to 'nrfjprog --program' process's arguments instead
of --sectorerase. This is cleaner, resulting in fewer subprocesses and
avoiding an extra chip reset.
Having a separate 'west flash --recover' option doubles the number of
test cases if we want to keep exhaustively enumerating them. That
doesn't feel worthwhile, so update the test cases by picking a
representative subset of the possibilities. Each test now has enough
state that it's worth wrapping it up in a named tuple for readability.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
script was failing during a run with -f, the status key was not in the
dictionary and the check would cause an exception. Fix that using
.get().
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The current bossac runner have multiple entries for flash offset
parameter. Remove offset parameter from command line and rework
all infraestructure to get offset from device tree. Add proper
verification routines to validate configurations on board and
device tree entries to fix SDK compatibility checks.
Fixes#29312.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Add is_extended_samba_protocol method to verify if board is using SAM-BA
extended protocol (Arduino/Adafruit UF2). It allows enforce serial line
speed to 1200 baud automatically. This avoid add entries on board.cmake
file.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Add a dt_chosen_enabled(chosen) filter function to sanitycheck. The
function returns true if the devicetree /chosen node contains 'chosen'
and the referenced node is enabled.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
mdb binary starts several subproceses and one of them is cld process.
In runners/mdb.py we record process id of cld on each mdb launch
to terminate simulator correctly later. However we can finish test
and terminate mdb before the cld process was found (so cld won't
be terminated correctly by sanitycheck infrastructure). It may happen
if we launch mdb on fast host machine.
That leads to several issues. First of all we get ugly error in
sanitycheck output:
------------------------>8--------------------------------
FileNotFoundError: [Errno 2] No such file or directory: '/xxxx/mdb.pid'
------------------------>8--------------------------------
Secondly (and it's more important) we terminate simulator incorrectly.
We terminate mdb leaving cld process alive, running and consuming one
cpu core permanently (until we kill it manually)
So, let's increase granularity of lookups and don't wait extra 0.5
seconds before the first lookup.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Add a new option that will enable treating RAM/SRAM overflows as errors
instead of skipping them, which is the default.
Fixes#27583
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We were setting all devices as connected, now do that based on serial
availability.
Rename internal variables and make them shorter:
connected_hardware -> duts
ConnectedDevice = DUT
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
use a loop instead of all() to make the test easier to debug.
remove the default platform test, as this is now being filtered
differently in the code.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The available key is a runtime variable, it does not need to be in the
hardware map. Make it optional to keep the file format compatible for
now.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Try and keep terminilogy consistent, a test application with multiple
test cases is now a 'test suite'.
Also fix accounting when retrying failed.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
If we provide arch on command line, do not check for all platforms of
architectures not specified.
Fixes#30099
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Show in debug mode what files are being written. In some cases this
takes a while and it is good to see what is going on.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
With python threading we have multiple issues with performance and
leakage. Use the python Process and implement locking using
multiprocessing library. This change improves performance and fixes
various issues with logging, concurrency and reliability of the output.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Running sanitycheck for multiple platforms but only request coverage
on a single platform fails, example:
sanitycheck --enable-coverage --coverage-platform nrf52840dk_nrf52840
-p nrf52840dk_nrf52840 -p nrf52dk_nrf52832 -T <sample>
This happens because `testcase_extra.conf` will only be created if the
current platform is included in the list of coverage platforms.
The error in the example above that would be seen is:
File not found:
<...>/sanitycheck/testcase_extra.conf
This commit now uses the existence of `testcase_extra.conf` which is
created in the method `create_overlay()` before appending
the conf file to the list of overlay files.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Get list of connected hardware and filter tests to only be run on
connected hardware in cases where no platform was specified when runn
the tests. If the platform does not exist in the hardware map, just
skip it.
Fixes#29166
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We made a similar change for the nightly builds, but the PR builds
invoke run_ci.sh, so we need the same change here.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Generating JSON report format without changing
the existing report formats.
JSON report is divided into three sections
environment tests are run
test cases basic info and discarded tests
after applying filters
Added the complete debug log to the report
Fixes: #26443
Signed-off-by: Spoorthy Priya Yerabolu <spoorthy.priya.yerabolu@intel.com>
Move actual test cases from the run-sample-tests.sh script to
the network samples directory that are supported by Docker based
testing. Each network sample directory that supports Docker testing,
will contain docker-test.sh script that is sourced by the runner
script. The docker-test.sh script will run the test as needed and
then return return value to the runner script.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
I keep seeing people miss the --context option in the "west flash
--help" output.
This option is very important for understanding the runner-specific
options and state, and missing it means people get confused about what
west flash, debug, etc. can do and are doing.
Try to avoid this problem by adding a big fat banner about the
omission of runner-specific options in the main help output, and
provide more hints about how to use --context.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
When running sanitycheck without any platform filters (-p option), we
take the default platforms and run on those only. When the -G options is
used for integration testing, the platforms listed as integration
platforms are not being added on top of default platforms.
This change adds integration platforms to the list an treats
integration_platforms as a positive filter, so that
integration_platforms are always being considered.
Fixes#29829
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add a way to run dumb_http_server_mt sample application against
HTTP get script (using curl) running in Docker.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Allow gPTP sample to be run via run-sample-tests.sh script.
This makes it possible to do simple smoke testing and verify that
gPTP stack is not broken.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We have a use case for checking the results of a DT_PROP_HAS_IDX()
call with COND_CODE_1(). That won't work because its expansion is an
integer comparison; COND_CODE_1() expects a literal 1 or 0.
Adjust the macro implementation so it expands to a literal 1 or 0.
Make this work even when the index argument needs an expansion while
we're at it.
Fixes: #29833
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
TSIM3 is a LEON processor and system simulator.
This commit allows using TSIM sanitycheck and the make run target.
TSIM parameters can be further specified in the board configuration
using TSIM and TSIM_SYS.
Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
Fixes: #28462
This commit allows shields to be defined in other BOARD_ROOTs, either
using `-DBOARD_ROOT=<path>` or a Zephyr module defined BOARD_ROOT.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Add missing infrastructure for simulation run on mdb-nsim.
When the nSIM via mdb simulation support was added to Zephyr
scripts the handler call was lost. So nSIM via mdb simulation
was broken from the beginning.
Fix that bu adding missing handler call fro mdb-nsim.
Note that we use BinaryHandler which call west flash. It's
required in case of nSIM via mdb as we create mdb.pid file with
mdb-nsim runner help.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
ARC nSIM boards (starting with nsim_ prefix) allow to run
tests in simulator (nSIM). However with proper west runner
the tests can be run on real HW (FPGA based).
So check device_testing flag firstly and rollback to nSIM
simulation run in case of device_testing is not set.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Record MDB's CLD process pid to file so this process can be
terminated by sanitycheck infrastructure.
Update mdb runners test to be able to handle changes.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
mdb runner is quite special as it can be used to run Zephyr on
both simulator (nSIM) and real hardware.
However it is really misleading as same command (west flash)
will run Zephyr in simulation for one board and try to run it
on HW for another board. Things are getting worse for boards
supporting both runs in simulation and on real hardware.
Let's split mdb runner for mdb-hw (for runs on HW) and mdb-nsim
(for runs in simulation) runners.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
The zeth interface was left hanging around when the test
finished but we can remove it here as it is not needed.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The current stty command uses a hard code value of 1200. This is not
compliant with SAM-BA specs and may create compatibility problems. Add
an optional speed argument with 115200 as default value following SAM-BA
specifications. All boards that needs a different speed should define
board_runner_args(bossac "--speed=<value>") with value as required
speed.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Introduce TagoIO IoT Cloud HTTP post client example. This explorer
Zephyr network resources to demonstrate an end to end application.
The TagoIO allows that any user can test on a easy way Ethernet, WIFI
and Modem (PPP) with BSD sockets. The example provides overlays to
configure WIFI and Modem.
The application consists an a pseudo temperature sensor that sends
periodically data to TagoIO IoT Cloud platform. The data can be
visualized on a web browser dashboard, cellphone or tablet. The
steps to configure TagoIO are described on the example documentation.
Special Variables:
- CONFIG_TAGOIO_DEVICE_TOKEN DEVID token generated by TagoIO
- CONFIG_TAGOIO_HTTP_WIFI_SSID SSID when using WIFI
- CONFIG_TAGOIO_HTTP_WIFI_PSK PASSWD when using WIFI
- CONFIG_MODEM_GSM_UART_NAME UART label when using MODEM
- CONFIG_MODEM_GSM_APN APN when using MODEM
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Fixes: #29758
Commit 7165b77a81 ("scripts: edtlib:
refactor for first class bindings") introduced a Binding class.
Its child_binding instance attribute has a compatible which can be
None. Adjust this behavior so the child Binding object has the same
compatible as the parent binding which ultimately has a compatible.
Without this, sanitycheck's expr_parser is doing some matching on
compatibles in child nodes that is producing unexpected results.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The child_binding object should default to having a path and
compatible that matches the parent's. Mark it as xfail because the
compatible part is failing.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The filters were updated to match the 3.3.0 generated text, so update
the sphinx requirement to exclude versions that use different text.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This is a convenience function for creating a bunch of Binding objects
from files in a directory.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
skips due to ram/rom overflow were captured as failures. Fix this and
count them correctly as skips.
Fixes#29412
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add date and if a commit should be considered for weekly testing.
This will still work with the old format.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add the ability to mark a property as 'deprecated' to get a warning that
it will be removed in the future.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Breathe>=4.23.0 brings in basic xrefitem rendering support and fixes
issues parsing anonymous struct/unions. This version also adds a config
knob for showing or hiding enumerator values, so set it to generate
documentation compatible with previous versions.
Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
This commit adds posibility to save zephyr version in the xml reports.
It adds 'properties' attribute to testsuite attribute. 'properties'
can contain multiple 'property' attributes. Zephyr version is added
as such 'property'.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
It's not clear why this error is here. The "formats" array seems to
be limited to "bin" and "hex" only, but every signing tool is going to
have its own idea of what format to emit and what ingredients need to
be used to do that.
In particular, rimage (used for the Intel Audio DSPs) doesn't use nor
generate zephyr.bin (it's very large), so it trips over this failure.
Just present the possibly-empty list of output formats to the Signer
object and let it make the decision about whether an empty formats
list is an error.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Avoids parsing the whole "before to now" commits after rebase.
Now, we just parse all commits since first commit of the branch
compared to master, each timer either at first push, forced push,
forced push after rebase.
Fixes#28509
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>