Skip to content

Sync csa branch with main - #1245

Merged
sarthak shaha (Sarthak-Shaha) merged 6 commits into
mainfrom
automation/update_main
Oct 6, 2026
Merged

sarthak shaha (Sarthak-Shaha) merged 6 commits into
mainfrom
automation/update_main

Conversation

@silabs-matter-ci-bot

Copy link
Copy Markdown
Contributor

This PR syncs the csa branch with the main branch.

PR MUST BE MERGED WITH MERGE COMMIT - ADMIN MUST ENABLE THE OPTION

Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com>
* [Zephyr] Map target_cpu to riscv for RISC-V boards

The chip-module GN wrapper only mapped target_cpu for native_sim
(x86/x64) boards; every other board fell through to GN's host default,
which applies ARM flags (e.g. -mthumb) to the RISC-V toolchain and fails
to compile on RISC-V Zephyr targets such as the ESP32-C6.

Add an `elseif(CONFIG_RISCV)` branch setting target_cpu="riscv". The
Zephyr-provided -march/-mabi in target_cflags continue to drive the exact
ISA/ABI, so riscv_arch/abi are left empty.

* fix(inet): gate zephyr recvmsg shim by version

Zephyr 4.4 declares recvmsg() in <zephyr/posix/sys/socket.h>.
ZephyrSocket.h defines a static inline of the same name, and GCC
rejects a static definition that follows an extern declaration:

  src/inet/ZephyrSocket.h:37:23: error: 'ssize_t recvmsg(int,
  net_msghdr*, int)' was declared 'extern' and later 'static'

Whether the Zephyr declaration is seen first depends on include order,
so the error only surfaces in some translation units. Defining
CHIP_CONFIG_MAX_FABRICS or CHIP_CONFIG_SECURE_SESSION_POOL_SIZE in a
project config is enough to trigger it in UDPEndPointImplSockets.cpp.

- Define the shim only for Zephyr releases before 4.4, which is the
  version that gained the symbol
- Reuse the ZEPHYR_VERSION_CODE idiom from OTAImageProcessorImpl.cpp

* feat(cmake): default the pigweed environment root

The GN sub-build imports build_overrides/pigweed_environment.gni from
_PW_ACTUAL_ENVIRONMENT_ROOT, which only scripts/activate.sh exports.
Zephyr 4.4 needs Python 3.12 while the Matter environment ships 3.11,
so Zephyr examples built with west cannot source activate.sh and users
had to export the variable and add gn to PATH before every west call.

- Default the environment root to <CHIP_ROOT>/.environment, the
  location scripts/bootstrap.sh creates, when the variable is unset
- Pass it explicitly to the gn and ninja steps of the chip-gn
  ExternalProject
- Let find_program fall back to the bootstrapped gn under .environment

Behaviour is unchanged when the Matter environment is activated, since
the exported value still takes precedence.

* feat(esp32): add esp32-c6 zephyr lighting example

Add a Matter On/Off Light for the ESP32-C6 running Zephyr RTOS instead
of ESP-IDF. It builds on the generic chip_device_platform="zephyr"
layer, the same path the NXP RW612 port takes, so no ESP32-specific
src/platform directory is needed. The device commissions over BLE with
`chip-tool pairing ble-wifi` and then operates over Wi-Fi.

- Target esp32c6_devkitc/esp32c6/hpcore on Zephyr v4.4.2 with board
  files for the 4 MB flash, the led0 alias on GPIO2 and trimmed Wi-Fi
  and network buffers for the C6 SRAM
- Use the generic ZephyrWifiDriver over net_mgmt without the WPA
  supplicant, which lives in the hal_espressif blob
- Select the PSA crypto backend, since mbedTLS 4.x in Zephyr 4.4 no
  longer builds the classic PAL, and keep SPAKE2+ on mbedTLS because
  TF-PSA-Crypto lacks PSA_ALG_SPAKE2P_MATTER
- Reuse lighting-common/lighting-app.zap and register the example
  DeviceInfoProviderImpl the User Label cluster requires
- Document the west build, flash and monitor flow, the design notes
  and the limitations of this prototype configuration

Configuration choices verified on hardware and recorded in the README:

- CONFIG_THREAD_ANALYZER_AUTO must stay off. Its periodic stack walk
  stops the C6 BLE controller from putting the advertiser on air, so
  the device logs "advertising started" yet no commissioner sees it.
- CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y, because the Zephyr platform
  otherwise leaves the commissioning window closed at boot.
- picolibc with THREAD_LOCAL_STORAGE, since newlib is no longer
  selectable on Zephyr 4.4 and CHIP uses thread_local.
- CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=16 and a 4096-byte BT RX stack,
  sized for a single light commissioning over CHIPoBLE under PSA.

Footprint: 35% of a 4 MB flash and 80% of the C6 SRAM. The example
uses test attestation credentials and the test passcode; factory data
and OTA are not enabled.

* feat(build): add esp32 zephyr build target

Add `esp32-zephyr-c6devkitc-light` to build_examples.py, a west-based
builder for the examples/<app>/esp32/zephyr examples that mirrors the
Telink and NXP Zephyr builders.

- Read the Zephyr tree from ESP32_ZEPHYR_BASE, optionally the SDK from
  ESP32_ZEPHYR_SDK_DIR and a Python 3.12+ venv from ESP32_ZEPHYR_VENV,
  since Zephyr 4.4 rejects the Python 3.11 in the CHIP environment
- Configure with `west build --cmake-only`, compile with ninja and
  publish zephyr.elf and zephyr.bin as build outputs
- Update the golden target list

* feat(scripts): add esp32 zephyr build helper

Add scripts/examples/esp32_zephyr_example.sh following the
scripts/examples/*_example.sh convention of the other platforms, so
the example can be built without setting up a terminal by hand.

- Read the Zephyr tree from ESP32_ZEPHYR_BASE or ZEPHYR_BASE and
  default the west venv to .venv in the workspace root
- Pass extra arguments through to `west build`

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* docs(lighting-app): fix readme spelling failures

* refactor(esp32): Address review comments

* docs(lighting-app): simplify esp32 zephyr readme

* refactor(esp32): drop shared chip_gn.cmake change

- Revert chip_gn.cmake to master

* refactor(lighting-app): move esp32 zephyr example to esp32_zephyr

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Trim the multi line comments

* feat(lighting-app): log attribute updates on esp32 zephyr

- Log endpoint, cluster and attribute IDs in the post-attribute-change callback
- Clarify Zephyr SDK (toolchain) vs Zephyr RTOS version in README

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* fix(basic-information): keep old NodeLabel on oversized write

- Validate NodeLabel length before SetContent so a ConstraintError no longer clears the stored value
- Add unit test for the oversized-write case

* Addressed review comments
* Add script to gen certificates, added development PAA certs

* Update credentials/development/gen-development-ml-dsa-paa-certs.sh

Co-authored-by: simonhmorris1 <112178216+simonhmorris1@users.noreply.github.com>

* consolidated into the original script. Added certificates to credential_files

* Mislabeled file name, applied the patch suggested from CI

* Restyled by shfmt

* remove shebang

* overlooked there was a tool to do what I did manually

* Addressed comments from Andrei

---------

Co-authored-by: simonhmorris1 <112178216+simonhmorris1@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
…74503)

TCPEndPoint::Send queues the data and then asks the system layer for a
write callback. If that request failed, Send returned the error but left
the data queued, the endpoint connected, and no write callback armed.
Later sends see a non-empty queue and never request one again, so once
the socket applies backpressure the queued data is never sent; with
push = false it is never sent at all.

Close the endpoint with the error instead, as DriveSending and
HandleConnectCompleteImpl already do when the equivalent call fails.

TCPBase::HandleTCPEndPointConnectComplete flushes pending packets
through Send before reporting the connection. If a flush send closed the
connection, the close was reported as a closed connection and the
attempt was then reported as successful on the released connection
state, so the connect-complete callback never saw the failure. Mark the
connection connected only after the flush, so a close during it (or a
TCP_NODELAY failure before it) is reported as a failed attempt, and
report success only if the connection survived.
* Fix found spec inconsistencies

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add assertion for  Options bit 0x02

* Fix order;Add InvalidArgumentsRejectedWhileOff

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add tests

* Add assertations

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@silabs-matter-ci-bot
silabs-matter-ci-bot Bot requested a review from a team as a code owner October 6, 2026 00:50
@silabs-matter-ci-bot silabs-matter-ci-bot Bot added changing-git-submodules-on-purpose sl-require-admin-action This TAG indicates that an admin must take action. labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

The check for sl-require-admin-action label CI failure for this job is normal. An admin must do the merge.

@Sarthak-Shaha
sarthak shaha (Sarthak-Shaha) merged commit f914550 into main Oct 6, 2026
111 of 114 checks passed
@Sarthak-Shaha
sarthak shaha (Sarthak-Shaha) deleted the automation/update_main branch October 6, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changing-git-submodules-on-purpose sl-require-admin-action This TAG indicates that an admin must take action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants