In order to make sure that the build works in folders that require a UTF
encoding, make sure that both CMake and the various Python scripts that
interact with each other on files use the same encoding, in this case
UTF-8.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
We don't use the DT_FLASH_AREA_*_LABEL defines today so lets mark them
deprecated until we actually need something.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This script is looking for a hyperspecific error (mismatched padding
when linking into two simultaneous output sections) that bit us once,
in an era where the linker scripts were less unified. We haven't seen
it crop up since, and multiple platforms have changed the way they do
this anyway.
It's needless complexity. Junk it.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
In a3bea8872b (PR #16352)
_bt_br_channels_area was added to the code but not the
sanitycheck sections whitelist => Add it
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
In c20ff1150f
and 5f19c8160a
(PR #16897)
_bt_settings_area was replaced with _settings_handlers_area
Update sanitycheck sections whitelist accordingly
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The code to sanitize the generated font path by removing bindir
improperly stripped the first character of every argument when --bindir
was not provided, corrupting the command documentation when fonts are
generated manually. Only sanitize if --bindir was provided with
non-empty content.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
* Remove dead code that referenced 'generation' but didn't do anything
with it
* Replace looking at 'generation' with a simple check for property
starting with # (for things like #address-cells, etc) or ending in
-map (for things like gpio-map) to skip
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
uint8-array is the name for what the devicetree specification calls a
bytestring.
The original parsing code treated square brackets as equivalent to
quotes or angle brackets, failing to interpret elements as hex-encoded.
This was a bug, corrected in this patch by processing content as a
sequence of hex-encoded bytes with arbitrary whitespace.
The original generating code emitted the property as individual
elements. Replace that with generation of a single structure
initializer, which is more useful in cases where the length of a
property value may vary between nodes.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
For using alpha numeric property values in a devicetree node, we
need to match the values starts with a number. Current scenario will
return the value as a numeric literal if it starts with a number. This
will not work for a compatible like, "96b-ls-con" which is proposed in
issue #15598.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
sanitycheck --help mentions that west-flash requires device-testing
to be enabled (and indeed it does because DeviceHandler will never
be called where west_flash option is used. Let's generate an error
if west-flash is used w/o specifying device-testing.
Also cleanup help text which looks odd in both sanitycheck --help
and in the file itself.
Signed-off-by: Michael Scott <mike@foundries.io>
Several boards have multiple runners setup. We need a way to specify
which runner to use with sanitycheck. Introduce --west-runner option.
Signed-off-by: Michael Scott <mike@foundries.io>
We don't have any uses of this form of define so deprecate it for now.
If needed this should be DT_INST_<INSTANCE ID>_<COMPAT>_BUS_<BUS>.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Now that we've converted LED and SW to use DT_ prefix we can mark the
non-DT_ prefixed versions as deprecated.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Now that we've converted all _GPIO_ to _GPIOS_ we can mark the _GPIO_
form as deprecated (same for _PWM_ / _PWMS_).
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
A number of minor issues with the 'fixed-clock' support:
* Fix the #clock-cells to be 0
* Fix nxp_ke1xf.dtsi to set #clock-cells 0 and the clock reference to
only be a phandle.
* Fix the generation script to only generate what it should for a
'fixed-clock'
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
sanitycheck takes any "extra_config" list found in the testcase.yaml
file and generates an "overlay" file from it. This file is placed in
the per-test build directory and passed to cmake/kconfig.cmake through a
-DOVERLAY_CONF= option set in the (also) generated sanity-out/Makefile.
This commit moves this generated config overlay to a subdirectory one
level down from the build directory, otherwise kconfig.cmake picks it
up *twice*: once from the -DOVERLAY_CONF= option already mentioned above
and a second time because kconfig.cmake scans the build directory and
blindly picks up ALL files ending with .conf[*]. The second pickup is
problematic because kconfig.cmake currently gives it the top precedence,
even higher than anything the user espressed with --extra-args=CONFIG_*
Here's a quick and simple demonstration of the issue fixed by this
commit:
cd $ZEPHYR_BASE/samples/net/sockets/net_mgmt/
sanitycheck -T. -p qemu_x86 -b -v # --extra-args=CONFIG_USERSPACE=y|n
grep CONFIG_USERSPACE $(find sanity-out/ -name .config)
.net_mgmt.kernelmode/zephyr/.config: # CONFIG_USERSPACE is not set
.net_mgmt.usermode/zephyr/.config: CONFIG_USERSPACE=y
grep 'Merged configuration' $(find sanity-out/ -name build.log)
Without this commit, attemps to override anything with
--extra-args=CONFIG_ are silently dropped on the floor.
For more background this issue was found while using the recipe in
commit message 4afcc0f8af
[*] picking up all .conf files is debatable but a much bigger debate
with backward compatibility implications. This small fix makes
absolutely zero difference to anyone or anything not using sanitycheck.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
There are a few reasons why sanitycheck will only build a test and not
run it: list them in the developer guide. Also lists the --options that
provide that information and update their --help message.
A couple other --help fixes.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
When stripped symbols are present in the build size_report has crashed
due to it not being aware of this case.
This patch causes stripped symbols to be ignored instead, allowing
analysis of the non-stripped symbols.
It is left as future work to somehow display how much space stripped
symbols are taking up.
Stripped symbols can be present when third-party binaries are linked
into the build.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
The --jobs default was recently changed in commit 9f4f57eed3, update
its help message.
Add the hopefully last missing verbose("Spawning...") statement.
Fix comment updated in commit 095b82a301.
Replace two tags with whitespace.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
sanitycheck is opening an insane number of file descriptors
simultaneously as it opens up communication pipes with
every test that supports emulation, on every emulated
board target.
Increase the resource limit on open files until this code
can be properly refactored.
Workaround for: #17239
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
- The --gcov-tool argument now has a reasonable default
if the Zephyr SDK is in use.
- --coverage-platform, if unspecified, defaults to what
was passed to --platform
- --coverage implies --enable-slow, so that tests with
the 'slow' tag are built and run.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We have a number of timing sensitive tests which run
correctly on a much more frequent basis if the system
is not so heavily loaded. Instead of squeezing a few
more crumbs of performance by doubling the CPU count,
just use the number of CPUs reported by the system.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
If GCOV coverage is enabled, the coverage dump happens after
"PROJECT EXECUTION SUCCESSFUL" is printed. In some cases,
the additional time added was not enough to capture all the
GCOV output on a heavily loaded system before the emulator
gets killed.
Ideally, the decision to kill the emulator needs to be smarter
and less race-prone, but that can wait for a future
enhancement.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
So the time used to run boards which use the BinaryHandler can be
reported, record the time used from spawning the process until
it finnishes or is killed.
The BinaryHandler is used by the "native" boards, unit tests,
nsim and Renode.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
This patch adds generation of `*_FIXED_CLOCK_FREQUENCY` macros for
clock consuming nodes that are provided with a fixed rate clock.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This patch is needed in order to get compilable macros for compatibles
like "arm,cortex-m0+".
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Commit 212ec9a29a / feature #14121 already ordered partitions by
decreasing size, however it was common in samples/userspace/shared_mem/
/sample.kernel.memory_protection.shared_mem for two partitions to have
the same size and be randomly ordered between them. This adds the
partition name as a second sort key.
Unlike previous attempt in commit 725abdf430 this doesn't use the
partition name as the first (and only) key and doesn't break the
decreasing size order. Huge thanks to Sigvart Hovland for spotting this
in a post-merge but prompt code review.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This reverts commit 725abdf430 which did get rid of randomness in the
order of the partition _names_ as claimed but regressed commit
212ec9a29a / feature #14121 and broke the previous size order which I
missed. Huge thanks to Sigvart Hovland for spotting this in a post-merge
but prompt code review. Proper fix in the next commit.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Dictionaries are not ordered in Python 3.5 and before, so building twice
in a row could lead to a different partition order, different
build/zephyr/include/generated/app_smem_*.ld files and different
binaries.
Fix with a minor change to the "for" loop in the output function:
make it iterate on sorted(partitions.items()) instead of the raw and
randomly ordered partitions dictionary.
It is easy to reproduce the issue even without downgrading to an
obsolete Python version; pick a test like samples/userspace/shared_mem/
and simply change the code to this:
--- a/scripts/gen_app_partitions.py
+++ b/scripts/gen_app_partitions.py
@@ -159,10 +159,12 @@ def parse_elf_file(partitions):
partitions[partition_name][SZ] += size
+import random
def generate_final_linker(linker_file, partitions):
string = linker_start_seq
size_string = ''
- for partition, item in sorted(partitions.items()):
+ for partition, item in sorted(partitions.items(),
+ key=lambda x: random.random()):
string += data_template.format(partition)
if LIB in item:
for lib in item[LIB]:
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Dictionaries are not ordered in Python 3.5 and before, so building twice
${ZEPHYR_BASE}/samples/application_development/code_relocation/
in a row could lead to a different sections order, different
build/zephyr/include/generated/linker_relocate.d and code_relocation.c
and different binaries.
Fix with a minor change to three "for" loops in the output functions:
make them iterate on sorted(list of sections) instead of the raw and
randomly ordered dictionaries of sections.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
When using a build folder format with build.dir-fmt that includes any
parameters that need resolving, the west runners cannot find the folder
since the required information (board, source dir or app) is not
available.
Add a very simple heuristic to support the case where a build folder
starts with a hardcoded prefix (for example 'build/') and a single build
is present under that prefix.
The heuristic is gated behind a new configuration option:
build.guess-dir
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Use Device Tree,and in particular a new 'bt-c2h-uart' to select which
UART is being used to communicate with an external BLE Host when acting
as a Controller.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Print a friendlier error message on ValueError, but don't throw away
the stack trace.
Move another call to log.die().
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
Follow along with changes made in west flash/debug/etc to make it
easier to see the output steps visually.
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
Having common log handlers now lets us improve our logging output so
that info messages are prefixed with the runner they came from, and
doing something similar with the high level steps as we go, like this:
-- west <command>: using runners
-- runners.RUNNER_NAME: doing something
<output from RUNNER_NAME subprocesses go here>
-- runners.RUNNER_NAME: all done, bye
We can also colorize the west output to make it stand out better from
subprocesses, using the same output formatting style that west
commands like west list do.
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
I've had some requests to be able to use code in the runners package
without having west installed.
It turns out to be pretty easy to make this happen, as west is
currently only used for west.log and some trivial helper methods:
- To replace west log, use the standard logging module
- Add an appropriate handler for each runner's logger in
run_common.py which delegates to west.log, to keep
output working as expected.
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
Add support so that we can flag any "defines" associated with a call to
either extract_cells or extract_controller as deprecated.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
We never set 'use-prop-name' on clock bindings so lets just always
use CLOCK_CONTROLLER as the define name we generate.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>