Commit Graph

7558 Commits

Author SHA1 Message Date
Marius Vikhammer 82c1f71d96 ci(esp_intr_dump): add expected output for esp32s31 2026-04-08 09:43:21 +08:00
Island 51bbd5257a Merge branch 'dev/ble-log-202603' into 'master'
dev: BLE Log 202603

See merge request espressif/esp-idf!46934
2026-04-03 18:10:47 +08:00
C.S.M f7031990f2 Merge branch 'ci/enable_s31_target_test' into 'master'
ci(esp32s31): Add ci target test for esp32s31

Closes IDF-14694

See merge request espressif/esp-idf!47208
2026-04-03 13:23:47 +08:00
Mahavir Jain b3bb9a2a91 Merge branch 'fix/fix_esp_local_ctrl_potential_double_free' into 'master'
fix(esp_local_ctrl): fixes a potential double free

See merge request espressif/esp-idf!46953
2026-04-03 09:36:48 +05:30
C.S.M 152b5ccb4c ci(esp32s31): Add ci target test for esp32s31 2026-04-03 11:38:45 +08:00
Armando (Dou Yiwen) b533c6750e Merge branch 'feat/mmu_s31' into 'master'
mmu: s31 support for external mmu

Closes IDF-14669

See merge request espressif/esp-idf!47133
2026-04-03 02:42:20 +00:00
Roland Dobai 6c6b1b8ae3 Merge branch 'feat/adopt_fast_reflashing' into 'master'
feat(idf_py): idf.py flash will reflash only changed data sectors by default

Closes IDF-11871

See merge request espressif/esp-idf!45542
2026-04-02 19:37:27 +02:00
Guillaume Souchere 25cb4d0196 Merge branch 'feat/esp-system-linux-support-update' into 'master'
feat(esp_system): Add linux support for freertos hooks and system init function

See merge request espressif/esp-idf!46570
2026-04-02 11:31:42 +02:00
Radim Karniš 38d37e5e9f feat(idf_py): idf.py flash will reflash only changed data sectors by default
idf.py flash -a is introduced to trigger a flash of all data (not just changed sectors).
2026-04-02 10:59:30 +02:00
Radim Karniš c62515671d change(build): Rename Fast reflashing configuration to Minimize binary changes, make non-experimental 2026-04-02 10:53:32 +02:00
Euripedes Rocha 099d7ee8ce Merge branch 'trim-common-components-networking-manifests' into 'master'
fix: Component depends rules for networking and protocols

See merge request espressif/esp-idf!46961
2026-04-02 08:54:05 +02:00
Ashish Sharma 544e71e263 fix(esp_local_ctrl): fixes a potential double free 2026-04-02 09:57:23 +08:00
armando ea124ede83 ci(s31): add s31 to no runner tag 2026-04-02 09:51:56 +08:00
Mahavir Jain 1a4ad657be Merge branch 'docs/update_doc_for_fe_dev_mode_to_release_mode_transition' into 'master'
docs: added guide to transit from dev mode to release mode of FE

Closes IDF-15376

See merge request espressif/esp-idf!45919
2026-04-01 19:08:00 +05:30
Euripedes Rocha Filho 985af4a130 fix: Component depends rules for networking and protocols
Reduces the scope of testing to the direct dependencies.
2026-04-01 12:43:03 +02:00
Guillaume Souchere 8706cd6135 feat(esp_system): add linux test for system init function regisration 2026-04-01 11:46:06 +02:00
Frantisek Hrbata 32d31d72a3 Merge branch 'feat/cmakev2_bootloader' into 'master'
feat(cmakev2): build bootloader using the cmakev2 build system

Closes IDF-15433

See merge request espressif/esp-idf!46465
2026-04-01 10:29:05 +02:00
nilesh.kale 85b5e6a231 fix: added reference to example security/security_features_app in docs 2026-04-01 13:54:34 +05:30
Fu Hanxi e93cda6391 Merge branch 'ci/apply-idf-ci-1.x' into 'master'
ci: upgrade idf-ci to 1.x

Closes CII-108

