Skip to content

Commit

Permalink
Revert "[EFR32] Provide a way to build matter examples using a openth…
Browse files Browse the repository at this point in the history
…read library (project-chip#21836)"

This reverts commit 7816a69.
  • Loading branch information
mspang committed Aug 20, 2022
1 parent 1ea6bbe commit 516a9dc
Show file tree
Hide file tree
Showing 39 changed files with 136 additions and 243 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --recursive --platform efr32
run: scripts/checkout_submodules.py --shallow --platform efr32

# - name: Out of Tree verification
# run: third_party/silabs/out_of_tree_verification.sh
Expand Down
3 changes: 1 addition & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@
platforms = qpg
[submodule "third_party/openthread/ot-efr32"]
path = third_party/openthread/ot-efr32
url = https://github.com/SiliconLabs/ot-efr32.git
branch = matter_sve
url = https://github.com/openthread/ot-efr32.git
platforms = efr32
[submodule "third_party/openthread/ot-ifx"]
path = third_party/openthread/ot-ifx
Expand Down
14 changes: 13 additions & 1 deletion examples/chef/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,21 @@ efr32_executable("chef_app") {
# OpenThread Settings
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
"${examples_plat_dir}:efr-matter-shell",
]
if (chip_openthread_ftd) {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
]
} else {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
]
}
}

if (chip_enable_ota_requestor) {
Expand Down
2 changes: 0 additions & 2 deletions examples/chef/efr32/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex"
pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip"
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
chip_enable_openthread = true
openthread_external_platform =
"${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
2 changes: 1 addition & 1 deletion examples/chef/efr32/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
extern "C" {
#endif

void efr32InitLog(void);
void efr32LogInit(void);

void efr32Log(const char * aFormat, ...);
#define EFR32_LOG(...) efr32Log(__VA_ARGS__);
Expand Down
14 changes: 13 additions & 1 deletion examples/light-switch-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,21 @@ efr32_executable("light_switch_app") {
# OpenThread Settings
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
"${examples_plat_dir}:efr-matter-shell",
]
if (chip_openthread_ftd) {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
]
} else {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
]
}
}

# Attestation Credentials
Expand Down
2 changes: 0 additions & 2 deletions examples/light-switch-app/efr32/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip"
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
chip_enable_openthread = true
pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex"
openthread_external_platform =
"${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
2 changes: 1 addition & 1 deletion examples/light-switch-app/efr32/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
extern "C" {
#endif

void efr32InitLog(void);
void efr32LogInit(void);

void efr32Log(const char * aFormat, ...);
#define EFR32_LOG(...) efr32Log(__VA_ARGS__);
Expand Down
14 changes: 13 additions & 1 deletion examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,21 @@ efr32_executable("lighting_app") {
# OpenThread Settings
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
"${examples_plat_dir}:efr-matter-shell",
]
if (chip_openthread_ftd) {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
]
} else {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
]
}
}

if (chip_enable_ota_requestor) {
Expand Down
3 changes: 0 additions & 3 deletions examples/lighting-app/efr32/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip"
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
chip_enable_openthread = true
pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex"

openthread_external_platform =
"${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
14 changes: 13 additions & 1 deletion examples/lock-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,21 @@ efr32_executable("lock_app") {
# OpenThread Settings
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
"${examples_plat_dir}:efr-matter-shell",
]
if (chip_openthread_ftd) {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
]
} else {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
]
}
}

if (chip_enable_ota_requestor) {
Expand Down
2 changes: 0 additions & 2 deletions examples/lock-app/efr32/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ chip_enable_openthread = true
pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip"
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
pw_rpc_CONFIG = "$dir_pw_rpc:disable_global_mutex"
openthread_external_platform =
"${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
2 changes: 1 addition & 1 deletion examples/lock-app/efr32/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
extern "C" {
#endif

void efr32InitLog(void);
void efr32LogInit(void);

void efr32Log(const char * aFormat, ...);
#define EFR32_LOG(...) efr32Log(__VA_ARGS__);
Expand Down
2 changes: 1 addition & 1 deletion examples/persistent-storage/efr32/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
extern "C" {
#endif

void efr32InitLog(void);
void efr32LogInit(void);

void efr32Log(const char * aFormat, ...);
#define EFR32_LOG(...) efr32Log(__VA_ARGS__);
Expand Down
2 changes: 1 addition & 1 deletion examples/pigweed-app/efr32/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
extern "C" {
#endif

void efr32InitLog(void);
void efr32LogInit(void);
void efr32Log(const char * aFormat, ...);
#define EFR32_LOG(...) efr32Log(__VA_ARGS__);
void appError(int err);
Expand Down
18 changes: 6 additions & 12 deletions examples/platform/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import("//build_overrides/chip.gni")
import("//build_overrides/efr32_sdk.gni")
import("${chip_root}/src/lib/lib.gni")
import("${chip_root}/src/platform/device.gni")
import("${efr32_sdk_build_root}/efr32_sdk.gni")

config("chip_examples_project_config") {
Expand All @@ -41,19 +40,14 @@ config("chip_examples_project_config") {
}

source_set("openthread_core_config_efr32_chip_examples") {
if (chip_enable_openthread) {
sources = [ "project_include/OpenThreadConfig.h" ]
sources = [ "project_include/OpenThreadConfig.h" ]

public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ]

if (use_silabs_thread_lib) {
public_deps += [ "${efr32_sdk_build_root}:openthread_core_config_efr32" ]
} else {
public_deps += [ "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32" ]
}
public_deps = [
"${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32",
"${efr32_sdk_build_root}:efr32_sdk",
]

public_configs = [ ":chip_examples_project_config" ]
}
public_configs = [ ":chip_examples_project_config" ]
}

source_set("efr-matter-shell") {
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/efr32/efr32_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
extern "C" {
#endif

void efr32InitLog(void);
void efr32LogInit(void);

void efr32Log(const char * aFormat, ...);
#define EFR32_LOG(...) efr32Log(__VA_ARGS__);
Expand Down
6 changes: 4 additions & 2 deletions examples/platform/efr32/init_efrPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ void init_efrPlatform(void)
#endif

#if EFR32_LOG_ENABLED
efr32InitLog();
efr32LogInit();
#endif

#if CHIP_ENABLE_OPENTHREAD
sl_ot_sys_init();
efr32RadioInit();
efr32AlarmInit();
efr32MiscInit();
#endif // CHIP_ENABLE_OPENTHREAD
}

Expand Down
2 changes: 1 addition & 1 deletion examples/shell/efr32/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
extern "C" {
#endif

void efr32InitLog(void);
void efr32LogInit(void);

void efr32Log(const char * aFormat, ...);
#define EFR32_LOG(...) efr32Log(__VA_ARGS__);
Expand Down
14 changes: 13 additions & 1 deletion examples/thermostat/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,21 @@ efr32_executable("thermostat_app") {
# OpenThread Settings
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
"${examples_plat_dir}:efr-matter-shell",
]
if (chip_openthread_ftd) {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
]
} else {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
]
}
}

# Attestation Credentials
Expand Down
14 changes: 13 additions & 1 deletion examples/window-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,21 @@ efr32_executable("window_app") {
# OpenThread Settings
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
"${examples_plat_dir}:efr-matter-shell",
]
if (chip_openthread_ftd) {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
]
} else {
deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
]
}
}

