Commit graph

1456 commits

Author SHA1 Message Date
Ederson de Souza a0ee472a6f tests/misc: Add llext EDK test
This test uses pytest to generate an EDK from a simple Zephyr
application, and uses this EDK to build a simple extension, to ensure
that EDK generation is sane.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-05-17 16:21:48 +01:00
Ederson de Souza 4e9a2a7c33 cmake: Handle imacros from flags
Instead of hardcoding `autoconf.h` imacro, get the list of imacros from
the llext flags. As those come in the form of absolute paths, they also
need to be massaged to point from the EDK directory without revealing
host complete paths.

Also, the EDK now keeps the imacros on a different flag,
`LLEXT_GENERATED_IMACROS_CFLAGS`, to keep it similar to other generated
includes.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-05-17 16:21:48 +01:00
Ederson de Souza cd535b75aa cmake: Reuse llext flags for EDK
Some flags are common between in tree extensions and out of tree
supported by the EDK. Instead of duplicating those flags, the EDK reuses
the llext ones.

However, as the EDK has its own needs, two new lists,
`LLEXT_EDK_APPEND_FLAGS` and `LLEXT_EDK_REMOVE_FLAGS` are defined to
allow EDK to append or remove flags as needed.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-05-17 16:21:48 +01:00
Ederson de Souza dc8d7ada19 cmake/modules: Extract flags filtering code to a function
This way they can be reused by the LLEXT EDK.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-05-17 16:21:48 +01:00
Ederson de Souza 2f41060fbd cmake/llext-edk: Generate more granular CFLAGS
Besides the LLEXT_CFLAGS, which have all that is needed to compile,
generate more granular ones, LLEXT_INCLUDE_CFLAGS,
LLEXT_ALL_INCLUDE_CFLAGS, LLEXT_GENERATED_INCLUDE_CFLAGS and
LLEXT_BASE_CFLAGS. These are done for convenience, as they can help on
different setups, such as unit testing.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-05-17 16:21:48 +01:00
Ederson de Souza 967168a536 subsys/llext: Generate syscalls stubs for EDK exclusively for userspace
A new Kconfig option which generates syscall stubs assuming that
extensions will always run on userspace, thus simplifying linking
them, as there's no need for z_impl_ stubs (used for direct syscalls),
CONFIG_LLEXT_EDK_USERSPACE_ONLY.

While defining __ZEPHYR_USER__ could have the same effect for optmised
builds, people building extensions on debug environments - thus
non-optimised - would suffer, as they'd need to somehow make the stubs
available (by either exporting the symbol or implementing dummy stubs).

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-05-17 16:21:48 +01:00
Ederson de Souza d156a03074 cmake: New target which generates a sort of development kit for llext
Loadable extensions need access to Zephyr (and Zephyr application)
includes and some CFLAGS to be properly built. This patch adds a new
target, `llext-edk`, which generates a tar file with those includes and
flags that can be loaded from cmake and make files.

A Zephyr application willing to expose some API to extensions it loads
only need to add the include directories describing such APIs to the
Zephyr ones via zephyr_include_directories() CMake call.

A new Kconfig option, CONFIG_LLEXT_EDK_NAME allows one to control some
aspects of the generated file, which enables some customization - think
of an application called ACME, willing to have a ACME_EXTENSION_KIT or
something.

All EDK Kconfig options are behind CONFIG_LLEXT_EDK, which doesn't
depend on LLEXT directly - so that EDK features can be leveraged by
downstream variations of loadable extensions.

Also, each arch may need different compiler flags for extensions: those
are handled by the `LLEXT_CFLAGS` cmake flag. An example is set for GCC
ARM.

Finally, EDK throughout this patch means Extension Development Kit,
which is a bad name, but at least doesn't conflict with SDK.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-05-17 16:21:48 +01:00
Evgeniy Paltsev 47b334c619 ARC: nSIM: cmake: launch cores in direct order for simulation run
Align cmake launch script with west runners

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-05-17 12:40:52 +02:00
Jonathon Penix 99adbadad5 toolchain: llvm: Allow TLS when using llvm targeting arm
TLS for Arm targets seems to be well supported in clang/lld, so mark it as
supported by the toolchain.

Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
2024-05-14 09:43:37 +02:00
Noah Pendleton 265da0df86 buildsystem: Add an option to compress debug sections
Compressing debug sections can reduce the output
ELF file size substantially.

