Skip to content

Commit

Permalink
[OIS] Platform and examples implementation (#23382)
Browse files Browse the repository at this point in the history
* [OIS] Open IoT SDK build system integration

Add Open IoT SDK build system configuration directory.
Create GN project to build CHIP library for Open IoT SDK port.
Implement CMake file to build and expose CHIP library.
Create python script to build GN arguments file.
Provide mbedtls and LwIP default configuration.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Open IoT SDK platform layer implementation

Add platform layer adaptation files
Open IoT SKD platform layer GN build integration

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Open IoT SDK system layer adaptation

Add cmsis-rtos locking option.
Implement cmsis-rtos system mutex.
Open IoT SDK system layer GN build integration.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Add Open IoT SDK platform to common GN build settings

Propagate Open IoT SDK platform settings in build system
of Matter components.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Open IoT SDK streamer implementation

Add Open IoT SDK shell streamer based on SDK retarget.
Use default shell main loop.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Open IoT SDK examples common

Add Open IoT SDK example platform target that contains source code
shared between examples.
Create common Cmake settings - sdk, chip and linker common cmake files.
Create custome Corstone 300 GCC linker scripts.
Create Corstone 300 FVP configuraiton file.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Open IoT SDK shell example

Implement Open IoT SDK shell example.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Open IoT SDK lock-app example

Implement Open IoT SDK lock-app example.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Open IoT SDK examples helper tools

Add Open IoT SDK example script which allows build and run
supported examples.
Implement OpenIotSdkBuilder Python class with generating and building
examples support.
Add Open IoT SDK targets to Python builder.
Add Open IoT SDK memory configuration to memory script tool.
Add Open IoT SDK VSCode tasks integration - build, run and debug OIS
examples tasks.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Add Open IoT SDK examples workflow

Github workflow to validate Open IoT SDK examples

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Add integration tests for Open IoT SDK examples

Add network setup script to enable/disable the TAP/TUN network
environment. Create TAP/TUN device and bridge interface to connect it
with the ethernet network interface.

Create Pytest implementation of Open IoT SDK examples integration tests.
Implement lock-app and shell examples tests cases.
Add test command to Open IoT SDK example script.
Add integrations tests to CI workflow.
Add Open IoT SDK examples testing to Vscode tasks.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Add Open IoT SDK platform documentation

Create Open IoT SDK platform overview, commissioning approach
description and common examples guide.
Add README files to shell and lock-app examples.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [OIS] Add Open IoT SDK unit-tests

Adaptation changes:
Exclude LwIP initialization for Open IoT SDK platform in unit tests
implementation.
Skip read/write chunking tests in controller component.
Skip CommissionerDUTVectors test in credentials component.
Skip ControllerTests - #23747 issue
Skip CHIP stack initialization in FailSafeContext test.

Add Open IoT SDK platform unit-tests application in
src/test_driver/openiotsdk/unit-tests directory.
Add unit tests to Open IoT SDK example script, CI workflow
and VScode tasks.
Add unit-tests application documentation.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

Signed-off-by: ATmobica <artur.tynecki@arm.com>
  • Loading branch information
ATmobica authored and pull[bot] committed Jun 16, 2023
1 parent 15e6c2b commit 2209752
Show file tree
Hide file tree
Showing 130 changed files with 13,691 additions and 32 deletions.
6 changes: 6 additions & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ contrib
controllee
conv
CopperConcentrationMeasurement
Corstone
cortexa
cp
cpio
Expand Down Expand Up @@ -885,6 +886,7 @@ MyPASSWORD
MySSID
NAMESERVER
NAMESPACE
namespaces
namespacing
nano
natively
Expand Down Expand Up @@ -1143,11 +1145,13 @@ rsn
RSSI
RST
rsync
RTC
rtd
RTL
rtld
RTOS
RTT
RTX
RUNAS
RunMain
runtime
Expand Down Expand Up @@ -1253,6 +1257,7 @@ subdirectory
subfolder
submodule
submodules
subnet
subprocess
SubscribeResponse
SubscriptionId
Expand Down Expand Up @@ -1325,6 +1330,7 @@ Tizen
TKIP
tlsr
TLV
TLS
tmp
tngvndl
TODO
Expand Down
114 changes: 114 additions & 0 deletions .github/workflows/examples-openiotsdk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Copyright (c) 2021 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 - Open IoT SDK

on:
push:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
cancel-in-progress: true

jobs:
openiotsdk:
name: Open IoT SDK examples building
timeout-minutes: 140

env:
TEST_NETWORK_NAME: OIStest

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build-openiotsdk:0.6.06
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
options: --privileged

steps:
- uses: Wandalen/wretry.action@v1.0.36
name: Checkout
with:
action: actions/checkout@v3
with: |
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --recursive --platform openiotsdk

- name: Set up environment for size reports
if: ${{ !env.ACT }}
env:
GH_CONTEXT: ${{ toJson(github) }}
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"

- name: Bootstrap
timeout-minutes: 10
run: scripts/build/gn_bootstrap.sh

- name: Build and install Python controller
timeout-minutes: 10
run: |
scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env'
- name: Build shell example
id: build_shell
timeout-minutes: 10
run: |
scripts/examples/openiotsdk_example.sh shell
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
openiotsdk release shell \
examples/shell/openiotsdk/build/chip-openiotsdk-shell-example.elf \
/tmp/bloat_reports/
- name: Build lock-app example
id: build_lock_app
timeout-minutes: 10
run: |
scripts/examples/openiotsdk_example.sh lock-app
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
openiotsdk release lock-app \
examples/lock-app/openiotsdk/build/chip-openiotsdk-lock-app-example.elf \
/tmp/bloat_reports/
- name: Build unit tests
id: build_unit_tests
timeout-minutes: 10
run: |
scripts/examples/openiotsdk_example.sh unit-tests
- name: Test shell example
if: steps.build_shell.outcome == 'success'
timeout-minutes: 5
run: |
scripts/examples/openiotsdk_example.sh -C test shell
- name: Test lock-app example
if: steps.build_lock_app.outcome == 'success'
timeout-minutes: 5
run: |
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh -C test -n ${TEST_NETWORK_NAME}tap lock-app
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
- name: Run unit tests
if: steps.build_unit_tests.outcome == 'success' && github.event_name == 'pull_request'
timeout-minutes: 90
run: |
scripts/examples/openiotsdk_example.sh -C run unit-tests
75 changes: 75 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,35 @@
"/tmp/ota-image.bin"
],
"cwd": "${workspaceFolder}"
},

