Commit graph

5615 commits

Author SHA1 Message Date
Andrei Emeltchenko
9f7a90332b sanitycheck: Allow to pass command with argument to ser_pty
By default, subprocess.Popen commands are supplied as a list of strings.
Using split() allows to use command with arguments, for example it is
possible to use following:

sanitycheck ... \
--device-serial-pty="set_ambient read_terminal.py" \
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-09-04 07:55:52 -04:00
Anas Nashif
0f831b1e15 sanitycheck: mark arc simulation smp systems as mdb
This changes back smp simulation systems to require mdb.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-03 15:10:07 -07:00
Martí Bolívar
3124c02987 cmake: flash/debug: refactor runner configuration
This commit message is a bit of a novel mostly:

- because the issues involved are longstanding
- as evidence this is not a capricious refactoring

The runners.core.RunnerConfig Python class holds common configuration
values used by multiple runners, such as the location of the build
outputs and board directory.

The runners code, first written in 2017-ish, replaced various shell
scripts that got this information from the environment. Avoiding
environment variables was a requirement, however. It's ghastly to set
environment variables for a single command invocation on Windows, and
the whole thing was part of a larger push to make Zephyr development
on Windows better.

I had a hammer (the argparse module). Finding a replacement naturally
looked like a nail, so the information that ends up in RunnerConfig
got shunted from the build system to Python in the form of 'west
flash' / 'west debug' command line options like '--board-dir',
'--elf-file', etc.

I initially stored the options and their values in the CMake cache.
This was chosen in hopes the build system maintainer would like
the strategy (which worked).

I knew the command line arguments approach was a bit hacky (this
wasn't a nail), but I also honestly didn't have a better idea at the
time.

It did indeed cause issues:

- users don't know that just because they specify --bin-file on the
  command line doesn't mean that their runner respects the option, and
  have gotten confused trying to flash alternate files, usually for
  chain-loading by MCUboot (for example, see #15961)

- common options weren't possible to pass via board.cmake files
  (#22563, fixed partly via introduction of runners.yaml and the west
  flash/debug commands no longer relying on the cache)

- it is confusing that "west flash --help" prints information about
  openocd related options even when the user's board has no openocd
  support. The same could be said about gdb in potential future use
  cases where debugging occurs via some other tool.

Over time, they've caused enough users enough problems that
improvements are a priority.

To work towards this, put these values into runners.yaml using a new
'config: ...' key/value instead of command line options.

For example, instead of this in the generated runners.yaml file:

args:
  common:
  - --hex-file=.../zephyr.hex

we now have:

config:
  hex_file: zephyr.hex

and similarly for other values.

In Python, we still support the command line options, but they are not
generated by the build system for any in-tree boards. Further work is
needed to deprecate the confusing ones (like --hex-file) and move the
runner-specific host tool related options (like --openocd) to the
runners that need them.

Individual board.cmake files should now influence these values by
overriding the relevant target properties of the
runners_yaml_props_target.

For example, instead of:

  board_runner_args(foo "--hex-file=bar.hex")

Do this:

  set_target_properties(runners_yaml_props_target PROPERTIES
                        hex_file bar.hex)

This change additionally allows us to stitch cmake/mcuboot.cmake and
the runners together easily by having mcuboot.cmake override the
properties that set the hex or bin file to flash. (The command line
arguments are still supported as-is.)

Combined with 98e0c95d91ae16f14e4997fb64ccdf0956595712 ("build:
auto-generate signed mcuboot binaries"), this will allow users to
build and flash images to be chain loaded by mcuboot in a way that
avoids calling 'west sign' and passing 'west flash' its output files
entirely.

While we are here, rename runner_yml_write to runners_yaml_append().
This function doesn't actually write anything, and we're here
refactoring this file anyway, so we might as well improve the
situation while we're at it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar
e63d299515 scripts: run_common: rename some variables
The 'runner_config' variable name is particularly misleading because
there is a class called RunnerConfig, and that variable does not
contain one.

Rename it to 'runners_yaml' since it contains the parsed contents of
the runners.yaml file. Rename the variable that refers to the path
itself to 'runners_yaml_path'. No functional changes expected.

This is prep work for redoing how actual RunnerConfig objects get
made.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar
36e0286e26 scripts: runners: switch RunnerConfig to NamedTuple
This adds type checking for free. No functional changes expected.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar
c4254a7025 scripts: runners: type annotate runners/core.py
Before venturing off into refactoring land, let's make sure we have a
type checker running on the main APIs used by the various runners so
we don't miss anything obvious.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar
bd827056f6 scripts: runners: add type checking for west_commands
Use mypy to type check the runners package.

The test procedure is now annoying enough to replicate locally that
I'm going to wrap it in a script. Do this for both UNIX and Windows
environments by writing that script in Python.

Keep the GitHub workflow up to date so we now get mypy results in CI.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar
1bb39a6434 scripts: runners: trivial comment and docstring fixes
Fix stale or incorrect text.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Anas Nashif
bb2d899c32 ci: run module tests only on major changes
Do not run module tests if core code isn't being changed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-03 18:11:19 +02:00
Anas Nashif
af83ccda68 ci: do not run full CI on only board changes
If we are only changing board code, do not build full sanitycheck, just
build the affected boards.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-03 18:11:19 +02:00
Anas Nashif
8b5e166f8e ci: run_ci: do not call buildkite-agent
Do not call buildkite here, this script should be callable to reproduce
CI results.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-03 18:11:19 +02:00
Carles Cufi
f8ad4d5f87 scripts: size_report: Fix colorized output
Colorama needs to be initialized, and for colors to display correctly on
Windows one needs to use the `USES_TERMINAL` option in CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-03 09:54:21 -04:00
Carles Cufi
cf2b3596f7 scripts: size_report: Fix reporting on Windows
Certain symbols do not contain a valid path, instead showing
`<built-in>` in the filename attribute. This leads to the resolve() call
failing on Windows, since the `<>` characters are not allowed in
filenames there. Fix this by catching the exception and skipping the
call in that case.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-03 09:54:21 -04:00
Tomasz Bursztyka
72d9e8c8ab scripts: coccinelle: Scripts for finding wrong device instance usage
2 scripts are provided.
- find_functions.cocci (name probably sucks...)
- find_dev_usage.cocci (ditto...)

find_functions.cocci can patch files where device instance are not
const.

Then it is used to generate the function database:

./scripts/coccicheck --mode=report --jobs=1 \
--cocci=scripts/coccinelle/find_functions.cocci \
--sp-flag="--include-headers" ./

Then, find_dev_usage.cocci will check if the const qualifier is, or
might be lost in a function call.

For instance:
./scripts/coccicheck --mode=report --jobs=1 \
--cocci=scripts/coccinelle/find_dev_usage.cocci \
--sp-flag="--include-headers" drivers/i2c

Which will output a WARNING on non-zephyr functions calls with a device:

./drivers/i2c/i2c_cc13xx_cc26xx.c:393:5-8: WARNING: in i2c_cc13xx_cc26xx_pm_control calling cb param with dev, check if const qualifier is not lost
./drivers/i2c/i2c_mcux_lpi2c.c:205:40-43: WARNING: in mcux_lpi2c_init calling LPI2C_MasterTransferCreateHandle param with dev, check if const qualifier is not lost
./drivers/i2c/i2c_nrfx_twi.c:258:5-8: WARNING: in twi_nrfx_pm_control calling cb param with dev, check if const qualifier is not lost
./drivers/i2c/i2c_nrfx_twi.c:202:22-25: WARNING: in init_twi calling nrfx_twi_init param with dev, check if const qualifier is not lost
./drivers/i2c/i2c_mcux.c:187:38-41: WARNING: in i2c_mcux_init calling I2C_MasterTransferCreateHandle param with dev, check if const qualifier is not lost
./drivers/i2c/i2c_mcux_flexcomm.c:184:43-46: WARNING: in mcux_flexcomm_init calling I2C_MasterTransferCreateHandle param with dev, check if const qualifier is not lost
./drivers/i2c/i2c_nrfx_twim.c:232:5-8: WARNING: in twim_nrfx_pm_control calling cb param with dev, check if const qualifier is not lost
./drivers/i2c/i2c_nrfx_twim.c:174:8-11: WARNING: in init_twim calling nrfx_twim_init param with dev, check if const qualifier is not lost
./drivers/i2c/i2c_rv32m1_lpi2c.c:246:6-9: WARNING: in rv32m1_lpi2c_init calling LPI2C_MasterTransferCreateHandle param with dev, check if const qualifier is not lost

Or:
./scripts/coccicheck --mode=report --jobs=1 \
--cocci=scripts/coccinelle/find_dev_usage.cocci \
--sp-flag="--include-headers" drivers/ieee802154

Which will output an ERROR on using a zephyr function that looses the
const qualifier:

drivers/ieee802154/ieee802154_rf2xx.c:778:3-6: ERROR: in rf2xx_init calling k_thread_create param with dev, loosing const qualifier, please wrap
drivers/ieee802154/ieee802154_nrf5.c:477:19-22: ERROR: in nrf5_init calling k_thread_create param with dev, loosing const qualifier, please wrap
drivers/ieee802154/ieee802154_cc1200.c:819:3-6: ERROR: in cc1200_init calling k_thread_create param with dev, loosing const qualifier, please wrap
drivers/ieee802154/ieee802154_mcr20a.c:1443:3-6: ERROR: in mcr20a_init calling k_thread_create param with dev, loosing const qualifier, please wrap
drivers/ieee802154/ieee802154_cc2520.c:1116:3-6: ERROR: in cc2520_init calling k_thread_create param with dev, loosing const qualifier, please wrap
drivers/ieee802154/ieee802154_cc13xx_cc26xx.c:439:32-35: ERROR: in ieee802154_cc13xx_cc26xx_data_init calling k_thread_create param with dev, loosing const qualifier, please wrap

ISSUE:
- Is it possible to run a set of rules first on all the code, and then
  another set, both sets being in the same .cocci file?
  Would be nice to have all at once.

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Peter Bigot
2fcf76219e userspace: update k_object API to support immutable objects
The k_object API associates mutable state structures with known kernel
objects to support userspace.  The kernel objects themselves are not
modified by the API, and in some cases (e.g. device structures) may be
const-qualified.  Update the API so that pointers to these const
kernel objects can be passed without casting away the const qualifier.

Fixes #27399

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-02 13:48:13 +02:00
Anas Nashif
8b425fa7d8 sanitycheck: do not report parent test
Fix the case where we have no ztest test_* testcases and reports were
missed. This now makes sure we do not report the parent testcase when
there are individual test_* results.

Fixes #27765

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-01 15:02:22 -04:00
Martí Bolívar
9b6736748d scripts: west sign: add --quiet option
This suppresses stdout on normal runs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-01 13:33:46 +02:00
Fabio Utzig
551f1789a5 doc: update versions of build tools
Update documentation build tooling:

- Sphinx>=3.2.0
- Breathe>=4.20.0
- docutil>=0.16.0

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Watson Zeng
0079cecc19 sanitycheck: add argument --pre-script
add argument --pre-script to specify a pre script. This will be
executed before device handler open serial port and invoke runner.

Currently, pre_script can only get from hardware.map file. just like:
./scripts/sanitycheck  --hardware-map xxx.map
and set pre_script in xxx.map file.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-08-31 15:54:32 +02:00
Watson Zeng
3b43d946fd sanitycheck: run custom pre script before open the serial port
In some cases it might be a good idea to reset the board for real to
make sure it is completely recovered from some failed state (simple
re-loading of the application binary or even Elf file contents doesn't
affect most of internal CPU states so doesn't help in recovery,
see https://github.com/zephyrproject-rtos/zephyr/issues/25022 &
https://github.com/zephyrproject-rtos/zephyr/issues/26665).
And so we may want to utilize some external utility which triggers the
hard reset (in case of ARC boards it is
https://github.com/foss-for-synopsys-dwc-arc-processors/rff-ftdi-reset).
So we need to have a way to execute an external command before each and
every test.

Now given we already have quite some call-backs we try to use them
before re-inventing the wheel. And pre_script seem to be a good option
with just on minor note - it is called after serial port gets open.
And while in some cases it might be OK if serial port on the board is
not affected by the board's reset, if it is affected we'll be losing
connection on reset (and that's the case with ARC boards BTW as the
FTDI USB-to-Serial IC is also wired to the reset signal on most of
the boards). That said we just move invocation of pre_script before
opening the serial port and everything should be good now.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-08-31 15:54:32 +02:00
Anas Nashif
ad44bed754 sanitycheck: fix footprint reports
By default show reports based on last release. Fix a few other issues
where we had 0 values and were dividing by zero.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-31 09:20:52 -04:00
Martí Bolívar
b5ad84afe9 scripts: west_commands: handle EOFError in nrfjprog.py
We should simply exit if the user hits control-D during the prompt.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-31 12:56:20 +02:00
Torsten Rasmussen
ab7ec17b86 cmake: zephyr module processing improvements.
This commit improves Zephyr modules support in CMake.
All Zephyr modules will now have a corresponding
`ZEPHYR_${module_name}_MODULE_DIR` set, regardless of whether they
define a cmake folder in module.yml.

This results in:
`ZEPHYR_${module_name}_MODULE_DIR` defined for all modules and refers to
the root of the modle.
`ZEPHYR_${module_name}_CMAKE_DIR` defined for modules that specifies
cmake in module.yml, or is having both a CMakeLists.txt and Kconfig file
in the zephyr folder.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-31 12:15:02 +02:00
Torsten Rasmussen
25c3f8e12f scripts: zephyr_modules.py cleanup.
This commit has no functional changes but is simply a cleanup so that
flake8 will pass without warnings.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-31 12:15:02 +02:00
Anas Nashif
9eb9c4cce9 sanitycheck: add option --emulation-only
This will only build/run on emulation platforms.
The decision is made based on the value of the 'simulation' key in the
platform yaml file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-28 14:22:07 -07:00
Øyvind Rønningstad
7012fdf0b7 nrfjprog.py: Fix snr globbing to allow leading 0s
This is needed for sanitycheck hardware maps which take the serial
number directly from USB metadata.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-08-28 11:38:05 +02:00
Anas Nashif
dca317c730 sanitycheck: inclusive language
change whitelist -> allow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-27 07:04:07 -04:00
Daniel Leung
faae15d838 sanitycheck: allow QEMU to crash without failing
Adds some code to allow QEMU to crash without failing the test.
This is required for testing coredump code as it will certainly
cause QEMU to crash.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-08-24 20:28:24 -04:00
Daniel Leung
5b1b4a3755 sanitycheck: need to wait for harness to process QEMU outputs
There is a potential that QEMUHandler.handle() returns before
the testing harness finishes processing all the output from QEMU.
Simply wait for the harness thread to finish before returning.

Also, fix the return code in the debug message as it should be
the return code from Popen().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-08-24 20:28:24 -04:00
Daniel Leung
181d07321f coredump: add support for ARM Cortex-M
This adds the necessary bits in arch code, and Python scripts
to enable coredump support for ARM Cortex-M.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-08-24 20:28:24 -04:00
Daniel Leung
8fbb14ef50 coredump: add support for x86 and x86_64
This adds the necessary bits to enable coredump for x86
and x86_64.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-08-24 20:28:24 -04:00
Daniel Leung
49206a86ff debug/coredump: add a primitive coredump mechanism
This adds a very primitive coredump mechanism under subsys/debug
where during fatal error, register and memory content can be
dumped to coredump backend. One such backend utilizing log
module for output is included. Once the coredump log is converted
to a binary file, it can be used with the ELF output file as
inputs to an overly simplified implementation of a GDB server.
This GDB server can be attached via the target remote command of
GDB and will be serving register and memory content. This allows
using GDB to examine stack and memory where the fatal error
occurred.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-08-24 20:28:24 -04:00
Daniel Leung
203556cd8c sanitycheck: update section names in size calculator
Commit 8d7bb8ffd8 refactored
device structures which changed some of the linker sections:
"devconfig" was removed, and "devices" was added. However,
the list in sanitycheck's size calculator was not updated,
which results in sanitycheck complaining about unrecognized
sections when doing footprint.

Also, a few sections have been renamed (with added suffix
"_area") due to introduction of Z_ITERABLE_SECTION_RAM/ROM
macros. There are also some missing section names.

Fixes the issue by adding the missing sections names, and
updating existing ones.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-08-24 20:18:06 -04:00
Anas Nashif
5ab117ffd2 tracing: scripts: add scripts for parsing ctf data
Generate trace using samples/subsys/tracing for example:

    west build -b qemu_x86 samples/subsys/tracing  -t run \
      -- -DCONF_FILE=prj_uart_ctf.conf

    mkdir ctf
    cp build/channel0_0 ctf/
    cp subsys/tracing/ctf/tsdl/metadata ctf/
    ./scripts/tracing/parse_ctf.py -t ctf

1969-12-31 19:00:00.001779 (+0.000000 s): thread_create: thread_a
1969-12-31 19:00:00.001915 (+0.000136 s): thread_info (Stack size: 1024)
1969-12-31 19:00:00.002021 (+0.000107 s): thread_ready: thread_a
1969-12-31 19:00:00.002287 (+0.000265 s): thread_switched_out: main
1969-12-31 19:00:00.002320 (+0.000033 s): thread_switched_in: main
1969-12-31 19:00:00.002585 (+0.000265 s): thread_abort: main
1969-12-31 19:00:00.002730 (+0.000145 s): thread_switched_out: main
1969-12-31 19:00:00.002762 (+0.000032 s): thread_switched_in: thread_a
1969-12-31 19:00:00.002829 (+0.000067 s): thread_create: 1130656
1969-12-31 19:00:00.002860 (+0.000031 s): thread_info (Stack size: 1024)
1969-12-31 19:00:00.002911 (+0.000052 s): thread_ready: 1130656
1969-12-31 19:00:00.003033 (+0.000121 s): thread_name_set
1969-12-31 19:00:00.003132 (+0.000100 s): semaphore_take (1140992)
1969-12-31 19:00:00.003201 (+0.000069 s): end_call 38 (SEMA_TAKE)
1969-12-31 19:00:00.003330 (+0.000128 s): start_call 39 (SLEEP)
1969-12-31 19:00:00.003721 (+0.000391 s): thread_suspend: thread_a
1969-12-31 19:00:00.003802 (+0.000081 s): thread_switched_out: thread_a
1969-12-31 19:00:00.003834 (+0.000032 s): thread_switched_in: thread_b
1969-12-31 19:00:00.003872 (+0.000038 s): semaphore_take (1141016)
1969-12-31 19:00:00.003976 (+0.000103 s): thread_pending: thread_b
1969-12-31 19:00:00.004095 (+0.000119 s): thread_switched_out: thread_b
1969-12-31 19:00:00.004127 (+0.000032 s): thread_switched_in: idle 00
1969-12-31 19:00:00.004232 (+0.000105 s): idle
1969-12-31 19:00:00.510848 (+0.506616 s): isr_enter
1969-12-31 19:00:00.511664 (+0.000816 s): thread_resume: thread_a
1969-12-31 19:00:00.511947 (+0.000283 s): thread_ready: thread_a
1969-12-31 19:00:00.512385 (+0.000438 s): isr_exit
1969-12-31 19:00:00.512570 (+0.000186 s): thread_switched_out: idle 00
1969-12-31 19:00:00.512689 (+0.000119 s): thread_switched_in: thread_a
1969-12-31 19:00:00.512869 (+0.000180 s): end_call 39 (SLEEP)

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-24 13:21:12 +02:00
Fabio Utzig
716ab47dcc west: try image-1's size as slot size in imgtool
When MCUBoot is built using the swap-move strategy, the secondary slot
can be one sector smaller than the primary slot, because the primary
slot's last "useful" image sector must be "reserved" for the move
operation; this impacts the generation of padded images, so when
signing an image, the proper size to use is the secondary slot's,
unless a secondary image is not defined which is the case when using
single image DFU.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-24 10:18:56 +02:00
Wenbo Yang
17216128ab hardening: remove the empty line before EOF
The extra empty line broke the "ninja hardenconfig" on my machine with
Python 3.7.5, it complains:

"
... ...
File "/home/zephyrproject/zephyr/scripts/kconfig/hardenconfig.py",
line 46, in compare_with_hardened_conf

name = row[0]
IndexError: list index out of range
FAILED: CMakeFiles/hardenconfig
"

The csv.reader reads this empty line and gets an empty list which will
not be successfully "de-referenced".  Removing it to improve the
out-of-box experience when pepople try out the hardening options.

Signed-off-by: Wenbo Yang <wenbo.yangcn@gmail.com>
2020-08-21 15:09:07 -04:00
Peter A. Bigot
e49e3c8fef scripts: update checkpatch based on current linux kernel version
This squashes and applies the Linux diffs to scripts/checkpatch.pl
between Linux commit 16fbf79b0f83bc75 ("Linux 5.6-rc7") and
9123e3a74ec7b93 ("Linux 5.9-rc1") except for commits identified below.

The last 1000 commits to Zephyr master were compared for checkpatch
output differences between the previous Zephyr version and this
version.  One new diagnostic about function declarations with an empty
parameter-list was introduced (FUNCTION_WITHOUT_ARGS).  The text of an
existing diagnostic was changed (DT_SPLIT_BINDING_PATCH).  The text of
LONG_LINE diagnostics was enhanced to provide the actual line length.

Linux commit dfa05c28ca7ffc0a ("checkpatch: remove email address
comment from email address comparisons") was removed because
differences in the scripts resulted in false signed-off-by check
diagnostics when a full name included characters not in Basic Latin,
due to changes in how the author name was extracted.  Earlier upstream
changes not integrated into Zephyr may be required.

Linux commit b95692f8b3000166 ("checkpatch: prefer fallthrough; over
fallthrough comments") was removed because Zephyr doesn't support the
upstream pseudo keyword.

Linux commit bdc48fa11e46f867 ("checkpatch/coding-style: deprecate
80-column warning") was edited to not actually change the 80-column
maximum line limit as this change has not been mooted for Zephyr.

Linux commit ced69da1db0b57bb ("checkpatch: fix CONST_STRUCT when
const_structs.checkpatch is missing") was edited to the CONST_STRUCT
file as that's not supported in Zephyr.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-08-21 13:57:02 -04:00
Henrik Brix Andersen
96a39f00c2 west: runners: jlink: add support for -nogui 1 command line parameter
Add support for the J-Link Commander "-NoGui 1" command line parameter
in the West J-Link runner.

This command line parameter suppresses GUI dialogs (except for license
dialogs) in J-Link Commander starting from v6.80.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-08-20 13:04:37 -05:00
Martí Bolívar
2ed2d3bfa9 scripts: runners: add --no-erase support
If a runner supports the --erase option, make it so that the user can
add --no-erase to the command line to explicitly disable it.

Add a diagnostic at info() level whenever this option is requested.

The intent of this commit is to make it more obvious when a mass erase
was requested, especially in situations (like MCUboot with
CONFIG_MCUBOOT_TRY_MASS_ERASE=y) where this option may be turned on by
default.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-19 16:38:26 -05:00
Torsten Rasmussen
edde894d04 cmake: Zephyr CMake package clean-up and minor fix
Fixes: #27375

This is a cleanup of the Zephyr CMake package export.
The code has been simplified so that the export now happens through a
CMake script. This avoids several generated CMake build files compared
to previous export mode, and thus removes the need for a CMake pristine
script.

A benefit of this cleanup is that it also fixes #27375.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-19 12:52:33 -04:00
Maciej Perkowski
c67a0cd098 sanitycheck: Improve tests counting
This patch should improve couting and reporting of the number
of passed/skipped tests.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-08-19 12:49:42 -04:00
Martí Bolívar
112e1d32b2 scripts: west_commands: remove unused helper
The cached_runner_config() helper is no longer used, so remove it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-19 09:51:13 -04:00
Martí Bolívar
7492997ba7 scripts: west sign: clean up and address TODOs
Avoid use of the cached_runner_config() helper, which we have a TODO
item to get rid of. Adjust the output and do some other minor
improvements.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-19 09:51:13 -04:00
Martí Bolívar
9ca1de18eb scripts: west_commands: add .config parsing helper
Rolling yet another parser turns out to be the best way to let west
extensions respond to Kconfig values. See source code comments in the
patch for details.

The sanitylib library has some similar functionality but it isn't
exactly the same, and it gets strings wrong. For example, that parser
can't handle this option:

CONFIG_FOO="he said \"no\" to me"

This one can, and it has a couple of other features we'll find useful
for west extensions eventually besides.

(Not to mention that sanitylib also rolled its own CMake cache parser,
which also exists in west_commands.)

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-19 09:51:13 -04:00
Anas Nashif
74f4891a8f requirements: add anytree
Needed now by both ram and rom report targets.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-14 18:49:26 -04:00
Anas Nashif
239d175eff scripts: size_report: fix path prepending
Fixes potential issue on windows.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-14 18:49:26 -04:00
Anas Nashif
ac215a570c size_report: use anytree
Use anytree module to display tree and to allow easy exporting into
json.
Add option to export results into a json file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-14 18:49:26 -04:00
Øyvind Rønningstad
6cc7ea51e4 nrfjprog.py: Allow passing a glob to --snr
You can now do --snr 6*1* to achieve the same as --snr 683010000

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-08-14 13:32:36 +02:00
Øyvind Rønningstad
3b595ebd3e nrfjprog.py: Small refactor of get_board_snr()
Move some functionality out into separate functions for clarity.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-08-14 13:32:36 +02:00
Wayne Ren
938642cf7f scripts: add the support of DW_AT_count for array type
In DWARF 4, e.g. ARC Metaware toolchain, DW_AT_count is
used not DW_AT_upper_bound. We should consider this corner
case.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-08-14 13:30:41 +02:00