Skip to content

Commit

Permalink
[nxp fromtree][NXP] Initial enablement of NXP Matter over WiFi with Z…
Browse files Browse the repository at this point in the history
…ephyr (project-chip#31648)

* [zephyr] Update deprecated Kconfig

CPLUSPLUS is deprecated and should be replaced with CPP
LIB_CPLUSPLUS is deprecated and should be replaced with REQUIRES_FULL_LIBCPP

Signed-off-by: Axel Le Bourhis <[email protected]>

* [NXP] Initial enablement of NXP Matter over WiFi with Zephyr

Features:
* Matter over WiFi
* BLE commissioning
* Storage
* Factory data
* OTA
* MbedTLS PSA API

Signed-off-by: Axel Le Bourhis <[email protected]>

* Restyled by whitespace

* Restyled by clang-format

* Restyled by gn

* Restyled by prettier-markdown

* Fix misspell error

Signed-off-by: Axel Le Bourhis <[email protected]>

* Update copyrights to date contributed

Signed-off-by: Axel Le Bourhis <[email protected]>

---------

Signed-off-by: Axel Le Bourhis <[email protected]>
Co-authored-by: Restyled.io <[email protected]>

(cherry picked from commit 28676c8)
  • Loading branch information
axelnxp authored and dinabenamar committed Feb 13, 2024
1 parent 0ff709f commit 9df00a2
Show file tree
Hide file tree
Showing 48 changed files with 5,079 additions and 15 deletions.
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

0 comments on commit 9df00a2

Please sign in to comment.