Skip to content

Commit

Permalink
Merge remote-tracking branch 'csa/master' into onboarding_payload_ren…
Browse files Browse the repository at this point in the history
…aming
  • Loading branch information
OlivierGre committed Dec 19, 2024
2 parents 900da2e + aac3e3f commit bc60247
Show file tree
Hide file tree
Showing 259 changed files with 12,461 additions and 1,978 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/check-data-model-directory-updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Check for changes to data_model directory without a sha update
name: Data model directory checks

on:
pull_request:
paths:
- "data_model/**"

jobs:
check-submodule-update-label:
name: Check for changes to data_model directory without a sha update
check-data_model-updates:
name: Check for updates to data model directory without SHA updates
runs-on: ubuntu-latest
if: "git diff --name-only HEAD^..HEAD data_model/ | grep -q spec_sha"
container:
image: ghcr.io/project-chip/chip-build
steps:
- name: Error Message
run: echo This pull request attempts to update data_model directory, but is missing updates to spec_sha file with the latest version of the sha. Files in the data_model directory are generated automatically and should not be updated manually.
- name: Fail Job
run: exit 1
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check for changes to master data_model directory without a SHA update
run: |
python3 scripts/dm_xml_ci_change_enforcement.py data_model/master
- name: Check for changes to 1.3 data_model directory without a SHA update
run: |
python3 scripts/dm_xml_ci_change_enforcement.py data_model/1.3
- name: Check for changes to 1.4 data_model directory without a SHA update
run: |
python3 scripts/dm_xml_ci_change_enforcement.py data_model/1.4
10 changes: 9 additions & 1 deletion .github/workflows/examples-esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ jobs:
"./scripts/build/build_examples.py \
--enable-flashbundle \
--target esp32-m5stack-all-clusters-minimal \
--target esp32-m5stack-all-clusters-rpc-ipv6only \
--pregen-dir ./zzz_pregenerated \
build \
--copy-artifacts-to out/artifacts \
Expand All @@ -95,6 +94,15 @@ jobs:
mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py
- name: Build example All Clusters App(Target:ESP32C3)
run: scripts/examples/esp_example.sh all-clusters-app sdkconfig.defaults.esp32c3 esp32c3
- name: Build example All Clusters App(Target:ESP32)
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--enable-flashbundle \
--target esp32-devkitc-all-clusters-rpc-ipv6only \
build \
--copy-artifacts-to out/artifacts \
"
- name: Copy aside build products
run: |
mkdir -p example_binaries/esp32-build
Expand Down
32 changes: 17 additions & 15 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -520,24 +520,26 @@ jobs:
echo "TRACE_TEST_JSON: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
echo "TRACE_TEST_PERFETTO: out/trace_data/test-{SCRIPT_BASE_NAME}" >> /tmp/test_env.yaml
- name: Verify Testing Support
run: |
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/test_testing/test_IDM_10_4.py'
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/test_testing/test_TC_ICDM_2_1.py'
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/test_testing/test_TC_SC_7_1.py'
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/test_testing/TestDecorators.py'
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/TestChoiceConformanceSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/TestConformanceSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/TestConformanceTest.py'
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/TestIdChecks.py'
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/TestMatterTestingSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/TestSpecParsingDeviceType.py'
scripts/run_in_python_env.sh out/venv 'python3 src/python_testing/TestSpecParsingSupport.py'
- name: Run Tests
run: |
mkdir -p out/trace_data
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/controller/python/test/test_scripts/mobile-device-test.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/execute_python_tests.py --env-file /tmp/test_env.yaml --search-directory src/python_testing'
scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py --all-clusters out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingDeviceType.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceTest.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestChoiceConformanceSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestMatterTestingSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingSupport.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_TC_ICDM_2_1.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_IDM_10_4.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_TC_SC_7_1.py'
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/TestDecorators.py'
scripts/run_in_python_env.sh out/venv 'scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/controller/python/test/test_scripts/mobile-device-test.py'
scripts/run_in_python_env.sh out/venv 'src/python_testing/execute_python_tests.py --env-file /tmp/test_env.yaml --search-directory src/python_testing'
scripts/run_in_python_env.sh out/venv 'scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py --all-clusters out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app'
- name: Uploading core files
uses: actions/upload-artifact@v4
Expand Down
2 changes: 0 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,6 @@
"esp32-devkitc-temperature-measurement",
"esp32-m5stack-all-clusters",
"esp32-m5stack-all-clusters-ipv6only",
"esp32-m5stack-all-clusters-rpc",
"esp32-m5stack-all-clusters-rpc-ipv6only",
"infineon-psoc6-all-clusters",
"infineon-psoc6-lock",
"infineon-psoc6-light",
Expand Down
178 changes: 16 additions & 162 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ endif()

