Commit Graph

7346 Commits

Author SHA1 Message Date
Sudeep Mohanty 0458b98bfa feat(cmakev2/kconfig): Added basic test for Kconfig generation 2025-10-30 17:17:49 +08:00
Sudeep Mohanty 22914237b0 feat(cmakev2/kconfig): Added support for Kconfig target creation
The following functions are added to tools/cmakev2/kconfig.cmake:
- __create_kconfig_targets(): Calls other target creation functions.
- __create_menuconfig_target(): Creates menuconfig target.
- __create_confserver_target(): Creates confserver target.
- __create_save_defconfig_target(): Creates save-defconf target.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty 72e2fa0005 feat(cmakev2/kconfig): Added support for Kconfig output generation
The following functions are added to tools/cmakev2/kconfig.cmake:
- __generate_kconfig_outputs(): Generates Kconfig output files.
- __create_base_kconfgen_command(): Creates command for running
  kconfgen.
- __run_kconfgen(): Invokes kconfgen tool.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty b774ca25bc feat(cmakev2/kconfig): Added support for Kconfig environment preparation
The following functions are added to tools/cmakev2/kconfig.cmake:
- __setup_kconfig_environment(): Creates Kconfig environment for Kconfig
  output generation.
- __get_init_config_version(): Fetch ESP-IDF version and set the
  environment variable.
- __create_config_env_file(): Create the config.env file for kconfgen.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty 135fed5a49 feat(cmakev2/kconfig): Added support for Kconfig files collection
The following functions are added to tools/cmakev2/kconfig.cmake:
- __collect_kconfig_files_from_components(): Collect Kconfig files from
  components.
- __collect_kconfig_files_from_bootloader_components(): Collect Kconfig
  files from bootloader components.
- __collect_kconfig_files_from_directory(): Collect Kconfig files from
  a directory.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty 085633de35 feat(cmakev2/kconfig): Added __init_kconfig() and initial Kconfig properties
This commit adds the tools/cmakev2/kconfig.cmake file for Kconfig
processing. The file provides the following functions:

- __init_kconfig(): Placeholder to initialize Kconfig build properties,
  collect kconfig files and generate the initial sdkconfig.
- __generate_sdkconfig(): Placeholder to generate sdkconfig output files.
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 3b28a2ac33 feat(cmakev2/utilities): add __dump_all_properties helper
Dump all properties for build, components, and libraries.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata a71a2e1c4e fix(cmakev2/component): correct function descriptions and typos
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata d669f1841b feat(cmakev2/build): add idf_build_library stub
Add idf_build_library function and enable setting and getting its
properties. This lays the groundwork for future initialization that
needs to occur after the project() call, such as determining compilation
options and others.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata bc645db318 fix(cmakev2/test): correct indentation in testing CMakeLists.txt
Fixes: 3488300671da ("feat(cmakev2/test): add simple test for toolchain set..")
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata b72b14a159 feat(cmakev2/utilities): add __set_property and __get_property helpers
The `idf_build_(set|get)_property` and
`idf_component_(set|get)_property` functions share a lot of similar
code. Move these common parts into new `__(set|get)_property` helper
functions. With the upcoming `idf_build_library` API function, we might
need to add properties for the interface target created for the library,
which would otherwise lead to yet another code duplication for setting
and getting library interface properties.

Update the current implementations of `idf_build_(set|get)_property` and
`idf_component_(set|get)_property` to utilize these new helper
functions.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 27e726b176 feat(cmakev2/test): add simple test for toolchain settings
Also format the current testing CMakeLists.txt properly.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata d37f7eaeb6 feat(cmakev2/idf): initialize toolchain
Determine the IDF_TOOLCHAIN from the following sources in this order:
environmental variable and CMake cache variable.  Ensure there are no
inconsistencies between the values set in these different locations.

Set the IDF_TOOLCHAIN and IDF_TOOLCHAIN_FILE build properties. Also,
configure the IDF_TOOLCHAIN CMake cache variable and set the
CMAKE_TOOLCHAIN_FILE global variable.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata ec600a8132 feat(cmakev2/idf): initialize IDF_TARGET build property
Determine the IDF_TARGET from the following sources in this order:
environmental variable, CMake cache variable, and sdkconfig files.
Ensure there are no inconsistencies between the values set in these
different locations.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 6e27038dc3 feat(cmakev2/utilities): add __get_sdkconfig_option helper
Search for the configuration option value in the specified sdkconfig
file.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 62db5692cd feat(cmakev2/idf): initialize SDKCONFIG and SDKCONFIG_DEFAULTS build properties
Based on the environmental variables, CMake cache variables, or default
values, set the DKCONFIG and SDKCONFIG_DEFAULTS build properties.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata ed34c24de6 feat(cmakev2/idf): add Python interpreter detection
Determine the Python interpreter and verify package dependencies if the
CMake cache variable PYTHON_DEPS_CHECKED is not set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 00671f2f1e feat(cmakev2/idf): add IDF_VERSION variables
The version.cmake file should be the sole file used from the cmakev1
build system. There's no need to maintain the IDF_VERSION information in
two separate locations.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 95f4d88dac feat(cmakev2/utilities): add __get_default_value helper
Helper for obtaining the default value of a variable. It returns the
value of the specified variable based on the following order of
precedence, with the highest precedence first:

