Commit Graph
626 Commits
Author SHA1 Message Date
Samuel Obuch 5d8dabc15f change(cmake): use lpcore openocd configs with CONFIG_ULP_COPROC_TYPE_LP_CORE 2026-05-12 13:09:56 +02:00
Roland Dobai efb0ad6d05 Merge branch 'fix/cmake_quotations_v6.0' into 'release/v6.0'
Build & config: Quote variable references in conditional expressions (v6.0)

See merge request espressif/esp-idf!47738
2026-04-27 16:05:49 +02:00
Ivan Grokhotkov 8c19b15608 change(version): Update version to 6.0.1 2026-04-22 22:54:06 +08:00
Roland Dobai 7aef45a869 fix(cmake): quote variable references in conditional expressions
Closes https://github.com/espressif/esp-idf/issues/18445
2026-04-20 17:22:54 +08:00
Roland Dobai 7341f0564b feat(cmake): Create a merged hints database in the build directory 2026-03-24 19:23:22 +01:00
Jiang Jiang Jian 7a9362c9c8 Merge branch 'fix/cmake_flags_passing_to_external_project_v6.0' into 'release/v6.0'
fix(build): fix passing CMAKE_<LANG>_FLAGS from ExternalProject_Add (v6.0)

See merge request espressif/esp-idf!46651
2026-03-20 10:47:26 +08:00
Jiang Jiang Jian d8c022123d Merge branch 'fix/ai_idf_ver_fallback_when_no_git_v6.0' into 'release/v6.0'
fix(cmake): Fall back to version from components when git describe fails (v6.0)

See merge request espressif/esp-idf!46027
2026-03-20 10:34:25 +08:00
Alexey Lapshin c089650ec7 fix(build): fix passing CMAKE_<LANG>_FLAGS from ExternalProject_Add 2026-03-16 15:19:35 +07:00
Frantisek HrbataandClaude Opus 4.6 90875ec492 fix(cmake): Fall back to version from components when git describe fails
When version.txt does not exist and git describe fails (e.g. in
release archives or environments without git), IDF_VER was set to
the raw git_describe output which resolves to "-128-NOTFOUND",
causing esp_get_idf_version() to return a garbled string.

Add a fallback that constructs the version string from the
IDF_VERSION_MAJOR, IDF_VERSION_MINOR and IDF_VERSION_PATCH
variables when git describe is not available.

Closes https://github.com/espressif/esp-idf/issues/18240

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-02-24 12:55:20 +01:00
Frantisek Hrbata 1e5d8fbf82 fix(build): ensure the main component exists when MINIMAL_BUILD is enabled
The minimal build property is simply a shorthand for `set(COMPONENTS
main)`. The issue is that there is currently no check to verify whether
the `main` component actually exists or is known to the build system.
If the `main` component is not present, print an error message along
with suggestions on how to fix this inconsistency.

Closes https://github.com/espressif/esp-idf/issues/18219

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-02-17 06:59:55 +01:00
Jiang Jiang Jian d6cadbacd2 Merge branch 'fix/minimal_build_property_v6.0' into 'release/v6.0'
fix(cmake): disable MINIMAL_BUILD build property if COMPONENTS is defined (v6.0)

See merge request espressif/esp-idf!45116
2026-01-29 14:04:05 +08:00
Frantisek Hrbata fb61fa2209 fix(cmake): disable MINIMAL_BUILD build property if COMPONENTS is defined
The MINIMAL_BUILD build property and the COMPONENTS variable are both
used to determine the initial component list for the build.

Currently, if the COMPONENTS variable is set, the MINIMAL_BUILD logic
is ignored during component selection, but the MINIMAL_BUILD build
property remains set. This leads to an inconsistent state where
menuconfig displays information indicating MINIMAL_BUILD is active,
even though it was ignored in favor of the COMPONENTS variable.

Fix this by setting the MINIMAL_BUILD property to OFF if the
COMPONENTS variable is used.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-01-19 18:34:11 +08:00
Ferdinand Bachmann 832498d25d fix(cmake): Fix "IMPORTED_LOCATION not set for imported target" errors
esp-idf uses imported targets as dummy targets that are never linked.
Previous CMake versions would ignore these and not error on unset
IMPORTED_LOCATION if they are never actually linked. CMake 4.2 and newer
errors during codemodel-v2 api queries when imported targets are missing
IMPORTED_LOCATION, so set a dummy location that would error when
actually linked, which fixes the error during api queries.

