Commit Graph

7170 Commits

Author SHA1 Message Date
Harshal Patil ed57a94687 Merge branch 'feat/extend_pmp_protection_esp32p4_eco5' into 'master'
Extend PMP memprot for ESP32-P4 V3

Closes IDF-14075

See merge request espressif/esp-idf!42402
2025-11-11 10:07:21 +05:30
Erhan Kurubas 08cf6c1a40 Merge branch 'move_sysview_to_component_registry' into 'master'
Move sysview to component registry

Closes IDF-13403 and DOC-12867

See merge request espressif/esp-idf!43011
2025-11-10 19:19:17 +01:00
Erhan Kurubas 79cda70029 change(app_trace): move sysview to component registry 2025-11-10 15:55:41 +08:00
Song Ruo Jing 4b8633cc2b refactor(rom/gpio): add 'rom_' prefix to GPIO ROM functions 2025-11-07 15:26:52 +08:00
David Čermák 27baa4a261 Merge branch 'fix/ci_netif_deps' into 'master'
[esp-netif]: Improve CI builds of netif tests

See merge request espressif/esp-idf!43136
2025-11-06 14:18:44 +08:00
Fu Hanxi cc72cf9953 Merge branch 'ci/enable-junit-report-in-mr' into 'master'
ci: enable junit report in MR

See merge request espressif/esp-idf!42925
2025-11-06 03:32:19 +01:00
David Cermak 4f8aa980be fix(ci): Refine depends pattern for netif test apps 2025-11-05 10:41:24 +01:00
Marius Vikhammer 02ff6e9656 test(netif): fixed protocols test-apps building for unrelated comp. changes 2025-11-05 10:40:39 +01:00
Frantisek Hrbata 1a9d0ce3f5 ci(pre-commit): exclude buildv2_test_app from check-readmes
The `tools/test_build_system/buildv2_test_app` is a cmakev2 build system
testing application, same as `build_test_app`, which should be removed
from the readme check performed by check_build_test_rules.py.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-05 10:21:52 +01:00
Fu Hanxi 2160ce6c56 ci: remove generate pytest report job
this is a temp workaround, since the current job takes too much time.
should replace it a new implementation
2025-11-05 10:17:14 +01:00
Roland Dobai d1b91b79b5 Merge branch 'fix/cmakev2_fixes' into 'master'
fix(cmakev2): sync with cmakev1 changes

See merge request espressif/esp-idf!43095
2025-11-05 09:51:30 +01:00
harshal.patil c66ef46f99 feat(cpu_region_protect): Extend PMP memprot for ESP32-P4 V3 2025-11-05 13:34:47 +05:30
Armando (Dou Yiwen) 6c8e58b388 Merge branch 'feat/p4_eco5_target_test' into 'master'
esp32p4: temporarily disable target test

Closes CII-17

See merge request espressif/esp-idf!42603
2025-11-05 01:32:16 +00:00
Frantisek Hrbata 999cc27599 feat(cmakev2/project): add warning for usage of deprecated variables
The COMPONENTS and EXCLUDE_COMPONENTS variables are unused in cmakev2. A
deprecation warning will be printed if they are set. This change also
includes a helper functions for printing deprecation warnings.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 14:38:13 +01:00
Frantisek Hrbata de5ad78f6b fix(cmakev2/project): drop prefix_map_gdbinit in favor of gdbinit/prefix_map
The cmakev1 dropped generation of prefix_map_gdbinit, reflect this
change also in cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 12:08:50 +01:00
Frantisek Hrbata 37efbf8675 fix(cmakev2/project): bump C and CXX standard
The cmakev1 bumped C and CXX standard to gnu23 and gnu++26, do the same
in cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 11:10:02 +01:00
Frantisek Hrbata c98146a8c6 fix(cmakev2/compat): add esp_stdio to common requires
The cmakev1 added esp_stdio to common requires, add it in cmakev2 too
for backward compatibility.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 11:06:02 +01:00
Roland Dobai a0b589c147 Merge branch 'feat/cmakev2' into 'master'
feat(cmakev2): introduce cmake-based build system v2