Signed-off-by: Noah Pendleton <noah.pendleton@gmail.com>
2024-05-13 14:23:12 +02:00
Pieter De Gendt 7b6e9dc4b8 cmake: linker_script: Fix cmake linker for some networking
Iterable sections for CoAP services and network management events
were missing.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-05-13 09:46:44 +02:00
Pieter De Gendt 509d8f8aae cmake: linker_script: Support deferred init with CMAKE_LINKER_GENERATOR
The section for deferred devices was missing when
CONFIG_CMAKE_LINKER_GENERATOR is enabled.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-05-13 09:46:13 +02:00
Grzegorz Swiderski 22fd74914a cmake: modules: dts: Expose DTS_INCLUDE_FILES
This was previously used as a variable internal to the module, but it
can be used in other places in the build system, which may want a list
of DT-specific includes. Therefore, document it as an output variable.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-05-13 10:36:37 +03:00
Ederson de Souza 2b53c83058 cmake/modules/extensions: Fix string list replacement
Changing from `;` to `|` directly doesn't consider for escaped `;`
inside a list. Fix suggested by @pillo79.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-05-12 11:05:20 -04:00
Yong Cong Sin 2e072ad017 ztest: include: unittest: relocate cpu.h and include only if unit-test
The `cpu.h` is meant to be a hack around Zephyr's dependencies
for unit-test, relocate it to a folder that's included only by
unit-test.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-10 11:50:36 +02:00
Yong Cong Sin af78efaa4d subsys/testsuite/ztest: create stub headers at CMake configure time
Create unittest stub headers at CMake configure time.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-10 11:50:36 +02:00
Pieter De Gendt db8bb9ef56 cmake: linker: Use kconfig for iterable section subalign
Replace the hard-coded 4 with the Kconfig symbol
CONFIG_LINKER_ITERABLE_SECTION_SUBALIGN .

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-05-07 18:01:37 -04:00
Debbie Martin 882238116e arch: arm: cortex-r: Add compiler tuning for Cortex-R82
Change the GCC toolchain configuration to make use of the Cortex-R82
target. When Cortex-R82 was added as a GCC toolchain option, the GCC
version of the Zephyr SDK did not support Cortex-R82 tuning. Zephyr was
therefore compiled compiled for the Armv8.4-A architecture. Since Zephyr
SDK 0.15.0 (which updated GCC from 10.3.0 to 12.1.0) coupled with Zephyr
3.2, the Cortex-R82 target is supported.

The Armv8-R AArch64 architecture does not support the EL3 exception level.
EL3 support is therefore made conditional on Armv8-R vs Armv8-A.

Signed-off-by: Debbie Martin <Debbie.Martin@arm.com>
2024-05-07 17:57:05 -04:00
Nikolay Agishev e97d33d0c8 ARCMWDT: Fix building under hwmv2 model
On very early stage build system needs to get access to DTC preprocessor.
MWDT has no it's own preprocessor, so here zephyr-SDK preprocessor is used.
On latest build stages zephyr-SDK objcoby also required as MWDT binutils
don't support all features. This at the same time requires that
ZEPHYR_SDK_INSTALL_DIR must be initialized with valid arch-dependent
prefix.

Zephyr-SDK requires ARCH variable to be initialized before
include "generic.cmake", but in hew HWMv2 model ARCH variable will be
initialized more later. This workaround uses any (first awailable,
independent on ARCH) toolchain from SDK for DTC preprocessing only.
For other build stages ARCMWDT will be used.

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2024-05-07 10:44:15 +02:00
Jonathon Penix 7d5ccc083c cmake: llvm: arm: Remove '--specs' when building with clang for arm
Currently, clang produces a warning that the '--specs=nosys.specs' argument
is unused. Remove this flag to fix the warning as clang will generally not
honor '--specs' when targeting arm baremetal.

While this flag has been present for some time, I think this should be safe
to do. For background, clang does not seem to handle '--specs' [1] besides
possibly passing it through to GCC if GCC is used as the driver for
linking. However, whether GCC will be used for linking as a fallback
depends on the "Toolchain" [1] clang uses internally, which in turn depends
on the triple. For arm/thumb baremetal triples, the Toolchain clang uses
will not fall back to GCC to drive linking, so '--specs' will never be used
here.