{
"name": "Debug Open IoT SDK example application",
"type": "cortex-debug",
"request": "launch",
"cwd": "${workspaceRoot}/examples/${input:openiotsdkApp}/openiotsdk",
"executable": "./build/chip-openiotsdk-${input:openiotsdkApp}-example.elf",
"armToolchainPath": "${env:ARM_GCC_TOOLCHAIN_PATH}/bin",
"servertype": "external",
"gdbTarget": "${input:openiotsdkRemoteHost}:31627", //GDBserver port on FVP
"overrideLaunchCommands": ["-enable-pretty-printing"],
"runToEntryPoint": "main",
"preLaunchTask": "Debug Open IoT SDK example",
"showDevDebugOutput": "parsed"
},
{
"name": "Debug Open IoT SDK unit-tests application",
"type": "cortex-debug",
"request": "launch",
"cwd": "${workspaceRoot}/src/test_driver/openiotsdk/unit-tests",
"executable": "./build/${input:openiotsdkUnittest}.elf",
"armToolchainPath": "${env:ARM_GCC_TOOLCHAIN_PATH}/bin",
"servertype": "external",
"gdbTarget": ":31627", //GDBserver port on FVP
"overrideLaunchCommands": ["-enable-pretty-printing"],
"runToEntryPoint": "main",
"preLaunchTask": "Debug Open IoT SDK unit-tests",
"showDevDebugOutput": "parsed"
}
],
"inputs": [
Expand Down Expand Up @@ -479,6 +508,52 @@
"description": "What mbed target do you want to use?",
"options": ["CY8CPROTO_062_4343W"],
"default": "CY8CPROTO_062_4343W"
},
{
"type": "pickString",
"id": "openiotsdkApp",
"description": "What Open IoT SDK example do you want to use?",
"options": ["shell", "lock-app"],
"default": "shell"
},
{
"type": "promptString",
"id": "openiotsdkRemoteHost",
"description": "Type the hostname/IP address of external GDB target that you want to connect to. Leave blank for internal GDB server",
"default": ""
},
{
"type": "pickString",
"id": "openiotsdkUnittest",
"description": "What Open IoT SDK unit test do you want to use?",
"options": [
"accesstest",
"AppTests",
"ASN1Tests",
"BDXTests",
"ChipCryptoTests",
"ControllerTests",
"CoreTests",
"CredentialsTest",
"DataModelTests",
"InetLayerTests",
"MdnsTests",
"MessagingLayerTests",
"MinimalMdnsCoreTests",
"MinimalMdnsRecordsTests",
"MinimalMdnsRespondersTests",
"PlatformTests",
"RawTransportTests",
"RetransmitTests",
"SecureChannelTests",
"SetupPayloadTests",
"SupportTests",
"SystemLayerTests",
"TestShell",
"TransportLayerTests",
"UserDirectedCommissioningTests"
],
"default": "accesstest"
}
]
}
Loading

0 comments on commit 2209752

Please sign in to comment.