forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove support for nRF5 SDK for Thread & Zigbee (project-chip…
- Loading branch information
Showing
134 changed files
with
13,471 additions
and
2 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
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,94 @@ | ||
# 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. | ||
|
||
name: Build example - nRF | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
nrf: | ||
name: nRF | ||
env: | ||
BUILD_TYPE: gn_nrf | ||
BUILD_VERSION: 0.2.14 | ||
BUILD_IMAGE: chip-build-nrf-platform | ||
BUILD_ORG: connectedhomeip | ||
|
||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: connectedhomeip/chip-build-nrf-platform:0.4.12 | ||
volumes: | ||
- "/tmp/bloat_reports:/tmp/bloat_reports" | ||
- "/tmp/output_binaries:/tmp/output_binaries" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
# Fetch depth 0 to get all history and be able to check mergepoint for bloat report | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: "cpp, python" | ||
queries: +security-and-quality | ||
- name: Bootstrap | ||
run: scripts/build/gn_bootstrap.sh | ||
- name: Build example nRF5 Lock App | ||
run: | ||
scripts/examples/gn_nrf_example.sh examples/lock-app/nrf5 | ||
out/lock_app_debug | ||
- name: Build example nRF5 Lighting App | ||
run: | ||
scripts/examples/gn_nrf_example.sh examples/lighting-app/nrf5 | ||
out/lighting_app_debug | ||
- name: Build example nRF5 Shell App | ||
run: | ||
scripts/examples/gn_nrf_example.sh examples/shell/nrf52 | ||
out/shell_app_debug | ||
- name: Binary artifact suffix | ||
id: outsuffix | ||
uses: haya14busa/action-cond@v1.0.0 | ||
with: | ||
cond: ${{ github.event.pull_request.number == '' }} | ||
if_true: "${{ github.sha }}" | ||
if_false: "pull-${{ github.event.pull_request.number }}" | ||
- name: Uploading Binaries | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: | ||
${{ env.BUILD_TYPE }}-example-build-${{ | ||
steps.outsuffix.outputs.value }} | ||
path: | | ||
out/lock_app_debug/chip-nrf52840-lock-example | ||
out/lighting_app_debug/chip-nrf52840-lighting-example | ||
out/shell_app_debug/shell-nrf52840 | ||
# TODO: NRF Connect https://github.com/project-chip/connectedhomeip/issues/2225 | ||
- name: Show tree | ||
run: find . | ||
- name: Remove third_party binaries for CodeQL Analysis | ||
run: find out -type d -name "third_party" -exec rm -rf {} + | ||
- name: Remove nrfxlib binaries for CodeQL Analysis | ||
run: find out -type d -name "nrfxlib" -exec rm -rf {} + | ||
- name: Remove NordicSemiconductor binaries for CodeQL Analysis | ||
run: | ||
find out -type d -name "NordicSemiconductor" -exec rm -rf {} + | ||
|
||
- name: Perform CodeQL Analysis | ||
if: ${{ github.event_name == 'push' }} | ||
uses: github/codeql-action/analyze@v1 |
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,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 nRF5 SDK build files. | ||
nrf5_sdk_build_root = "//third_party/nrf5_sdk" | ||
} |
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,38 @@ | ||
# 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("//build/toolchain/arm_gcc/arm_toolchain.gni") | ||
|
||
arm_toolchain("nrf5_lock_app") { | ||
toolchain_args = { | ||
current_os = "freertos" | ||
import("${chip_root}/examples/lock-app/nrf5/args.gni") | ||
} | ||
} | ||
|
||
arm_toolchain("nrf5_lighting_app") { | ||
toolchain_args = { | ||
current_os = "freertos" | ||
import("${chip_root}/examples/lighting-app/nrf5/args.gni") | ||
} | ||
} | ||
|
||
arm_toolchain("nrf5_pigweed_app") { | ||
toolchain_args = { | ||
current_os = "freertos" | ||
import("${chip_root}/examples/pigweed-app/nrf5/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
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,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 nRF5 SDK. | ||
nrf5_sdk_build_root = "//third_party/connectedhomeip/third_party/nrf5_sdk" | ||
} |
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,16 @@ | ||
# CHIP nRF52840 Common Code | ||
|
||
This directory contains common code for several example apps. | ||
|
||
- `common` | ||
|
||
This directory contains common code for bringing up a nRF52840 example app. | ||
|
||
- `util` | ||
|
||
This directory contains some usful classes for example apps. | ||
|
||
- `gdb` | ||
|
||
This directory contains some shell scripts for setting up debugging | ||
environment. |
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,38 @@ | ||
# Set convenience vars for the start and end of the .text section | ||
set $FLASH_START=&__isr_vector | ||
set $FLASH_END=&__etext | ||
|
||
# Search for the signature string indicating that the app was built with support | ||
# for J-Link monitor mode debugging. | ||
set logging file /dev/null | ||
set logging redirect on | ||
set logging on | ||
find /b1 $FLASH_START, $FLASH_END, 'J', 'L', 'I', 'N', 'K', 'M', 'O', 'N', 'H', 'A', 'N', 'D', 'L', 'E', 'R' | ||
set logging off | ||
set logging redirect off | ||
|
||
# Tell the user which type of debugging will being used. | ||
if $numfound != 0 | ||
echo J-LINK monitor handler detected: Enabling monitor mode debugging\n | ||
else | ||
echo J-LINK monitor handler NOT detected: Using standard 'HALT' mode debugging\n | ||
end | ||
|
||
# Connect to the GDB server | ||
echo Connecting to local GDB server\n | ||
target remote localhost:2331 | ||
|
||
# Enable monitor mode debugging if available. | ||
set logging file /dev/null | ||
set logging redirect on | ||
set logging on | ||
if $numfound != 0 | ||
mon exec SetMonModeDebug=1 | ||
eval "mon exec SetMonModeVTableAddr=%p", $FLASH_START | ||
else | ||
mon exec SetMonModeDebug=0 | ||
end | ||
set logging off | ||
set logging redirect off | ||
|
||
|
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,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# 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. | ||
# | ||
|
||
SCRIPT_ROOT=$(dirname "$0") | ||
GNU_INSTALL_ROOT=${GNU_INSTALL_ROOT:-${HOME}/tools/arm/gcc-arm-none-eabi-7-2018-q2-update/bin} | ||
GDB=$GNU_INSTALL_ROOT/arm-none-eabi-gdb | ||
DEFAULT_APP=./build/chip-nrf52840-lock-example.out | ||
STARTUP_CMDS=$SCRIPT_ROOT/gdb-startup-cmds.txt | ||
|
||
if [[ $# -eq 0 ]]; then | ||
APP=$DEFAULT_APP | ||
else | ||
APP=$1 | ||
fi | ||
|
||
EXTRA_STARTUP_CMDS=() | ||
if [[ -n $OPENTHREAD_ROOT ]]; then | ||
EXTRA_STARTUP_CMDS+=( | ||
"set substitute-path /build/KNGP-TOLL1-JOB1/openthread/examples/.. $OPENTHREAD_ROOT" | ||
) | ||
fi | ||
|
||
exec "$GDB" -q -x "$STARTUP_CMDS" "${EXTRA_STARTUP_CMDS[@]/#/-ex=}" "$APP" |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# 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. | ||
# | ||
|
||
JLINK_GDB_SERVER=JLinkGDBServer | ||
DEVICE_TYPE=NRF52840_XXAA | ||
RTT_PORT=19021 | ||
|
||
command -v "$JLINK_GDB_SERVER" || { | ||
echo "ERROR: $JLINK_GDB_SERVER not found" | ||
echo "Please install SEGGER J-Link software package" | ||
exit 1 | ||
} | ||
|
||
command -v nc || { | ||
echo "ERROR: nc command not found" | ||
exit 1 | ||
} | ||
|
||
# Launch JLink GDB Server in background; redirect output thru sed to add prefix. | ||
"$JLINK_GDB_SERVER" -device "$DEVICE_TYPE" -if SWD -speed 4000 -rtos GDBServer/RTOSPlugin_FreeRTOS "$@" > >(exec sed -e 's/^/JLinkGDBServer: /') 2>&1 & | ||
GDB_SERVER_PID=$! | ||
|
||
# Repeatedly open a connection to the GDB server's RTT port until | ||
# the user kills the GDB server with an interrupt character. | ||
while true; do | ||
# Wait for GDB server to begin listening on RTT port | ||
while ! lsof -nP -i4TCP:"$RTT_PORT" -sTCP:LISTEN >/dev/null; do | ||
# Quit if the GDB server exits. | ||
if ! kill -0 "$GDB_SERVER_PID" >/dev/null 2>&1; then | ||
echo "" | ||
exit | ||
fi | ||
|
||
# Wait a bit. | ||
sleep 0.1 | ||
|
||
done | ||
|
||
# Connect to RTT port. | ||
nc localhost "$RTT_PORT" | ||
|
||
done |
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,26 @@ | ||
# 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. | ||
|
||
# The location of the build configuration file. | ||
buildconfig = "//build/config/BUILDCONFIG.gn" | ||
|
||
# CHIP uses angle bracket includes. | ||
check_system_includes = true | ||
|
||
default_args = { | ||
target_cpu = "arm" | ||
target_os = "freertos" | ||
|
||
import("//args.gni") | ||
} |
Oops, something went wrong.