I believe this behavior in clang is fairly longstanding as well (since
~2017/LLVM 5 [2]). While there isn't a minimum required clang version for
Zephyr, Zephyr currently requires lld >= 14.0.0. So, I don't think removing
this flag should impact current users (besides preventing the warning).

[1] https://clang.llvm.org/docs/DriverInternals.html
[2] https://reviews.llvm.org/D33259

Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
2024-05-07 09:33:16 +02:00
Jamie McCrae a0267d2f48 west: runners: Add run once commands and deferred reset
This adds supports for flashing images with sysbuild where there
are multiple images per board to prevent using the same command per
image flash which might cause issues if they are not ran just once
per flash per unique board name. A deferred reset feature is also
introduced that prevents a board (or multiple) from being reset if
multiple images are to be flashed until the final one has been
flashed which prevents issues with e.g. security bits being enabled
that then prevent flashing further images.

These options can be set at a board level (in board.yml) or a SoC
level (in soc.yml), if both are present then the board configuration
will be used instead of the SoC, and regex can be used for matching
of partial names which allows for matching specific SoCs or CPU cores
regardless of the board being used

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 17:56:19 +01:00
Nicolas Lebedenco 6837ca808b cmake: Revert breaking change to CMAKE_SYSTEM_NAME
This commit reverts a breaking change in CMAKE_SYSTEM_NAME introduced by
"Zephyr" back to "Generic") and removes the file
`cmake/modules/Platform/Zephyr`.

Both changes in the aforementioned PR were only introduced to ultimately
modify the value of the global CMake property TARGET_SUPPORTS_SHARED_LIBS
for the special case of building for Xtensa with LLEXT.

The modification of CMAKE_SYSTEM_NAME is considered a breaking change
because it has the potential to alter the build of any non-trivial project
that previously checked for the "Generic" system identifier as
corresponding to Zephyr - for example by doing
`if (CMAKE_SYSTEM_NAME STREQUAL "Generic")`. Such builds may now break in
many ways including silently when there is no `else()` clause with a
`message()` to alert the user that a whole configuration block had been
skipped.

In essence, that CMAKE_SYSTEM_NAME modification was only introduced in
order to have CMake to load `cmake/modules/Platform/Zephyr.cmake` which in
turn adjusted the value of TARGET_SUPPORTS_SHARED_LIBS.

But the use of a CMake platform file like this is ineffective for
non-trivial projects where one or more top level CMake `project()` calls
may happen before the first call to `find_package(Zephyr)` because in such
cases CMAKE_MODULE_PATH will not have been modified yet to contain the
path to <Zephyr_ROOT>/cmake/modules and thus no platform file will be
include by CMake.

This patch moves the conditional override of TARGET_SUPPORTS_SHARED_LIBS
needed by some archs (e.g. Xtensa) into the `kernel.cmake` module which
is known to be the first call to `project()` that enables any language and
thus the one that must come before any artifact target can be defined.

Note commit 64e7d85 added a Kconfig to specify the object type of llext
being built, so it's not tied to the arch anymore but to the
CONFIG_LLEXT_TYPE_ELF_SHAREDLIB option.

Signed-off-by: Nicolas Lebedenco <nicolas@lebedenco.net>
2024-04-29 16:17:39 +02:00
Jamie McCrae 6ed5ac7111 cmake: modules: configuration_files: Add support for soc overlays
Adds support for SoC overlay files which go in a ``socs`` folder
in application folders and functions similar to the ``boards``
folder, but works for SoCs instead of boards

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 15:08:35 +01:00
Jamie McCrae 6f58159a72 cmake: Add support for socs folder and Kconfig fragments
Adds support for a new ``socs`` folder that can be placed in
application folders and functions similar to the ``boards``
folder, but works for SoCs instead of boards

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 15:08:35 +01:00
Jamie McCrae 43c323a835 cmake: modules: extensions: Fix documentation for zephyr_build_string
Fixes a missed entry and a wrong named variable in the
documentation for this function

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 15:08:35 +01:00
Patryk Duda 144a08c58c cmake: modules: Introduce FindThreads module
Some third-party modules uses 'find_package(Threads REQUIRED)' to check
if threads implementation is supported.

