Commit Graph

7963 Commits

Author SHA1 Message Date
Konstantin Kondrashov
de1e5035b5 feat(app_update): Add auto-confirmation of OTA updates
Enable rollback auto-confirmation by default
2026-09-01 12:53:21 +03:00
Mahavir Jain
a3192567d5 Merge branch 'feat/cpu_region_protection_h4' into 'master'
Memory region protection for ESP32-H4

Closes IDF-12588

See merge request espressif/esp-idf!47070
2026-08-31 17:41:52 +05:30
Martin Vychodil
4cce27e1cc Merge branch 'fix/sdmmc_dma_aligned_buffer_leak' into 'master'
fix(sdmmc): release aligned buffer on card deinit

Closes IDF-16031 and DOC-15562

See merge request espressif/esp-idf!51530
2026-08-28 13:57:05 +08:00
Roland Dobai
1ba374b7e6 Merge branch 'fix/lto_function_data_sections' into 'master'
fix(build): keep per-function sections when generating code at LTO link time

See merge request espressif/esp-idf!51629
2026-08-27 13:55:43 +02:00
Adam Múdry
e0c094da69 fix(sdmmc): release aligned DMA buffer on card deinit 2026-08-27 12:00:24 +02:00
harshal.patil
53c9439161 change(esp_hw_support): rework ESP32-H4 region protection to the application-owned layout
The bootloader programs only unlocked PMA entries (no PMP), so the layout is
not a bootloader<->application ABI; the application resets all entries, programs
them in ascending order from IRAM, and locks everything. Verified on ESP32-H4 v0.1.
2026-08-25 10:40:28 +05:30
harshal.patil
07debe6edc feat(esp_hw_support): Memory region protection for ESP32-H4 2026-08-25 10:40:28 +05:30
Roland Dobai
e37a7ae137 Merge branch 'feat/cmakev2-configdep' into 'master'
feat: Adopt rebuild optimization tool (configdep) in cmakev2

Closes IDF-15301

See merge request espressif/esp-idf!51263
2026-08-24 13:53:47 +02:00
Roland Dobai
502c3c305b Merge branch 'fix/mcp_subprocess_stdin' into 'master'
fix(tools): detach MCP tool subprocess stdin from JSON-RPC pipe

Closes IDFGH-18123

See merge request espressif/esp-idf!51872
2026-08-24 13:43:23 +02:00
Marius Vikhammer
b95b1bbf1f Merge branch 'bugfix/cmakev2-coredump-default-component' into 'master'
fix(cmakev2): include config-selected default components

See merge request espressif/esp-idf!49614
2026-08-21 10:16:27 +08:00
Jan Beran
8b213b517d feat: Adopt rebuild optimization tool (configdep) in cmakev2 2026-08-20 15:57:10 +08:00
Fu Hanxi
289a17b3a2 tests: replace CLI-dependent xfail/skipif conditions 2026-08-20 09:14:41 +02:00
Marius Vikhammer
5c0facdaba fix(cmakev2): include config-selected default components 2026-08-20 11:09:58 +08:00
Marius Vikhammer
71ec4f2699 Merge branch 'fix/buildv2_ldgen_template_rebuild_test' into 'master'
fix(test_build_system): fix ldgen template rebuild test for build system v2

See merge request espressif/esp-idf!51732
2026-08-20 11:08:46 +08:00
Mahavir Jain
53076b8aad Merge branch 'feat/enable_dpu_region_protection_for_esp32s31' into 'master'
feat: enable cpu region protection for esp32s31

Closes IDF-15238

See merge request espressif/esp-idf!49270
2026-08-19 19:13:11 +05:30
Marek Fiala
7613daadc6 fix(tools): send mcp-server startup diagnostics to stderr
idf.py mcp-server printed startup, shutdown, and error messages on
stdout. On the stdio MCP transport, stdout is the JSON-RPC channel, so
those non-JSON lines can confuse or break strict clients. Route them to
stderr like the other diagnostics in mcp_ext.py.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-19 09:10:01 +02:00
Marek Fiala
be74313d0b fix(tools): detach MCP tool subprocess stdin from JSON-RPC pipe
idf.py mcp-server tool handlers were spawning idf.py without redirecting
stdin, so the child inherited the long-lived MCP JSON-RPC transport and
could hang indefinitely on tools/call. Pass stdin=subprocess.DEVNULL on
every spawn of idf.py.