Closes https://github.com/espressif/esp-idf/pull/18103
2026-01-16 12:11:06 +01:00
Roland Dobai 0c592432ef change(cmake): add temporary hotfix to skip warnings for specific components
Temporary workaround for avoiding to produce warnings for esp_wifi (
https://github.com/espressif/esp-idf/issues/18036,
https://github.com/espressif/esp-idf/issues/17840).
2026-01-10 00:39:39 +08:00
Marek Fiala 20faecf847 feat(tools): Clean up esp-idf-size new generation 2026-01-06 00:01:17 +08:00
Daniel Paul f723c276d0 feat: Add source of the component into project_description.json 2025-12-10 17:20:42 +08:00
Alexey Lapshin ad7f4b9670 feat(esp_libc): make picolibc default libc 2025-12-06 00:08:35 +07:00
Jan Beran 9b7835ed97 change(kconfig): add support for configuration report 2025-11-25 20:50:47 +08:00
Alexey Lapshin a217630b1e feat(build): propagate compiler flags from files to toolchain.cmake
This change improves build consistency across external projects integrated
through CMake by ensuring that compiler flags defined in configuration files
are passed correctly to the toolchain. It covers the majority of use cases,
as external projects are typically also CMake-based. For projects that use
a custom build system, users will still need to specify the required flags
manually.
2025-11-19 01:12:40 +07: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 2daee9ba73 feat(cmake/toolchain): include utilities.cmake from correct build system version
The toolchain files are using the remove_duplicated_flags function from
utilities.cmake. However, we want to avoid mixing utilities from cmakev1
and cmakev2. Use `IDF_BUILD_VER_TAG` to include utilities from the
currently used build system version.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 07:48:13 +01: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
Vincent-Dalstra a36c8b8725 fix: Add quotes around node ID in dependency graph
Graphviz node ID's are represented as strings, that can only use a
restricted set of characters (characters, digits, and underscores), and
must not match a reserved keyword. These restrictions do not apply when
the string is wrapped in double quotes. This allows for component names
with dashes in them, for example.

Closes https://github.com/espressif/esp-idf/pull/17594
2025-10-08 19:55:21 +08:00
Alexey Gerenkov e1f647906d fix(build): Add missing '-nostartfiles' option in Clang toolchain files 2025-10-06 22:37:41 +08:00
Roland Dobai 18d6b53195 Merge branch 'fix/dont-regenerate-unnecessary-config-files' into 'master'
fix(kconfig.cmake): Do not regenerate unnecessary config files

Closes IDF-14220

See merge request espressif/esp-idf!42231
2025-10-01 14:52:04 +02:00
Peter Dragun e3198fff3c feat: Update esptool to v5 2025-09-30 15:28:55 +02:00
Roland Dobai af1ceb322f Merge branch 'feat/remove_legacy_esp_size' into 'master'
Tools/esp-idf-size: Remove --legacy argument and replace JSON format with JSON2

Closes IDF-8772 and DOC-12437

See merge request espressif/esp-idf!41743
2025-09-30 09:47:44 +02:00
Roland Dobai bc01141098 fix(cmake): correct component targets property name in validation
The component validation script was using an incorrect property name
'__COMPONENT_TARGETS' when retrieving component targets. This should be
'__BUILD_COMPONENT_TARGETS' to match the actual property name used
throughout the build system.

This fix ensures the component validation can properly access the list
of component targets and perform validation checks correctly.
2025-09-29 15:37:54 +02:00
Jan Beran f7393ab305 fix(kconfig.cmake): Do not regenerate unnecessary config files 2025-09-29 10:03:47 +02:00
Marek Fiala 56fa45c741 revert(tools): Removed --legacy option for esp-idf-size 2025-09-29 01:54:38 +08:00
Alexey Lapshin d081549979 feat(tools): enable zc* extensions for esp32p4 revision >= 3.0 2025-09-26 15:09:23 +08:00
Alexey Lapshin 22cae61ee1 Merge branch 'feature/enable_zc_extensions' into 'master'
Enable zc* extensions for riscv chips supported them

Closes IDF-13918

See merge request espressif/esp-idf!40074
2025-09-25 08:42:07 +04:00
Alexey Lapshin a5b54a7ea3 feat(build): enable zc* extensions for riscv chips 2025-09-24 21:30:56 +07:00
Roland Dobai adb2d5deee feat(cmake): Produce warnings when component dependencies are not defined
There are idf.py hints for helping the user to set component
dependencies properly instead of building sources out-of-component or
including headers from outside the component directory. These are
produced with
tools/idf_py_actions/hint_modules/component_requirements.py.

However, idf.py hints are printed only when the build fails. If the user
starts with a buildable solution then the suggestions to add component
dependencies are not printed.

This commit introduces cmake-level warnings for building source files
from outside the component and including header files without setting up
proper component dependencies.
2025-09-24 13:43:23 +02:00
Sudeep Mohanty f620ab6dbd Merge branch 'feat/move_bootloader_part_table_flash_deps' into 'master'
refactor(build-system): Simplify flash target creation

See merge request espressif/esp-idf!41777
2025-09-24 11:43:48 +02:00
Alexey Lapshin d9389ba082 change(bootloader): rename bootloader.ld -> bootloader.ld.in
This change passes file through compiler preprocessor which unlocks
future code refactoring.
2025-09-24 00:51:54 +08:00
Alexey Lapshin 2d12315b62 fix(tools): clean gdbinit files generation 2025-09-17 16:58:02 +08:00
Alexey Lapshin 9281e78381 change(esp_libc): rename newlib component to esp_libc 2025-09-09 22:00:44 +08:00
Sudeep Mohanty b719292b75 refactor(build-system): Simplify flash target creation
This commit refactors the flash target creation. Now bootloader and
partition table components add dependencies to the flash target directly
from their component CMakeLists.txt files instead of it being done in
the esptool_py component. The commit also removes the redundant
__esptool_py_setup_main_flash_target() function.
2025-09-09 12:21:31 +02:00
Alexey Lapshin 620d1cb519 Merge branch 'feature/enable_esp_chip_tuning' into 'master'
feat(build): enable -mtune=esp-base option for RISCV targets

See merge request espressif/esp-idf!40164
2025-08-29 10:52:03 +04:00
Sudeep Mohanty 5eb8e746fc Merge branch 'fix/build_system_create_bin_gen_tgts' into 'master'
feat(build-system): Create build system hooks for post-elf processing

Closes IDFGH-16204

See merge request espressif/esp-idf!41097
2025-08-28 14:35:21 +02:00
Alexey Lapshin ecc37c12d7 feat(build): enable -mtune=esp-base option for RISC-V targets
The `-mtune=esp-base` option is identical to the default tuning profile,
except that `slow_unaligned_access` is set to false.

This reduces the instruction count for built-in `memcpy` and improves
performance, since our chips can handle misaligned access with minimal
penalty (without triggering exceptions).

Example:

  void load(uint32_t *r, char* x) {
    memcpy(r, x, sizeof(uint32_t));
  }
  void store(char* x, uint32_t v) {
    memcpy(x, &v, sizeof(uint32_t));
  }

Previously generated code:

  load:
        lbu     a5,2(a1)
        lbu     a3,0(a1)
        lbu     a4,1(a1)
        sb      a5,2(a0)
        sb      a3,0(a0)
        sb      a4,1(a0)
        lbu     a5,3(a1)
        sb      a5,3(a0)
        ret
  store:
        srli    a3,a1,8
        srli    a4,a1,16
        srli    a5,a1,24
        addi    sp,sp,-16
        sb      a1,0(a0)
        sb      a3,1(a0)
        sb      a4,2(a0)
        sb      a5,3(a0)
        addi    sp,sp,16
        jr      ra

With `-mtune=esp-base`:

  load:
        lw      a5,0(a1)
        sw      a5,0(a0)
        ret
  store:
        sw      a1,0(a0)
        ret

Inlining behavior
=================

Without `-mtune=esp-base`:
  - `memcpy()` is inlined only when the compile-time size is ≤ 12 bytes.
    - Maximum cost: ~25 instructions

With `-mtune=esp-base`:
  - `memcpy()` is inlined for all compile-time constant sizes.
    - Maximum cost: ~14 instructions

As a result, some applications may see reduced code size, while others
may increase slightly. However, performance always improves because
extra `memcpy` calls are eliminated.

Performance results
===================

esp32p4 (Ethernet iperf):
  - No noticeable difference

esp32c61 (Wi-Fi iperf):
  - ~2 Mb/s increase for TCP and UDP TX (may be within measurement error)

NOTE
====

Applies only to RISC-V chips that do not have the hardware issue marked
by the SOC_CPU_MISALIGNED_ACCESS_ON_PMP_MISMATCH_ISSUE macro.
2025-08-27 12:46:41 +07:00
Fu Hanxi b111672f42 Merge branch 'fix/kconfig-optional-dependency' into 'master'
fix(build): pass sdkconfig.json during injection to add kconfig optional dependencies correctly

See merge request espressif/esp-idf!41470
2025-08-26 16:38:52 +02:00
Fu Hanxi d65e0e39c6 fix: make sure sdkconfig.json is updated after running the menuconfig 2025-08-25 14:48:58 +02:00
Fu Hanxi 60e9ec429d fix: kconfig optional dependency in transitive dependency 2025-08-25 14:32:05 +02:00
Marek Fiala 9d35d63651 feat(cmake): Update minimum cmake version to 3.22 (whole repository) 2025-08-19 14:44:32 +02:00
Alexey Lapshin 03855b90f8 Merge branch 'feature/update-gnu-standards' into 'master'
feat(build): update gnu17->gnu23 and gnu++2b->gnu++26

See merge request espressif/esp-idf!41014
2025-08-19 14:30:34 +04:00
Ivan Grokhotkov a939f410dd Merge branch 'bugfix/ldgen_prebuilt_library_placements' into 'master'
build: pass pre-built libraries to ldgen, clean up how blobs are added

Closes IDF-12049 and IDF-12736

See merge request espressif/esp-idf!40353
2025-08-19 10:50:31 +02:00
Alexey Lapshin 4c481c863f feat(build): update gnu17->gnu23 and gnu++2b->gnu++26 2025-08-19 10:29:37 +07:00
Sudeep Mohanty 4cfc196680 feat(build-system): Create build system hooks for post-ELF processing
This commit adds new CMake APIs for the build system, viz.,
idf_build_add_post_elf_dependency() and
idf_build_get_post_elf_dependencies().
These APIs allow components to add post-ELF processing hooks before the
binary file is generated.

Closes https://github.com/espressif/esp-idf/issues/17251
2025-08-15 12:22:47 +02:00