The original implementation tries to find threads library using various
methods (e.g. checking if pthread library is present or compiling
example program to check if the implementation is provided by libc), but
it's not able to detect pthread implementation provided by Zephyr.

Signed-off-by: Patryk Duda <patrykd@google.com>
2024-04-29 15:59:42 +02:00
Jonathon Penix 4d7fe771f1 linker: lld: riscv: Enable gp relaxation for lld
Unlike GNU ld, lld's gp relaxation is disabled by default and must be
explicitly enabled via `--relax-gp`. Pass this flag to enable gp relaxation
for lld when both linker relaxations and gp usage for RISC-V are enabled.

Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
2024-04-29 15:56:22 +02:00
Pieter De Gendt cb459f12ba arcmwdt: Enable GNU C Extensions
Replace the global CSTD property with a Kconfig symbol selection.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-04-25 09:54:39 +00:00
Pieter De Gendt a599ed13a1 kconfig: Add symbols for GNU C Extensions
Add a symbol to enable GNU C Extensions. And a hidden option for
toolchains to signal GNU Extensions support.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-04-25 09:54:39 +00:00
Jamie McCrae 23551eb05a cmake: boards: Fix missing board name
Fixes an issue whereby the board name was missing

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-24 14:55:18 -04:00
Patryk Duda a8fa0ea938 linker: Add more DWARF 5 debug sections
These sections were reported by 'GNU ld (GNU Binutils) 2.41.0' using
'ld --verbose'.

Signed-off-by: Patryk Duda <patrykd@google.com>
2024-04-22 07:47:52 -07:00
Tomasz Moń 5144d0f65f usb: device_next: Introduce speed specific configurations
USB High-Speed devices must be able to operate at both High-Speed and
Full-Speed. The USB specification allows the device to have different
configurations depending on connection speed. Modify the API to reflect
USB Specification requirements on what can (e.g. configurations) and
what cannot (e.g. VID, PID) be speed dependent.

While the class configurations for different speeds are completely
independent, the actual class instances are shared between operating
speeds (because only one speed can be active at a time). Classes are
free to provide different number of interfaces and/or endpoints for
different speeds. The endpoints are assigned for all operating speeds
during initialization.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-04-22 06:51:22 -07:00
Tomasz Moń f411f801fe usb: device_next: Separate endpoint assignment from class data
Introduce usbd_class_iter for keeping endpoint assignment variables
and the single-linked list node. No functional changes right now, but
this paves the way for independent speed specific configurations.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-04-22 06:51:22 -07:00
Nicolas Lebedenco 39cb21dfc0 cmake: Fix invalid calls of set_compiler_property
set_compiler_property does not accept a TARGET argument. Only set_property
does but they are easy to confuse. This patch fixes the wrong instances of
set_compiler_property that should have been set_property.

Signed-off-by: Nicolas Lebedenco <nicolas@lebedenco.net>
2024-04-19 16:40:16 +00:00
Nicolas Lebedenco 4df926b02d cmake: Make enable_language() clear about what it is actually doing
That call to enable_languages() is passed C CXX ASM which misleads the
reader into thinking that the three languages are enabled in that call but
at that point only ASM is actually because C and CXX were already
implicitly enabled by the call to project() above. The suggested change
removes the misleading C CXX arguments but we could as well make it clear
in the project() call by passing LANGUAGES C CXX.

