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

V1.0 branch #1

Merged
merged 10 commits into from
Nov 25, 2022
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
12 changes: 10 additions & 2 deletions .github/workflows/examples-ameba.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build-ameba:0.5.99
image: connectedhomeip/chip-build-ameba:0.6.03
options: --user root

steps:
Expand All @@ -47,4 +47,12 @@ jobs:
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform ameba
- name: Build example Ameba All Clusters App
run: scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target-glob 'ameba-*' build"
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target ameba-amebad-all-clusters \
--target ameba-amebad-all-clusters-minimal \
--target ameba-amebad-light \
--target ameba-amebad-pigweed \
build \
"
36 changes: 23 additions & 13 deletions .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020 Project CHIP Authors
# Copyright (c) 2022 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,7 +32,8 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build-telink:0.6.02

image: connectedhomeip/chip-build-telink:0.6.06
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"

Expand All @@ -54,37 +55,46 @@ jobs:
GH_CONTEXT: ${{ toJson(github) }}
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"

- name: Build example Telink Lighting App
- name: Build example Telink All Clusters App
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-light' build"
"./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-all-clusters' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d all-clusters-app \
out/telink-tlsr9518adk80d-all-clusters/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: Build example Telink Light Switch App
- name: Build example Telink All Clusters Minimal App
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-light-switch' build"
"./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-all-clusters-minimal' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d all-clusters-minimal-app \
out/telink-tlsr9518adk80d-all-clusters-minimal/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: Build example Telink OTA Requestor App
- name: Build example Telink Lighting App
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-ota-requestor' build"

- name: Get Lighting size stats
run: |
"./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-light' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d lighting-app \
out/telink-tlsr9518adk80d-light/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: Get Light Switch size stats
- name: Build example Telink Light Switch App
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-light-switch' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d light-switch-app \
out/telink-tlsr9518adk80d-light-switch/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: Get OTA Requestor size stats
- name: Build example Telink OTA Requestor App
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-ota-requestor' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d ota-requestor-app \
out/telink-tlsr9518adk80d-ota-requestor/zephyr/zephyr.elf \
Expand Down
2 changes: 2 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@
"nrf-nrf5340-pump-controller",
"nrf-nrf5340-shell",
"qpg-qpg6100-lock",
"telink-tlsr9518adk80d-all-clusters",
"telink-tlsr9518adk80d-all-clusters-minimal",
"telink-tlsr9518adk80d-light",
"telink-tlsr9518adk80d-light-switch",
"telink-tlsr9518adk80d-ota-requestor",
Expand Down
13 changes: 10 additions & 3 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ menu "CHIP Device Layer"
help
The size (in bytes) of the service directory cache. This limits the maximum size of the directory
that can be returned in response to a service directory query.

config ENABLE_EXTENDED_DISCOVERY
bool "Enable Extended discovery Support"
default n
Expand Down Expand Up @@ -500,7 +500,7 @@ menu "CHIP Device Layer"
config USE_BLE_ONLY_FOR_COMMISSIONING
bool "Use BLE only for commissioning"
default y
help
help
Disable this flag if BLE is used for any other purpose than commissioning.
When enabled, it deinitialized the BLE on successful commissioning, and on
bootup do not initialize the BLE if device is already provisioned with Wi-Fi/Thread credentials.
Expand Down Expand Up @@ -695,6 +695,13 @@ menu "CHIP Device Layer"
Details like Supported calendar types, supported locales, and fixed labels will be read from factory
partition.

config ENABLE_ESP32_LOCATIONCAPABILITY
depends on ENABLE_ESP32_FACTORY_DATA_PROVIDER
bool "Enable ESP32 Device LocationCapability "
default n
help
Enable ESP32 Device LocationCapability

endmenu


Expand Down Expand Up @@ -890,7 +897,7 @@ menu "CHIP Device Layer"
default "nvs"
help
Label of the partition to store key-values in the "chip-counters" namespace.

config CHIP_KVS_NAMESPACE_PARTITION_LABEL
string "chip-kvs namespace partition label"
default "nvs"
Expand Down
84 changes: 61 additions & 23 deletions config/telink/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ if (CONFIG_CHIP)
include(ExternalProject)
include(../../zephyr/ota-image.cmake)
include(../../zephyr/zephyr-util.cmake)
include(generate_factory_data.cmake)

# ==============================================================================
# Declare configuration variables and define constants
Expand All @@ -45,7 +46,7 @@ list(APPEND CHIP_CFLAGS_CC)
# CHIP libraries that the application should be linked with
list(APPEND CHIP_LIBRARIES)

# GN meta-build system arguments in the form of 'key1 = value1\nkey2 = value2...' string
# GN meta-build system arguments passed to the make_gn_args.py script
string(APPEND CHIP_GN_ARGS)

# C/C++ compiler flags which should not be forwarded to CHIP
Expand All @@ -67,28 +68,27 @@ set(CHIP_CFLAG_EXCLUDES
# ==============================================================================

macro(chip_gn_arg_import FILE)
string(APPEND CHIP_GN_ARGS "import(\"${FILE}\")\n")
string(APPEND CHIP_GN_ARGS "--module\n${FILE}\n")
endmacro()

macro(chip_gn_arg_string ARG STRING)
string(APPEND CHIP_GN_ARGS "${ARG} = \"${STRING}\"\n")
string(APPEND CHIP_GN_ARGS "--arg-string\n${ARG}\n${STRING}\n")
endmacro()

macro(chip_gn_arg_bool ARG BOOLEAN)
if (${BOOLEAN})
string(APPEND CHIP_GN_ARGS "${ARG} = true\n")
macro(chip_gn_arg_bool ARG)
if (${ARGN})
string(APPEND CHIP_GN_ARGS "--arg\n${ARG}\ntrue\n")
else()
string(APPEND CHIP_GN_ARGS "${ARG} = false\n")
string(APPEND CHIP_GN_ARGS "--arg\n${ARG}\nfalse\n")
endif()
endmacro()

macro(chip_gn_arg_cflags ARG CFLAGS)
set(CFLAG_EXCLUDES "[")
foreach(cflag ${CHIP_CFLAG_EXCLUDES})
string(APPEND CFLAG_EXCLUDES "\"${cflag}\", ")
endforeach()
string(APPEND CFLAG_EXCLUDES "]")
string(APPEND CHIP_GN_ARGS "${ARG} = filter_exclude(string_split(\"${CFLAGS}\"), ${CFLAG_EXCLUDES})\n")
string(APPEND CHIP_GN_ARGS "--arg-cflags\n${ARG}\n${CFLAGS}\n")
endmacro()

macro(chip_gn_arg ARG VALUE)
string(APPEND CHIP_GN_ARGS "--arg\n${ARG}\n${VALUE}\n")
endmacro()

# ==============================================================================
Expand Down Expand Up @@ -197,8 +197,6 @@ chip_gn_arg_cflags("target_cflags_cc" ${CHIP_CFLAGS_CC})
chip_gn_arg_string("zephyr_ar" ${CMAKE_AR})
chip_gn_arg_string("zephyr_cc" ${CMAKE_C_COMPILER})
chip_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER})
chip_gn_arg_string("chip_project_config_include" "${CHIP_PROJECT_CONFIG}")
chip_gn_arg_string("chip_system_project_config_include" "${CHIP_PROJECT_CONFIG}")
chip_gn_arg_bool ("is_debug" CONFIG_DEBUG)
chip_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD)
chip_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD)
Expand All @@ -208,16 +206,32 @@ chip_gn_arg_bool ("chip_build_tests" CONFIG_CHIP_BUILD_TE
chip_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS)
chip_gn_arg_bool ("chip_build_libshell" CONFIG_CHIP_LIB_SHELL)

if (CONFIG_CHIP_FACTORY_DATA)
chip_gn_arg_bool ("chip_use_transitional_commissionable_data_provider" "false")
chip_gn_arg_bool ("chip_enable_factory_data" "true")
elseif (CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND)
chip_gn_arg_bool ("chip_use_transitional_commissionable_data_provider" "false")
endif()

if (CONFIG_CHIP_ROTATING_DEVICE_ID)
chip_gn_arg_bool("chip_enable_rotating_device_id" "true")
chip_gn_arg_bool("chip_enable_additional_data_advertising" "true")
endif()

if (CONFIG_CHIP_ENABLE_DNSSD_SRP)
chip_gn_arg_string("chip_mdns" "platform")
endif()

if (CHIP_PROJECT_CONFIG)
chip_gn_arg_string("chip_project_config_include" ${CHIP_PROJECT_CONFIG})
chip_gn_arg_string("chip_system_project_config_include" ${CHIP_PROJECT_CONFIG})
endif()
if (CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER)
chip_gn_arg_bool("chip_build_example_providers" "true")
list(APPEND CHIP_LIBRARIES -lMatterDeviceInfoProviderExample)
endif()

file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/args.gn CONTENT ${CHIP_GN_ARGS})
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/args.tmp" CONTENT ${CHIP_GN_ARGS})

# ==============================================================================
# Define 'chip-gn' target that builds CHIP library(ies) with GN build system
Expand All @@ -227,13 +241,17 @@ ExternalProject_Add(
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
SOURCE_DIR ${CHIP_ROOT}
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}
CONFIGURE_COMMAND ${GN_EXECUTABLE}
CONFIGURE_COMMAND ""
BUILD_COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/make_gn_args.py
@args.tmp > args.gn &&
${GN_EXECUTABLE}
--root=${CHIP_ROOT}
--root-target=${GN_ROOT_TARGET}
--dotfile=${GN_ROOT_TARGET}/.gn
--script-executable=${Python3_EXECUTABLE}
gen --check --fail-on-unused-args ${CMAKE_CURRENT_BINARY_DIR}
BUILD_COMMAND ninja
--export-compile-commands
gen --check --fail-on-unused-args . &&
ninja
INSTALL_COMMAND ""
BUILD_BYPRODUCTS ${CHIP_LIBRARIES}
BUILD_ALWAYS TRUE
Expand Down Expand Up @@ -288,11 +306,11 @@ if (CONFIG_CHIP_OTA_IMAGE_BUILD)
west sign -t imgtool -p ${ZEPHYR_BASE}/../bootloader/mcuboot/scripts/imgtool.py -d ${PROJECT_BINARY_DIR}/.. -- --key ${ZEPHYR_BASE}/../bootloader/mcuboot/root-rsa-2048.pem
)

add_custom_target(final_bin ALL
add_custom_target(merge_mcuboot ALL
COMMAND
dd if=${PROJECT_BINARY_DIR}/../modules/chip-module/build_mcuboot/zephyr/zephyr.bin of=${PROJECT_BINARY_DIR}/zephyr_final.bin
dd if=${PROJECT_BINARY_DIR}/../modules/chip-module/build_mcuboot/zephyr/zephyr.bin of=${PROJECT_BINARY_DIR}/zephyr.bin
COMMAND
dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr_final.bin bs=1024 seek=64
dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=64
)

chip_ota_image(chip-ota-image
Expand All @@ -301,8 +319,28 @@ if (CONFIG_CHIP_OTA_IMAGE_BUILD)
)

add_dependencies(west_sign ${ZEPHYR_FINAL_EXECUTABLE})
add_dependencies(final_bin west_sign)
add_dependencies(merge_mcuboot west_sign)
add_dependencies(chip-ota-image west_sign)
endif()

if (CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE)
add_custom_target(merge_factory_data ALL
COMMAND
dd if=${PROJECT_BINARY_DIR}/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=976
)
if (CONFIG_CHIP_OTA_IMAGE_BUILD)
add_dependencies(merge_factory_data merge_mcuboot)
else()
add_dependencies(merge_factory_data ${ZEPHYR_FINAL_EXECUTABLE})
endif()
endif()

# ==============================================================================
# Define 'factory_data' target for generating a factory data partition
# ==============================================================================

if (CONFIG_CHIP_FACTORY_DATA_BUILD)
telink_generate_factory_data()
endif()

endif() # CONFIG_CHIP
Loading