Closes https://github.com/espressif/esp-idf/issues/18961
2026-08-19 09:09:34 +02:00
harshal.patil
01b86f1269 change(esp_hw_support): harden the ESP32-S31 PSRAM region permissions
Both PSRAM layouts were mapped as a single RWX window, so everything in external
RAM - the heap included - was executable.

PSRAM used as data only is now RW, and under XIP-from-PSRAM it is split per
section as ESP32-P4 does: .text RX, .rodata read-only, and the MMU-page
alignment gaps and the reclaimed heap RW, so neither is executable.

Both describe the layout that esp_psram_init() produces, and the entries are
locked, so - again as on ESP32-P4 - they are only narrowed when
CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION says that layout applies. Without
it the application owns the region and PSRAM stays RWX.

The per-section entries cost one PMP entry more than the 16 available, so the CPU
subsystem and peripheral windows are chained as TOR entries, taking one entry
instead of three.

soc.h is corrected against the S31 bus address map: the peripheral window base
was 1 MB too low, and the LP peripheral top, derived from a register base plus a
size rather than from the map, was 16 KB short. SOC_NON_CACHEABLE_OFFSET_FLASH
is added.
2026-08-19 09:39:52 +05:30
Daniel Paul
7e6fc433cc chore: Pin the testing versions of components 2026-08-18 20:51:54 +08:00
Daniel Paul
39de6e1429 fix: Kconfig test - Make assertion whitespace-insensitive 2026-08-18 20:51:54 +08:00
Daniel Paul
b764f073ac feat: Consume root-managed components from IDF Component Manager 2026-08-18 20:51:54 +08:00
Fu Hanxi
399b92e15c Merge branch 'fix/worktree-submodule-copy' into 'master'
Fix worktree submodule copy of gitlink files

See merge request espressif/esp-idf!51815
2026-08-18 14:45:55 +02:00
Wang Meng Yang
9150d065a3 Merge branch 'feat/support_pan_bnep' into 'master'
feat(bt/bluedroid): support Classic Bluetooth PAN profile

See merge request espressif/esp-idf!50641
2026-08-18 17:38:59 +08:00
Fu Hanxi
3d74dcead1 Merge branch 'feat/build_size_metrics_apps_on_master_branch' into 'master'
ci: move app-size-metrics job to ci/actions/common repo

See merge request espressif/esp-idf!51793
2026-08-18 10:26:55 +02:00
nilesh.kale
b5891edb9b feat: enable cpu region protection for esp32s31 2026-08-17 19:23:58 +05:30
linruihao
4f54340e51 feat(bt/bluedroid): support Classic Bluetooth PAN profile
- Port part of PAN/BNEP code from Android
- Add ESP API and BTC layer
2026-08-17 19:52:21 +08:00
Jakub Kocka
5889cba730 ci(tools): Fix worktree submodule copy of gitlink files 2026-08-17 11:53:09 +02:00
morris
3438867a73 Merge branch 'lld_orphan' into 'master'
esp_system: enable linking with LLD on RISC-V targets

Closes LLVM-216

See merge request espressif/esp-idf!48712
2026-08-17 14:40:36 +08:00
Sudeep Mohanty
5f546d080a fix(test_build_system): fix ldgen template rebuild test for build system v2
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-17 07:59:40 +02:00
Evgeny Torbin
1733fbdcd6 ci: move app-size-metrics job to ci/actions/common repo 2026-08-14 15:47:39 +02:00
Frantisek Hrbata
4052daa8a6 fix(build): keep per-function sections when generating code at LTO link time
ESP-IDF compiles every component with -ffunction-sections/-fdata-sections and
links with -Wl,--gc-sections, so that code and data nothing references does not
reach the image. With CONFIG_COMPILER_LTO_LINKTIME the object files carry GIMPLE
instead of machine code and code generation is deferred to the link, where those
two options no longer apply. The LTO partition is therefore emitted as a single
.text/.rodata, and since --gc-sections works at section granularity it can only
keep or drop that section as a whole. Some function in it is always live, so
nothing is dropped.

