Repository: espressif/arduino-esp32
Pull request #11240: ci(idf): Use included IDF examples in CI
Author: login: lucasssvaz
Labels: name: Type: CI & Testing
description: Related to continuous integration, automated testing, or test infrastructure.
name: Status: Pending Merge
description: Pull Request is ready to be merged
name: Area: Arduino as ESP-IDF component
description: Issues about Arduino used as component in ESP-IDF
Created: 2025-04-11T13:39:38Z | Merged: 2025-04-28T15:45:13Z

## Description of Change

Add compilation test of our existing ESP-IDF examples to CI

## Tests scenarios

CI



Diff:
diff --git a/.github/scripts/on-push-idf.sh b/.github/scripts/on-push-idf.sh
new file mode 100644
index 00000000000..72e7c7f574e
--- /dev/null
+++ b/.github/scripts/on-push-idf.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+set -e
+
+CHECK_REQUIREMENTS="./components/arduino-esp32/.github/scripts/sketch_utils.sh check_requirements"
+
+# Export IDF environment
+. ${IDF_PATH}/export.sh
+
+# Find all examples in ./components/arduino-esp32/idf_component_examples
+idf_component_examples=$(find ./components/arduino-esp32/idf_component_examples -mindepth 1 -maxdepth 1 -type d)
+
+for example in $idf_component_examples; do
+    if [ -f "$example"/ci.json ]; then
+        # If the target is listed as false, skip the sketch. Otherwise, include it.
+        is_target=$(jq -r --arg target "$IDF_TARGET" '.targets[$target]' "$example"/ci.json)
+        if [[ "$is_target" == "false" ]]; then
+            printf "\n\033[93mSkipping %s for target %s\033[0m\n\n" "$example" "$IDF_TARGET"
+            continue
+        fi
+    fi
+
+    idf.py -C "$example" set-target "$IDF_TARGET"
+
+    has_requirements=$(${CHECK_REQUIREMENTS} "$example" "$example/sdkconfig")
+    if [ "$has_requirements" -eq 0 ]; then
+        printf "\n\033[93m%s does not meet the requirements for %s. Skipping...\033[0m\n\n" "$example" "$IDF_TARGET"
+        continue
+    fi
+
+    printf "\n\033[95mBuilding %s\033[0m\n\n" "$example"
+    idf.py -C "$example" -DEXTRA_COMPONENT_DIRS="$PWD/components" build
+done
diff --git a/.github/scripts/sketch_utils.sh b/.github/scripts/sketch_utils.sh
index e536da50111..befea255e0b 100755
--- a/.github/scripts/sketch_utils.sh
+++ b/.github/scripts/sketch_utils.sh
@@ -16,7 +16,7 @@ function check_requirements { # check_requirements <sketchdir> <sdkconfig_path>
     local requirements_or
 
     if [ ! -f "$sdkconfig_path" ] || [ ! -f "$sketchdir/ci.json" ]; then
-        echo "ERROR: sdkconfig or ci.json not found" 1>&2
+        echo "WARNING: sdkconfig or ci.json not found. Assuming requirements are met." 1>&2
         # Return 1 on error to force the sketch to be built and fail. This way the
         # CI will fail and the user will know that the sketch has a problem.
     else
diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml
index d98da24fc07..c8b8ddc2127 100644
--- a/.github/workflows/push.yml
+++ b/.github/workflows/push.yml
@@ -31,6 +31,7 @@ on:
       - "!libraries/**.properties"
       - "!libraries/**.py"
       - "package/**"
+      - "idf_component_examples/**"
       - "tools/**.py"
       - "platform.txt"
       - "programmers.txt"
@@ -45,7 +46,6 @@ on:
       - "!.github/scripts/tests_*"
       - "!.github/scripts/upload_*"
       - "variants/esp32/**/*"
-      - "variants/esp32c2/**/*"
       - "variants/esp32c3/**/*"
       - "variants/esp32c6/**/*"
       - "variants/esp32h2/**/*"
@@ -124,7 +124,7 @@ jobs:
               - 'idf_component.yml'
               - 'Kconfig.projbuild'
               - 'CMakeLists.txt'
-              - "variants/esp32c2/**/*"
+              - "idf_component_examples/**"
 
       - name: Set chunks
         id: set-chunks
@@ -267,15 +267,23 @@ jobs:
           submodules: recursive
           path: components/arduino-esp32
 
+      - name: Setup jq
+        uses: dcarbone/install-jq-action@e397bd87438d72198f81efd21f876461183d383a # v3.0.1
+
       - name: Build
         env:
           IDF_TARGET: ${{ matrix.idf_target }}
         shell: bash
         run: |
-          . ${IDF_PATH}/export.sh
-          idf.py create-project test
-          echo CONFIG_FREERTOS_HZ=1000 > test/sdkconfig.defaults
-          idf.py -C test -DEXTRA_COMPONENT_DIRS=$PWD/components build
+          chmod a+x ./components/arduino-esp32/.github/scripts/*
+          ./components/arduino-esp32/.github/scripts/on-push-idf.sh
+
+      - name: Upload generated sdkconfig files for debugging
+        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+        if: always()
+        with:
+          name: sdkconfig-${{ matrix.idf_target }}
+          path: ./components/arduino-esp32/idf_component_examples/**/sdkconfig
 
   # Save artifacts to gh-pages
   save-master-artifacts:
diff --git a/idf_component_examples/.gitignore b/idf_component_examples/.gitignore
new file mode 100644
index 00000000000..6052fd4e70b
--- /dev/null
+++ b/idf_component_examples/.gitignore
@@ -0,0 +1,4 @@
+build/
+managed_components/
+dependencies.lock
+sdkconfig
diff --git a/idf_component_examples/esp_matter_light/CMakeLists.txt b/idf_component_examples/esp_matter_light/CMakeLists.txt
index 16a7533f2a5..1430df8ff78 100644
--- a/idf_component_examples/esp_matter_light/CMakeLists.txt
+++ b/idf_component_examples/esp_matter_light/CMakeLists.txt
@@ -8,6 +8,7 @@ set(PROJECT_VER_NUMBER 1)
 # This should be done before using the IDF_TARGET variable.
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 
+idf_build_set_property(MINIMAL_BUILD ON)
 project(arduino_managed_component_light)
 
 # WARNING: This is just an example for using key for decrypting the encrypted OTA image
@@ -20,7 +21,7 @@ if(CONFIG_IDF_TARGET_ESP32C2)
     include(relinker)
 endif()
 
-idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
+idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++2a;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
 idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
 # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various
 # flags that depend on -Wformat
diff --git a/idf_component_examples/esp_matter_light/README.md b/idf_component_examples/esp_matter_light/README.md
index 06a22cdceac..b0173f6a437 100644
--- a/idf_component_examples/esp_matter_light/README.md
+++ b/idf_component_examples/esp_matter_light/README.md
@@ -59,15 +59,22 @@ Use ESP-IDF 5.1.4 from https://github.com/espressif/esp-idf/tree/release/v5.1
 This example has been tested with Arduino Core 3.0.4
 
 The project will download all necessary components, including the Arduino Core.  
-Run `idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.<SOC>.idf" -p <PORT> flash monitor`
+Execute this sequence:
+ `<remove build folder> using linux rm command or Windows rmdir command`
+ `idf.py set-target <SoC_Target>`
+ `idf.py -D SDKCONFIG_DEFAULTS="sdkconfig_file1;sdkconfig_file2;sdkconfig_fileX" -p <PORT> flash monitor`
 
 Example for ESP32-S3/Linux | macOS:  
 ```
-idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32s3" -p /dev/ttyACM0 flash monitor
+rm -rf build
+idf.py set-target esp32s3
+idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults" -p /dev/ttyACM0 flash monitor
 ```
 Example for ESP32-C3/Windows:  
 ```
-idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32c3" -p com3 flash monitor
+rmdir /s/q build
+idf.py set-target esp32c3
+idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults" -p com3 flash monitor
 ```
 
 It may be necessary to delete some folders and files  before running `idf.py`  
@@ -95,11 +102,15 @@ In order to build the application that will use Thread Networking instead of Wi-
 
 Example for ESP32-C6/Linux | macOS:  
 ```
-idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.c6_thread" -p /dev/ttyACM0 flash monitor
+rm -rf build
+idf.py set-target esp32c6
+idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.c6_thread" -p /dev/ttyACM0 flash monitor
 ```
 Example for ESP32-C6/Windows:  
 ```
-idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.c6_thread" -p com3 flash monitor
+rmdir /s/q build
+idf.py set-targt esp32c6
+idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.c6_thread" -p com3 flash monitor
 ```
 
 It may be necessary to delete some folders and files before running `idf.py`  
diff --git a/idf_component_examples/esp_matter_light/ci.json b/idf_component_examples/esp_matter_light/ci.json
new file mode 100644
index 00000000000..f23a085285d
--- /dev/null
+++ b/idf_component_examples/esp_matter_light/ci.json
@@ -0,0 +1,11 @@
+{
+  "targets": {
+    "esp32c2": false,
+    "esp32s2": false
+  },
+  "requires": [
+    "CONFIG_SOC_WIFI_SUPPORTED=y",
+    "CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y",
+    "CONFIG_MBEDTLS_HKDF_C=y"
+  ]
+}
diff --git a/idf_component_examples/esp_matter_light/main/Kconfig.projbuild b/idf_component_examples/esp_matter_light/main/Kconfig.projbuild
index 6e6abcb7fcf..3e0a35c5e15 100644
--- a/idf_component_examples/esp_matter_light/main/Kconfig.projbuild
+++ b/idf_component_examples/esp_matter_light/main/Kconfig.projbuild
@@ -3,100 +3,40 @@ menu "Light Matter Accessory"
         config BUTTON_PIN
             int
             prompt "Button 1 GPIO"
-            default ENV_GPIO_BOOT_BUTTON
+            default 9 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6
+            default 0
             range -1 ENV_GPIO_IN_RANGE_MAX
             help
                 The GPIO pin for button that will be used to turn on/off the Matter Light. It shall be connected to a push button. It can use the BOOT button of the development board.
     endmenu
 
-
     menu "LEDs"
         config WS2812_PIN
             int
             prompt "WS2812 RGB LED GPIO"
-            default ENV_GPIO_RGB_LED
+            default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6
+            default 48
             range -1 ENV_GPIO_OUT_RANGE_MAX
             help
                 The GPIO pin for the Matter Light that will be driven by RMT. It shall be connected to one single WS2812 RGB LED.
     endmenu
 
-    # TARGET CONFIGURATION
-    if IDF_TARGET_ESP32C3
-        config ENV_GPIO_RANGE_MIN
-            int
-            default 0
-
-        config ENV_GPIO_RANGE_MAX
-            int
-            default 19
-            # GPIOs 20/21 are always used by UART in examples
-
-        config ENV_GPIO_IN_RANGE_MAX
-            int
-            default ENV_GPIO_RANGE_MAX
-
-        config ENV_GPIO_OUT_RANGE_MAX
-            int
-            default ENV_GPIO_RANGE_MAX
-
-        config ENV_GPIO_BOOT_BUTTON
-            int
-            default 9
-
-        config ENV_GPIO_RGB_LED
-            int
-            default 8
-    endif
-    if IDF_TARGET_ESP32C6
-        config ENV_GPIO_RANGE_MIN
-            int
-            default 0
+    config ENV_GPIO_RANGE_MIN
+        int
+        default 0
 
-        config ENV_GPIO_RANGE_MAX
-            int
-            default 30
-            # GPIOs 16/17 are always used by UART in examples
+    config ENV_GPIO_RANGE_MAX
+        int
+        default 19 if IDF_TARGET_ESP32C3
+        default 30 if IDF_TARGET_ESP32C6
+        default 48
 
-        config ENV_GPIO_IN_RANGE_MAX
-            int
-            default ENV_GPIO_RANGE_MAX
+    config ENV_GPIO_IN_RANGE_MAX
+        int
+        default ENV_GPIO_RANGE_MAX
 
-        config ENV_GPIO_OUT_RANGE_MAX
-            int
-            default ENV_GPIO_RANGE_MAX
-
-        config ENV_GPIO_BOOT_BUTTON
-            int
-            default 9
-
-        config ENV_GPIO_RGB_LED
-            int
-            default 8
-    endif
-    if IDF_TARGET_ESP32S3
-        config ENV_GPIO_RANGE_MIN
-            int
-            default 0
-
-        config ENV_GPIO_RANGE_MAX
-            int
-            default 48
-
-        config ENV_GPIO_IN_RANGE_MAX
-            int
-            default ENV_GPIO_RANGE_MAX
-
-        config ENV_GPIO_OUT_RANGE_MAX
-            int
-            default ENV_GPIO_RANGE_MAX
-
-        config ENV_GPIO_BOOT_BUTTON
-            int
-            default 0
-
-        config ENV_GPIO_RGB_LED
-            int
-            default 48
-    endif
+    config ENV_GPIO_OUT_RANGE_MAX
+        int
+        default ENV_GPIO_RANGE_MAX
 
 endmenu
diff --git a/idf_component_examples/esp_matter_light/main/idf_component.yml b/idf_component_examples/esp_matter_light/main/idf_component.yml
index 2b4ae4b34a4..e0286324591 100644
--- a/idf_component_examples/esp_matter_light/main/idf_component.yml
+++ b/idf_component_examples/esp_matter_light/main/idf_component.yml
@@ -1,9 +1,9 @@
 dependencies:
   espressif/esp_matter:
-    version: "^1.3.0"
+    version: ">=1.3.0"
   # Adds Arduino Core from GitHub repository using main branch
   espressif/arduino-esp32:
-    version: "^3.0.5"
+    version: ">=3.0.5"
     override_path: "../../../"
     pre_release: true
 
diff --git a/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c3 b/idf_component_examples/esp_matter_light/sdkconfig.defaults
similarity index 98%
rename from idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c3
rename to idf_component_examples/esp_matter_light/sdkconfig.defaults
index df6d6b0d585..43871661856 100644
--- a/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c3
+++ b/idf_component_examples/esp_matter_light/sdkconfig.defaults
@@ -1,5 +1,3 @@
-CONFIG_IDF_TARGET="esp32c3"
-
 # Arduino Settings
 CONFIG_FREERTOS_HZ=1000
 CONFIG_AUTOSTART_ARDUINO=y
diff --git a/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c6 b/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c6
index f228f3158c8..9fe589613ef 100644
--- a/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c6
+++ b/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32c6
@@ -1,68 +1,5 @@
 CONFIG_IDF_TARGET="esp32c6"
 
-# Arduino Settings
-CONFIG_FREERTOS_HZ=1000
-CONFIG_AUTOSTART_ARDUINO=y
-
-# Log Levels
-# Boot Messages - Log level
-CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y
-# Arduino Log Level
-CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO=y
-# IDF Log Level
-CONFIG_LOG_DEFAULT_LEVEL_ERROR=y
-
-# Default to 921600 baud when flashing and monitoring device
-CONFIG_ESPTOOLPY_BAUD_921600B=y
-CONFIG_ESPTOOLPY_BAUD=921600
-CONFIG_ESPTOOLPY_COMPRESSED=y
-CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y
-CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
-CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
-
-#enable BT
-CONFIG_BT_ENABLED=y
-CONFIG_BT_NIMBLE_ENABLED=y
-
-#disable BT connection reattempt
-CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=n
-
-#enable lwip ipv6 autoconfig
-CONFIG_LWIP_IPV6_AUTOCONFIG=y
-
-# Use a custom partition table
-CONFIG_PARTITION_TABLE_CUSTOM=y
-CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
-CONFIG_PARTITION_TABLE_OFFSET=0xC000
-
-# Disable chip shell
-CONFIG_ENABLE_CHIP_SHELL=n
-
-# Enable OTA Requester
-CONFIG_ENABLE_OTA_REQUESTOR=n
-
-#enable lwIP route hooks
-CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y
-CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y
-
-# disable softap by default
-CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
-CONFIG_ENABLE_WIFI_STATION=y
-CONFIG_ENABLE_WIFI_AP=n
-
-# Disable DS Peripheral
-CONFIG_ESP_SECURE_CERT_DS_PERIPHERAL=n
-
-# Use compact attribute storage mode
-CONFIG_ESP_MATTER_NVS_USE_COMPACT_ATTR_STORAGE=y
-
-# Enable HKDF in mbedtls
-CONFIG_MBEDTLS_HKDF_C=y
-
-# Increase LwIP IPv6 address number to 6 (MAX_FABRIC + 1)
-# unique local addresses for fabrics(MAX_FABRIC), a link local address(1)
-CONFIG_LWIP_IPV6_NUM_ADDRESSES=6
-
 # libsodium
 CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y
 
diff --git a/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32s3 b/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32s3
deleted file mode 100644
index 9c1aa36b6c9..00000000000
--- a/idf_component_examples/esp_matter_light/sdkconfig.defaults.esp32s3
+++ /dev/null
@@ -1,64 +0,0 @@
-CONFIG_IDF_TARGET="esp32s3"
-
-# Arduino Settings
-CONFIG_FREERTOS_HZ=1000
-CONFIG_AUTOSTART_ARDUINO=y
-
-# Log Levels
-# Boot Messages - Log level
-CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y
-# Arduino Log Level
-CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO=y
-# IDF Log Level
-CONFIG_LOG_DEFAULT_LEVEL_ERROR=y
-
-# Default to 921600 baud when flashing and monitoring device
-CONFIG_ESPTOOLPY_BAUD_921600B=y
-CONFIG_ESPTOOLPY_BAUD=921600
-CONFIG_ESPTOOLPY_COMPRESSED=y
-CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y
-CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
-CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
-
-#enable BT
-CONFIG_BT_ENABLED=y
-CONFIG_BT_NIMBLE_ENABLED=y
-
-#disable BT connection reattempt
-CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=n
-
-#enable lwip ipv6 autoconfig
-CONFIG_LWIP_IPV6_AUTOCONFIG=y
-
-# Use a custom partition table
-CONFIG_PARTITION_TABLE_CUSTOM=y
-CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
-CONFIG_PARTITION_TABLE_OFFSET=0xC000
-
-# Disable chip shell
-CONFIG_ENABLE_CHIP_SHELL=n
-
-# Enable OTA Requester
-CONFIG_ENABLE_OTA_REQUESTOR=n
-
-#enable lwIP route hooks
-CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y
-CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y
-
-# disable softap by default
-CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
-CONFIG_ENABLE_WIFI_STATION=y
-CONFIG_ENABLE_WIFI_AP=n
-
-# Disable DS Peripheral
-CONFIG_ESP_SECURE_CERT_DS_PERIPHERAL=n
-
-# Use compact attribute storage mode
-CONFIG_ESP_MATTER_NVS_USE_COMPACT_ATTR_STORAGE=y
-
-# Enable HKDF in mbedtls
-CONFIG_MBEDTLS_HKDF_C=y
-
-# Increase LwIP IPv6 address number to 6 (MAX_FABRIC + 1)
-# unique local addresses for fabrics(MAX_FABRIC), a link local address(1)
-CONFIG_LWIP_IPV6_NUM_ADDRESSES=6
diff --git a/idf_component_examples/hello_world/CMakeLists.txt b/idf_component_examples/hello_world/CMakeLists.txt
index 664d45871d0..af087cf42b6 100644
--- a/idf_component_examples/hello_world/CMakeLists.txt
+++ b/idf_component_examples/hello_world/CMakeLists.txt
@@ -5,4 +5,6 @@
 cmake_minimum_required(VERSION 3.16)
 
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
+
+idf_build_set_property(MINIMAL_BUILD ON)
 project(main)
diff --git a/idf_component_examples/hw_cdc_hello_world/CMakeLists.txt b/idf_component_examples/hw_cdc_hello_world/CMakeLists.txt
index 16bb1063af3..1c3971f4dbf 100644
--- a/idf_component_examples/hw_cdc_hello_world/CMakeLists.txt
+++ b/idf_component_examples/hw_cdc_hello_world/CMakeLists.txt
@@ -9,4 +9,5 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 list(APPEND compile_definitions "ARDUINO_USB_CDC_ON_BOOT=1")
 list(APPEND compile_definitions "ARDUINO_USB_MODE=1")
 
+idf_build_set_property(MINIMAL_BUILD ON)
 project(hw_cdc_hello_world)
diff --git a/idf_component_examples/hw_cdc_hello_world/ci.json b/idf_component_examples/hw_cdc_hello_world/ci.json
new file mode 100644
index 00000000000..80669afc2cc
--- /dev/null
+++ b/idf_component_examples/hw_cdc_hello_world/ci.json
@@ -0,0 +1,5 @@
+{
+  "requires": [
+    "CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED=y"
+  ]
+}


Reviews:
user: login: SuGlider
body: LGTM
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-15T19:22:08Z
user: login: P-R-O-C-H-Y
state: APPROVED
author_association: MEMBER
submitted_at: 2025-04-16T15:02:20Z
user: login: SuGlider
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-24T16:57:00Z
user: login: SuGlider
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-25T16:31:45Z

Review comments:
diff_hunk: @@ -3,7 +3,7 @@ dependencies:
     version: "^1.3.0"
path: idf_component_examples/esp_matter_light/main/idf_component.yml
user: login: SuGlider
body: ```suggestion
    version: ">=1.3.0"
```
created_at: 2025-04-24T16:57:00Z
author_association: COLLABORATOR
diff_hunk: @@ -59,15 +59,22 @@ Use ESP-IDF 5.1.4 from https://github.com/espressif/esp-idf/tree/release/v5.1
 This example has been tested with Arduino Core 3.0.4
 
 The project will download all necessary components, including the Arduino Core.  
-Run `idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.<SOC>.idf" -p <PORT> flash monitor`
+Execute this sequence:
+ `<remove build folder> using linux rm command or Windows rmdir command`
+ `idf.py set-target <SoC_Target>`
+ `idf.py -D SDKCONFIG_DEFAULTS="sdkconfig.defaults.<SOC>.idf" -p <PORT> flash monitor`
path: idf_component_examples/esp_matter_light/README.md
user: login: SuGlider
body: ```suggestion
 `idf.py -D SDKCONFIG_DEFAULTS="sdkconfig_file1;sdkconfig_file2;sdkconfig_fileX" -p <PORT> flash monitor`
```
created_at: 2025-04-25T16:31:45Z
author_association: COLLABORATOR

PR comments:
user: login: github-actions[bot]
created_at: 2025-04-11T13:40:17Z
body: 
<!--
  0 failure: 
  0 warning: 
  1 messages
  1 markdown notices
  DangerID: danger-id-Danger;
-->



<table>
  <thead>
    <tr>
      <th width="50"></th>
      <th width="100%" data-danger-table="true">Messages</th>
    </tr>
  </thead>
  <tbody><tr>
      <td>:book:</td>
      <td>🎉 Good Job! All checks are passing!</td>
    </tr>
  </tbody>
</table>

👋 <strong>Hello lucasssvaz</strong>, we appreciate your contribution to this project!<br><hr>📘 Please review the project's <a href="https://github.com/espressif/arduino-esp32/blob/master/docs/en/contributing.rst">Contributions Guide</a> for key guidelines on code, documentation, testing, and more.<br><hr>🖊️ Please also make sure you have <strong>read and signed</strong> the <a href="https://cla-assistant.io/espressif/arduino-esp32">Contributor License Agreement</a> for this project.<br><hr><details><summary>Click to see more instructions ...</summary><p><br>This automated output is generated by the <a href="https://github.com/espressif/shared-github-dangerjs">PR linter DangerJS</a>, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.<br><br>DangerJS is triggered with each `push` event to a Pull Request and modify the contents of this comment.<br><br><strong>Please consider the following:</strong><br>- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.<br>- Danger is <strong>not a substitute for human code reviews</strong>; it's still important to request a code review from your colleagues.<br>- To manually <a href="https://github.com/espressif/arduino-esp32/actions">retry these Danger checks</a>, please navigate to the <kbd>Actions</kbd> tab and re-run last Danger workflow.<br></p></details><details><summary>Review and merge process you can expect ...</summary><p><br><strong>We do welcome contributions in the form of bug reports, feature requests and pull requests.</strong><br><br><strong>1.</strong> An internal issue has been created for the PR, we assign it to the relevant engineer.<br><strong>2.</strong> They review the PR and either approve it or ask you for changes or clarifications.<br><strong>3.</strong> Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.<br>    - At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.<br><strong>4.</strong> If the change is approved and passes the tests it is merged into the default branch.<br></p></details>

<p align="right">
  Generated by :no_entry_sign: <a href="https://danger.systems/js">dangerJS</a> against 128bc3fd97f9c0c40480bcbf708d2deedabb15cf
</p>

author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-04-14T13:21:13Z
body: ## Test Results
 76 files   76 suites   12m 46s ⏱️
 38 tests  38 ✅ 0 💤 0 ❌
241 runs  241 ✅ 0 💤 0 ❌

Results for commit 128bc3fd.

[test-results]:data:application/gzip;base64,H4sIAEmRDWgC/12MSw7CIBQAr9KwdgEUhXoZAw9IiG0xfFaNdxdIa9HlzCSzIetmE9F94LfLgGJ26SSdg0zOr42rKC3VOooDHjED/JmnexWDv8JKN/8IE4IPuwl5rUfKyA7HsTfnsXE3bNz/wC+LSwUQoULBaPXE7QQYGGYCK1CWY6GpNkZLpcgVLHp/AE/yLVgFAQAA

:recycle: This comment has been updated with latest results.
author_association: CONTRIBUTOR
user: login: SuGlider
created_at: 2025-04-15T14:50:13Z
body: @lucasssvaz - what is the reason for removing matter_light specific target default sdkconfig? Those are examples.
author_association: COLLABORATOR
user: login: SuGlider
created_at: 2025-04-15T19:21:50Z
body: > @lucasssvaz - what is the reason for removing matter_light specific target default sdkconfig? Those are examples.

We already talked about it - question answered.
author_association: COLLABORATOR
user: login: Jason2866
created_at: 2025-04-17T09:54:39Z
body: @SuGlider Is it planned to adopt the example to work with actual Arduino Core 3.2.0?
Currently it is only for Arduino Core ~3.0.5
author_association: COLLABORATOR
user: login: SuGlider
created_at: 2025-04-24T14:32:06Z
body: > @SuGlider Is it planned to adopt the example to work with actual Arduino Core 3.2.0? Currently it is only for Arduino Core ~3.0.5

@Jason2866 - Could you please share your findings about this issue? Thanks!
author_association: COLLABORATOR
user: login: SuGlider
created_at: 2025-04-24T16:51:10Z
body: > @SuGlider Is it planned to adopt the example to work with actual Arduino Core 3.2.0? Currently it is only for Arduino Core ~3.0.5

I guess this is about https://github.com/espressif/arduino-esp32/blob/master/idf_component_examples/esp_matter_light/main/idf_component.yml

```
dependencies:
  espressif/esp_matter:
    version: "^1.3.0"
  # Adds Arduino Core from GitHub repository using main branch
  espressif/arduino-esp32:
    version: "^3.0.5"
    override_path: "../../../"
    pre_release: true

    # testing - using Arduino from the repository
    # version: "master"  # branch or commit
    # git: https://github.com/espressif/arduino-esp32.git
  ```
  
  That shall be solved with the changes:
  
  ```
dependencies:
  espressif/esp_matter:
    version: ">=1.3.0"
  # Adds Arduino Core from GitHub repository using main branch
  espressif/arduino-esp32:
    version: ">=3.0.5"
    override_path: "../../../"
    pre_release: true
 ```
author_association: COLLABORATOR
user: login: Jason2866
created_at: 2025-04-25T12:28:10Z
body: @SuGlider Try to compile. Compile errors come up when trying with Core 3.2.0 and IDF 5.4.1+
author_association: COLLABORATOR
user: login: SuGlider
created_at: 2025-04-25T13:32:55Z
body: > @SuGlider Try to compile. Compile errors come up when trying with Core 3.2.0 and IDF 5.4.1+

I have done it. I was able to build the Matter application for the ESP32 using Core 3.2.0, IDF5.4.1 and Matter 1.4.0.

I have checkout this PR, installed IDF v5.4 and imported the Arduino as Component Matter Light project from the repository.
I have modified the `main/idf_component.yml` file to comment out the last 2 lines (`override_path: "../../../"` and `pre_release: true`). I have run `idf.py set-target esp32` and then `idf.py build`. All good. 
author_association: COLLABORATOR
user: login: Jason2866
created_at: 2025-04-25T15:04:18Z
body: @SuGlider Dont get it going with branch master and IDF 5.4.1+ from 25.04.11
https://github.com/pioarduino/platform-espressif32/actions/runs/14667529394/job/41165941836
used example https://github.com/pioarduino/platform-espressif32/tree/refs/heads/test_matter/examples/espidf-arduino-matter-light
author_association: COLLABORATOR
user: login: SuGlider
created_at: 2025-04-25T15:24:42Z
body: > @SuGlider Dont get it going with branch master and IDF 5.4.1+ from 25.04.11 https://github.com/pioarduino/platform-espressif32/actions/runs/14667529394/job/41165941836 used example https://github.com/pioarduino/platform-espressif32/tree/refs/heads/test_matter/examples/espidf-arduino-matter-light

This error is related `std::to_underlying` it needs C++ 23.
I have changed the CMakeLists.txt file in this PR to use C++ 2a.
d8e7a91b2420313408b2cefe276ad2ef5a89cf6f

Try that change within pioarduino and let me know.
author_association: COLLABORATOR
user: login: SuGlider
created_at: 2025-04-25T16:42:50Z
body: @Jason2866 - please evaluate https://github.com/pioarduino/platform-espressif32/pull/146
author_association: COLLABORATOR
user: login: Jason2866
created_at: 2025-04-25T16:56:20Z
body: @SuGlider Will do. Needs a pio python script to change the used c++ version.
author_association: COLLABORATOR
user: login: Jason2866
created_at: 2025-04-25T17:04:45Z
body: Just noticed we need to fix the Arduino Lib Builder pioarduino script.
There is this entry
```
CXXFLAGS=[
        "-march=rv32imc_zicsr_zifencei",
        "-std=gnu++2b",
        "-fexceptions",
        "-fno-rtti",
        "-fuse-cxa-atexit",
        "-std=gnu++2a"
    ],
```
I guess it fetches the different settings from normal run and the Matter run. Similar issue than adding the ndebug entry.
I can't override correctly when two set here.
author_association: COLLABORATOR
user: login: Jason2866
created_at: 2025-04-25T17:34:37Z
body: This weird setup does work:
```
build_unflags = 
    -std=c++17
    -std=gnu++2b
build_flags =
    -std=gnu++2a
```
author_association: COLLABORATOR
user: login: SuGlider
created_at: 2025-04-25T17:46:24Z
body: > This weird setup does work:
> 
> ```
> build_unflags = 
>     -std=c++17
>     -std=gnu++2b
> build_flags =
>     -std=gnu++2a
> ```

does this setup build it for pioarduino?
I have tried 2b but it fails with Matter 1.4
2a is the best ESP Matter can go.
author_association: COLLABORATOR
user: login: Jason2866
created_at: 2025-04-26T10:42:23Z
body: Yes, this setup does build successfully. It uses Matter v1.4. and ++2a

https://github.com/pioarduino/platform-espressif32/actions/runs/14669953811/job/41173950292

Thx for your help!
author_association: COLLABORATOR