Skip to content

Add Matter component as part of the libs #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3de9c30
Add Matter component as part of the libs
me-no-dev Sep 17, 2024
327b336
feat(matter): adds necessary setup
SuGlider Sep 19, 2024
b45dbb4
feat(matter): sdkconfig for each SoC
SuGlider Sep 19, 2024
37d604e
Merge pull request #222 from SuGlider/arduino_esp_matter
SuGlider Sep 20, 2024
edf680d
fix(matter): no wifi within C2
SuGlider Sep 22, 2024
71f2a7e
fix(matter): replaces wrong pieces
SuGlider Sep 23, 2024
4cc2300
fix(matter): forgot folder reference
SuGlider Sep 23, 2024
a540e5c
feat(matter): strip matter lib.a
SuGlider Sep 23, 2024
977fbba
fix(matter): missing double quote
SuGlider Sep 23, 2024
0fbcf11
fix(matter): bad folder name
SuGlider Sep 23, 2024
8c17e97
feat(matter): testing freertos backward compatibility
SuGlider Sep 24, 2024
a797cb3
feat(matter): testing not using minimal mdns
SuGlider Sep 24, 2024
6bb7873
feat(matter): disable lwip ipv6 autoconfig
SuGlider Sep 24, 2024
ce3497d
feat(matter): common settings
SuGlider Sep 25, 2024
6fd125d
feat(matter): revert changes
SuGlider Sep 25, 2024
a8326a6
feat(matter): revert changes
SuGlider Sep 25, 2024
76bd8ef
feat(matter): revert changes
SuGlider Sep 25, 2024
f6f6598
feat(matter): revert changes
SuGlider Sep 25, 2024
052d5ae
feat(matter): no WiFi matter for H2 - thread only
SuGlider Sep 25, 2024
5f3b994
feat(matter): revert changes
SuGlider Sep 25, 2024
46e4060
feat(matter): revert changes
SuGlider Sep 25, 2024
18dbe03
feat(matter): no support for H2 - no WiFi
SuGlider Sep 25, 2024
89b4af0
feat(matter): clean up
SuGlider Sep 25, 2024
3b6b0cb
feat(matter): script clean up
SuGlider Sep 25, 2024
d6b2b73
Merge branch 'master' into feat/esp_matter
SuGlider Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ add_custom_command(
VERBATIM
)
add_custom_target(mem-variant DEPENDS "mem_variant")

##################
### ESP Matter ###
##################
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-DCHIP_HAVE_CONFIG_H" APPEND)
16 changes: 16 additions & 0 deletions configs/defconfig.common
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,14 @@ CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y
CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT=y
CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT=y
CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM=y
CONFIG_LWIP_MULTICAST_PING=y
CONFIG_LWIP_BROADCAST_PING=y
CONFIG_LWIP_IPV6_NUM_ADDRESSES=8
CONFIG_MBEDTLS_PSK_MODES=y
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE=y
CONFIG_MBEDTLS_ECJPAKE_C=y
CONFIG_MBEDTLS_HKDF_C=y
CONFIG_MBEDTLS_CAMELLIA_C=y
CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER=y
# CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN is not set
Expand Down Expand Up @@ -111,3 +117,13 @@ CONFIG_ESP_COREDUMP_STACK_SIZE=1024
CONFIG_MBEDTLS_DYNAMIC_BUFFER=y
CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y
CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y
#
# Matter Settings
#
# Disable Matter BLE
CONFIG_ENABLE_CHIPOBLE=n
CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n
# ESP Insights
CONFIG_ENABLE_ESP_INSIGHTS_TRACE=n
# Use compact attribute storage mode
CONFIG_ESP_MATTER_NVS_USE_COMPACT_ATTR_STORAGE=y
17 changes: 0 additions & 17 deletions configs/defconfig.esp32c6
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,6 @@ CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2304
#CONFIG_ULP_COPROC_LP_CORE=y
#CONFIG_ULP_COPROC_RESERVE_MEM=4096

#
# ESP32 Arduino OpenThread Configuration
#
# lwIP
#
CONFIG_LWIP_IPV6_NUM_ADDRESSES=8
CONFIG_LWIP_MULTICAST_PING=y
CONFIG_LWIP_BROADCAST_PING=y
# end of lwip

#
# mbedTLS
#
CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE=y
CONFIG_MBEDTLS_ECJPAKE_C=y
# end of mbedTLS

#
# OpenThread
#
Expand Down
17 changes: 0 additions & 17 deletions configs/defconfig.esp32h2
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,6 @@ CONFIG_RTC_CLK_CAL_CYCLES=576
# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2304

#
# ESP32 Arduino OpenThread Configuration
#
# lwIP
#
CONFIG_LWIP_IPV6_NUM_ADDRESSES=8
CONFIG_LWIP_MULTICAST_PING=y
CONFIG_LWIP_BROADCAST_PING=y
# end of lwip

#
# mbedTLS
#
CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE=y
CONFIG_MBEDTLS_ECJPAKE_C=y
# end of mbedTLS

#
# OpenThread
#
Expand Down
5 changes: 5 additions & 0 deletions main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ dependencies:
version: ">=1.4.2"
rules:
- if: "target in [esp32s3]"
espressif/esp_matter:
version: "^1.3.0"
require: public
rules:
- if: "target not in [esp32c2, esp32h2]"

# esp-sr: "^1.3.1"
# esp32-camera: "^2.0.4"
Expand Down
13 changes: 12 additions & 1 deletion tools/copy-libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,17 @@ echo -n "$LD_FLAGS" > "$FLAGS_DIR/ld_flags"
echo -n "$LD_SCRIPTS" > "$FLAGS_DIR/ld_scripts"
echo -n "$AR_LIBS" > "$FLAGS_DIR/ld_libs"

# Matter Library adjustments
for flag_file in "c_flags" "cpp_flags" "S_flags"; do
echo "Fixing $FLAGS_DIR/$flag_file"
sed 's/\\\"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib\/address_resolve\/AddressResolve_DefaultImpl.h>\\\"/-DCHIP_HAVE_CONFIG_H/' $FLAGS_DIR/$flag_file > $FLAGS_DIR/$flag_file.temp
mv $FLAGS_DIR/$flag_file.temp $FLAGS_DIR/$flag_file
done
CHIP_RESOLVE_DIR="$AR_SDK/include/espressif__esp_matter/connectedhomeip/connectedhomeip/src/lib/address_resolve"
sed 's/CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER/<lib\/address_resolve\/AddressResolve_DefaultImpl.h>/' $CHIP_RESOLVE_DIR/AddressResolve.h > $CHIP_RESOLVE_DIR/AddressResolve_temp.h
mv $CHIP_RESOLVE_DIR/AddressResolve_temp.h $CHIP_RESOLVE_DIR/AddressResolve.h
# End of Matter Library adjustments

# copy zigbee + zboss lib
if [ -d "managed_components/espressif__esp-zigbee-lib/lib/$IDF_TARGET/" ]; then
cp -r "managed_components/espressif__esp-zigbee-lib/lib/$IDF_TARGET"/* "$AR_SDK/lib/"
Expand Down Expand Up @@ -530,7 +541,7 @@ for item; do
done
done

for lib in "openthread" "espressif__esp-tflite-micro" "bt"; do
for lib in "openthread" "espressif__esp-tflite-micro" "bt" "espressif__esp_matter"; do
if [ -f "$AR_SDK/lib/lib$lib.a" ]; then
echo "Stripping $AR_SDK/lib/lib$lib.a"
"$TOOLCHAIN-strip" -g "$AR_SDK/lib/lib$lib.a"
Expand Down