Skip to content

Commit

Permalink
Add Lock app example for infineon P6 board (project-chip#8268)
Browse files Browse the repository at this point in the history
* Add Lock app example for infineon P6 board

* P6 lock app changes addressing review comments

* Update Code changes to support new Clock modifications

* Rename repo to p6_sdk along with docker vscode changes

* Update README.md with dockerfile link for software download

* Remove warnings false check for compile

* Update script to remove sudo and cleanup folder names

* Add all Infineon assets as gitsubmodules

* Address review comments cleaning up code

* Cleanup code as per final review comments

* Address BLE configuration comments
  • Loading branch information
praveenCY authored Aug 12, 2021
1 parent 0b406de commit 080ae57
Show file tree
Hide file tree
Showing 121 changed files with 11,443 additions and 4 deletions.
64 changes: 64 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,67 @@
path = third_party/mbed-os-posix-socket/repo
url = https://github.com/ARMmbed/mbed-os-posix-socket.git
branch = main
[submodule "p6/abstraction-rtos"]
path = third_party/p6/p6_sdk/libs/abstraction-rtos
url = https://github.com/Infineon/abstraction-rtos
[submodule "p6/bluetooth-freertos"]
path = third_party/p6/p6_sdk/libs/bluetooth-freertos
url = https://github.com/Infineon/bluetooth-freertos
branch = v2.X
[submodule "p6/btstack"]
path = third_party/p6/p6_sdk/libs/btstack
url = https://github.com/Infineon/btstack
[submodule "p6/clib-support"]
path = third_party/p6/p6_sdk/libs/clib-support
url = https://github.com/Infineon/clib-support
[submodule "p6/connectivity-utilities"]
path = third_party/p6/p6_sdk/libs/connectivity-utilities
url = https://github.com/Infineon/connectivity-utilities
[submodule "p6/core-lib"]
path = third_party/p6/p6_sdk/libs/core-lib
url = https://github.com/Infineon/core-lib
[submodule "p6/core-make"]
path = third_party/p6/p6_sdk/libs/core-make
url = https://github.com/Infineon/core-make
[submodule "p6/kv-store"]
path = third_party/p6/p6_sdk/libs/kv-store
url = https://github.com/Infineon/kv-store
[submodule "p6/mtb-hal-cat1"]
path = third_party/p6/p6_sdk/libs/mtb-hal-cat1
url = https://github.com/Infineon/mtb-hal-cat1
[submodule "p6/mtb-pdl-cat1"]
path = third_party/p6/p6_sdk/libs/mtb-pdl-cat1
url = https://github.com/Infineon/mtb-pdl-cat1
[submodule "p6/psoc6cm0p"]
path = third_party/p6/p6_sdk/libs/psoc6cm0p
url = https://github.com/Infineon/psoc6cm0p
[submodule "p6/whd-bsp-integration"]
path = third_party/p6/p6_sdk/libs/whd-bsp-integration
url = https://github.com/Infineon/whd-bsp-integration
[submodule "p6/wifi-connection-manager"]
path = third_party/p6/p6_sdk/libs/wifi-connection-manager
url = https://github.com/Infineon/wifi-connection-manager
[submodule "p6/wifi-host-driver"]
path = third_party/p6/p6_sdk/libs/wifi-host-driver
url = https://github.com/Infineon/wifi-host-driver
[submodule "p6/wifi-mw-core"]
path = third_party/p6/p6_sdk/libs/wifi-mw-core
url = https://github.com/Infineon/wifi-mw-core
[submodule "p6/TARGET_CY8CKIT-062S2-43012"]
path = third_party/p6/p6_sdk/libs/TARGET_CY8CKIT-062S2-43012
url = https://github.com/Infineon/TARGET_CY8CKIT-062S2-43012
[submodule "p6/freertos"]
path = third_party/p6/p6_sdk/libs/freertos
url = https://github.com/Infineon/freertos
[submodule "p6/retarget-io"]
path = third_party/p6/p6_sdk/libs/retarget-io
url = https://github.com/Infineon/retarget-io
[submodule "p6/mbedtls"]
path = third_party/p6/p6_sdk/libs/mbedtls
url = https://github.com/ARMmbed/mbedtls
[submodule "p6/secure-sockets"]
path = third_party/p6/p6_sdk/libs/secure-sockets
url = https://github.com/Infineon/secure-sockets
[submodule "p6/recipe-make-cat1a"]
path = third_party/p6/p6_sdk/libs/recipe-make-cat1a
url = https://github.com/Infineon/recipe-make-cat1a
15 changes: 15 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
# Set this to true to enable efr32 builds by default.
enable_efr32_builds = false

# Set this to true to enable p6 builds by default.
enable_p6_builds = false

# Set this to true to enable Qorvo qpg builds by default.
enable_qpg_builds = false

Expand Down Expand Up @@ -227,6 +230,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
# Build the efr32 lock app example.
enable_efr32_lock_app_build = enable_efr32_builds

# Build the p6 lock app example.
enable_p6_lock_app_build = enable_p6_builds

# Build the qpgxxxx lock app example.
enable_qpg_lock_app_build = enable_qpg_builds && !is_debug

Expand Down Expand Up @@ -359,6 +365,12 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
}
}

