Skip to content

Commit 080ae57

Browse files
authored
Add Lock app example for infineon P6 board (#8268)
* 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
1 parent 0b406de commit 080ae57

File tree

121 files changed

+11443
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+11443
-4
lines changed

.gitmodules

+64
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,67 @@
9595
path = third_party/mbed-os-posix-socket/repo
9696
url = https://github.com/ARMmbed/mbed-os-posix-socket.git
9797
branch = main
98+
[submodule "p6/abstraction-rtos"]
99+
path = third_party/p6/p6_sdk/libs/abstraction-rtos
100+
url = https://github.com/Infineon/abstraction-rtos
101+
[submodule "p6/bluetooth-freertos"]
102+
path = third_party/p6/p6_sdk/libs/bluetooth-freertos
103+
url = https://github.com/Infineon/bluetooth-freertos
104+
branch = v2.X
105+
[submodule "p6/btstack"]
106+
path = third_party/p6/p6_sdk/libs/btstack
107+
url = https://github.com/Infineon/btstack
108+
[submodule "p6/clib-support"]
109+
path = third_party/p6/p6_sdk/libs/clib-support
110+
url = https://github.com/Infineon/clib-support
111+
[submodule "p6/connectivity-utilities"]
112+
path = third_party/p6/p6_sdk/libs/connectivity-utilities
113+
url = https://github.com/Infineon/connectivity-utilities
114+
[submodule "p6/core-lib"]
115+
path = third_party/p6/p6_sdk/libs/core-lib
116+
url = https://github.com/Infineon/core-lib
117+
[submodule "p6/core-make"]
118+
path = third_party/p6/p6_sdk/libs/core-make
119+
url = https://github.com/Infineon/core-make
120+
[submodule "p6/kv-store"]
121+
path = third_party/p6/p6_sdk/libs/kv-store
122+
url = https://github.com/Infineon/kv-store
123+
[submodule "p6/mtb-hal-cat1"]
124+
path = third_party/p6/p6_sdk/libs/mtb-hal-cat1
125+
url = https://github.com/Infineon/mtb-hal-cat1
126+
[submodule "p6/mtb-pdl-cat1"]
127+
path = third_party/p6/p6_sdk/libs/mtb-pdl-cat1
128+
url = https://github.com/Infineon/mtb-pdl-cat1
129+
[submodule "p6/psoc6cm0p"]
130+
path = third_party/p6/p6_sdk/libs/psoc6cm0p
131+
url = https://github.com/Infineon/psoc6cm0p
132+
[submodule "p6/whd-bsp-integration"]
133+
path = third_party/p6/p6_sdk/libs/whd-bsp-integration
134+
url = https://github.com/Infineon/whd-bsp-integration
135+
[submodule "p6/wifi-connection-manager"]
136+
path = third_party/p6/p6_sdk/libs/wifi-connection-manager
137+
url = https://github.com/Infineon/wifi-connection-manager
138+
[submodule "p6/wifi-host-driver"]
139+
path = third_party/p6/p6_sdk/libs/wifi-host-driver
140+
url = https://github.com/Infineon/wifi-host-driver
141+
[submodule "p6/wifi-mw-core"]
142+
path = third_party/p6/p6_sdk/libs/wifi-mw-core
143+
url = https://github.com/Infineon/wifi-mw-core
144+
[submodule "p6/TARGET_CY8CKIT-062S2-43012"]
145+
path = third_party/p6/p6_sdk/libs/TARGET_CY8CKIT-062S2-43012
146+
url = https://github.com/Infineon/TARGET_CY8CKIT-062S2-43012
147+
[submodule "p6/freertos"]
148+
path = third_party/p6/p6_sdk/libs/freertos
149+
url = https://github.com/Infineon/freertos
150+
[submodule "p6/retarget-io"]
151+
path = third_party/p6/p6_sdk/libs/retarget-io
152+
url = https://github.com/Infineon/retarget-io
153+
[submodule "p6/mbedtls"]
154+
path = third_party/p6/p6_sdk/libs/mbedtls
155+
url = https://github.com/ARMmbed/mbedtls
156+
[submodule "p6/secure-sockets"]
157+
path = third_party/p6/p6_sdk/libs/secure-sockets
158+
url = https://github.com/Infineon/secure-sockets
159+
[submodule "p6/recipe-make-cat1a"]
160+
path = third_party/p6/p6_sdk/libs/recipe-make-cat1a
161+
url = https://github.com/Infineon/recipe-make-cat1a

BUILD.gn

+15
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
169169
# Set this to true to enable efr32 builds by default.
170170
enable_efr32_builds = false
171171

172+
# Set this to true to enable p6 builds by default.
173+
enable_p6_builds = false
174+
172175
# Set this to true to enable Qorvo qpg builds by default.
173176
enable_qpg_builds = false
174177

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

233+
# Build the p6 lock app example.
234+
enable_p6_lock_app_build = enable_p6_builds
235+
230236
# Build the qpgxxxx lock app example.
231237
enable_qpg_lock_app_build = enable_qpg_builds && !is_debug
232238

@@ -359,6 +365,12 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
359365
}
360366
}
361367

