check_compliance generates Kconfig files for sourcing board and soc
Kconfig tree in order to run compliance.
Each board and soc generated a source entry, however several socs are
using same soc dir and thus multiple identical source lines where
created.
Use a set() to ensure unique folders before generating Kconfig files.
This ensures that each Kconfig file is only sourced once.
This improves both compliance as fewer lines needs to be written, as
well as improves Kconfiglib as fewer Kconfig files must be sourced, as
redundant sourcing is not avoided.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
- the variable 'copyright' can be accessed without
being initialized
- the yaml package (ruamel) has been changed, the API
yaml.safe_load() is deprecated. See error message
with the original code below.
$ python3 ./scripts/utils/board_v1_to_v2.py -b frdm_k64f -g blob -v blob -s k6x
New board already exists, updating board with additional SoC
Moving files to the new board folder...
Creating or updating board.yaml...
Traceback (most recent call last):
File "/home/yves/sw/zephyr/zephyrproject/zephyr/./scripts/utils/board_v1_to_v2.py", line 206, in
board_v1_to_v2(
File "/home/yves/sw/zephyr/zephyrproject/zephyr/./scripts/utils/board_v1_to_v2.py", line 78, in board_v1_to_v2
board_settings = ruamel.yaml.safe_load(f) # pylint: disable=assignment-from-no-return
File "/home/yves/.local/lib/python3.10/site-packages/ruamel/yaml/main.py", line 1105, in safe_load
error_deprecation('safe_load', 'load', arg="typ='safe', pure=True")
File "/home/yves/.local/lib/python3.10/site-packages/ruamel/yaml/main.py", line 1039, in error_deprecation
raise AttributeError(s, name=None)
AttributeError:
"safe_load()" has been removed, use
yaml = YAML(typ='safe', pure=True)
yaml.load(...)
instead of file "/home/yves/sw/zephyr/zephyrproject/zephyr/./scripts/utils/board_v1_to_v2.py", line 78
Signed-off-by: yves <yves.vandervennet@nxp.com>
Migration script requires update now that boards to be migrated
seat under boards_legacy and move directly under boards/
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
To un-block continuing of soc and board porting then move all socs and
boards which have not yet been ported to boards_legacy / soc_legacy
folders.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit aligns check_compliance to use osource for SoC
Kconfig.defconfig, as that is also the rule for the Kconfig tree in
Zephyr itself.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Testing r"(?!SERIES_).*$" was not correct as we need to consider
lines not starting by SERIES.
Fix this and make the condition globally more simple.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Make 'default' and 'revisions' fields optional for custom revisions.
When using custom revision format, then board author must create a
revision.cmake file for revision handling, in which case revisions
don't need to be specified in the board.yml file.
Therefore make 'default' and 'revisions' fields optional in the schema
and implement custom yaml validation which can validate that 'default'
and 'revisions' are specified for all other revision formats.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
When creating file Kconfig.<board>, get the copyright from
old Kconfig.board file and use it in the new file.
Add the License as well.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Using extend instead of append to correctly extend the list of valid
board identifiers.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
With the support of omitting SoC field for single SoC boards then there
is no reason to have this field optional.
Users are still able to use a short board name when building.
But always requiring SoC field in the board.yml paves the way for future
enhancements to the new hw model without having to do a second update
to a lot of board.yml files.
Such enhancement can be:
- Create Kconfig SoC selection and thereby remove need for Kconfig
boilerplate code, and also thereby remove risk of naming
inconsistencies.
- Extend board documentation, so that web doc provides option to filter
all boards with a given SoC.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Extending board output with SoC information.
This provides the possibility to print all SoCs present for boards in
new hw model.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit extends compliance check to include a KconfigBoardV2 check.
This check verifies that a v2 scheme board / SoC does not contain
references outside the Kconfig trees.
The check is invoked as: `check_compliance.py -m KconfigBoardV2`
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit updates twister testplan.py to handle HWMv2 boards.
It does so by switching to use list_boards.py to obtain a list of
folders containing <board>.yaml files for processing instead of a
global globbing of sub-folders under boards.
With HWMv2, boards can be organized more freely, meaning that a fixed
glob hierarchy is no longer safe.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Extend list_boards.py and update boards CMake module to handle HWMv2.
list_boards.py is extended to support board.yml file in each board
folder with various information related to the board, such as vendor,
soc, cpucluster, variants, revisions.
The HWMv2 removes the requirement for a _defconfig file.
It also unifies how board revisions, cpusets, etc is defined which again
provides an option for cleaner build system implementation for handling
of boards and their integration to the build system.
The CMake boards.cmake module is updated to take advantage of the
improved design.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The list_hardware.py script parses archs.yml in all <arch-root>/arch
folders and soc.yml in all <soc-root>/soc sub-folders.
The archs.yml and soc.yml are introduced with hw model v2.
Hw model v2 removes the need for architecture knowledge of the SoCs,
and as part of this makes multi-arch and multi-core SoCs possible.
Hw model v2 also allows for greater flexibility in arch and SoC
organization as they can be organized freely.
As example SoCs can be organized by vendors, architecture, or any other
way as the socs.yml contains the path to the location of the SoC,
instead of relying on a specific arch.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Hw model v2 scheme offers SoC and maintainers the possibility to define
promptless SoCs settings which must be selected by the board Kconfig.
Having a board doing `select SOC_<name>` is a much cleaner approach then
selecting the SoC in a configuration file.
It furthermore removes the need to present all SoCs in choice groups, as
the SoC is now an internal setting to Kconfig.
This further has the benefit of not presenting users, especially
new-comers to Zephyr, with SoC selection options in menuconfig which
has potential to cause confusion.
It moves the SOC, SOC_SERIES, and SOC_FAMILY from arch/Kconfig into the
soc Kconfig tree, where they rightfully belongs.
With hw model v2, BOARD name is now passed from the build system to
Kconfig which ensures that the board name used in CMake is always in
sync with the board name used in Kconfig for hw model v2.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The method get_kconfig_dts() relies on str's split() to split
lines into fields separated by ':'. The second field is an
absolute path to a file.
On Windows, an absolute path includes a drive's letter followed
by ':' which breaks the current code.
On Linux, although rare, a file or directory name may also include
':', which would also break the code.
The fix is to constraint the number of splits to 1.
The code then becomes:
_,b = line.split(":", 1)
Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
Skip doc/security/vulnerabilities.rst when checking for undefined Kconfig
symbols as older vulnerabilities can contain references to removed Kconfig
symbols.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Remove a message that had a typo in it but, more importantly that was
not needed.
The CONFIG_ISR_TABLES_LOCAL_DECLARATION already selects EXPERIMENTAL so
a user is properly alerted about the consequences just like any other
EXPERIMENTAL features if they enable WARN_EXPERIMENTAL.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
So that we can stop using the artificial riscv32/64 dual naming. This
patch temporarily allows using both, riscv or riscv32/64.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Optionally record run-id and run-attempt github context variables
as additional test suite environment properties on upload into
ElasticSearch to track re-runs of CI workflows.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
'buffer' argument is read only, so it can be 'const'. This makes it
compatible with POSIX specification of write(3) syscall.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Align with native_simulator's upstream main
f02906708cf1668fe54ef2c2f1e159ed947573aa
Which includes:
* f029067 CPU ctrl: Fix two malformed error/warning messages
* 114f78b Host trampolines: Fix typos in comment
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add integration_platforms to the list of the default platforms per test
for improved coverage when not running in integration mode.
Some tests when run without any option do not exercise any tests and
skip the integration platforms completely.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Enhance the -s option of twister, used to point to a single scenario in
a testsuite.
- Now accept --scenario on the command line, --test still supported.
- If no testsuite is provided, extract testsuite from scenario
identifier and avoid parsing the whole tree if we only want to address
one scenario in a testsuite.
- If just the identifier of the scenario is provided to
--test/--scenario option, try to find this as well, do not need the
full path for that.
Something like this is now possible:
twister --scenario kernel.threads.init --list-tests
twister -T <path> --scenario kernel.threads.init --list-tests
twister -T <path>/kernel.threads.init --list-tests
All should print the same output.
Fixes#67307
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
According to the Zephyr documentation, the multi-level interrupts
are encoded as follows:
`L1_ID | ((L2_ID + 1) << L2_BITS) | ((L3_ID + 1) << (L3_BITS + L2_BITS))`
This means that when L3 interrupts are enabled, the gen_isr_table.py
script will receive the value of L2_ID + 1. Currently, the script
takes this value and directly compares it with the offsets set via
`CONFIG_3RD_LVL_INTR_xx_OFFSET`. This is wrong because the values from
said configurations are the same as L2_ID and because of that the
script will generate an error. To fix this, use the value of L2_ID
instead of L2_ID + 1.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Binaries are located in multiple build directory subfolders when built for
multiple domains (sysbuild is one example). Parse domains.yaml and preserve
files across all domains for testing when --prep-artifacts-for-testing
option is used.
Signed-off-by: Mike Szczys <szczys@hotmail.com>
Resolves incorrectly located `image_ok` tag in generated hex files when
CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE is used.
Fixes#64098
Signed-off-by: Abram Early <abram.early@gmail.com>
Updated the instance with the device id to have it in the summary
report also when using pytest harness.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
This commit moves all the functionality related to the current
interrupt parser into gen_isr_tables_parser_carrays.py file.
The new parser file gen_isr_tables_parser_local.py file is
implemented with the new parser that.
Additional information added to the generated interrupt header
that contains data required by the new parser.
Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
This commit breaks the code into functional classes.
This way the functionality is visibly splitted into
functional parts and it is easier to replace the
specific parser part to implement new code generators.
There is also common functionality to handle multi level interrupts
moved to configuration class.
Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
This commit cleans up the gen_isr_tables code for better clarity
and easier modification.
Changes include:
- Separate functions to load intList section.
- Replace spurious handlers in internal data with None.
Now it is the output generator work to choose right function.
- All the work to generate vt and swt separated into its own functions.
- Remove the need for internal shared array - all the information
is here in swt array.
- The update_masks function - more functionality moved here.
- Simplify bit_mask function.
Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
On the hardware, after booting up the device, on the
console might appear additional logs after receiving first
prompt. Wait and clear the buffer to avoid unexpected
messages when verifying output.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
dt_chosen_partition_addr_int|hex allow obtaining the absolute address of
a partition, which is the result of the grandparent node address plus
the partition node address.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Add basic support to flash application and/or radio core for nRF54H
series. Note that features like merged hexes present in nRF53 series is
not supported.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
On some new SoCs, the erase option is not required, so introduce a new
option that doesn't set any erase mode.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Using ztest predicate feature, testcases are skipped, however, the skip
is only reported as part of the summary and not through normal
execution. Until now such tests were reported as blocked or had a null
status in the twister json output.
This changes will look into summary results and use them to confirm
parsed results and add any missing results that either were not reported
or not captured through the serial console.
The issue can be observed with the drivers.can.api test for example on
the frdm_k64f board.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
uicr_ranges dictionary entries did not contain the `_FAMILY` suffix, now
used by self.family variable, resulting in an always false check.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
As saving tests writes to file, rather than appending to it,
we should indicate that in the --save-tests help.
--load-tests help changed so its grammar is the same as --save-tests's.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
When pytest harness test is run on harware, messages sent from target
right after application start-up are lost, because connection to COM
port is not established yet. It can cause unexpected
behavior of a test. Fix it by flashing and running application after
connecting to COM port when testing on hardware.
Signed-off-by: Michal Smola <michal.smola@nxp.com>
Import of pty module causes exception when pytest harness is used
for device testing on Windows. Fix it by importing pty module
on non-windows hosts only. Add logger message for case pty
is used by mistake on Windows.
Signed-off-by: Michal Smola <michal.smola@nxp.com>