See merge request espressif/esp-idf!42691
2025-11-04 02:53:36 +01:00
Roland Dobai a6396a5387 Merge branch 'feature/cmake_presets' into 'master'
feat(tools): add idf.py support for CMake configuration presets

Closes IDF-13090, IDF-9350, and DOC-12674

See merge request espressif/esp-idf!40552
2025-11-03 17:15:46 +01:00
igor.udot 824c7f7320 ci: extend wildcard support for no_runner_tags 2025-11-03 02:48:04 +00:00
igor.udot 7a411e8a1b ci: extend wildcard support for EXCLUDE_RUNNER_TAGS 2025-11-03 02:48:04 +00:00
armando 2c9c5c66c8 change(ci): temporarily disable p4 target test 2025-11-03 02:48:04 +00:00
morris 0332719183 Merge branch 'refactor/remove_twai_errata_config' into 'master'
refactor(driver_twai): remove twai errata config

Closes IDF-13623 and IDF-13002

See merge request espressif/esp-idf!42850
2025-11-03 10:28:29 +08:00
Erhan Kurubas 1dac8685db feat(tracing): add new component for tracing 2025-10-30 12:15:35 +01:00
Frantisek Hrbata 7116d9dc01 feat(toolchain): more remove_duplicated_flags function to separate file
Currently, the toolchain CMake files use the remove_duplicated_flags
function from utilities.cmake. The cmakev2 implementation also includes
this function for backward compatibility. Move the
remove_duplicated_flags function to a separate file,
deduplicate_flags.cmake, so it can be shared between cmakev1 and
cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 997cd81675 feat(cmakev2/compat): add idf_component_register to the API
Using idf_component_register is the preferred method for creating new
components for cmakev2. This approach ensures compatibility with both
versions of the build system. The KCONFIG and KCONFIG_PROJBUILD options
have been removed from the API documentation, but are retained in code
in case a cmakev1 component uses these options to warn about
incompatibility. Also remove a note about `project_include.cmake`,
because cmakev2 includes all project_include files.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata fc1f995e5e fix(cmakev2/component): set the cmakev2 component archive name
Currently, the archive file name is set only in the cmakev1
idf_component_register shim. The predictable component archive file name
is important, for example, for usage in linker fragments. Ensure that
the cmakev2 component also has the archive file name set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata a7977d0d14 fix(cmakev2/component): fix setting SOURCES for cmakev2 components
Currently, when the cmakev2 component sources are set, the SRCS target
property is used.  This is obviously wrong because the correct CMake
property is SOURCES.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 2760eca984 feat(cmakev2/build): rename LINKER_SCRIPTS_STATIC to LINKER_SCRIPTS
Rename the LINKER_SCRIPTS_STATIC component property to LINKER_SCRIPTS.
This property stores linker scripts that are not processed by ldgen,
which essentially includes all of them. The only linker script processed
by ldgen is sections.ld, which is handled by the esp_system component.
This implies that there is likely no practical use case for other
components to utilize ldgen processed linker scripts. This change is
purely cosmetic to allow components to add linker scripts with:

idf_component_set_property(${COMPONENT_TARGET} LINKER_SCRIPTS linker_script.ld APPEND)

instead of