The options are recorded in the object file (in the .gnu.lto_.opts section), but
they do not reach the code generator. Code generation at link time runs as a
separate compiler invocation (LTRANS) whose command line lto-wrapper
reconstructs from those recorded options, and append_compiler_options() in
gcc/lto-wrapper.cc forwards only CL_TARGET options plus a small hard-coded list:
-fPIC/-fpic/-fPIE/-fpie, -fcommon, -fgnu-tm, -fopenmp/-fopenacc, -fcf-protection=,
(-fasynchronous-)unwind-tables, -g, -O/-Os/-Og/-Ofast/-Oz and the diagnostics
formatting options. Everything else hits the default arm and is dropped.

-ffunction-sections/-fdata-sections are neither. They are plain Common options in
common.opt without the Optimization marker, so they are not part of the
per-function state that is streamed with each function (which is why -O2 and -Os
do survive per translation unit under LTO), and they are not target options
either. They reach LTRANS only if they are repeated on the link command line.

Pass them next to -flto=auto, in both build systems.

This can be verified on any LTO build by adding -save-temps to the link options
and inspecting the generated <output>.ltrans.mk, which contains the literal
LTRANS command line:

    grep -o -- "-ffunction-sections\|-fdata-sections" build/*.ltrans.mk

Measured on esp32c3 with -Os and CONFIG_COMPILER_LTO_COMPILETIME, application
binary size in bytes:

                            no LTO     LTO   LTO+fix   fix saves
    hello_world             116112  119792    115808   -3984  (-3.33%)
    wifi/getting_started    734720  792960    732976  -59984  (-7.56%)

Without this change, enabling LTO produces a larger image than not using LTO at
all; with it, LTO is size neutral to slightly positive.

Two effects contribute. The dead code inside the partition itself stays, which
scales with how much code was compiled with LTO. On top of that, every function
retained this way keeps whatever it references alive as well, transitively and
across object boundaries: constant data, other functions, and sections of objects
that were not compiled with LTO at all. That second effect is not bounded by the
size of the LTO partition and can dominate. In the wifi/getting_started case a
single retained function, esp_crt_bundle_attach(), is the only referrer of the
mbedTLS certificate bundle, so a 55 KB .rodata blob stayed in an application that
never uses TLS. A plain non-LTO build collects all of it, which is what this
change restores.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-08-14 13:34:41 +02:00
Fu Hanxi
807adb6ca6 Merge branch 'ci/use-latest-common-repo' into 'master'
ci: use latest ci/actions/common repo

See merge request espressif/esp-idf!51759
2026-08-14 10:37:49 +02:00
Marius Vikhammer
aaad158b85 ci(precommit): fixed readme issue found by precommit in ota size metric 2026-08-14 08:19:23 +02:00
Stefan Stipanovic
d0ae774d59 fix(esp_system): enable linking with LLD on RISC-V targets 2026-08-13 21:23:36 +02:00
Fu Hanxi
cfca633f01 ci: use main branch of ci/actions/common 2026-08-13 15:26:02 +02:00
Mahavir Jain
8c007f0e03 Merge branch 'feat/bootloader-mbedtls-split-final' into 'master'
feat(esp_image_verify): split image verification out of bootloader_support

Closes IDF-8577 and IDFGH-17033

See merge request espressif/esp-idf!48383
2026-08-13 08:45:58 +05:30
Mahavir Jain
9006fc70ac fix(build): word-align the length symbol of embedded data files
The generated assembly emitted <name>_length immediately after the raw
payload bytes, so the 32-bit word landed misaligned whenever the data
size was not a multiple of 4. Consumers declare it as a 32-bit object
(e.g. `extern const size_t <name>_length` in the ULP firmware loaders),
so the compiler emits an alignment-assuming word load, which is a
misaligned flash read prone to spurious load faults on chips with
SOC_CPU_MISALIGNED_ACCESS_ON_PMP_MISMATCH_ISSUE (ESP32-C6/H2/H21).
2026-08-12 08:42:49 +05:30
Ashish Sharma
e7af5c69d9 feat(esp_image_verify): split image verification out of bootloader_support 2026-08-12 08:39:18 +05:30
Ashish Sharma
8589d9df25 fix(build): prepare dependents for bootloader_support dropping mbedtls
bootloader_support is about to stop pulling mbedtls (and app_update) into
every build graph, so components and apps that relied on those transitive
edges must own their dependencies

Closes https://github.com/espressif/esp-idf/issues/18072
Related https://github.com/espressif/esp-idf/issues/18778
2026-08-12 08:39:18 +05:30
Marius Vikhammer
3887bf6848 Merge branch 'ci/metric_apps' into 'master'
ci(size_metrics): add more size metrics apps

See merge request espressif/esp-idf!51622
2026-08-10 19:50:14 +08:00
Frantisek Hrbata
e9cf6abc31 Merge branch 'fix/harden_empty_toolchain_output' into 'master'
fix: harden build against empty toolchain output

Closes IDFGH-17820

See merge request espressif/esp-idf!50136
2026-08-10 09:31:40 +02:00
Frantisek Hrbata
a9de9dc172 Merge branch 'fix/ldgen_template_fingerprint' into 'master'
fix(ldgen): add the linker template to the generation fingerprint

See merge request espressif/esp-idf!51620
2026-08-10 08:31:03 +02:00
Marius Vikhammer
dd089bacb2 ci(size_metrics): add more size metrics apps 2026-08-07 13:49:28 +02:00
Renz Christian Bagaporo
1c183dc089 Merge branch 'fix/ldgen_stale_output' into 'master'
fix(cmake): track transitive includes in linker script preprocessing

Closes IDF-16033

See merge request espressif/esp-idf!51580
2026-08-07 16:44:17 +08:00
Frantisek Hrbata
5d4e96aeb8 fix(ldgen): add the linker template to the generation fingerprint
ldgen skips regeneration when a fingerprint over the section names, the
linker fragment files, sdkconfig and Kconfig is unchanged. The linker
script template was not part of that fingerprint, even though everything
outside its mapping placeholders is copied into the generated script
verbatim.

The build system regenerates the preprocessed template whenever any of
its inputs changes, not only when a linker fragment changes. When such a
change reaches ldgen but leaves the section names alone, the fingerprint
still matches, generation is skipped, and the image is linked against the
previously generated script. The skip path updates the mtime of the
output, so nothing in the build output shows that the change was dropped.

Add the template to the fingerprint so that regenerating it always
regenerates the linker script.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-08-07 10:39:10 +02:00
Marius Vikhammer
81f6360e4d Merge branch 'feat/optimize_bootloader_size' into 'master'
change(bootloader): optimize bootloader size

See merge request espressif/esp-idf!51573
2026-08-06 22:06:38 +08:00
Alexey Lapshin
366ce3ebed Merge branch 'fix/kasan_heap_alignment' into 'master'
fix(heap): preserve aligned allocation with KASAN

See merge request espressif/esp-idf!51186
2026-08-06 14:06:58 +04:00
Marius Vikhammer
47262f8e6b change(bootloader): optimize bootloader size
Trim bootloader size by moving some logs to DEBUG. Allows
compiling bootloader on P4 with CONFIG_ESPTOOLPY_FLASHMODE_QIO
without changing partition table offset
2026-08-06 10:01:36 +02:00
Mahavir Jain
2495e37a48 Merge branch 'feat/pma_pmp_lock_policy' into 'master'
Stop locking PMP in the bootloader and freeze the entry layout

See merge request espressif/esp-idf!50326
2026-08-06 11:31:39 +05:30
Renz Bagaporo
a3b304f380 fix(cmake): track linker script preprocessor includes 2026-08-06 09:18:13 +09:00