See merge request espressif/esp-idf!46623
2026-03-30 19:31:53 +02:00
Fu Hanxi 12cc3a92af Merge branch 'feat/parametrize-pytest-cli-args' into 'master'
ci: move test cli args alongside test scripts

Closes IDFCI-1951 and IDFCI-2940

See merge request espressif/esp-idf!46966
2026-03-28 08:04:25 +01:00
Fu Hanxi 9ecd3ecad4 ci: apply idf-ci 1.x 2026-03-27 15:12:31 +01:00
Frantisek Hrbata c6c1293d0c fix(cmakev2/project): guard compiler optimization flags with build property
The __init_project_configuration() function in cmakev2's project.cmake
unconditionally applied app-level compiler optimization flags based on
CONFIG_COMPILER_OPTIMIZATION_* Kconfig options. When the bootloader
subproject was built with cmakev2, these app-level flags leaked into the
bootloader compile command alongside the correct bootloader-specific
flags from CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_*.

For example, with the default configuration (app: DEBUG, bootloader:
SIZE), the bootloader received both "-Og -fno-shrink-wrap" (from app
config) and "-Os -freorder-blocks" (from bootloader config). While GCC
uses the last -O flag (-Os wins), the stray -fno-shrink-wrap persisted.

Introduce a SET_COMPILER_OPTIMIZATION build property that defaults to
YES when unset. Subprojects that manage their own optimization flags
(like the bootloader) can set this to NO before calling
idf_project_init() to prevent the default optimization flags from being
applied. This keeps project.cmake generic without requiring it to know
about specific subproject types.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-27 19:18:11 +08:00
Frantisek Hrbata 9f8329c2df fix(cmakev2/project): initialize idf_path for macro prefix map
The idf_path variable was used in -fmacro-prefix-map and
-fdebug-prefix-map flags but never read from the IDF_PATH build
property, resulting in an empty substitution. This caused full
filesystem paths to leak into .rodata instead of being mapped to /IDF.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-27 19:18:11 +08:00
Frantisek Hrbata ab90489ccb fix(cmakev2/utilities): resolve embed file path in idf_component_include
Commit f62f45cf5c changed target_add_binary_data to resolve the
embedded file path relative to the component directory by using
idf_component_get_property to obtain the COMPONENT_DIR. This fixed the
path resolution when target_add_binary_data is called from
idf_component_include, which runs outside the component's directory
context.

However, target_add_binary_data can also be called directly from a
project's CMakeLists.txt with a non-component target, e.g.
target_add_binary_data(app.elf ...) as done in
examples/security/security_features_app. In this case,
idf_component_get_property fails because the target is not a component.

Fix this by moving the path resolution to idf_component_include, where
the embed file paths from EMBED_FILES and EMBED_TXTFILES component
properties are resolved to absolute paths relative to COMPONENT_DIR
before being passed to target_add_binary_data. This way,
target_add_binary_data receives already absolute paths from
idf_component_include and can use plain get_filename_component(ABSOLUTE)
for direct calls, which correctly resolves relative to
CMAKE_CURRENT_SOURCE_DIR.

Fixes: f62f45cf5c ("fix(cmakev2/utilities): add a dependency target for the embedded file")

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-27 19:18:11 +08:00
Frantisek Hrbata a2461ea32b feat(cmakev2/kconfig): add GENERATE_SDKCONFIG build property
Add a GENERATE_SDKCONFIG build property that controls whether kconfgen
writes the sdkconfig file (--output config) during the configuration
step. It defaults to 1 (enabled).

When building the bootloader as a subproject, the set of components
(and their Kconfig files) differs from the main project. Running
kconfgen with --output config in this context rewrites the main
project's sdkconfig. Even when the content is identical, the timestamp
update causes ninja to detect sdkconfig as newer than build.ninja
outputs (e.g. cmake_install.cmake), triggering an infinite CMake
re-run loop.

Setting GENERATE_SDKCONFIG to 0 in a subproject prevents this,
matching the behaviour of cmakev1's __OUTPUT_SDKCONFIG property.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-27 19:18:11 +08:00
Frantisek Hrbata c91597454d feat(cmakev2/idf): add PROJECT_COMPONENTS_SOURCE build property
Add the PROJECT_COMPONENTS_SOURCE build property to control how project
components are categorised during component discovery.  By default it is
set to "project_components" (priority 3 - highest), preserving the
existing behaviour.

