Commit Graph

47785 Commits

Author SHA1 Message Date
Jiang Jiang Jian
56bbfa89ea Merge branch 'test/esp_idf_hp_uart_wakeup_6.0' into 'release/v6.0'
fix(esp_driver_uart): resolve the issue of other chips receiving break data (v6.0)

See merge request espressif/esp-idf!43191
2025-11-11 19:16:44 +08:00
Jiang Jiang Jian
e8ba1ed59a Merge branch 'update/version_6_0_0' into 'release/v6.0'
Update version to 6.0.0

See merge request espressif/esp-idf!43129
2025-11-11 15:18:36 +08:00
morris
74710439b9 Merge branch 'feat/deprecate_legacy_twai_v6.0' into 'release/v6.0'
feat(driver_twai): add legacy driver deprecated warning (v6.0)

See merge request espressif/esp-idf!42975
2025-11-11 11:30:00 +08:00
morris
074c94607f Merge branch 'fix/pcnt_example_pytest_v6.0' into 'release/v6.0'
test(pcnt): fix pcnt example pytest (v6.0)

See merge request espressif/esp-idf!43194
2025-11-11 11:27:43 +08:00
Chen Jichang
17c3f42bd2 test(pcnt): fix pcnt example pytest 2025-11-10 15:28:25 +08:00
hebinglin
0d0908b86e fix(esp_driver_uart): resolve the issue of other chips receiving break data 2025-11-10 12:02:02 +08:00
Island
0978fc13ae Merge branch 'docs/ble_add_low_power_intro_v6.0' into 'release/v6.0'
Added BLE Low Power Mode Introduction (v6.0)

See merge request espressif/esp-idf!42996
2025-11-10 10:37:10 +08:00
Island
b65d10f0d8 Merge branch 'change/ble_update_lib_20251030_v6.0' into 'release/v6.0'
change(ble): [AUTO_MR] 20251030 - Update ESP BLE Controller Lib (v6.0)

See merge request espressif/esp-idf!42981
2025-11-10 10:36:55 +08:00
Roland Dobai
2bfbab6e31 Merge branch 'fix/cmakev2_fixes_v6.0' into 'release/v6.0'
fix(cmakev2): sync with cmakev1 changes (v6.0)

See merge request espressif/esp-idf!43139
2025-11-07 15:31:35 +01:00
Michael (XIAO Xufeng)
3911e65523 Merge branch 'feat/switch_h4_ci_build_to_mp_v6.0' into 'release/v6.0'
feat(esp32h4): switch default h4 build to mp version (v6.0)

See merge request espressif/esp-idf!43052
2025-11-06 00:22:51 +08:00
Zhao Wei Liang
f8f9cacd1c change(ble): [AUTO_MR] Update lib_esp32c6 to 5b8adfa8
(cherry picked from commit 16a893e934)

Co-authored-by: zhaoweiliang <zhaoweiliang@espressif.com>
2025-11-06 00:07:34 +08:00
Zhao Wei Liang
d13044debf change(ble): [AUTO_MR] Update lib_esp32c5 to 5b8adfa8
(cherry picked from commit baf8a20a5e)

Co-authored-by: zhaoweiliang <zhaoweiliang@espressif.com>
2025-11-06 00:07:34 +08:00
Zhao Wei Liang
d44a245e1b change(ble): [AUTO_MR] Update lib_esp32h2 to 5b8adfa8
(cherry picked from commit 4e07ce892d)

Co-authored-by: zhaoweiliang <zhaoweiliang@espressif.com>
2025-11-06 00:07:34 +08:00
Frantisek Hrbata
d5fcecbe85 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 12:02:08 +01:00
Frantisek Hrbata
dd5aae9c56 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-05 11:23:03 +01:00
Frantisek Hrbata
5724a6e1e4 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-05 11:23:03 +01:00
Frantisek Hrbata
c4d76cf7f4 fix(kconfig): distinguish project configuration menu for excluded components
Currently both menu configs, for component's project configuration and
component's configuration, for components not included in the build have
the same name: "Configuration for components not included in the build".
This might be confusing. Let's use "Project configuration for components
not included in the build" for component Kconfig.projbuild files.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-05 11:23:03 +01:00
Frantisek Hrbata
a384cde5ae 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-05 11:23:03 +01:00
Frantisek Hrbata
33e7824e33 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-05 11:23:03 +01:00
Wei Yuhan
d9ad0ad50b change(version): Update version to 6.0.0 v6.0-beta1 2025-11-05 16:25:23 +08:00
morris
b45631a7af Merge branch 'fix/anacmpr_etm_test_v6.0' into 'release/v6.0'
fix(test): deley some time to ensure gptimer is stopped (v6.0)

See merge request espressif/esp-idf!42891
2025-11-05 11:14:34 +08:00
morris
11c39ccf4b Merge branch 'feat/p4_eco5_target_test_v6.0' into 'release/v6.0'
esp32p4: temporarily disable target test (v6.0)

See merge request espressif/esp-idf!43026
2025-11-05 11:13:26 +08:00
Roland Dobai
36d7618208 Merge branch 'feat/cmakev2_v6.0' into 'release/v6.0'
feat(cmakev2): introduce cmake-based build system v2 (v6.0)

See merge request espressif/esp-idf!43078
2025-11-04 18:02:10 +01:00
Roland Dobai
0c8566f287 Merge branch 'feature/cmake_presets_v6.0' into 'release/v6.0'
feat(tools): add idf.py support for CMake configuration presets (v6.0)