1. Environmental variable
2. CMake cache variable
3. Provided default value

This can be used to retrieve the value of variables that might also be
set in the environment or cache, such as PYTHON or SDKCONFIG.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 4b02439599 fix(cmakev2/utilities): make the PATHS option optional in __get_absolute_paths
With the default signature of `cmake_parse_arguments`, without using
`PARSE_ARGV`, it's not possible to determine if options were not
specified or set as an empty string (or empty list)[1]. If an empty
string is passed to the `PATHS` option, the variable parsed by
`cmake_parse_arguments` is not defined. This issue can be addressed by
using `PARSE_ARGV`, but this approach only works for functions and
requires CMake version 3.31 or newer. Additionally, when `PARSE_ARGV` is
used for multiple value option, the values are not concatenated into a
single list, which is inconvenient, as the lists are instead escaped. If
the `PATHS` option is not defined, set it to an empty string.  This
allows passing an empty string, as well as a mix of lists and
individual strings, through PATHS.

The behaviour can be seen with a simple example:

$ cmake -P test.cmake

```test.cmake
cmake_minimum_required(VERSION 3.22)

function(test)
    set(options)
    set(one_value)
    set(multi_value PATHS)

    cmake_parse_arguments(ARG "${options}" "${one_value}" "${multi_value}" ${ARGN})
    #cmake_parse_arguments(PARSE_ARGV 0 ARG "${options}" "${one_value}" "${multi_value}")

    message("PATHS: ${ARG_PATHS}")
endfunction()

test(PATHS "one;two;three" "four" "five;six" "seven")
```

```
PATHS: one;two;three;four;five;six;seven
vs
PATHS: one\;two\;three;four;five\;six;seven
```

Also update the current usage of __get_absolute_paths, as the check for
empty PATHS is no longer necessary.

[1] https://cmake.org/cmake/help/latest/policy/CMP0174.html#policy:CMP0174

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 2cbeb7a1a2 test(cmakev2): add testing project CMakeLists.txt
This is a basic CMake project that currently includes tests for
displaying build and component properties, as well as testing component
priority. These tests should be removed once proper CI testing is
in place.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata 050ed5c76a ci(cmakev2): temporarily exclude cmakev2 from CI testing
There are currently no CI tests for CMakeV2, so add it to the
exclude_check_tools_files.txt file. Once CI testing is implemented, this
change should be reverted.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata a9d55936ef feat(cmakev2): add basic component initialization
Discover component directories and initialize components within them.
This process does not include managed components, which should be added
separately at a later stage. To facilitate this, some minimal
functionalities are introduced, such as build properties, component
properties, and other helper functions.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
wanckl a31e2b4018 refactor(driver_twai): using hal/config in hal layer 2025-10-29 17:46:15 +08:00
Marek Fiala 1e351a8b67 test(tools): Moved preset parsing into core_ext.py and added tests 2025-10-29 11:47:40 +08:00
Ivan Grokhotkov 78ae7ab085 feat(build): add idf.py support for CMake configuration presets
This commit adds a new idf.py --preset NAME argument, which allows
selecting the CMake configuration preset with a given name.
For idf.py, selecting the preset does two things:
- sets the build directory, which is specified in the preset itself
  using "binaryDir" field
- passes --preset argument to CMake configuration phase

The multi_config example is updated to illustrate how this feature is
expected to be used.
2025-10-29 11:47:40 +08:00
Marek Fiala 86ec7c7d6b Merge branch 'revert/env_locale' into 'master'
Revert "fix: Updated locale handling to prevent issues with build tools"

See merge request espressif/esp-idf!42953
2025-10-29 11:39:58 +08:00
Marek Fiala 3c9ad9c091 Revert "fix: Updated locale handling to prevent issues with build tools"
This reverts commit 7e09b471ab.
2025-10-28 04:02:21 +01:00
Marius Vikhammer 27059a16f8 test(test_apps): set minimal build for misc test-apps 2025-10-28 10:17:41 +08:00
Marius Vikhammer 7b6d81ebb8 Merge branch 'ci/split_system_build_test' into 'master'
test(system): restructured system build test test-apps

Closes IDF-14206

See merge request espressif/esp-idf!42320
2025-10-27 14:32:43 +08:00
Marius Vikhammer cd741e995f test(system): restructured system build test test-apps 2025-10-27 09:25:07 +08:00
Roland Dobai f21b4c2381 change(version): Update version to 6.1-dev
Start of v6.1 development
2025-10-24 09:01:34 +02:00
David Čermák 406c7f3ec6 Merge branch 'fix/netif_deprecated_inc' into 'master'
[lwip]: Removed deprecated headers

Closes IDF-6414

See merge request espressif/esp-idf!41868
2025-10-23 13:51:26 +08:00
C.S.M 19fef9f5ac Merge branch 'refactor/remove_flash_rom_patch_cfg' into 'master'
refactor(spi_flash): Remove spi_flash rom driver patch config option