Setting it to "idf_components" (priority 0) before calling
idf_project_init() makes the project's built-in components overridable
by user-supplied components through EXTRA_COMPONENT_DIRS (priority 2).

This is needed for sub-projects like the bootloader, whose built-in
components (e.g. main) are provided by ESP-IDF and should be overridable
by user-supplied components placed in bootloader_components/.  The
cmakev1 build system allowed this override because it used a
last-one-wins strategy, but cmakev2 uses strict priority-based component
resolution where project_components always win.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-27 19:18:11 +08:00
Frantisek Hrbata 3a0f0bb13f feat(cmakev2/build): add ALL option to idf_build_binary and idf_sign_binary
Add an optional ALL parameter to idf_build_binary and idf_sign_binary
functions. When specified, the created custom target is included in the
default build target. Without ALL, custom targets created by these
functions are excluded from the default build (add_custom_target
behavior), meaning they won't be built unless explicitly requested or
depended upon by another target in ALL.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-27 19:18:11 +08:00
Frantisek Hrbata ba4c6de807 feat(cmakev2/utilities): add idf_target_post_build_msg helper
Add a helper function for printing multi-line post-build messages on a
target. The message lines are joined with newlines, written to a file at
configure time, and printed at build time using a single cmake -E cat
command, replacing the need for repeated cmake -E echo invocations.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-27 19:18:11 +08:00
Frantisek Hrbata 6b8aa157e5 feat(cmakev2/build): add idf_check_bootloader_size helper
Add a public API function to check that the bootloader binary does not
overlap the partition table, mirroring the existing idf_check_binary_size
pattern for application binaries.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-27 19:18:11 +08:00
Frantisek Hrbata 43d4fdd4b3 fix(cmakev2/build): fix typo in idf_sign_binary keyfile variable
The KEYFILE argument value was stored in a misspelled variable
"keyfle" instead of "keyfile", causing custom keyfile paths to
be silently ignored.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-27 19:18:11 +08:00
Frantisek Hrbata 44a610cbf0 feat(cmakev2/compat): allow to set commonly required components
The commonly required components are configured solely for backward
compatibility with cmakev1. Since the bootloader build explicitly sets
commonly required components, we need to support this feature in cmakev2
as well. Ideally, there should be no commonly required components, and
each component should specify its requirements explicitly.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-27 19:18:11 +08:00
Frantisek Hrbata 3c8a4657a5 Merge branch 'fix/cmakev2_ci_fixes' into 'master'
fix(cmakev2): fix Linux target build and skip unsupported root component tests

See merge request espressif/esp-idf!47050
2026-03-27 12:12:42 +01:00
Fu Hanxi f00fbc88a4 ci: set build status as fail when upload failed 2026-03-27 11:11:03 +01:00
Fu Hanxi 036bb8ec77 ci: move linux test cli args alongside the test scripts 2026-03-27 09:19:21 +01:00
Frantisek Hrbata 76e7ea2ba5 fix(cmakev2): skip root component tests until cmakev2 support is added
The TestIdfRootDependency tests (test_basic_build,
test_build_only_when_required, test_cleanup_unused) were introduced in
MR 39704 to validate the idf_extra_components.yml root dependency
feature. This feature relies on component manager integration that is
not yet implemented in the cmakev2 build system, causing all three
tests to fail when run with --buildv2.

Skip these tests for cmakev2 using the buildv2_skip marker until root
components support is added (IDF-14259).

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-26 16:30:15 +01:00
Fu Hanxi 4f92cfd077 ci: rename eco tags to revision 2026-03-26 12:24:59 +01:00
Fu Hanxi ddc7e0cdf7 ci: move qemu test cli args alongside test scripts
remove redundant host_test marker
2026-03-26 10:56:15 +01:00
Fu Hanxi 365268ae94 ci: move dev_password and dev_user alongside the test scripts 2026-03-26 10:56:15 +01:00
Daniel Paul 914d32c101 Merge branch 'feat/move-cjson-to-root-dep' into 'master'
feat: support moving idf components to component registry

