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>
Some target may need to pass in the application argument. In such case
do not override it.
Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
Signed-off-by: Sudan Landge <sudan.landge@arm.com>
For CONFIG_USERSPACE the input from gen_app_partitions.py there is
a need to be able to specify input files as well as input sections
patterns for zephyr_linker_section_configure(). This is used for
app partitions from libraries (which generate input patterns like
foo.a:*(.data*)).
This adds documentation to zephyr_linker_section_configure() to clarify
what INPUT allows, and also adds some parsing tricks to ld_script.cmake
to properly add the file patterns when they are missing.
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
It seems as if ld_script.cmake hasnt handled
zephyr_linker_section_configure( ALIGN ...) due to a typo
in a variable name,
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
All in all this makes cmake linker generator able to work for at least
most of the kernel tests and samples, on cortex m4.
Make the cmake linker generator have a file-structure more similar to
the ld-skeletons.
Add or edit groups, sections and logic to make the generator reflect
what the ld-skeletons do, esp. for kobjects and APP_SMEM, nonint and
some other details are also effected.
Use the new zephyr_linker_include_generated() and
zephyr_linker_include_var() functions to to handle
${DEVICE_API_LINKER_SECTIONS_CMAKE}, the kobject-prebuilt-*.h files and
APP_SMEM partition. Essentially the output from gen_app_partitions.py,
gen_kobject_placeholders.py.
Add ALIGN_WITH_INPUT on sections being put into DATA_REGION. This makes
the init layout work for ld.
This leverages the updates in gen_app_partitions.py to generate its
output as cmake linker generator sections too, and puts them into a
group defined in linker.cmake
Setup generator variables for alignment of APP_SMEM. Note that this does
not yet handle MPU_ALIGN which depends on the size of the section...
Fix broken k_object_assignment iterable section
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
Add methods for the linker-script generator to pick up information
from previus linkerpasses:
* zephyr_linker_include_generated(FILE f.cmake [PASS X] [KCONFIG])
cmake-includes f.cmake in the relevant PASSes. This allows scripts
to generate any content (e.g. sections or section configs) as if
it was generated by the main cmake machiery. This is intended to
cover the case of ld-script snippets generated by e.g.
gen_app_partitions.py
It can also parse KCconfig files to capture @CONFIG_FOO@ variables
* @FOO[,undef:v]@ in an value or expression in the zephyr_linker_*
inputs. This looks for a defintion of FOO (se below), and uses its
value if found. If FOO is not defined, the whole @@ thing is left
untouched, unless ,undef: is used, in which case v is used instead.
* zephyr_linker_include_generated(FILE f.h [PASS x]) greps for f.h
for #define FOO value to be accessed as @FOO@
* zephyr_linker_include_var(VAR FOO VALUE V) allows the main
cmake-script to set a @FOO@ variable.
Note that the #define support is VERY basic, and does not use a proper
pre-processor. It works for the current use of files generated by e.g.
gen_kobject_placeholders.py but is not a general solution.
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
Move creation of the generator arguments file from each target.cmake
into a function (zephyr_linker_generate_linker_settings_file).
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
Add MIN_SIZE and MAX_SIZE options to zephyr_linker_section()
and zephyr_linker_section_configure().
This allows padding (for MIN_SIZE) and link-time checking (for MAX_SIZE)
of sections (and parts of sections).
Clarify comments for zephyr_linker_section_configure
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
Make it possible to have multiple PASS parameters to
zephyr_linker_section() and zephyr_linker_section_configure() sections
(oring them) OR to have multiple PASS NOT p options (in which case the
sections applies in neither of the passes)
Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
Extend `zephyr_library_amend()` to support an optional directory
argument.
The current `zephyr_library_amend()` works well when used inside a
Zephyr module with same structure, but fails when the macro is called
from Zephyr module integration code is located in a Zephyr
`MODULE_EXT_ROOT` because in this case the CMake code being executed
is not present in the Zephyr module itself, in which case the dir name
creation based on relative to module dir give wrong result.
For this use-case then support a base directory.
This also allows for use-cases in Zephyr modules where the directory
structure matching Zephyr's own structure is placed in a sub-folder.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
In case a confirmed image gets generated, it should be used during
flash process.
If there is a valid application in second image slot, flashing
*.signed.hex will result in a unconfirmed image in first slot.
After reboot MCUboot will replace the unconfirmed image by swaping
the confirmed application from the second into the first slot.
Signed-off-by: David Schneider <schneidav81@gmail.com>
Currently stderr is printed only if dtc encounters warnings, but it's
not printed in case of errors. However this information can be useful
to quickly identify and resolve the problem.
To solve this let's add "COMMAND_ERROR_IS_FATAL ANY" to execute_process()
so that CMake will fail in case of errors and a proper message will be
printed on the output.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Removes functions that would handle deprecated variables and
functionality from CMake within Zephyr that were deprecated in
Zephyr 3.1 onwards but before 3.7
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
In the linker script generator there was one error checking
construct that used regexp and that ended up in the generated
linker file, which caused parsing problems with the IAR
linker. It was unnecessary. Also updated
common-rom-kernel-devices.ld.
Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
Recently 0ae0c3dc44 allowed for three digit priorities, this resulted
in objects potentially matching multiple sections, for example:
.z_init_PRE_KERNEL_2_0_0_
.z_init_PRE_KERNEL_2_?_*
.z_init_PRE_KERNEL_2_???_*
This does not seem to be detected by ld, but the IAR linker emits a
warning.
Add some extra qualifiers in the object section name to make it
unambiguous, this has the extra value of making it easier to interpret,
for example going from:
.z_init_POST_KERNEL_90_00012_
to
.z_init_POST_KERNEL_P_90_SUB_00012_
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Some projects may have needs for more than 99 priority levels, so add
a third linker input section for each obj level.
Signed-off-by: Josh DeWitt <josh.dewitt@garmin.com>
Ensure the priority is surrounded by underscores for clarity. This makes
sections show up as
z_init_PRE_KERNEL_1_0_0_ instead of
z_init_PRE_KERNEL_10_0_
Signed-off-by: Josh DeWitt <josh.dewitt@garmin.com>
Rewrote the warning levels for toolchain IAR as IAR tools just turn
off warnings, not on. Also did some minor cleanup for coding
guidelines.
Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
xt-clang is usually based on older version of clang, and
Zephyr main targets more recent versions. Because of this,
some newer compiler flags may cause warnings where twister
would mark as test being failed. To workaround that,
add -Wno-unknown-warning-option to suppress those warnings.
Fixes#84138
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Build type was removed in 763a49f082 but
the function description was not updated accordingly.
Remove build type from the function description.
Add board qualifier as that is missing.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit brings support for additional GCC static analyzer options
with 'GCC_SCA_OPTS=...'
Linked to discussion on 'ccache' side effect on analyzer file
generation[1]
[1] https://github.com/zephyrproject-rtos/zephyr/discussions/86196
Signed-off-by: Alex Fabre <alex.fabre@rtone.fr>
Introduce GCC_COMPILER_VERSION to be used in Zephyr CMake when knowledge
of the current GCC Compiler version is needed and
CMAKE_C_COMPILER_VERSION has not been defined yet.
CMAKE_C_COMPILER_VERSION is not defined until project() is called.
Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
Export the currently used board name and (when applicable) qualifiers
and revisions to the EDK files. This information can be used by EDK
users who deal with multiple targets to differentiate between them.
Uses the existing 'zephyr_string' function to sanitize the strings
instead of a custom regex replace.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
The -imacros flag may be given in a number of different variations:
- with one or two preceding dashes, and
- separated from its argument, joined by an equals sign, or joined with
no separator
This patch fixes the handling of the -imacros flag in the LLEXT EDK to
detect all of those options.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
The config LOG_USE_VLA depends on that MISRA_SANE is not set.
Unfortunately the IAR toolchain can't handle vla:s inside a
statement, which the LOG_USE_VLA macro does.
I've added a new, hidden config to check if vla is ok inside
statements, SUPPORT_VLA_IN_STATEMENTS. Default is always y, but
a toolchain can override it so that VLA is not used by
Z_LOG_MSG_ON_STACK_ALLOC.
Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
Introduce a new field to store device flags. Only device deferred init
flag has been added, replacing usage of linker hackery to know wether a
device requires initialization at boot time or not. This change will be
helpful in the near future as devices will become reference counted, so we
will need to know wether they have been initialized or not.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Configures both of these variables so that they can contain
CMake variables which will be expanded
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
CMSIS modules dsp and nn sets the optimization flag -Ofast for their
libraries. I've now made a new compiler property optimization_fast to
avoid using ifdefs in the cmsis CMakeLists.txt files.
I've update GCC and arcmwdt (not sure if arcmwdt supports -Ofast)
Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>