idf_component_set_property(${COMPONENT_TARGET} LINKER_SCRIPTS_STATIC linker_script.ld APPEND)

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 229000b186 fix(cmakev2/docs): keep only the very basic functions in API
Currently, we include numerous functions in the automatically generated
documentation for the build system API. Let's begin with only the
essential functions and gradually add more to the API based on requests
and actual needs.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty e744534fca fix(cmakev2): Add workaround in idf_build_component for duplicate managed component
This commit adds a workaround in idf_build_component shim to avoid
initialization of a duplicate managed component. The component manager
when running on a Windows system returns duplicate managed components
upon successive invocations.
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 06ae65cca4 fix(cmakev2/component): fix component library link with whole archive
The current approach involves wrapping the library target within the
library interface target with the whole-archive flags, such as for the
GCC linker. However, this does not work as expected because the library
target is expanded, and the whole-archive flags are also applied to
other library targets that the wrapped library target depends on. IOW
the whole-archive flags surround multiple archives, not just the one
requrested.  Generally, using linker flags like whole-archive in the
library INTERFACE(INTERFACE_LINK_LIBRARIES) does not seem to work as
CMake may perform deduplication and rearrange the flags [1].

The proof of concept used `CMAKE_LINK_LIBRARY_USING_<FEATURE>` with the
WHOLE_ARCHIVE feature, which was introduced in CMake 3.24 to specify how
the library target should be linked. There are two issues with this.
First, this feature is only available from CMake 3.24 onwards, while our
minimum CMake version is set to 3.22. More importantly, all occurrences
of a library on the link line are wrapped.  For example, if a library
like `vfs` appears multiple times on the link line due to dependencies,
each occurrence will be wrapped with whole-archive, causing the linker
to complain about multiple symbol definitions. Therefore, even though
WHOLE_ARCHIVE is recommended for handling whole-archive linkage, it does
not seem suitable for our purposes. This was overlooked in the PoC
because only a simple testing component was used to check the
WHOLE_ARCHIVE behavior.

One way to address this issue is to adopt the same approach used in
cmakev1, which involves specifying the whole-archive flags when linking
component library targets to the final executable. In this case, CMake
retains the flags without any alteration, unlike when the flags are
specified in INTERFACE_LINK_LIBRARIES for the component interface
targets. While this approach is feasible, it would alter the current
logic, where we have a single library interface for the entire idf
library that can be linked to the executable. This change would also
complicate the direct use of the idf library, as it would no longer be
possible to simply link it to the executable. Instead, the executable
would need to correctly link the component libraries with the
whole-archive flags. We could encapsulate this process within the
idf_build_executable function, but projects that only use
idf_build_library would need to implement the same solution.

It appears possible to address this issue by using target_link_options
instead. This allows to specify exactly what should appear on the link
command line. One side effect of this approach is that the library
appears on the link command line multiple times: first when used with
target_link_options and second when used in target_link_libraries.
However, this does not seem to pose a problem. The flags specified with
target_link_options appear on the command line first, ensuring that the
whole-archive is prioritized, and the component archive libraries may be
repeated on the link line anyway due to dependencies. Essentially, the
final link command line is very similar to the one from cmakev1. We may
revisit this approach in the future, but for now, it seems to work as
expected.

[1] https://gitlab.kitware.com/cmake/cmake/-/issues/20078
[2] https://cmake.org/cmake/help/latest/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.html
[3] https://discourse.cmake.org/t/automatically-wrapping-a-static-library-
    in-whole-archive-no-whole-archive-when-used-during-linking/5883

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 6284960254 fix(cmakev2/component): sanitize PATHS argument before calling __get_relative_paths
Currently, when the cmakev1 properties for INCLUDE_DIRS and
PRIV_INCLUDE_DIRS are constructed in the
__set_component_cmakev1_properties function, the return values from the
get_target_property function for INCLUDE_DIRECTORIES and
INTERFACE_INCLUDE_DIRECTORIES properties are not checked. If a component
target does not set e.g. INCLUDE_DIRECTORIES property,
get_target_property will return a value such as `include_dirs-NOTFOUND`.
This value is subsequently passed to __get_relative_paths in the PATHS
argument, causing the file(RELATIVE_PATH) call in __get_relative_paths
to fail with an error.

```
CMake Error at /home/fhrbata/work/esp-idf/tools/cmakev2/utilities.cmake:235 (file):
  file RELATIVE_PATH must be passed a full path to the file:
  include_dirs-NOTFOUND
```