Closes IDF-1578

See merge request espressif/esp-idf!42108
2025-10-23 11:24:46 +08:00
Jiang Jiang Jian 8e1ebcad18 Merge branch 'feat/support_nan_usd' into 'master'
Add support for Unsynchronized Service Discovery (USD)

See merge request espressif/esp-idf!30990
2025-10-22 14:00:49 +08:00
C.S.M c81cf3bdf6 refactor(spi_flash): Remove spi_flash rom driver patch config option 2025-10-22 10:37:19 +08:00
Roland Dobai ca6cfada99 Merge branch 'feat/add_idf_py_mcp' into 'master'
tools: add idf.py mcp-server support

Closes DOC-12659

See merge request espressif/esp-idf!40833
2025-10-21 09:43:13 +02:00
Jakub Kocka 138ef35683 Merge branch 'fix/env_locale' into 'master'
Updated setting of locale to prevent Windows issues with building tools

Closes IDFGH-16402

See merge request espressif/esp-idf!42110
2025-10-21 14:48:34 +08:00
Chen Chen bb80291429 Merge branch 'refactor/pre_i2c_removal' into 'master'
refactor(i2c): Add disclaimer for legacy driver

Closes IDF-14262

See merge request espressif/esp-idf!42607
2025-10-21 14:39:09 +08:00
Marek Fiala c4347a682d feat: Install mcp with initialization scripts 2025-10-20 16:22:54 +02:00
Mahavir Jain 7c517deb35 tools: add idf.py mcp-server support 2025-10-20 16:22:54 +02:00
David Cermak 18907c2c8f fix(lwip): Remove deprecated ping wrappers over lwip raw api 2025-10-20 17:51:39 +08:00
morris 2fb0c3cdfe Merge branch 'fix/i2c_disable_od_in_delete' into 'master'
fix(i2c): disable open drain mode on deinit

Closes IDFGH-16635

See merge request espressif/esp-idf!42644
2025-10-20 15:27:06 +08:00
Sarvesh Bodakhe 4c3d6c1292 fix(wifi): Add refactoring and migration guide for USD, Offchan_tx, ROC
1. fix(wifi): Rename old NAN configuration to NAN-Sync
  - Rename CONFIG_ESP_WIFI_NAN_ENABLE to CONFIG_ESP_WIFI_NAN_SYNC_ENABLE to indicate
    the support for Synchronized NAN (Wi-Fi Aware).
  - Because the original flag really controls the synchronized feature set, rename it
    to CONFIG_ESP_WIFI_NAN_SYNC_ENABLE so the NAN-Sync and NAN-USD paths can be
    selected independently without confusion.
2. Document esp_wifi_start requirement and fix USD examples
3. Rename nan_callbacks to nan_sync_callbacks
4. Remove the discovery_flag, clarify docs for sync vs USD flows, and add USD start/stop APIs
5. Require esp_wifi_start() before USD start
6. docs(nan): add NAN-USD application examples
7. add migration guide and hints for NAN-USD proto field
8. Improve allow_broadcast documentation
9. Add attention to the API esp_wifi_remain_on_channel
10. fix(wifi): align NAN API renames and docs for v6.0
  - keep shared APIs under esp_wifi_nan_* while reserving
    sync/usd names for mode-specific entry points
  - clarify synchronized-cluster scope in headers, docs, and migration notes (EN/zh-CN)
  - update examples for renamed helpers and WIFI_NAN_SYNC_CONFIG_DEFAULT()
  - rename `wifi_nan_config_t` to `wifi_nan_sync_config_t`
11. Mark NAN-USD as esp-idf experimental feature
2025-10-20 12:46:55 +05:30
Chen Chen 4ac9954101 refactor(i2c): Add disclaimer for legacy driver 2025-10-20 11:38:26 +08:00
Jakub Kocka 7e09b471ab fix: Updated locale handling to prevent issues with build tools
Closes https://github.com/espressif/esp-idf/issues/17542
2025-10-17 09:58:44 +02:00
morris e5da8951b3 fix(uart): always add NOP workaround for UART FIFO read on esp32 2025-10-17 13:08:25 +08:00
Marius Vikhammer a257812e14 feat(stdio): added esp_stdio component
esp_stdio contains everything the old esp_vfs_console contained (the vfs stdio glue layer)
as well as other functionality related to stdio (previously referred to as console)
2025-10-16 10:01:59 +08:00
morris ab149384e1 Merge branch 'refactor/clean_soc_caps_gptimer' into 'master'
refactor(hal): graduate watch dog hal driver into a new component: esp_hal_wdt

Closes IDF-14091

See merge request espressif/esp-idf!42338
2025-10-15 17:18:20 +08:00
Marius Vikhammer 668ce92cc3 Merge branch 'ci/test_apps_ulp_dep' into 'master'
ci(network): fixed dependencies for misc network and wifi related test apps

Closes IDF-14193, IDF-14201, IDF-14205, IDF-14204, IDF-14192, and IDF-14196

See merge request espressif/esp-idf!42592
2025-10-15 17:16:56 +08:00