include(${CMAKE_CURRENT_LIST_DIR}/ota-image.cmake)

set(CHIP_REQUIRE_COMPONENTS esp_eth freertos lwip bt mbedtls fatfs app_update console openthread nvs_flash spi_flash)

if(NOT "${IDF_TARGET}" STREQUAL "esp32h2")
list(APPEND CHIP_REQUIRE_COMPONENTS mdns)
endif()
set(CHIP_REQUIRE_COMPONENTS esp_eth freertos lwip bt mbedtls fatfs app_update console openthread nvs_flash spi_flash mdns)

if (NOT CMAKE_BUILD_EARLY_EXPANSION)
if (CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE)
Expand Down Expand Up @@ -314,6 +310,10 @@ if (CONFIG_CHIP_DEVICE_ENABLE_DYNAMIC_SERVER)
chip_gn_arg_append("chip_build_controller_dynamic_server" "true")
endif()

if (CONFIG_ICD_MAX_NOTIFICATION_SUBSCRIBERS)
chip_gn_arg_append("icd_max_notification_subscribers" ${CONFIG_ICD_MAX_NOTIFICATION_SUBSCRIBERS})
endif()

set(args_gn_input "${CMAKE_CURRENT_BINARY_DIR}/args.gn.in")
file(GENERATE OUTPUT "${args_gn_input}" CONTENT "${chip_gn_args}")

Expand Down Expand Up @@ -420,170 +420,24 @@ target_include_directories(${COMPONENT_LIB} INTERFACE
"${CHIP_ROOT}/config/esp32/${CONFIG_CHIP_EXTERNAL_PLATFORM_DIR}/../../"
)

idf_component_get_property(mbedtls_lib mbedtls COMPONENT_LIB)

idf_build_get_property(idf_target IDF_TARGET)
set(target_name "${idf_target}")

if(CONFIG_BT_ENABLED)
idf_component_get_property(bt_lib bt COMPONENT_LIB)
if((target_name STREQUAL "esp32h2") OR (target_name STREQUAL "esp32c2") OR (target_name STREQUAL "esp32c6"))
idf_component_get_property(bt_dir bt COMPONENT_DIR)
list(APPEND chip_libraries $<TARGET_FILE:${bt_lib}>)
if (EXISTS ${bt_dir}/controller/lib_${target_name}/${target_name}-bt-lib/libble_app.a)
list(APPEND chip_libraries "${bt_dir}/controller/lib_${target_name}/${target_name}-bt-lib/libble_app.a")
elseif(EXISTS ${bt_dir}/controller/lib_${target_name}/${target_name}-bt-lib/${target_name}/libble_app.a)
list(APPEND chip_libraries "${bt_dir}/controller/lib_${target_name}/${target_name}-bt-lib/${target_name}/libble_app.a")
else()
message(WARNING "There is no libble_app.a in the given path")
endif()
elseif(target_name STREQUAL "esp32p4")
list(APPEND chip_libraries $<TARGET_FILE:${bt_lib}>)
else()
list(APPEND chip_libraries $<TARGET_FILE:${bt_lib}> -lbtdm_app)
endif()
endif()

if (CONFIG_ENABLE_CHIP_SHELL)
idf_component_get_property(console_lib console COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${console_lib}>)
endif()

if(CONFIG_OPENTHREAD_ENABLED)
idf_component_get_property(openthread_lib openthread COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${openthread_lib}>)
if (CONFIG_IEEE802154_ENABLED)
idf_component_get_property(ieee802154_lib ieee802154 COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${ieee802154_lib}>)
endif()
endif()

if(NOT CONFIG_USE_MINIMAL_MDNS)
idf_build_get_property(build_components BUILD_COMPONENTS)
# For IDF v5.x, the mdns component was moved to idf_managed_components.
# We should use 'espressif__mdns' for 'idf_component_get_property'.
if("espressif__mdns" IN_LIST build_components)
idf_component_get_property(mdns_lib espressif__mdns COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${mdns_lib}>)
elseif("mdns" IN_LIST build_components)
idf_component_get_property(mdns_lib mdns COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${mdns_lib}>)
endif()
endif()

if(CONFIG_OPENTHREAD_BORDER_ROUTER)
idf_component_get_property(rcp_update_lib espressif__esp_rcp_update COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${rcp_update_lib}>)
idf_component_get_property(serial_flasher_lib espressif__esp-serial-flasher COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${serial_flasher_lib}>)
endif()

if (CONFIG_ENABLE_ENCRYPTED_OTA)
idf_component_get_property(esp_encrypted_img_lib espressif__esp_encrypted_img COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${esp_encrypted_img_lib}>)
endif()

# Let user set EXECUTABLE_COMPONENT_NAME and defaults to main if not specified
if (NOT EXECUTABLE_COMPONENT_NAME)
set(EXECUTABLE_COMPONENT_NAME "main")
endif()