See merge request espressif/esp-idf!43069
2025-11-04 18:01:57 +01:00
Marek Fiala
4591a6f29b Revert "fix: Updated locale handling to prevent issues with build tools"
This reverts commit 7e09b471ab.
2025-11-04 09:20:51 +01:00
Frantisek Hrbata
48b1594238 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-11-04 07:49:45 +01:00
Frantisek Hrbata
5985242d82 ci(pre-commit): revert temporary disable check-kconfig-files
Enable check-kconfig-files. It was temporarily disabled because it was
not possible to add a new sourced file through an environment variable,
as kconfcheck had a fixed list of allowed environment variable names.
This issue should now be resolved.
2025-11-04 07:48:15 +01:00
Frantisek Hrbata
6653cf5c1f ci(cmakev2): run the buildv2 tests only if the buildv2 label is set
Currently, the buildv2 tests are initiated using the same patterns as
the tests for the current build system. This means that any change in
the current build system will also trigger the buildv2 tests. Initially,
it might be wise not to block the CI for changes in the current build
system in case there is an issue with buildv2. Therefore, let's
explicitly start the buildv2 tests only when the buildv2 label is set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 07:48:15 +01:00
Frantisek Hrbata
f93a0d9ff2 fix(esp_libc/cmake): add vfs as requirement if CONFIG_VFS_SUPPORT_IO is enabled
The esp_libc relies on the stdio implementation of the vfs component if
CONFIG_VFS_SUPPORT_IO is enabled. This is not an issue in cmakev1
because if the vfs component is not included in the project build, its
configuration is not available, and CONFIG_VFS_SUPPORT_IO is not set.
However, in cmakev2, the configuration for all components is available,
and the presence of some component configuration options does not
necessarily mean that the component is included in the project build.
When esp_libc is compiled without the vfs dependency but with
CONFIG_VFS_SUPPORT_IO enabled, the libc initialization will encounter a
panic due to a NULL pointer dereference (fp->_flags) in __swsetup_r, as
fopen in esp_libc_init_global_stdio will return NULL.
2025-11-04 07:48:15 +01:00
Frantisek Hrbata
78d07f5a2f feat(cmakev2/docs): add note about v2 being technical preview
Although the current documentation exposes only limited functionality,
which is unlikely to change, add an explicit note that the build system
v2 is currently a technical preview intended for testing and early
evaluation.

Ensure consistency in referring to v2 throughout the documentation. In
some places, it is referred to as V2 or Version 2; unify this to v2.

Additionally, update the hello_world example for v2 to use the
idf::spi_flash alias instead of the interface variable to maintain
consistency with the rest of the documentation.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 07:48:15 +01:00
Frantisek Hrbata
9c4b7ca488 feat(cmakev2/docs): prefer idf_component_register to create new components
Extend the current documentation to recommend using the
idf_component_register function as the preferred method for creating a
new component for v2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 07:48:15 +01:00
Frantisek Hrbata
07a7581187 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-11-04 07:48:15 +01:00
Frantisek Hrbata
ee1dec6145 feat(cmakev2/docs): extend esp_target_info component example
Enhance the `esp_target_info` component example by adding some of
the missing features that the component might require. This includes
adding a linker script, a linker fragment, linking the component archive
as a whole library, and providing an example of how the linker options
can be set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 07:48:15 +01:00
Frantisek Hrbata
d82866aaf9 feat(cmakev2/docs): add information about cmakev2 component incompatibility with cmakev1
Components designed exclusively for cmakev2 are not compatible with
cmakev1 due to the lack of forward compatibility. It is important to
clarify this at the very beginning of the `Creating a New Component`
section. Additionally recommended a guidance on how to create a
component that will be compatible with both versions.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 07:48:15 +01:00
Frantisek Hrbata
832128e864 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-11-04 07:48:15 +01:00
Frantisek Hrbata
6f516845fc 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-11-04 07:48:15 +01:00
Frantisek Hrbata
e6b1c5857b 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-11-04 07:48:15 +01:00
Frantisek Hrbata
6373cc540b feat(cmakev2/docs): initial basic documentation
Add very basic documentation. It is currently written with the
expectation that the reader is already familiar with the existing build
system and focuses more on the changes that might be necessary to adapt
existing components to work with cmakev2.  Additionally, it provides
basic information on how to create a new component and project.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 07:48:15 +01:00
Frantisek Hrbata
65052dfbdd 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-11-04 07:48:15 +01:00
Sudeep Mohanty
7cddcfa37f feat(cmakev2): Enable buildv2 tests for windows on CI 2025-11-04 07:48:15 +01:00
Sudeep Mohanty
e6c46258dd 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-11-04 07:48:15 +01:00
Frantisek Hrbata
72e96e4907 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-11-04 07:48:15 +01:00
Frantisek Hrbata
c2e54b259c 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-11-04 07:48:15 +01:00
Sudeep Mohanty
514a27073d feat(cmakev2): Enabled test_cmake.py for cmakev2 in CI 2025-11-04 07:48:15 +01:00
Sudeep Mohanty
419ff4568b feat(cmakev2): ruff formatting changes for test_cmake.py 2025-11-04 07:48:15 +01:00
Sudeep Mohanty
c3881a0631 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-11-04 07:48:15 +01:00
Sudeep Mohanty
859bcacd29 feat(cmakev2): Enabled all component manager tests for cmakev2 2025-11-04 07:48:15 +01:00
Peter Dragun
2c9b71b36e fix: Update esptool commands to use new syntax 2025-11-04 07:48:15 +01:00
Frantisek Hrbata
e56168dbb5 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-11-04 07:48:15 +01:00
Sudeep Mohanty
53fd83b7f6 feat(cmakev2): Enable test_components.py for cmakev2 in CI 2025-11-04 07:48:15 +01:00