-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added compile support for NuttX systems
This is a basic version of compile support and only x86 simulator lightning-APP is supported now. The compilation method is shown below: bash examples/lighting-app/nuttx/build_sim.sh and compiled binaries are in the examples/lighting-app/nuttx/out directory. Detailed introduction about NuttX system can refer to this link: https://github.com/apache/nuttx Signed-off-by: zhanghongyu <[email protected]>
- Loading branch information
Showing
18 changed files
with
237 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# 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. | ||
|
||
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 = "" | ||
target_os = "nuttx" | ||
|
||
import("${chip_root}/config/nuttx/chip-gn/args.gni") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# 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. | ||
|
||
import("//build_overrides/build.gni") | ||
import("//build_overrides/chip.gni") | ||
|
||
import("${chip_root}/build/chip/tests.gni") | ||
|
||
assert(current_os == "nuttx") | ||
|
||
declare_args() { | ||
chip_build_example_providers = false | ||
chip_example_lighting = false | ||
} | ||
|
||
static_library("nuttx") { | ||
output_name = "libchipnuttx" | ||
|
||
public_deps = [ | ||
"${chip_root}/examples/platform/linux:app-main", | ||
"${chip_root}/src/lib", | ||
] | ||
|
||
if (chip_build_tests) { | ||
public_deps += [ "${chip_root}/src:tests" ] | ||
} | ||
|
||
if (chip_build_example_providers) { | ||
public_deps += [ "${chip_root}/examples/providers:device_info_provider" ] | ||
} | ||
|
||
if (chip_example_lighting) { | ||
public_deps += [ | ||
"${chip_root}/examples/lighting-app/lighting-common", | ||
"${chip_root}/examples/lighting-app/lighting-common:lighting-manager", | ||
] | ||
} | ||
|
||
output_dir = "${root_out_dir}/lib" | ||
|
||
complete_static_lib = true | ||
} | ||
|
||
group("default") { | ||
deps = [ ":nuttx" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# 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. | ||
|
||
import("//build_overrides/chip.gni") | ||
|
||
import("${chip_root}/src/crypto/crypto.gni") | ||
|
||
chip_device_platform = "nuttx" | ||
|
||
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/nuttx/chip-gn/toolchain:nuttx" | ||
|
||
pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# 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. | ||
|
||
import("//build/toolchain/gcc_toolchain.gni") | ||
import("//build_overrides/build.gni") | ||
|
||
declare_args() { | ||
nuttx_ar = "" | ||
nuttx_cc = "" | ||
nuttx_cxx = "" | ||
} | ||
|
||
gcc_toolchain("nuttx") { | ||
ar = nuttx_ar | ||
cc = nuttx_cc | ||
cxx = nuttx_cxx | ||
|
||
toolchain_args = { | ||
current_os = "nuttx" | ||
is_clang = false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
matter_dir=$(dirname "$0")/../../.. | ||
realpath_matter=$(realpath "$matter_dir") | ||
echo "The root of matter is $realpath_matter" | ||
cd "$(dirname "$0")" | ||
|
||
if [ ! -e nuttx.zip ]; then | ||
wget -O nuttx.zip https://codeload.github.com/apache/nuttx/zip/refs/heads/master | ||
unzip -q nuttx.zip | ||
fi | ||
|
||
if [ ! -e nuttx ]; then | ||
mv nuttx-master nuttx | ||
fi | ||
|
||
if [ ! -e nuttx_app.zip ]; then | ||
wget -O nuttx_app.zip https://codeload.github.com/apache/nuttx-apps/zip/refs/heads/master | ||
unzip -q nuttx_app.zip | ||
fi | ||
|
||
if [ ! -e apps ]; then | ||
mv nuttx-apps-master apps | ||
fi | ||
|
||
if [ ! -e apps/netutils/connectedhomeip/connectedhomeip ]; then | ||
ln -s "$realpath_matter" apps/netutils/connectedhomeip/connectedhomeip | ||
fi | ||
|
||
mkdir out | ||
cd nuttx | ||
cmake -B build -DBOARD_CONFIG=sim:matter -GNinja | ||
cmake --build build | ||
cp build/nuttx ../out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters