Skip to content

Commit 0efd318

Browse files
authored
[OIS] Platform and examples implementation (#23382)
* [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>
1 parent e534257 commit 0efd318

File tree

130 files changed

+13691
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+13691
-32
lines changed

.github/.wordlist.txt

+6
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ contrib
301301
controllee
302302
conv
303303
CopperConcentrationMeasurement
304+
Corstone
304305
cortexa
305306
cp
306307
cpio
@@ -885,6 +886,7 @@ MyPASSWORD
885886
MySSID
886887
NAMESERVER
887888
NAMESPACE
889+
namespaces
888890
namespacing
889891
nano
890892
natively
@@ -1143,11 +1145,13 @@ rsn
11431145
RSSI
11441146
RST
11451147
rsync
1148+
RTC
11461149
rtd
11471150
RTL
11481151
rtld
11491152
RTOS
11501153
RTT
1154+
RTX
11511155
RUNAS
11521156
RunMain
11531157
runtime
@@ -1253,6 +1257,7 @@ subdirectory
12531257
subfolder
12541258
submodule
12551259
submodules
1260+
subnet
12561261
subprocess
12571262
SubscribeResponse
12581263
SubscriptionId
@@ -1325,6 +1330,7 @@ Tizen
13251330
TKIP
13261331
tlsr
13271332
TLV
1333+
TLS
13281334
tmp
13291335
tngvndl
13301336
TODO
+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Build example - Open IoT SDK
16+
17+
on:
18+
push:
19+
pull_request:
20+
workflow_dispatch:
21+
22+
concurrency:
23+
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
openiotsdk:
28+
name: Open IoT SDK examples building
29+
timeout-minutes: 140
30+
31+
env:
32+
TEST_NETWORK_NAME: OIStest
33+
34+
runs-on: ubuntu-latest
35+
if: github.actor != 'restyled-io[bot]'
36+
37+
container:
38+
image: connectedhomeip/chip-build-openiotsdk:0.6.06
39+
volumes:
40+
- "/tmp/bloat_reports:/tmp/bloat_reports"
41+
options: --privileged
42+
43+
steps:
44+
- uses: Wandalen/wretry.action@v1.0.36
45+
name: Checkout
46+
with:
47+
action: actions/checkout@v3
48+
with: |
49+
token: ${{ github.token }}
50+
attempt_limit: 3
51+
attempt_delay: 2000
52+
- name: Checkout submodules
53+
run: scripts/checkout_submodules.py --shallow --recursive --platform openiotsdk
54+
55+
- name: Set up environment for size reports
56+
if: ${{ !env.ACT }}
57+
env:
58+
GH_CONTEXT: ${{ toJson(github) }}
59+
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"
60+
61+
- name: Bootstrap
62+
timeout-minutes: 10
63+
run: scripts/build/gn_bootstrap.sh
64+
65+
- name: Build and install Python controller
66+
timeout-minutes: 10
67+
run: |
68+
scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env'
69+
70+
- name: Build shell example
71+
id: build_shell
72+
timeout-minutes: 10
73+
run: |
74+
scripts/examples/openiotsdk_example.sh shell
75+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
76+
openiotsdk release shell \
77+
examples/shell/openiotsdk/build/chip-openiotsdk-shell-example.elf \
78+
/tmp/bloat_reports/
79+
80+
- name: Build lock-app example
81+
id: build_lock_app
82+
timeout-minutes: 10
83+
run: |
84+
scripts/examples/openiotsdk_example.sh lock-app
85+
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
86+
openiotsdk release lock-app \
87+
examples/lock-app/openiotsdk/build/chip-openiotsdk-lock-app-example.elf \
88+
/tmp/bloat_reports/
89+
90+
- name: Build unit tests
91+
id: build_unit_tests
92+
timeout-minutes: 10
93+
run: |
94+
scripts/examples/openiotsdk_example.sh unit-tests
95+
96+
- name: Test shell example
97+
if: steps.build_shell.outcome == 'success'
98+
timeout-minutes: 5
99+
run: |
100+
scripts/examples/openiotsdk_example.sh -C test shell
101+
102+
- name: Test lock-app example
103+
if: steps.build_lock_app.outcome == 'success'
104+
timeout-minutes: 5
105+
run: |
106+
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up
107+
scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh -C test -n ${TEST_NETWORK_NAME}tap lock-app
108+
scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down
109+
110+
- name: Run unit tests
111+
if: steps.build_unit_tests.outcome == 'success' && github.event_name == 'pull_request'
112+
timeout-minutes: 90
113+
run: |
114+
scripts/examples/openiotsdk_example.sh -C run unit-tests

.vscode/launch.json

+75
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,35 @@
424424
"/tmp/ota-image.bin"
425425
],
426426
"cwd": "${workspaceFolder}"
427+
},
428+
429+
{
430+
"name": "Debug Open IoT SDK example application",
431+
"type": "cortex-debug",
432+
"request": "launch",
433+
"cwd": "${workspaceRoot}/examples/${input:openiotsdkApp}/openiotsdk",
434+
"executable": "./build/chip-openiotsdk-${input:openiotsdkApp}-example.elf",
435+
"armToolchainPath": "${env:ARM_GCC_TOOLCHAIN_PATH}/bin",
436+
"servertype": "external",
437+
"gdbTarget": "${input:openiotsdkRemoteHost}:31627", //GDBserver port on FVP
438+
"overrideLaunchCommands": ["-enable-pretty-printing"],
439+
"runToEntryPoint": "main",
440+
"preLaunchTask": "Debug Open IoT SDK example",
441+
"showDevDebugOutput": "parsed"
442+
},
443+
{
444+
"name": "Debug Open IoT SDK unit-tests application",
445+
"type": "cortex-debug",
446+
"request": "launch",
447+
"cwd": "${workspaceRoot}/src/test_driver/openiotsdk/unit-tests",
448+
"executable": "./build/${input:openiotsdkUnittest}.elf",
449+
"armToolchainPath": "${env:ARM_GCC_TOOLCHAIN_PATH}/bin",
450+
"servertype": "external",
451+
"gdbTarget": ":31627", //GDBserver port on FVP
452+
"overrideLaunchCommands": ["-enable-pretty-printing"],
453+
"runToEntryPoint": "main",
454+
"preLaunchTask": "Debug Open IoT SDK unit-tests",
455+
"showDevDebugOutput": "parsed"
427456
}
428457
],
429458
"inputs": [
@@ -479,6 +508,52 @@
479508
"description": "What mbed target do you want to use?",
480509
"options": ["CY8CPROTO_062_4343W"],
481510
"default": "CY8CPROTO_062_4343W"
511+
},
512+
{
513+
"type": "pickString",
514+
"id": "openiotsdkApp",
515+
"description": "What Open IoT SDK example do you want to use?",
516+
"options": ["shell", "lock-app"],
517+
"default": "shell"
518+
},
519+
{
520+
"type": "promptString",
521+
"id": "openiotsdkRemoteHost",
522+
"description": "Type the hostname/IP address of external GDB target that you want to connect to. Leave blank for internal GDB server",
523+
"default": ""
524+
},
525+
{
526+
"type": "pickString",
527+
"id": "openiotsdkUnittest",
528+
"description": "What Open IoT SDK unit test do you want to use?",
529+
"options": [
530+
"accesstest",
531+
"AppTests",
532+
"ASN1Tests",
533+
"BDXTests",
534+
"ChipCryptoTests",
535+
"ControllerTests",
536+
"CoreTests",
537+
"CredentialsTest",
538+
"DataModelTests",
539+
"InetLayerTests",
540+
"MdnsTests",
541+
"MessagingLayerTests",
542+
"MinimalMdnsCoreTests",
543+
"MinimalMdnsRecordsTests",
544+
"MinimalMdnsRespondersTests",
545+
"PlatformTests",
546+
"RawTransportTests",
547+
"RetransmitTests",
548+
"SecureChannelTests",
549+
"SetupPayloadTests",
550+
"SupportTests",
551+
"SystemLayerTests",
552+
"TestShell",
553+
"TransportLayerTests",
554+
"UserDirectedCommissioningTests"
555+
],
556+
"default": "accesstest"
482557
}
483558
]
484559
}

0 commit comments

Comments
 (0)