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 enablement of NXP Matter over WiFi with Zephyr #31648

Merged
merged 8 commits into from
Jan 25, 2024
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
10 changes: 10 additions & 0 deletions config/nxp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# NXP Zephyr build and configuration files

This directory contains build scripts and common configuration files used by
CHIP NXP Zephyr applications. It is structured as follows:

| File/Folder | Contents |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| chip-gn | GN project used to build selected CHIP libraries with the _nxp_zephyr_ platform integration layer |
| chip-module | CMake wrapper for the GN project defined in `chip-gn` directory, and other components that allow one to use CHIP as a Zephyr module |
| app | Common and optional Kconfig configuration files that can be used in NXP Zephyr applications |
25 changes: 25 additions & 0 deletions config/nxp/app/bootloader.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Copyright (c) 2024 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.
#

# Options to be used for MCUBOOT build are located on this file.

# The default signature key used by MCUBOOT is located on their repository,
# change this to the appropriate one.
# NOTE: This option needs to contain a path to the same file used by
# MCUBOOT_SIGNATURE_KEY_FILE.
#CONFIG_BOOT_SIGNATURE_KEY_FILE="root-rsa-2048.pem"

CONFIG_BOOT_MAX_IMG_SECTORS=2048
22 changes: 22 additions & 0 deletions config/nxp/app/enable-gnu-std.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright (c) 2024 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.
#

add_library(gnu17 INTERFACE)
target_compile_options(gnu17
INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17>
-D_SYS__PTHREADTYPES_H_)
target_link_libraries(app PRIVATE gnu17)
21 changes: 21 additions & 0 deletions config/nxp/app/pre-zephyr.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Copyright (c) 2024 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.
#

# Automatically find overlays defined at platform level
# Those are usually used to change FLASH and RAM layouts
if (EXISTS ${CHIP_ROOT}/src/platform/nxp/zephyr/boards/${BOARD}/${BOARD}.overlay)
list(APPEND EXTRA_DTC_OVERLAY_FILE ${CHIP_ROOT}/src/platform/nxp/zephyr/boards/${BOARD}/${BOARD}.overlay)
endif()
29 changes: 29 additions & 0 deletions config/nxp/chip-gn/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) 2024 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")

# 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 = "zephyr"

import("${chip_root}/config/nxp/chip-gn/args.gni")
}
40 changes: 40 additions & 0 deletions config/nxp/chip-gn/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) 2024 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("${chip_root}/build/chip/tests.gni")

assert(current_os == "zephyr")

declare_args() {
chip_build_example_providers = false
}

group("nxp_zephyr") {
deps = [ "${chip_root}/src/lib" ]

if (chip_build_tests) {
deps += [ "${chip_root}/src:tests" ]
}

if (chip_build_example_providers) {
deps += [ "${chip_root}/examples/providers:device_info_provider" ]
}
}

group("default") {
deps = [ ":nxp_zephyr" ]
}
32 changes: 32 additions & 0 deletions config/nxp/chip-gn/args.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) 2024 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/chip.gni")

import("${chip_root}/src/crypto/crypto.gni")

chip_device_platform = "nxp_zephyr"

chip_build_tests = false

chip_project_config_include = ""
chip_system_project_config_include = ""
chip_ble_project_config_include = ""

chip_crypto = "mbedtls"
chip_external_mbedtls = true

custom_toolchain = "${chip_root}/config/nxp/chip-gn/toolchain:zephyr"

pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ]
34 changes: 34 additions & 0 deletions config/nxp/chip-gn/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) 2024 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_root}/toolchain/arm_gcc/arm_toolchain.gni")

declare_args() {
zephyr_ar = ""
zephyr_cc = ""
zephyr_cxx = ""
}

gcc_toolchain("zephyr") {
ar = zephyr_ar
cc = zephyr_cc
cxx = zephyr_cxx

toolchain_args = {
current_os = "zephyr"
is_clang = false
}
}
Loading
Loading