Fix this by explicitly set the PATHS to an empty list before passing it
to the __get_relative_paths function if the property is not set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty 496ebf0583 feat(cmakev2): Enabled test_cmake.py for cmakev2 in CI 2025-10-30 17:17:49 +08:00
Sudeep Mohanty f3ffef0075 feat(cmakev2): ruff formatting changes for test_cmake.py 2025-10-30 17:17:49 +08:00
Sudeep Mohanty 577c0117cc feat(cmakev2): Create executable dummy source only if it does not exist
idf_build_executable() creates a dummy source file to create the
executable target. Since this file is created unconditionally everytime
CMake configuration happens, a source file change is registered which
causes CMake to execute other targets even though no other source file
changed.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty 22eb926468 feat(cmakev2): Enabled all component manager tests for cmakev2 2025-10-30 17:17:49 +08:00
Peter Dragun a66fecf16e fix: Update esptool commands to use new syntax 2025-10-30 17:17:49 +08:00
Frantisek Hrbata 1139551fde fix(test_build_system): disable tests related to outside component dependencies
The commit adb2d5deee ("feat(cmake): Produce warnings when component dependen..")
introduced additional checks for source files and include directories
used by a component that are located outside the component's directory.
If these files and directories belong to another component, a warning is
issued. This feature has not yet been implemented in cmakev2, so related
tests are temporary disabled.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty 84e65e5d24 feat(cmakev2): Enable test_components.py for cmakev2 in CI 2025-10-30 17:17:49 +08:00
Sudeep Mohanty bb3ce41141 feat(cmakev2): ruff formatting changes for test_components.py 2025-10-30 17:17:49 +08:00
Sudeep Mohanty 7030b25137 feat(cmakev2): Store COMPONENT_OVERRIDEN_DIR property for components 2025-10-30 17:17:49 +08:00
Sudeep Mohanty 0666fb28ea feat(cmakev2): Enabled test_common.py for cmakev2 2025-10-30 17:17:49 +08:00
Sudeep Mohanty 7fe743896d feat(cmakev2): Rename buildv2_test_app source file
This commit renames the buildv2_test_app.c file to build_test_app.c in
the buildv2_test_app template to enable tests to refer to the same
source file name when writing tests for both cmakev1 and cmakev2.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty c63063f3f6 feat(cmakev2): Enabled test_versions.py for cmakev2 2025-10-30 17:17:49 +08:00
Sudeep Mohanty f51b79dbe0 feat(cmakev2): ruff formatting changes for test_versions.py 2025-10-30 17:17:49 +08:00
Frantisek Hrbata e0525d7e94 feat(cmakev2/component): add __set_component_cmakev1_properties function
In cmakev1, certain arguments provided to the idf_component_register
function are stored as component properties. These properties are used
to generate the project_description.json file, which other tools rely
on. Since the idf_component_register function is obsolete in cmakev2, we
need to recreate component properties such as INCLUDE_DIRS,
PRIV_INCLUDE_DIRS, REQUIRES, and PRIV_REQUIRES, which were previously
provided by the idf_component_register function in cmakev1.  To achieve
this, let's examine the component's real target cmake properties and
reconstruct them to maintain compatibility with cmakev1.

The real target cmake properties may include generator expressions,
which are ignored. This should be acceptable, as they were not addressed
in cmakev1 either, and handling them is likely not feasible.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata ccab0ba626 feat(cmakev2/utilities): add __list_difference function
Return the difference between two lists, meaning the elements that are
present in the first list but not in the second.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 0e9ffe7ea9 feat(cmakev2/utilities): add __list_intersection function
Return the intersection of elements in the two lists.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata e1a697ef3c feat(cmakev2/utilities): add __remove_genex function
This helper function removes entries containing generator expressions
from the given list. The list is modified in place.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00