Signed-off-by: Nicolas Lebedenco <nicolas@lebedenco.net>
2024-04-19 16:40:11 +00:00
Luca Burelli ad8b90ad36 cmake: add_llext_target: handle empty LLEXT_REMOVE_FLAGS
When LLEXT_REMOVE_FLAGS is empty, the regular expression that is
constructed to remove flags from the Zephyr flags would match any
string, resulting in all flags being removed. This is not the intended
behavior, so we need to handle this case by setting the regular
expression to a pattern that does not match anything.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-04-19 10:10:39 +02:00
Luca Burelli 14509a8d7b cmake: add_llext_target: use toolchain-specific partial linking option
The partial linking option depends on the linker used in the build
process, and this flag is already defined by the Zephyr toolchains.
Use the $<TARGET_PROPERTY:linker,partial_linking> generator expression
to retrieve it instead of hardcoding the value for the GNU linker.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-04-19 10:10:39 +02:00
Jamie McCrae 5841c11cae cmake: modules: extensions: Rename prefix in functions
Renames a prefix in a function to avoid clashes with global variable
that have the same name

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-18 08:51:10 -07:00
Nicolas Lebedenco 6a42ede43b cmake: Normalize GNULD_LINKER variable
Some toolchains may generate convoluted paths when reporting accessory
tools. This is the case with GCC in the Zephyr SDK toolchain. For
example, for a Zephyr SDK installed under `C:\Portable\Zephyr` a call to
`gcc --print-prog-name=ld.bfd` should normally return something like
`c:/portable/zephyr/zephyr-sdk-0.16.5/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe`
but because of how the toolchain was created the path reported gets all
messed up with relative fragments. In above case, the actual path reported
was `c:/portable/zephyr/zephyr-sdk-0.16.5/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe`
One might argue that this should be fixed in the toolchain which could be
possible for the Zephyr SDK but not for other toolchains (definitely not
for proprietary ones).

Signed-off-by: Nicolas Lebedenco <nicolas@lebedenco.net>
2024-04-16 16:38:35 -07:00
Jamie McCrae a2ed8162c8 cmake: modules: boards: Add normalised variables
Adds a new variable NORMALIZED_BOARD_QUALIFIERS which contains
the board qualifiers in file-name format, this allows for
constructing strings in applications (e.g. for folder names) prior
to Zephyr being found for things like APPLICATION_CONFIG_DIR. Also
adds NORMALIZED_BOARD_TARGET.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-15 08:31:55 -07:00
Torsten Rasmussen 4959a0241e cmake: fix issue with parsing version file located in /VERSION
Fixes: #71384

