namely:
- dt_nodelabel
- dt_alias
- dt_prop
these currently fail quietly.
This can cause some very confusing errors later on.
By adding `REQUIRED` to the function call one can
easily generate a more clear message:
required nodelabel not found: ...
Signed-off-by: David van Rijn <david@refractor.dev>
Follow-up: #77887
The macros:
- toolchain_ld_base
- toolchain_ld_baremetal
- toolchain_ld_cpp
was deprecated in 5db1f1ae8f but no check
was added to FindDeprecated.cmake, meaning toolchains still providing
those macros was not getting a proper deprecation warning.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Ever since 059aae7c91 (cmake: modules:
dts: make Device Tree error messages more visible, PR #76472), warnings
generated by gen_defines.py got only printed when the exit code signaled
an error.
Without this patch, the warning gets swallowed and the build continues:
```
$ west build --pristine --board nrf54l15pdk/nrf54l15/cpuapp \
samples/userspace/hello_world_user
<snip>
-- Found BOARD.dts:
<snip>/boards/nordic/nrf54l15pdk/nrf54l15pdk_nrf54l15_cpuapp.dts
-- Generated zephyr.dts: <snip>/build/zephyr/zephyr.dts
<snip>
```
With this patch, the behavior is back to how it was before
059aae7c91:
```
$ west build --pristine --board nrf54l15pdk/nrf54l15/cpuapp \
samples/userspace/hello_world_user
<snip>
-- Found BOARD.dts: <snip>/nrf54l15pdk/nrf54l15pdk_nrf54l15_cpuapp.dts
unit address and first address in 'reg' (0x5004c000) don't match for
/soc/peripheral@50000000/vpr@4c000/mailbox@1
-- Generated zephyr.dts: <snip>zephyr/build/zephyr/zephyr.dts
<snip>
```
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
By enabling debugging information it becomes way much simpler
to find the root cause of a failing unit test as we can simply
run it with a debugger.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Add simics as a simulation platform allowing running platforms
supported in simics to be run using west or twister.
Originally authored by: Maureen Helm
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Adds new CMake extension functions that allow setting board-specific
emulator arguments, similar to existing support for setting
board-specific runner arguments.
Originally authored by: Maureen Helm
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Adds support for all relocation type produced by GCC
on AARCH64 platform using partial linking (-r flag) or
shared link (-fpic and -shared flag).
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
If we're running in a twister context, use the information as sane
defaults for CodeChecker.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
When running cmake directly (without west, as twister does) on nix the
CMake environment paths are set and thus it does not find the
virtualenv'ed python. Fix this by ignoring the cmake environment
variables nix sets.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Updates references to the net-tools project to refer to the correct
placement of net-tools under tools.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Remove the toolchain_ld_<base|baremetal|cpp> macro as all the macro
handling is now done through the use of linker properties.
Keep support for calling the old macros for out of tree toolchains
which have not been updated to the new property approach.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Move linker flag setting from toolchain_ld_baremetal() to linker flag
properties as to follow the principle used in previos commits and from
PR#24851.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Transition the linker flag for the toolchain_ld_base and
toolchain_ld_cpp macros to linker flag properties.
This work follows the toolchain abstraction started in PR#24851.
toolchain_ld_base() was intended for base linker flags, but has slowly
become a 'set-any-linker-flag-here' and thus having several
`if(<check>)` or `<func>_ifdef(<check> ...)`.
Move the check to the top-level Zephyr CMakeLists.txt file, so that it
becomes cleaner which part is responsible for setting a value, and then
move the actual value (the linker flag) definition to the linker flag
property location.
It also helps adding support for new linkers, as it becomes clearer
which linker flags Zephyr always expects, for example `base` and
`cpp_base`, as well as those settings which are targeting for a given
purpose, such as linker sort alignment.
It also makes it clearer when those are used, for example in top-level
CMakeLists.txt with CONFIG_LINKER_SORT_BY_ALIGNMENT compared to this
information being buried in a linker support macro.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
To ease the use of linker flag properties and to simplify the use of
generator expression then an optional PROPERTY argument has been added
to the zephyr_link_libraries() function.
This means a call such as:
zephyr_link_libraries($<TARGET_PROPERTY:linker,<property-name>)
can instead be simplified to:
zephyr_link_libraries(PROPERTY <property-name>)
Thus making intention clearer and keeping the complexity and minimizes
the risk of typos when writing generator expressions.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The selection of the runtime library when using LLVM has already been
done in llvm/target.cmake and passed to the toolchain_ld_base() function
through the global TOOLCHAIN_LD_FLAGS setting.
The only reason this haven't been noticed is because of CMake's built-in
symbol de-duplication feature.
Remove the redundant runtime library handling.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The support of PROPERTY_LINKER_SCRIPT_DEFINES has been broken since
the transition to CMake in 12f8f76165.
The intention was probably to allow users / projects to adjust
PROPERTY_LINKER_SCRIPT_DEFINES by setting a CMake cache variable.
The implementation tests for the CMake variable (local scope or cache)
PROPERTY_LINKER_SCRIPT_DEFINES, but it never uses such CMake variable.
Instead it uses a CMake global property named
PROPERTY_LINKER_SCRIPT_DEFINES. CMake variables and CMake global
properties are two very different things, and therefore the current
implementation has never worked. The fact that no one has never noticed
this flaw, means that the feature has never been used as intended.
Simplify the code by removing the use of the global CMake property and
instead set the value of the property on the linker script
pre-processing invocation.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The macro `toolchain_cc_nostdinc` were made obsolete with PR#24851 and
are no longer invoked.
Remove the macro implementations.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The IEEE 801.15.4 monitor can be started by a parameter to cmake. This
change removes a TODO to kill the monitor after qemu ends.
The change also re-assigns Ctrl-C to Ctrl-D to ensure that QEMU is not
inadvertently sending SIGINT to the surrounding ninja session (which
would leave the monitor sub-process alive).
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Initial CMake yaml module to facilitate reading yaml files into CMake,
update yaml settings and write it back to a file.
The yaml module also supports creation of yaml files from scratch.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Add a new zephyr_check_arguments_required_allow_empty() macro for
function argument validation.
Zephyr already has a zephyr_check_arguments_required() for checking
required arguments, like
zephyr_check_arguments_required(foo_func <prefix> FOO BAR)
which ensures that one of FOO or BAR are given in a call like:
foo_func(BAR val)
One limitation however, is that is some cases BAR may be allowed to be
empty, so that it's still possible to know if FOO or BAR were supplied.
In most case, BAR and FOO will have values following the keyword, like:
foo_func(BAR my_bar_val)
foo_func(FOO my_foo_val)
but in cases where `my_bar_val` is a variable which may be empty, like:
set(my_bar_val)
foo_func(BAR ${my_bar_val}) # (expands to: foo_func(BAR)
then BAR was actually supplied.
To support functions where such empty expansion is allowed, then a new
helper macro `zephyr_check_arguments_required_allow_empty()` has been
implemented, as to be able to distinguish `foo_func()` from
`foo_func(BAR)` when parsing arguments.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Introduce list mode in Zephyr-sdk module package.
The list mode allows to list all Zephyr SDK's found in the system
without loading any of them.
Signature of the list mode is:
> find_package(Zephyr-sdk COMPONENTS LIST)
Will print valid Zephyr SDKs and their path, as well as defining the
following corresponding CMake lists:
- Zephyr-sdk : List of Zephyr SDKs' version
- Zephyr-sdk_DIRS : List of Directories with a valid Zephyr SDK.
Each entry in Zephyr-sdk corresponds to the same entry index in the
Zephyr-sdk_DIRS list.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Minor cleanup of the FindZephyr-sdk.cmake module.
- Honor the QUIET flag on find_package(Zephyr-sdk QUIET)
Do not print messages when caller has specified QUIET in the
'find_package()' call.
- include Zephyr extensions CMake module.
FindZephyr-sdk.cmake uses zephyr_get() from extensions.cmake, and
therefore the proper thing to do is to include said module in order
to have the package re-usable.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Introduce core support for ARM's SCMI (System Control and
Management Interface). This includes:
* shared memory (SHMEM) driver. This consists of a suite
of functions used to interact with the shared memory area.
* shared memory and doorbell-based transport layer driver.
Data is passed between platform and agent via shared
memory. Signaling is done using polling (PRE_KERNEL) and
doorbells (POST_KERNEL). This makes use of Zephyr MBOX API
(for signaling purposes) and the SHMEM driver (for polling
and data transfer).
* core driver - acts as glue between transport and protocol
layers. Provides synchronized access to transport layer
channels and channel assignment/initialization.
* infrastructure for creating SCMI protocols
This is based on ARM's SCMI Platform Design Document: DEN0056E.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Fixes#64149
Add support for a new Kconfig symbol: BUILD_OUTPUT_ADJUST_LMA_SECTIONS.
This is supplemental to the existing BUILD_OUTPUT_ADJUST_LMA setting,
which normally adjusts all output sections' LMA by the provided offset.
Defining the new symbol will narrow down the set of applicable sections
to a user-specified CMake list of name patterns.
Example usage:
DT_CHOSEN_Z_FLASH = zephyr,flash
DT_CHOSEN_Z_SRAM = zephyr,sram
config BUILD_OUTPUT_ADJUST_LMA
default "$(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH)) - \
$(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM))"
config BUILD_OUTPUT_ADJUST_LMA_SECTIONS
default "*;!bss;!noinit"
Supported values for BUILD_OUTPUT_ADJUST_LMA_SECTIONS are aligned with
objcopy, since this feature has only been supported with GNU binutils
thus far.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
The LLEXT EDK was not exporting common Zephyr compile definitions
("-Dxxx" flags). This patch adds the compile definitions before the
other compile flags, as it is done in the Zephyr build system.
This patch also adds to this list the "-DLL_EXTENSION_BUILD" flag,
instead of providing a special case at a later stage.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
The variable llext_edk_cflags was used in the main CMakeLists.txt file,
while llext_cflags was used in the llext-edk.cmake file. This commit
unifies the variable names to use llext_edk_cflags in both files.
No logic changes are introduced by this commit.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This commit modifies the DTS cmake module to capture `stderr`
output of the `gen_defines.py` script and `dtc` program during
their execution. The messages can then be printed as CMake
`message`s, which improves QoL when debugging device tree
errors, and reduces the risk of introducing malformed DTS,
as the warning/error messages are made much more visible.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
The `create_runners_yaml` function no longer saves the yaml file
location in the cmake cache since 5b4c8945.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Don't provide __STDC_LIB_EXT1__ macro (Extensions to the C Library,
Part 1: Bounds-checking interfaces) if we use minimal libc - as we don't
have functions from this extension implemented in minimal libc.
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
The CPP in ARC MWDT toolchain relies on TLS (THREAD_LOCAL_STORAGE)
so enable it if CPP is selected.
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Since f3e5d9db3dca2421bd5b4015fbc270d3972376bd, one needs to define
`LL_EXTENSION_BUILD` to enable exporting symbols from extensions. That
patch added that for `add_llext_target`, but missed it for the EDK, thus
breaking it. This patch fixes that.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
This commit removes the "-vvv" argument from the SLID generation
scripts' command line when building Zephyr or an extension with
Kconfig CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID enabled. This removes
a lot of noise in the build log (usually ~250 lines) and is fine to
do because the printed information is also saved in build artifacts.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Adjust error message so that it clearly states runners.yaml is
missing from <build_dir>/zephyr, instead of referencing CMake cache
variable ZEPHYR_RUNNERS_YAML, which is no longer used (since
3124c02987 ).
Also clean up that variable in CMake since it is no longer used
(0 other references in entire tree).
Fixes#70605
Signed-off-by: Louis Feller <louis.feller@st.com>
Add initial support for the Cortex-M85 Core which is an implementation
of the Armv8.1-M mainline architecture.
The support is based on the Cortex-M55 support that already exists in
Zephyr.
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
The current implementation does not work well when ARMFVP_BIN_PATH is a
colon separated list.
This lets `find_program` deal with the lists.
Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
Clang uses floating-point instructions by default, even if -mfpu is not
defined. Disable using FPU when CONFIG_FPU=n.
Using floating-point instructions when FPU is not enabled generates
Usage Fault.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Fixes and simplifies the handling of how the dts watch file is
processed
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Fixes an issue in the code that processes the output file of a
compiler to see which files should be watched, the compiler can
combine multiple files into a single line instead of putting them
each on separate lines if the length of the file paths is short,
therefore account for this and split it up into multiple elements
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>