This commit brings a convenient way to run clang static analyzer on a
project with 'analyze-build' llvm utility.
Signed-off-by: Alex Fabre <alex.fabre@rtone.fr>
The logic to "guess" shield names/dirs was duplicated between
list_shields.py (which is used by e.g. west shields) and shields.cmake.
This commit moves the logic to list_shields.py, and updates
shields.cmake to call the script and process its JSON output.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The RX floating-point hardware only works on 32-bit values
so default gcc will build doubles as 32-bit, this make many
test fail on RX build test.
This commit force the build for RX arch to use 64-bit doubles
FPU will be supported later on this arch
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
Make the image devicetrees available to sysbuild for advanced use cases.
This is done by calling `zephyr_dt_import` on each image target. The DT
target properties are all expected to be prefixed with `DT_`, so there
should be no conflicts.
Thus, the DT contents of a given `<image>` can be retrieved using e.g.:
dt_nodelabel(<var> NODELABEL <label> TARGET <image>)
as noted in `extensions.cmake`.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
The CMake dt_* API is backed by target properties. By default, it uses
the target named `devicetree_target` that is initialized in `dts.cmake`.
We should be able to customize this, now that we have a function for
loading those properties into a different target. For example:
zephyr_dt_import(EDT_PICKLE_FILE /path/to/edt.pickle TARGET target)
dt_nodelabel(node NODELABEL label TARGET target)
This would make it possible to reference multiple devicetrees in the
same build system, particularly sysbuild.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Extract the part of `dts.cmake` that invokes `gen_dts_cmake.py`, then
generalize it into a CMake extension, which can be reused by sysbuild.
The Python script itself is also updated, so that the generated CMake
file can accept an input variable DEVICETREE_TARGET, which comes from
the `zephyr_dt_import(TARGET ...)` argument.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
The ECLAIR service STD.emptrecd (which checks for empty structures) is now
deprecated.
Use STD.anonstct (which checks for structures with no named
members, an UB in C99)
Based on a change by Nicola Vetrini in the Xen project:
https://lists.xenproject.org/archives/html/xen-changelog/2024-12/msg00125.html
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
While legacy shields are still supported, this introduces a shield.yml
file similar to board.yml that allows to more explicitly declare a
shield and to set some useful metadata such as vendor and full name.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Some simics dependencies live at its own directory, not application's.
Note we need to change it to its absolute path, because relative paths
for `add_custom_target` are relative to the build directory, while
relative SIMICS_PROJECT are more likely to be relative to ZEPHYR_BASE,
from where west or twister are normally run.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Similar to the pre_dt_board.cmake, this is an optional file for
additional arguments that need to get passed to the devicetree compiler.
Signed-off-by: Paul Schaetzle <paulschaetzle@mailbox.org>
Automatically generate a boolean CONFIG_BOARD_REVISION_FOO=y Kconfig
option based on e.g. CONFIG_BOARD_REVISION="foo".
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit allows comments to reference files with paths that are relative
to the Zephyr workspace root. This is done by adding a new argument
'--workspace-dir' to the 'gen_edt.py' script, which is passed to the
'EDT' and 'DT' classes and used instead of the current working directory.
The workspace directory is set to WEST_TOPDIR if West is in use,
otherwise it is set to the parent directory of ZEPHYR_BASE so that
Zephyr files have a 'zephyr/' prefix.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This will implement a way of doing static initialization
the "IAR" way. This is done by calling __iar_data_init3
which handles all static initialization that is mentioned
in the linker file "initialize by copy".
Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
Support to run non secure variants with ARMFVP was enabled with
a7122cf5 and fa45bebc
however, the pattern search doesn't work as expected.
This commit fixes that.
Signed-off-by: Sudan Landge <sudan.landge@arm.com>
Add coverity integration as a SCA variant. This is targetting the
service provided by blackduck to open-source projects available on
scan.coverity.com.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Instead of obscure linker-file hacks providing dummy definitions before
we have the proper generated k-object lookup functions, provide weak
definitions that will be taken out by the real generated implementations
when they are available.
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
The QingKe V2C has an integer multiplier but no divide. Add support
for the corresponding Zmmul extension and, as the extension was added
in GCC 13.0, add a test for the compiler version.
Signed-off-by: Michael Hope <michaelh@juju.nz>
Make sure to provide full paths when saving the intermediate files in
the YAML export, to prevent them from being saved in the source tree.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
The Renesas RX support flashing .mot file for binary image
This commit target to add the .mot file output for build and
flash script
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
GCC and Clang support the undefined behavior sanitizer in any
configuration, the only restriction is that if you want to get nice
messages printed, then you need the ubsan library routines which are only
present for posix architecture or when using picolibc.
This patch adds three new compiler properties:
* sanitizer_undefined. Enables the undefined behavior sanitizer.
* sanitizer_undefined_library. Calls ubsan library routines on fault.
* sanitizer_undefined_trap. Invokes __builtin_trap() on fault.
Overhead for using the trapping sanitizer is fairly low and should be
considered for use in CI once all of the undefined behavior faults in
Zephyr are fixed.
Signed-off-by: Keith Packard <keithp@keithp.com>
When using one set of environment variables for multiple
cores compilation, we also need to supply the core name in
linker flags. So add that to TOOLCHAIN_LD_FLAGS.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Move all the vendor-specific dtsi files that were in dts/common to a
new folder under dts/ designated for vendor-specific files,
since they are not common at all, except for one vendor.
Change MAINTAINERS.yml to reflect the moving of the files.
Update migration guide for this change.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Remove usage of ld-specific ADDR function within the cmake linker
generator scripting. Since the linker generator scripting doesn't
support MPUs, we can simply set the __ramfunc_region_start symbol to be
equal to __ramfunc_start
Fixes#87200
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
A message about not finding simics at SIMICS_PROJECT env var was not
showing the current value of said variable.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Introduce a new video device structure representing a device in a
video pipeline. Each video device embeds a pointer to its "source"
device and other "video" characteristics.
This structure give the video framework an access to all video features
of the device and a hierachical view of the video pipeline that the
device belongs to.
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
zephyr_linker_section(... ADDRESS 0xF00) was broken. The fixed
placement was using their parent group address.
This also removes some dead code in config_file_script.cmake that
helped confuse what is going on with fixed sections.
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
file(GENERATE ...) does not update the output file if the content is
unchanged. Since the metadata in build_info.yml mostly depends on the
build configuration, the timestamp of the intermediate file does not get
updated on most rebuilds, while the final file does, due to immediate
file(WRITE ...) calls. Since the latter is newer, no post-process step
is executed and the file is left with commented genexes.
Touching the intermediate file ensures that the post-process step is
performed every time, even if the content is unchanged, restoring the
expected behavior.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Switching the intermediate file format from JSON to YAML has a very
significant benefit: the file is now loaded via yaml_load(), which
internally calls Python to parse the file into the JSON format that
CMake expects. This means that the file contents are now automatically
escaped properly for JSON; it is a huge improvement over the previous
implementation, which was escaping everything given as input to
to_yaml().
With the removal of the now-redundant call in to_yaml(), escaping is
applied exactly once per value or list, when it is passed to yaml_set().
This allows to convert the logic in zephyr_string(ESCAPE ...) to a more
robust "escape everything" approach.
These changes fix the handling of strings with backslashes and different
types of quotes passed either directly or via generator expression. The
existing tests are updated to cover these cases.
Two other small changes are made in this commit:
- a small check in internal_yaml_list_append() is removed, as the same
issue is already detected by the caller yaml_set() logic.
- the to_yaml() function is modified to initialize the YAML output
variable at the top level, which is the expected behavior. This
resulted in genex temp files sometimes having duplicate lines.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
The intermediate file used to expand the generator expressions is now in
YAML format. This allows for a more robust handling of the data, as the
single quoted strings are a lot easier to escape: inside them every
character is a literal except for two single quotes (which intuitively
map to a literal single quote).
When saving a simple YAML file without genexes, the single quotes in
strings need to be escaped. However, doing so when saving the
intermediate file would make it harder to properly escape them later,
since it could be possible that the expansion of the generator
expressions would introduce new single quotes. For this reason, when
genexes are enabled, the escaping is now done in a single pass inside
the yaml-filter.cmake script.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Store strings in YAML as single-quoted entries to avoid issues with
special characters. This also fixes a quirk with the current test
suite where the quotes in the expected value are filtered out by the
YAML import.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This commit refactors the zephyr_string() function to explicitly
show that ESCAPE and SANITIZE are mutually exclusive options and
that SANITIZE joins multiple arguments into a single string before
processing it.
No functional change introduced by this commit.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
To move away from the JSON/YAML terminology, rename the variables that
refer to the intermediate files to "expanded" and "output" files.
Also, clean up a few "C-style" function calls and a typo in a variable
name in the same files.
No functional change introduced in this commit.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
MCUboot has a configuration for single application slot RAM loading, in
which the single loader (or a hook thereof) can load an application from
an arbitrary flash location to RAM. Applications that are to be loaded
in this way need to specify, in their mcuboot header, the load address
in RAM they are meant to be loaded.
This patch adds a new Kconfig for this mode. The load address used comes
from devicetree chosen property "mcuboot,ram-load-dev", if it exists,
and if not, "zephyr,sram".
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
MODULE_EXT_ROOT allows Zephyr modules to provide glue code for Zephyr
modules using `cmake-ext: True` and/or `kconfig-ext:True`.
A module ext root provides a `modules.cmake` file which defines
variables like: `set(ZEPHYR_FOO_CMAKE_DIR <glue-code-path>/foo)`
It is intended that a downstream module can replace Zephyr's default
glue code, which again can be replaced further downstream.
Setting values in first modules.cmake (Zephyr's) are replaced by later
processed modules.cmake (downstream) when the setting name is identical.
Therefore the module ext root list should not be reversed, and Zephyr
itself should be placed as first entry in the list.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Avoid placing the device tree memories at an absolute address.
This avoids placing both .rom_start AND SSRAM1 at
the same address on mps2/an521/cpu0.
This seems fine according to ld (since one placement is empty)
but causes a currently non-suppressable diag_warning
Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
The board revision is not part of the NORMALIZED_BOARD_TARGET variable
as composed by Zephyr, so it must also not be used in the EDK exported
value to avoid mismatches. The revision is exported as a separate
variable, so it can still be used to differentiate between board
revisions.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
As of c952f09a79 the calls to west
sign were replaced with imgtool but a lingering integration with
WEST_TOPDIR was allowed to remain which is not needed when there
are absolute paths available for the configuration. So, this
attempts to refactor the code to allow a few things
- allow a search of relative paths to application config and
then west topdir
- only fatal error when a west workspace is needed but not found,
so if the config is all absolute files then a west workspace is
not required
Fixes: #86438
Signed-off-by: Charles Hardin <ckhardin@gmail.com>