Closes PACMAN-1102

See merge request espressif/esp-idf!39704
2026-03-25 18:10:42 +08:00
Roland Dobai 0459417fed Merge branch 'feat/add_merged_hints_to_build' into 'master'
Build & Config: Create a merged hints database in the build directory

Closes IDF-15480

See merge request espressif/esp-idf!46861
2026-03-25 07:47:41 +01:00
Zhou Xiao 205bc49fd6 fix(ble_log_console): exclude from idf-ci pytest collection to fix CI
idf-ci discovers pyproject.toml pytest config and runs a separate
collection pass with --target all, which finds 0 target tests and
raises RuntimeError. Add to .idf_ci.toml exclude_dirs instead of
deleting tests. Restore all 227 unit tests with lint/mypy fixes.
2026-03-24 15:42:03 +08:00
Frantisek Hrbata 927fc8d03a test(cmakev2): add test for build with IDF_COMPONENT_MANAGER=0
Verify that setting IDF_COMPONENT_MANAGER=0 skips the component manager
flow entirely and produces a successful build. The test also asserts that
no "Component manager round" messages appear in the output, confirming
the manager loop is not entered.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-23 16:02:36 +01:00
Frantisek Hrbata 3cbca31571 fix(cmakev2): skip component manager flow when IDF_COMPONENT_MANAGER=0
When the component manager is disabled via IDF_COMPONENT_MANAGER=0, the
cmakev2 build system still entered the full component manager flow
(__fetch_components_from_registry), which called
__download_managed_component(). That function returned early with
result=0 without creating the expected output file, violating the
post-condition in __download_component_level_managed_components() that
checks result==0 => file exists, causing a fatal error.

Instead of patching the low-level function to write an empty stub file,
this commit properly skips the entire component manager flow when the
manager is disabled:

- Move __init_component_manager() to idf.cmake global initialization
  sequence alongside other __init_*() calls, so IDF_COMPONENT_MANAGER
  build property is available early.

- Set __SDKCONFIG_ORIG to the real sdkconfig path in __init_kconfig()
  as its default value. Previously it was only set inside
  __create_sdkconfig_orig_copy() and had a defensive fallback in
  __create_base_kconfgen_command(). The default ensures __SDKCONFIG_ORIG
  is always valid regardless of whether the component manager runs.

- Guard __create_sdkconfig_orig_copy() with an IDF_COMPONENT_MANAGER
  check. The sdkconfig backup exists solely to preserve unknown Kconfig
  options from managed components during intermediate kconfgen rounds.
  When the manager is disabled, no managed components exist, so the
  backup is unnecessary.

- Guard __fetch_components_from_registry() call in project.cmake behind
  IDF_COMPONENT_MANAGER == 1. When disabled, only the manifest warning
  is issued. No download loop runs, no temp files are created, and no
  "Component manager round N..." messages are printed.

- Remove the now-redundant IDF_COMPONENT_MANAGER guard from
  __download_managed_component(), since it is only reachable when the
  manager is enabled.

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

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-03-23 16:02:36 +01:00
Zhou Xiao 391f7b7d8a docs(ble_log_console): update user guides for new features and run/build scripts
- Recommend run.sh/run.bat as primary launch method with Launch Screen description
- Add build.sh/build.bat section for standalone executable packaging
- Document buffer utilization screen (m key) and two-table stats layout (d key)
- Update menuconfig path, status panel format, and Kconfig option names
- Remove obsolete textual ModuleNotFoundError troubleshooting
- Simplify manual configuration to single toggle (defaults cover most cases)
- Fix ESP32 -> ESP chip in introduction
2026-03-23 20:36:52 +08:00
Zhou Xiao ca920a8e8f feat(ble_log_console): add buffer utilization tracker and display
Add BufUtilTracker to record per-LBM inflight peak data, wire it
through StatsAccumulator and StatsUpdated message for thread-safe
delivery to the UI. Buffer utilization is displayed in a dedicated
BufUtilScreen accessible via the 'm' keybinding, separate from
the frame stats screen ('d').

Also reject false INIT_DONE frames with version==0 caused by
misaligned data during parser sync, preventing spurious stats resets.
2026-03-23 18:29:37 +08:00
Zhou Xiao d9a4d15203 feat(ble_log_console): add BUF_UTIL internal frame decoding
Add BUF_UTIL=5 to InternalSource, BufUtilPool enum, BufUtilResult
TypedDict, BufUtilEntry dataclass, and name resolution helpers.
Add decode branch in internal_decoder with pool/index extraction
from the packed lbm_id field. Tests cover valid decode, pool/index
extraction, and truncated payload handling.
2026-03-23 18:28:29 +08:00
Roland Dobai f46452d3ab feat(cmake): Create a merged hints database in the build directory 2026-03-23 09:24:45 +01:00
Zhou Xiao a51d879d1b feat(ble_log_console): add CLI entry point, build scripts, and docs
- Click-based CLI entry point (console.py) with --port, --baudrate,
  --log-dir options and interactive Launch Screen when --port omitted
- Deprecation warning for --output CLI flag
- 'ls' subcommand to list saved capture files
- PyInstaller build scripts (build.sh, build.bat, build_exe.py)
- Convenience run scripts (run.sh, run.bat)
- README rewrite with installation, usage, architecture docs, and
  troubleshooting guide
- User guides in English and Chinese
- Remove old single-file ble_log_console.py
- Register new scripts in executable-list.txt
2026-03-23 02:10:56 +08:00
Zhou Xiao 02f1960e56 feat(ble_log_console): add Textual frontend and app wiring
TUI frontend built on Textual with thread-safe backend integration:

- Launch screen with port/baud/log-dir selection and auto-refresh
- Log view with scrollable RichLog and color-coded write methods;
  Rich markup escaped to prevent crash on bracket characters
- Stats screen split into two tables by time base:
  - Firmware Counters (since chip init): Written and Buffer Loss
  - Console Measurements (since console start): Average Throughput
    and Peak Write — each with separate frames and bytes sub-columns
  - Column widths constrained with min_width/max_width for stable layout
  - Division-by-zero guard when peak window is zero
- Shortcut screen overlay
- Status panel with sync state, checksum mode, and transport metrics;
  speed display uses named UART_BITS_PER_BYTE constant
- Main app wiring: UART reader thread with threading.Lock for serial
  access, frame parser pipeline, stats emission via StatsUpdated
  messages (including funnel snapshots via public accessor for
  thread-safe delivery), BackendStopped message for disconnect
- BackendStopped posted on open_serial failure (prevents stuck status)
- Select.BLANK guard for baud rate in launch screen
- Explicit None guards replace asserts in backend worker
- Wall-clock burst tracking for REDIR frames (no chip-side timestamp)
- SN gap alerts (FrameLossDetected) and traffic spike notifications
2026-03-23 02:10:45 +08:00
Zhou Xiao 9046c77e52 feat(ble_log_console): add backend with frame parser, stats, and data models
Modular backend for the BLE log console rewrite:

- Frame parser with sync state machine and checksum auto-detection
  (4 modes: XOR/Sum x Full/Header-only); handles incomplete frames
  during re-sync search when previously synced
- Internal frame decoder (INIT_DONE, ENH_STAT, FLUSH, INFO)
- Data models: SourceCode, FrameByteCount, FunnelSnapshot, LossType
- Stats package with composition-root StatsAccumulator orchestrating:
  - TransportMetrics (RX bytes, lifetime-average throughput)
  - FirmwareLossTracker / FirmwareWrittenTracker (ENH_STAT deltas
    with first-report absolute value initialization)
  - SNGapTracker (sliding window reorder-tolerant SN gap detection)
  - PeakBurstTracker (per-source sliding window burst density)
  - TrafficSpikeDetector (wire utilization spike detection)
  - Wall-clock burst tracker for non-timestamped sources (REDIR)
- Torn-read guard on ENH_STAT reports (baudrate-based plausibility)
  with prev-state update on discard to prevent cascading drops
- Console-local metrics (TransportMetrics, PeakBurstTracker) preserved
  across INIT_DONE resets; only ENH_STAT-coupled components reset
- UART transport with port validation and exclusive serial access
- Comprehensive test suite (17 test files, 223 tests)
2026-03-23 02:10:29 +08:00