if (chip_enable_ota_requestor) {
Expand Down
2 changes: 0 additions & 2 deletions examples/window-app/efr32/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ chip_enable_ota_requestor = true
pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip"
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
chip_enable_openthread = true
openthread_external_platform =
"${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32"
2 changes: 1 addition & 1 deletion examples/window-app/efr32/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extern "C" {
#define COVER_LIFT_TILT_TIMEOUT 500
#endif

void efr32InitLog(void);
void efr32LogInit(void);

void efr32Log(const char * aFormat, ...);
#define EFR32_LOG(...) efr32Log(__VA_ARGS__);
Expand Down
6 changes: 2 additions & 4 deletions scripts/checkout_submodules.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,14 @@ def make_chip_root_safe_directory() -> None:
subprocess.check_call(['git', 'config', '--global', '--add', 'safe.directory', CHIP_ROOT])


def checkout_modules(modules: list, shallow: bool, force: bool, recursive: bool) -> None:
def checkout_modules(modules: list, shallow: bool, force: bool) -> None:
names = [module.name.replace('submodule "', '').replace('"', '') for module in modules]
names = ', '.join(names)
logging.info(f'Checking out: {names}')

cmd = ['git', '-C', CHIP_ROOT, 'submodule', 'update', '--init']
cmd += ['--depth', '1'] if shallow else []
cmd += ['--force'] if force else []
cmd += ['--recursive'] if recursive else []
cmd += [module.path for module in modules]

subprocess.check_call(cmd)
Expand Down Expand Up @@ -110,7 +109,6 @@ def main():
parser.add_argument('--force', action='store_true', help='Perform action despite of warnings')
parser.add_argument('--deinit-unmatched', action='store_true',
help='Deinitialize submodules for non-matching platforms')
parser.add_argument('--recursive', action='store_true', help='Recursive init of the listed submodules')
args = parser.parse_args()

modules = list(load_module_info())
Expand All @@ -119,7 +117,7 @@ def main():
unmatched_modules = [m for m in modules if not module_matches_platforms(m, selected_platforms)]

make_chip_root_safe_directory()
checkout_modules(selected_modules, args.shallow, args.force, args.recursive)
checkout_modules(selected_modules, args.shallow, args.force)

if args.deinit_unmatched:
deinit_modules(unmatched_modules, args.force)
Expand Down
7 changes: 0 additions & 7 deletions scripts/examples/gn_efr32_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ set -x
env
USE_WIFI=false

SILABS_THREAD_TARGET=\""../silabs:ot-efr32-cert"\"
USAGE="./scripts/examples/gn_efr32_example.sh <AppRootFolder> <outputFolder> <efr32_board_name> [<Build options>]"

if [ "$#" == "0" ]; then
Expand Down Expand Up @@ -103,8 +102,6 @@ if [ "$#" == "0" ]; then
build wifi example variant for given exansion board
--additional_data_advertising
enable Addition data advertissing and rotating device ID
--use_ot_lib
use the silabs openthread library
"
elif [ "$#" -lt "2" ]; then
echo "Invalid number of arguments
Expand Down Expand Up @@ -152,10 +149,6 @@ else
optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true "
shift
;;
--use_ot_lib)
optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" "
shift
;;
*)
if [ "$1" =~ *"use_rs911x=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then
USE_WIFI=true
Expand Down
8 changes: 7 additions & 1 deletion src/inet/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ static_library("inet") {
}

if (chip_system_config_use_open_thread_inet_endpoints) {
public_deps += [ "${chip_root}/third_party/openthread:openthread" ]
if (chip_openthread_ftd) {
public_deps +=
[ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ]
} else {
public_deps +=
[ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ]
}
}

if (chip_inet_config_enable_tcp_endpoint) {
Expand Down
Loading

0 comments on commit 516a9dc

Please sign in to comment.