Skip to content
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

Sync csa branch with main #280

Merged
merged 12 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/full-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ jobs:
name: Run

env:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64/
JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64/

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-android:112
image: ghcr.io/project-chip/chip-build-android:113
volumes:
- "/tmp/log_output:/tmp/test_logs"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/java-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: ghcr.io/project-chip/chip-build-java:104
image: ghcr.io/project-chip/chip-build-java:113
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0"

Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
# TODO: this direct path loading is not maintainable. Our build system should define and
# support test classes.
run: |
$JAVA_PATH/bin/java \
$JAVA_HOME/bin/java \
-cp 'third_party/java_deps/artifacts/*:out/linux-x64-tests/lib/src/controller/java/*' \
org.junit.runner.JUnitCore \
matter.tlv.TlvWriterTest \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/smoketest-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ jobs:
name: Smoke Run - Android

env:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64/
JAVA_HOME: /usr/lib/jvm/java-11-openjdk-amd64/

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-android:108
image: ghcr.io/project-chip/chip-build-android:113
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/unit_integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: linux
platform: linux unit_tests
bootstrap-log-name: bootstrap-logs-unittest-${{ matrix.type }}
- name: Artifact suffix
id: outsuffix
Expand All @@ -66,11 +66,11 @@ jobs:
# TODO: If rotating_device_id is ever removed/combined, we have to cover boringssl otherwise
run: |
case $BUILD_TYPE in
"main") GN_ARGS='';;
"clang") GN_ARGS='is_clang=true';;
"mbedtls") GN_ARGS='chip_crypto="mbedtls"';;
"rotating_device_id") GN_ARGS='chip_crypto="boringssl" chip_enable_rotating_device_id=true';;
"icd") GN_ARGS='chip_enable_icd_server=true chip_enable_icd_lit=true';;
"main") GN_ARGS='chip_build_all_platform_tests=true';;
"clang") GN_ARGS='is_clang=true chip_build_all_platform_tests=true';;
"mbedtls") GN_ARGS='chip_crypto="mbedtls" chip_build_all_platform_tests=true';;
"rotating_device_id") GN_ARGS='chip_crypto="boringssl" chip_enable_rotating_device_id=true chip_build_all_platform_tests=true';;
"icd") GN_ARGS='chip_enable_icd_server=true chip_enable_icd_lit=true chip_build_all_platform_tests=true';;
*) ;;
esac

Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
path = third_party/silabs/matter_support
url = https://github.com/SiliconLabsSoftware/matter_support.git
branch = main
platforms = silabs,silabs_docker
platforms = silabs,silabs_docker,unit_tests
[submodule "third_party/silabs/simplicity_sdk"]
path = third_party/silabs/simplicity_sdk
url = https://github.com/SiliconLabs/simplicity_sdk.git
Expand Down
12 changes: 10 additions & 2 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,13 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
}

if (chip_build_tests) {
deps += [ "//src:tests" ]
deps += [ "//examples:example_tests" ]
deps += [
"//examples:example_tests",
"//src:tests",

# Platform test group locations.
"//src/platform/silabs/tests:silabs_platform_tests",
]

if (current_os == "android" && current_toolchain == default_toolchain) {
deps += [ "${chip_root}/build/chip/java/tests:java_build_test" ]
Expand Down Expand Up @@ -251,6 +256,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
"//scripts/py_matter_yamltests:matter_yamltests.tests",
"//src:tests_run",
"//src/python_testing/matter_testing_infrastructure:chip-testing.tests",

# Platform test group locations.
"//src/platform/silabs/tests:silabs_platform_tests_run",
]

if (current_os == "linux" || current_os == "mac") {
Expand Down
10 changes: 5 additions & 5 deletions build/chip/java/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

java_path = getenv("JAVA_PATH")
java_home = getenv("JAVA_HOME")
declare_args() {
java_matter_controller_dependent_paths = []

Expand All @@ -24,15 +24,15 @@ declare_args() {
matter_enable_tlv_decoder_api = true

matter_enable_java_compilation = false
if (java_path != "" && (current_os == "linux" || current_os == "mac")) {
java_matter_controller_dependent_paths += [ "${java_path}/include/" ]
if (java_home != "" && (current_os == "linux" || current_os == "mac")) {
java_matter_controller_dependent_paths += [ "${java_home}/include/" ]

if (current_os == "mac") {
java_matter_controller_dependent_paths +=
[ "${java_path}/include/darwin/" ]
[ "${java_home}/include/darwin/" ]
} else {
java_matter_controller_dependent_paths +=
[ "${java_path}/include/linux/" ]
[ "${java_home}/include/linux/" ]
}

matter_enable_java_generated_api = false
Expand Down
6 changes: 3 additions & 3 deletions build/chip/java/jar_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def FindCommand(command):


def main():
java_path = FindCommand('jar')
if not java_path:
java_home = FindCommand('jar')
if not java_home:
sys.stderr.write('jar: command not found\n')
sys.exit(EXIT_FAILURE)

Expand All @@ -89,7 +89,7 @@ def main():
sys.stderr.write('usage: %s [jar_args]...\n' % sys.argv[0])
sys.exit(EXIT_FAILURE)

return subprocess.check_call([java_path] + args)
return subprocess.check_call([java_home] + args)


if __name__ == '__main__':
Expand Down
6 changes: 3 additions & 3 deletions build/chip/java/javac_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def ComputeClasspath(build_config_json):


def main():
java_path = FindCommand('javac')
if not java_path:
java_home = FindCommand('javac')
if not java_home:
sys.stderr.write('javac: command not found\n')
sys.exit(EXIT_FAILURE)

Expand Down Expand Up @@ -123,7 +123,7 @@ def main():

build_config_json = ReadBuildConfig(args.build_config)
classpath = ComputeClasspath(build_config_json)
java_args = [java_path]
java_args = [java_home]
if classpath:
java_args += ["-classpath", classpath]

Expand Down
2 changes: 1 addition & 1 deletion build/chip/java/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jar_runner = "${chip_root}/build/chip/java/jar_runner.py"
write_build_config = "${chip_root}/build/chip/java/write_build_config.py"

assert(android_sdk_root != "" || matter_enable_java_compilation,
"android_sdk_root must be specified or JAVA_PATH must be set.")
"android_sdk_root must be specified or JAVA_HOME must be set.")

# Declare a java library target
#
Expand Down
5 changes: 5 additions & 0 deletions build/chip/tests.gni
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ declare_args() {
# Enable building tests.
chip_build_tests = current_os != "freertos"

# Enable building all platform specific tests.
# This argument should set the default value for platform specific tests build arguments.
# See src/platform/silabs/tests/args.gni as an example.
chip_build_all_platform_tests = false

# Enabling useful support functions when building using GoogleTest framework (used in unit tests and pw_fuzzer FuzzTests)
# For unit tests: this should only be enabled through build_examples.py, see PR #36268
chip_build_tests_googletest = false
Expand Down
5 changes: 3 additions & 2 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,15 @@ menu "CHIP Core"
help
Enable this option to start a UDP Endpoint queue filter for mDNS Broadcast packets

config ENABLE_LWIP_THREAD_SAFETY
bool "Enable LwIP Thread safety options"
config USE_TCPIP_CORE_LOCK_FOR_THREAD_SAFETY
bool "Use TCPIP core locking for LwIP thread safety"
default y
select LWIP_TCPIP_CORE_LOCKING
select LWIP_CHECK_THREAD_SAFETY
help
CHIP SDK performs LwIP core locking before calling an LwIP API.
To make the calls thread safe we have to enable LWIP_TCPIP_CORE_LOCKING.
Otherwise CHIP SDK will post LwIP APIs to TCPIP task to ensure thread safety.
Here, we are also enabling LWIP_CHECK_THREAD_SAFETY which will assert when
LwIP code gets called from any other context or without holding the LwIP lock.

Expand Down
22 changes: 11 additions & 11 deletions docs/platforms/android/android_building.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ downloaded.
4. Apply
3. Install Command Line Tools:
1. Tools -> SDK Manager -> SDK Tools Tab -> Android SDK Command Line Tools
(latest)
10.0
2. Apply
4. Install SDK 26:
1. Tools -> SDK Manager -> SDK Platforms Tab -> Android 8.0 (Oreo) SDK Level
26
4. Install SDK 30:
1. Tools -> SDK Manager -> SDK Platforms Tab -> Android 11.0 (R) SDK Level
30
2. Apply
5. Install Emulator:
1. Tools -> Device Manager -> Create device -> Pixel 5 -> Android S API 31
Expand Down Expand Up @@ -98,21 +98,21 @@ architecture:

### Gradle & JDK Version

All Android projects utilize Gradle version 7.3.3 and JDK version 17.0.
All Android projects utilize Gradle version 7.3.3 and JDK version 11.0.

For developer using openjdk-17-jdk in MacOS, the JAVA_HOME environment variable
can be configured as follows via `sdkman`:
For developer using java 11 in MacOS, the JAVA can be configured as follows via
`sdkman`:

```
sdk install java 17.0.4.1-tem
sdk install java 11.0.26-tem
```

For developer using openjdk-17-jdk in Linux, the JAVA_HOME environment variable
For developer using openjdk-11-jdk in Linux, the JAVA_HOME environment variable
can be configured as follows:

```
sudo apt-get install openjdk-17-jdk
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
sudo apt-get install openjdk-11-jdk
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
```

<a name="kotlin"></a>
Expand Down
2 changes: 1 addition & 1 deletion examples/android/CHIPTest/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ android_library("java") {
}

java_prebuilt("android") {
jar_path = "${android_sdk_root}/platforms/android-26/android.jar"
jar_path = "${android_sdk_root}/platforms/android-30/android.jar"
}

group("default") {
Expand Down
12 changes: 0 additions & 12 deletions examples/contact-sensor-app/bouffalolab/bl702l/app_pds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,9 @@ extern "C" void vApplicationSleep(TickType_t xExpectedIdleTime)
extern BaseType_t TrapNetCounter, *pTrapNetCounter;
if (app_pds_wakeup_source == PDS_WAKEUP_BY_RTC)
{
extern void * pxCurrentTCB;

ChipLogProgress(NotSpecified, "wakeup source: rtc. %lu vs %lu ms @ %lu\r\n", xExpectedIdleTime,
(uint32_t) (bl_rtc_get_timestamp_ms() - sleep_before), (uint32_t) bl_rtc_get_timestamp_ms());

ChipLogProgress(NotSpecified, "application_sleep; %lu, %lu, %lu\r\n", (uint32_t) sleep_calling_time, (uint32_t) sleep_time,
(uint32_t) wakeup_time);
}
else if (app_pds_wakeup_source == PDS_WAKEUP_BY_GPIO)
{

if (((1 << CHIP_RESET_PIN) & app_pds_wakeup_pin) && app_pds_irq_handler)
{
app_pds_irq_handler(&gpio_key);
Expand All @@ -79,10 +71,6 @@ extern "C" void vApplicationSleep(TickType_t xExpectedIdleTime)
{
app_pds_irq_handler(&gpio_contact);
}

ChipLogProgress(NotSpecified, "wakeup source: gpio -> 0x%08lX. %lu vs %lu ms @ %lu\r\n", app_pds_wakeup_pin,
xExpectedIdleTime, (uint32_t) (bl_rtc_get_timestamp_ms() - sleep_before),
(uint32_t) bl_rtc_get_timestamp_ms());
}

app_pds_wakeup_source = -1;
Expand Down
7 changes: 5 additions & 2 deletions examples/java-matter-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ cluster requests to a Matter device

- [Matter Controller Java App Example](#matter-controller-java-app-example)
- [Requirements for building](#requirements-for-building)
- [Linux](#linux)
- [Preparing for build](#preparing-for-build)
- [Building & Running the app](#building--running-the-app)
- [Building \& Running the app](#building--running-the-app)

<hr>

Expand Down Expand Up @@ -47,6 +48,8 @@ system. You can install it through the following command as root:
sudo apt install default-jdk
```

Note: Current matter controller java app example needs java 8+.

You also need to install kotlin compiler on your Ubuntu system:

kotlin compiler version 1.8.10 or above is needed to compile
Expand Down Expand Up @@ -93,7 +96,7 @@ export PATH="/usr/lib/kotlinc/bin:$PATH"
### Linux

```shell
export JAVA_PATH=[JDK path]
export JAVA_HOME=[JDK path]
```

<hr>
Expand Down
5 changes: 3 additions & 2 deletions examples/kotlin-matter-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ control Matter accessory devices.

- [Matter Controller Kotlin App Example](#matter-controller-kotlin-app-example)
- [Requirements for building](#requirements-for-building)
- [Linux](#linux)
- [Preparing for build](#preparing-for-build)
- [Building & Running the app](#building--running-the-app)
- [Building \& Running the app](#building--running-the-app)

<hr>

Expand Down Expand Up @@ -82,7 +83,7 @@ export PATH="/usr/lib/kotlinc/bin:$PATH"
### Linux

```shell
export JAVA_PATH=[JDK path]
export JAVA_HOME=[JDK path]
```

<hr>
Expand Down
10 changes: 9 additions & 1 deletion examples/lighting-app/bouffalolab/bl602/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ bouffalolab_executable("lighting_app") {
output_name = "chip-bl602-lighting-example.out"

defines = [
"APP_TASK_STACK_SIZE=2044",
"APP_TASK_STACK_SIZE=4096",
"CHIP_UART_BAUDRATE=${baudrate}",
"START_ENTRY=bfl_main",
"SYS_AOS_LOOP_ENABLE",
Expand All @@ -109,6 +109,10 @@ bouffalolab_executable("lighting_app") {
defines +=
[ "CONFIG_BOUFFALOLAB_FACTORY_DATA_ENABLE=${chip_enable_factory_data}" ]

if (enable_lwip_pbuf_ram) {
defines += [ "CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_RAM=1" ]
}

bl_plat_name = "bl602"
sources = [
"${examples_plat_dir}/common/route_hook/bl_route_hook.c",
Expand Down Expand Up @@ -227,6 +231,10 @@ bouffalolab_executable("lighting_app") {
inputs = [ ldscript ]

if (chip_print_memory_usage) {
if (enable_lwip_pbuf_ram) {
ldflags += [ "-Wl,--defsym=__RAM_PBUF_POOL=0" ]
}

ldflags += [
"-Wl,--print-memory-usage",
"-fstack-usage",
Expand Down
4 changes: 4 additions & 0 deletions examples/lighting-app/bouffalolab/bl616/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ bouffalolab_executable("lighting_app") {
defines += [ "BOOT_PIN_RESET=2" ]
}

if (enable_lwip_pbuf_ram) {
defines += [ "CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_RAM=1" ]
}

defines += [ "BL616DK" ]

sources = [
Expand Down
Loading
Loading