368+
if (enable_p6_lock_app_build) {
369+
group("p6_lock_app") {
370+
deps = [ "${chip_root}/examples/lock-app/p6(${chip_root}/config/p6/toolchain:p6_lock_app)" ]
371+
}
372+
}
373+
362374
if (enable_qpg_lock_app_build) {
363375
group("qpg_lock_app") {
364376
deps = [ "${chip_root}/examples/lock-app/qpg(${chip_root}/config/qpg/toolchain:qpg_lock_app)" ]
@@ -450,6 +462,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
450462
if (enable_efr32_window_app_build) {
451463
deps += [ ":efr32_window_app" ]
452464
}
465+
if (enable_p6_lock_app_build) {
466+
deps += [ ":p6_lock_app" ]
467+
}
453468
if (enable_k32w_lighting_app_build) {
454469
deps += [ ":k32w_lighting_app" ]
455470
}

build_overrides/p6.gni

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
declare_args() {
16+
# Root directory for p6 SDK build files.
17+
p6_sdk_build_root = "//third_party/p6"
18+
}

config/p6/toolchain/BUILD.gn

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/build.gni")
16+
import("//build_overrides/chip.gni")
17+
18+
import("${build_root}/toolchain/arm_gcc/arm_toolchain.gni")
19+
20+
arm_toolchain("p6_lock_app") {
21+
toolchain_args = {
22+
current_os = "freertos"
23+
import("${chip_root}/examples/lock-app/p6/args.gni")
24+
}
25+
}

examples/build_overrides/p6.gni

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
declare_args() {
16+
# Root directory for P6 SDK.
17+
p6_sdk_build_root = "//third_party/connectedhomeip/third_party/p6"
18+
}

examples/lock-app/p6/.gn

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/build.gni")
16+
17+
# The location of the build configuration file.
18+
buildconfig = "${build_root}/config/BUILDCONFIG.gn"
19+
20+
# CHIP uses angle bracket includes.
21+
check_system_includes = true
22+
23+
default_args = {
24+
target_cpu = "arm"
25+
target_os = "freertos"
26+
27+
import("//args.gni")
28+
}

examples/lock-app/p6/BUILD.gn

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/build.gni")
16+
import("//build_overrides/chip.gni")
17+
import("//build_overrides/p6.gni")
18+
19+
import("${build_root}/config/defaults.gni")
20+
import("${p6_sdk_build_root}/p6_executable.gni")
21+
import("${p6_sdk_build_root}/p6_sdk.gni")
22+
23+
assert(current_os == "freertos")
24+
25+
p6_project_dir = "${chip_root}/examples/lock-app/p6"
26+
examples_plat_dir = "${chip_root}/examples/platform/p6"
27+
28+
declare_args() {
29+
# Dump memory usage at link time.
30+
chip_print_memory_usage = false
31+
32+
# PIN code for PASE session establishment.
33+
setup_pin_code = 20202021
34+
}
35+
36+
p6_sdk_sources("lock_app_sdk_sources") {
37+
include_dirs = [
38+
"${chip_root}/src/platform/P6",
39+
"${p6_project_dir}/include",
40+
"${examples_plat_dir}",
41+
]
42+
43+
defines = [
44+
"BOARD_ID=${p6_board}",
45+
"P6_LOG_ENABLED=1",
46+
"CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setup_pin_code}",
47+
]
48+
49+
sources = [ "${p6_project_dir}/include/CHIPProjectConfig.h" ]
50+
51+
public_configs = [ "${chip_root}/third_party/p6:p6_sdk_config" ]
52+
}
53+
54+
p6_executable("lock_app") {
55+
include_dirs = []
56+
defines = []
57+
output_name = "chip-p6-lock-example.out"
58+
59+
public_deps = [
60+
":lock_app_sdk_sources",
61+
"${chip_root}/examples/common/QRCode",
62+
"${chip_root}/examples/lock-app/lock-common",
63+
"${chip_root}/src/lib",
64+
"${chip_root}/src/setup_payload",
65+
]
66+
67+
include_dirs += [
68+
"include",
69+
"${examples_plat_dir}",
70+
"${p6_project_dir}/include",
71+
]
72+
73+
sources = [
74+
"${examples_plat_dir}/LEDWidget.cpp",
75+
"${examples_plat_dir}/init_p6Platform.cpp",
76+
"${p6_project_dir}/include/CHIPProjectConfig.h",
77+
"src/AppTask.cpp",
78+
"src/BoltLockManager.cpp",
79+
"src/ButtonHandler.cpp",
80+
"src/ZclCallbacks.cpp",
81+
"src/main.cpp",
82+
]
83+
84+
output_dir = root_out_dir
85+
86+
if (chip_print_memory_usage) {
87+
ldflags = [
88+
"-Wl,--print-memory-usage",
89+
"-fstack-usage",
90+
]
91+
}
92+
}
93+
94+
group("p6") {
95+
deps = [ ":lock_app" ]
96+
}
97+
98+
group("default") {
99+
deps = [ ":p6" ]
100+
}

0 commit comments

Comments
 (0)