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

[NXP] Initial support for K32W1 #28777

Merged
merged 30 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4180357
[NXP] Introducing Matter support for K32W1
doru91 Aug 1, 2023
94cb12a
[NXP] Add CI/CV support for K32W1
marius-alex-tache Aug 9, 2023
c45a2f5
[NXP] Bump ot-nxp submodule
marius-alex-tache Aug 21, 2023
789715d
[K32W] Add OPENTHREAD_PLATFORM_CORE_CONFIG_FILE define
marius-alex-tache Aug 21, 2023
522f5fb
[K32W1] Fix misspell
marius-alex-tache Aug 21, 2023
23bb566
Restyled by whitespace
restyled-commits Aug 21, 2023
996cbfe
Restyled by clang-format
restyled-commits Aug 21, 2023
0babb3c
Restyled by gn
restyled-commits Aug 21, 2023
38ff5f8
Restyled by prettier-markdown
restyled-commits Aug 21, 2023
75eb631
Restyled by autopep8
restyled-commits Aug 21, 2023
81f2d75
Restyled by isort
restyled-commits Aug 21, 2023
6e61b71
[K32W1] Fix lint errors
marius-alex-tache Aug 21, 2023
81460d7
[K32W1] Removed deprecated class
marius-alex-tache Aug 21, 2023
8f69b9d
Restyled by clang-format
restyled-commits Aug 21, 2023
3858b21
[test] Update testdata/all_targets_linux_x64 with K32W1 targets
marius-alex-tache Aug 21, 2023
4b8ba73
[K32W] Fix target names in workflow
marius-alex-tache Aug 22, 2023
40acfb9
[K32W1] Remove deprecated commented sections
marius-alex-tache Aug 23, 2023
96a9922
[K32W1] Add missing # to reference targets in README
marius-alex-tache Aug 23, 2023
16f994a
[K32W1] Fix spelling errors
marius-alex-tache Aug 25, 2023
0beb592
[K32W1] Update CSR crypto flag usage
marius-alex-tache Sep 6, 2023
5e56ee3
[K32W1] Remove ResetWatermarks empty implementation
marius-alex-tache Sep 7, 2023
93747bd
Fix typo in device.gni after fixing conflict
marius-alex-tache Sep 12, 2023
8d36b23
[K32W1] Remove anchors and backtick some words
marius-alex-tache Sep 13, 2023
2d8ddfe
[K32W] Fix confusing naming in K32W builder
marius-alex-tache Sep 20, 2023
255f476
[K32W] Remove commented option
marius-alex-tache Sep 20, 2023
cb6a55c
[K32W] Fix binary extension format
marius-alex-tache Sep 20, 2023
166e536
Restyled by autopep8
restyled-commits Sep 20, 2023
4349828
[K32W] Fix binary name when copying
marius-alex-tache Sep 21, 2023
6da082b
Restyled by clang-format
restyled-commits Oct 3, 2023
38b9a22
[K32W1] Fix ErrorStr header inclusion
marius-alex-tache Oct 3, 2023
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
34 changes: 22 additions & 12 deletions .github/workflows/examples-k32w.yaml
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.

name: Build example - K32W with SE051
name: Build example - K32W

on:
push:
Expand All @@ -37,7 +37,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-k32w:5
image: ghcr.io/project-chip/chip-build-k32w:6
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: k32w0
platform: k32w