if (CONFIG_ENABLE_DELTA_OTA)
idf_component_get_property(esp_delta_ota_lib espressif__esp_delta_ota COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${esp_delta_ota_lib}>)
endif()

idf_component_get_property(main_lib ${EXECUTABLE_COMPONENT_NAME} COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${main_lib}>)

if (CONFIG_SEC_CERT_DAC_PROVIDER)
idf_component_get_property(esp32_secure_cert_mgr_lib espressif__esp_secure_cert_mgr COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${esp32_secure_cert_mgr_lib}>)
endif()

if (CONFIG_ENABLE_ESP_INSIGHTS_TRACE)
idf_build_get_property(build_components BUILD_COMPONENTS)
# esp_insights can be used as an independent component or through component manager so,
# We should check and add the right component.
if("espressif__esp_insights" IN_LIST build_components)
idf_component_get_property(esp_insights_lib espressif__esp_insights COMPONENT_LIB)
elseif("esp_insights" IN_LIST build_components)
idf_component_get_property(esp_insights_lib esp_insights COMPONENT_LIB)
endif()

list(APPEND chip_libraries $<TARGET_FILE:${esp_insights_lib}>)
endif()

idf_component_get_property(lwip_lib lwip COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${lwip_lib}>)

if ("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.3" OR CONFIG_ESP32_WIFI_ENABLED)
idf_component_get_property(esp_wifi_lib esp_wifi COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${esp_wifi_lib}>)
endif()

if (CONFIG_ESP32_WIFI_ENABLED)
idf_component_get_property(esp_wifi_dir esp_wifi COMPONENT_DIR)
if (CONFIG_IDF_TARGET_ESP32C2)
set(blobs core net80211 pp)
else()
set(blobs core mesh net80211 pp)
endif()

foreach(blob ${blobs})
list(APPEND chip_libraries "${esp_wifi_dir}/lib/${target_name}/lib${blob}.a")
endforeach()

idf_component_get_property(wpa_supplicant_lib wpa_supplicant COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${wpa_supplicant_lib}>)
endif()

if (CONFIG_ETH_ENABLED)
idf_component_get_property(esp_eth_lib esp_eth COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${esp_eth_lib}>)
set(matter_requires lwip freertos console bt)
idf_build_get_property(build_components BUILD_COMPONENTS)
if("espressif__mdns" IN_LIST build_components)
list(APPEND matter_requires espressif__mdns)
elseif("mdns" IN_LIST build_components)
list(APPEND matter_requires mdns)
endif()

idf_component_get_property(esp_netif_lib esp_netif COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${esp_netif_lib}>)

idf_component_get_property(esp_hw_support_lib esp_hw_support COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${esp_hw_support_lib}>)

if (NOT CONFIG_IDF_TARGET_ESP32P4)
idf_component_get_property(esp_phy_lib esp_phy COMPONENT_LIB)
idf_component_get_property(esp_phy_dir esp_phy COMPONENT_DIR)
list(APPEND chip_libraries $<TARGET_FILE:${esp_phy_lib}>)

if (CONFIG_IDF_TARGET_ESP32)
set(phy_blobs phy rtc)
elseif (CONFIG_IDF_TARGET_ESP32S2)
set(phy_blobs phy)
else()
set(phy_blobs phy btbb)
endif()
foreach(phy_blob ${phy_blobs})
list(APPEND chip_libraries "${esp_phy_dir}/lib/${target_name}/lib${phy_blob}.a")
endforeach()
if (CONFIG_OPENTHREAD_BORDER_ROUTER)
list(APPEND matter_requires espressif__esp_rcp_update)
endif()

set(components_to_link esp_event hal esp_system soc efuse vfs driver freertos esp_timer)
if (NOT CONFIG_IDF_TARGET_ESP32P4)
list(APPEND components_to_link esp_coex)
endif()
idf_build_get_property(build_components BUILD_COMPONENTS)
foreach(component ${components_to_link})
# Some of the components are not present in IDF v4.x
# So, Check if the component is in the list of build components
if("${component}" IN_LIST build_components)
idf_component_get_property(lib_name ${component} COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${lib_name}>)
endif()
endforeach()
add_prebuilt_library(matterlib "${CMAKE_CURRENT_BINARY_DIR}/lib/libCHIP.a"
REQUIRES ${matter_requires})

target_link_libraries(${COMPONENT_LIB} INTERFACE -Wl,--start-group
${chip_libraries}
$<TARGET_FILE:mbedcrypto> $<TARGET_FILE:mbedx509>
$<TARGET_FILE:${mbedtls_lib}>
matterlib
-Wl,--end-group)

# Make the component dependent on our CHIP build
Expand Down
Loading

0 comments on commit bc60247

Please sign in to comment.