if (enable_p6_lock_app_build) {
group("p6_lock_app") {
deps = [ "${chip_root}/examples/lock-app/p6(${chip_root}/config/p6/toolchain:p6_lock_app)" ]
}
}

if (enable_qpg_lock_app_build) {
group("qpg_lock_app") {
deps = [ "${chip_root}/examples/lock-app/qpg(${chip_root}/config/qpg/toolchain:qpg_lock_app)" ]
Expand Down Expand Up @@ -450,6 +462,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
if (enable_efr32_window_app_build) {
deps += [ ":efr32_window_app" ]
}
if (enable_p6_lock_app_build) {
deps += [ ":p6_lock_app" ]
}
if (enable_k32w_lighting_app_build) {
deps += [ ":k32w_lighting_app" ]
}
Expand Down
18 changes: 18 additions & 0 deletions build_overrides/p6.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2021 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

declare_args() {
# Root directory for p6 SDK build files.
p6_sdk_build_root = "//third_party/p6"
}
25 changes: 25 additions & 0 deletions config/p6/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2021 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

import("${build_root}/toolchain/arm_gcc/arm_toolchain.gni")

arm_toolchain("p6_lock_app") {
toolchain_args = {
current_os = "freertos"
import("${chip_root}/examples/lock-app/p6/args.gni")
}
}
18 changes: 18 additions & 0 deletions examples/build_overrides/p6.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2021 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

declare_args() {
# Root directory for P6 SDK.
p6_sdk_build_root = "//third_party/connectedhomeip/third_party/p6"
}
28 changes: 28 additions & 0 deletions examples/lock-app/p6/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2021 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")

# The location of the build configuration file.
buildconfig = "${build_root}/config/BUILDCONFIG.gn"

# CHIP uses angle bracket includes.
check_system_includes = true

default_args = {
target_cpu = "arm"
target_os = "freertos"

import("//args.gni")
}
100 changes: 100 additions & 0 deletions examples/lock-app/p6/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Copyright (c) 2021 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/p6.gni")

import("${build_root}/config/defaults.gni")
import("${p6_sdk_build_root}/p6_executable.gni")
import("${p6_sdk_build_root}/p6_sdk.gni")

assert(current_os == "freertos")

p6_project_dir = "${chip_root}/examples/lock-app/p6"
examples_plat_dir = "${chip_root}/examples/platform/p6"

declare_args() {
# Dump memory usage at link time.
chip_print_memory_usage = false

# PIN code for PASE session establishment.
setup_pin_code = 20202021
}

p6_sdk_sources("lock_app_sdk_sources") {
include_dirs = [
"${chip_root}/src/platform/P6",
"${p6_project_dir}/include",
"${examples_plat_dir}",
]

defines = [
"BOARD_ID=${p6_board}",
"P6_LOG_ENABLED=1",
"CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setup_pin_code}",
]

sources = [ "${p6_project_dir}/include/CHIPProjectConfig.h" ]

public_configs = [ "${chip_root}/third_party/p6:p6_sdk_config" ]
}

p6_executable("lock_app") {
include_dirs = []
defines = []
output_name = "chip-p6-lock-example.out"

public_deps = [
":lock_app_sdk_sources",
"${chip_root}/examples/common/QRCode",
"${chip_root}/examples/lock-app/lock-common",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
]

include_dirs += [
"include",
"${examples_plat_dir}",
"${p6_project_dir}/include",
]

sources = [
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/init_p6Platform.cpp",
"${p6_project_dir}/include/CHIPProjectConfig.h",
"src/AppTask.cpp",
"src/BoltLockManager.cpp",
"src/ButtonHandler.cpp",
"src/ZclCallbacks.cpp",
"src/main.cpp",
]

output_dir = root_out_dir

if (chip_print_memory_usage) {
ldflags = [
"-Wl,--print-memory-usage",
"-fstack-usage",
]
}
}

group("p6") {
deps = [ ":lock_app" ]
}

group("default") {
deps = [ ":p6" ]
}
Loading

0 comments on commit 080ae57

Please sign in to comment.