- name: Set up environment for size reports
uses: ./.github/actions/setup-size-reports
Expand All @@ -58,32 +58,42 @@ jobs:
run: |
scripts/run_in_build_env.sh "\
./scripts/build/build_examples.py \
--target k32w-light-crypto-platform-tokenizer \
--target k32w-lock-crypto-platform-tokenizer \
--target k32w-lock-crypto-platform-low-power-nologs \
--target k32w-contact-crypto-platform-tokenizer \
--target k32w-contact-crypto-platform-low-power-nologs \
--target k32w-shell-crypto-platform \
--target k32w-k32w0-light-crypto-platform-tokenizer \
--target k32w-k32w0-lock-crypto-platform-tokenizer \
--target k32w-k32w0-lock-crypto-platform-low-power-nologs \
--target k32w-k32w0-contact-crypto-platform-tokenizer \
--target k32w-k32w0-contact-crypto-platform-low-power-nologs \
--target k32w-k32w0-shell-crypto-platform \
--target k32w-k32w1-light-crypto-platform-openthread-ftd \
--target k32w-k32w1-contact-crypto-platform-low-power-nologs \
build \
--copy-artifacts-to out/artifacts \
"
- name: Get light size stats
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
k32w k32w0+release light \
out/artifacts/k32w-light-crypto-platform-tokenizer/chip-k32w0x-light-example \
out/artifacts/k32w-k32w0-light-crypto-platform-tokenizer/chip-k32w0x-light-example.elf \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
k32w k32w1+release light \
out/artifacts/k32w-k32w1-light-crypto-platform-openthread-ftd/chip-k32w1-light-example.elf \
/tmp/bloat_reports/
- name: Get lock size stats
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
k32w k32w0+release lock \
out/artifacts/k32w-lock-crypto-platform-tokenizer/chip-k32w0x-lock-example \
out/artifacts/k32w-k32w0-lock-crypto-platform-tokenizer/chip-k32w0x-lock-example.elf \
/tmp/bloat_reports/
- name: Get contact size stats
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
k32w k32w0+release contact \
out/artifacts/k32w-contact-crypto-platform-tokenizer/chip-k32w0x-contact-example \
out/artifacts/k32w-k32w0-contact-crypto-platform-tokenizer/chip-k32w0x-contact-example.elf \
/tmp/bloat_reports/
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
k32w k32w1+release contact \
out/artifacts/k32w-k32w1-contact-crypto-platform-low-power-nologs/chip-k32w1-contact-example.elf \
/tmp/bloat_reports/
- name: Uploading Size Reports
uses: ./.github/actions/upload-size-reports
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@
path = third_party/freertos/repo
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
branch = V10.3.1-kernel-only
platforms = ameba,cc13xx_26xx,bouffalolab,efr32,esp32,k32w0,infineon,qpg,cc32xx,silabs_docker
platforms = ameba,cc13xx_26xx,bouffalolab,efr32,esp32,k32w,infineon,qpg,cc32xx,silabs_docker
[submodule "simw-top-mini"]
path = third_party/simw-top-mini/repo
url = https://github.com/NXP/plug-and-trust.git
branch = int/CHIPSE_Release
platforms = k32w0
platforms = k32w
[submodule "third_party/openthread/ot-nxp"]
path = third_party/openthread/ot-nxp
url = https://github.com/openthread/ot-nxp.git
platforms = k32w0
platforms = k32w
[submodule "third_party/openthread/ot-qorvo"]
path = third_party/openthread/ot-qorvo
url = https://github.com/openthread/ot-qorvo.git
Expand Down
18 changes: 18 additions & 0 deletions build_overrides/k32w1_sdk.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2020 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 K32W SDK build files.
k32w1_sdk_build_root = "//third_party/nxp/k32w1_sdk"
}
19 changes: 19 additions & 0 deletions examples/build_overrides/k32w1_sdk.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2020 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 k32w SDK.
k32w1_sdk_build_root =
"//third_party/connectedhomeip/third_party/nxp/k32w1_sdk"
}
29 changes: 29 additions & 0 deletions examples/contact-sensor-app/nxp/k32w/k32w1/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) 2020-2023 Project CHIP Authors
# Copyright (c) 2023 NXP
#
# 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")
}
136 changes: 136 additions & 0 deletions examples/contact-sensor-app/nxp/k32w/k32w1/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Copyright (c) 2021-2023 Project CHIP Authors
# Copyright (c) 2023 NXP
#
# 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/chip.gni")
import("//build_overrides/k32w1_sdk.gni")
import("//build_overrides/openthread.gni")

import("${k32w1_sdk_build_root}/k32w1_executable.gni")
import("${k32w1_sdk_build_root}/k32w1_sdk.gni")

import("${chip_root}/src/crypto/crypto.gni")
import("${chip_root}/src/lib/core/core.gni")
import("${chip_root}/src/platform/device.gni")

declare_args() {
chip_software_version = 0
}

assert(current_os == "freertos")

k32w1_platform_dir = "${chip_root}/examples/platform/nxp/k32w/k32w1"
k32w1_sdk_root = getenv("NXP_K32W1_SDK_ROOT")

k32w1_sdk("sdk") {
sources = [
"${k32w1_platform_dir}/app/project_include/OpenThreadConfig.h",
"include/CHIPProjectConfig.h",
"include/FreeRTOSConfig.h",
"main/include/app_config.h",
]

public_deps =
[ "${chip_root}/third_party/openthread/platforms:libopenthread-platform" ]

include_dirs = [
"main/include",
"main",
"include",
"${k32w1_platform_dir}/app/project_include",
"${k32w1_platform_dir}/app/support",
"${k32w1_platform_dir}/util/include",
]

defines = []
if (is_debug) {
defines += [ "BUILD_RELEASE=0" ]
} else {
defines += [ "BUILD_RELEASE=1" ]
}

if (chip_software_version != 0) {
defines += [
"CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${chip_software_version}",
]
}
}

k32w1_executable("contact_sensor_app") {
output_name = "chip-k32w1-contact-example"

sources = [
"${k32w1_platform_dir}/util/LEDWidget.cpp",
"${k32w1_platform_dir}/util/include/LEDWidget.h",
"main/AppTask.cpp",
"main/ContactSensorManager.cpp",
"main/ZclCallbacks.cpp",
"main/include/AppEvent.h",
"main/include/AppTask.h",
"main/include/ContactSensorManager.h",
"main/main.cpp",
]

deps = [
":sdk",
"${chip_root}/examples/common/QRCode",
"${chip_root}/examples/contact-sensor-app/contact-sensor-common",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/platform:syscalls_stub",
"${chip_root}/third_party/mbedtls:mbedtls",
"${k32w1_platform_dir}/app/support:freertos_mbedtls_utils",
]

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",
]
}

cflags = [ "-Wconversion" ]

output_dir = root_out_dir

ldscript = "${k32w1_sdk_root}/middleware/wireless/framework/Common/devices/kw45_k32w1/gcc/connectivity.ld"

inputs = [ ldscript ]

ldflags = [
"-Wl,--defsym=__heap_size__=0",
"-Wl,--defsym=__stack_size__=0x480",
"-Wl,--defsym=gNvmSectors=8",
"-Wl,--defsym=lp_ram_lower_limit=0x04000000",
"-Wl,--defsym=lp_ram_upper_limit=0x2001C000",
"-Wl,-print-memory-usage",
"-Wl,--no-warn-rwx-segments",
"-T" + rebase_path(ldscript, root_build_dir),
]

output_dir = root_out_dir
}

group("k32w1") {
deps = [ ":contact_sensor_app" ]
}

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