A VERSION file placed in `/` or `<drive>:\` was accidentally being
picked up during `find_package(Zephyr)`.

This happened because Zephyr loads the VERSION file to determine if it
is the correct Zephyr to use.

During initial phase of find_package(), then APPLICATION_SOURCE_DIR is
not defined, causing one version file to be picked up from `/VERSION`
instead of `<app>/VERSION`. `/VERSION` is outside any Zephyr repo, west
workspace, or the application itself and therefore should not be picked
up accidentally.

Fix this be checking that APPLICATION_SOURCE_DIR is defined, and only
when defined, look for a VERSION file there.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-04-15 14:05:38 +02:00
Marek Metelski 1c8ea0a941 cmake: shields: Simplify shield processing, print shields from modules
Fix issue #67244 in which boards from external modules where not
printed in the help message (displayed for `shields` target or
when trying to build with unknown shield). The SHIELD_LIST variable
was reset for each BOARD_ROOT discovered.

Simplify discovery logic. Discover all shields and set relevant
variables (SHIELD_LIST and SHIELD_DIR_${name}) in one step and
process all the expected boards in the next step.

Signed-off-by: Marek Metelski <marek@metelski.dev>
2024-04-12 15:03:29 +02:00
Luca Burelli e24295f0f5 llext: add support for building relocatable ELF files
This commit adds support for building relocatable (partially linked)
ELF files as the binary object type for the llext subsystem.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-04-11 11:35:24 -05:00
Luca Burelli 162e7c9a7f llext: support multiple source files
This change allows the `add_llext_target` function to accept multiple
source files when building an ELF shared library. The ELF object
target type is still limited to a single source file, since there is no
linking step in that case.

Also fixes a minor typo in another llext function documentation.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-04-11 11:35:24 -05:00
Luca Burelli 64e7d85ef6 llext: define target binary type
Add a new Kconfig option to select the binary object type for the llext
subsystem. This will allow to fully decouple the architecture type from
the kind of binary object that is expected by the loader.

The defaults have been chosen to match the current behavior of the ARM
and Xtensa architectures, but developers can now more easily experiment
with other object types.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-04-11 11:35:24 -05:00
Marcin Szymczyk d2b3e3a389 sysbuild: add SoC-specific sysbuild configuration
Sysbuild now supports SoC configuration,
in addition to application and board.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-04-10 17:53:24 +02:00
Torsten Rasmussen 4e3a01df41 cmake: support shortened file names for single SoC boards
This allow developers to create board files without the SoC name when
the board only defines a single SoC.

This means that a board, such as rpi_pico, which defines only a single
SoC, rp2040, and one variant, now allows the following file names:
Board target: rpi_pico/rp2040
- dts: rpi_pico_rp2040.dts, short: rpi_pico.dts
- defconfig: rpi_pico_rp2040_defconfig, short: rpi_pico_defconfig
- overlay: rpi_pico_rp2040.overlay, short: rpi_pico.overlay
- conf:  rpi_pico_rp2040.conf, short: rpi_pico.conf

Board target: rpi_pico/rp2040/w
- dts: rpi_pico_rp2040_w.dts, short: rpi_pico_w.dts
- defconfig: rpi_pico_rp2040_w_defconfig, short: rpi_pico_w_defconfig
- overlay: rpi_pico_rp2040_w.overlay, short: rpi_pico_w.overlay
- conf:  rpi_pico_rp2040_w.conf, short: rpi_pico_w.conf

A multi CPU cluster board, nrf5340dk:
Board target: nrf5340dk/nrf5340/cpunet
- dts: nrf5340dk_nrf5340_cpunet.dts, short: nrf5340dk_cpunet.dts
- defconfig: nrf5340dk_nrf5340_cpunet_defconfig,
             short: nrf5340dk_cpunet_defconfig
- overlay: nrf5340dk_nrf5340_cpunet.overlay,
           short: nrf5340dk_cpunet.overlay
- conf:  nrf5340dk_nrf5340_cpunet.conf, short: nrf5340dk_cpunet.conf

A multi SoC board, nrf5340dk (real: nrf52840, emulated: nrf52811):
Board target: nrf52840dk/nrf52840
- dts: nrf52840dk_nrf52840.dts, short: Not possible
- defconfig: nrf52840dk_nrf52840_defconfig, short: Not possible
- overlay: nrf52840dk_nrf52840.overlay, short: Not possible
- conf:  nrf52840dk_nrf52840.conf, short: Not possible

If two conflicting files are found, for example both
rpi_pico_rp2040.overlay and rpi_pico.overlay, then an error is raised.

If short form is detected for a board target with multiple SoCs, for
example nrf52840dk_nrf52840.overlay and nrf52840dk.overlay, then an
error is raised.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-04-09 23:35:54 +02:00
Jamie McCrae 0be0d2175b cmake: modules: extensions: Revert using common board files
This change reverts a change that was introduced with hwmv2 which
allowed for using common board names for overlays, given the board
target ``nrf9160dk@0.7.0/nrf9160/ns``.

In hwmv1 this would have used:
    ``nrf9160dk_nrf9160_ns.conf``.
    ``nrf9160dk_nrf9160_ns_0_7_0.conf``.

In hwmv2 this would have used:
    ``nrf9160dk_nrf9160_ns.conf``
    ``nrf9160dk_nrf9160_ns_0_7_0.conf``
    ``nrf9160dk_nrf9160.conf``
    ``nrf9160dk_nrf9160_0_7_0.conf``
    ``nrf9160dk.conf``
    ``nrf9160dk_0_7_0.conf``

With these changes, the following are used (which restores the hwmv1
behaviour):
    ``nrf9160dk_nrf9160_ns.conf``
    ``nrf9160dk_nrf9160_ns_0_7_0.conf``

For a board with a default SoC which is not a variant for example
``rpi_pico`` then ``rpi_pico.conf`` will also be used, this file
will not be used for variants e.g. ``rpi_pico/rp2040/w``

This applies to .dts, .conf and .overlay files in the boards
directory, and to .conf and .overlay files in application board
overlay directories.

This revert is needed to avoid issues whereby variants have
incompatible configuration to the parent board target, which has
been affecting samples and tests.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-09 23:35:54 +02:00
Gerard Marull-Paretas 80a6a20628 cmake: extensions: introduce zephyr_syscall_include_directories
Add a new CMake helper to add new include directories to be parsed by
the syscall machinery. This helper complements the existing
zephyr_syscall_header, which works at a header-level.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-04-09 12:04:57 +02:00
Gerard Marull-Paretas ca4e5d9c98 cmake: use INTERFACE_SOURCES in zephyr_syscall_header
Instead of INTERFACE_INCLUDE_DIRECTORIES, because header files are used,
not directories. Headers were added to both, target sources and include
directories.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-04-09 12:04:57 +02:00