-
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.
[ASR] add asr getting stated guide; add ASR582X CI (#27057)
* [ASR] add asr getting stated guide; add ASR582X CI * remove unused env in CI; remove app list --------- Co-authored-by: Andrei Litvin <[email protected]>
- Loading branch information
Showing
17 changed files
with
252 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Copyright (c) 2023 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 - ASR | ||
|
||
on: | ||
push: | ||
pull_request: | ||
merge_group: | ||
|
||
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 | ||
|
||
env: | ||
CHIP_NO_LOG_TIMESTAMPS: true | ||
# XXX: Workaround for https://github.com/actions/cache/issues/1141 | ||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3 | ||
|
||
jobs: | ||
asr: | ||
name: ASR | ||
|
||
runs-on: ubuntu-latest | ||
if: github.actor != 'restyled-io[bot]' | ||
|
||
container: | ||
image: connectedhomeip/chip-build-asr:0.7.14 | ||
options: --user root | ||
|
||
steps: | ||
- uses: Wandalen/[email protected] | ||
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 --allow-changing-global-git-config --shallow --platform asr | ||
- name: Bootstrap cache | ||
uses: actions/cache@v3 | ||
timeout-minutes: 10 | ||
with: | ||
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} | ||
path: | | ||
.environment | ||
build_overrides/pigweed_environment.gni | ||
- name: Bootstrap | ||
run: bash scripts/bootstrap.sh | ||
- name: Build all ASR582X examples | ||
run: | | ||
./scripts/run_in_build_env.sh \ | ||
"./scripts/build/build_examples.py \ | ||
--target asr-asr582x-lighting \ | ||
--target asr-asr582x-lighting-ota \ | ||
build \ | ||
" |
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,134 @@ | ||
# ASR Getting Started Guide | ||
|
||
The ASR platform is a [Matter](https://github.com/project-chip/connectedhomeip) | ||
platform that uses ASR FreeRTOS SDK. | ||
|
||
--- | ||
|
||
- [ASR Getting Started Guide](#asr-getting-started-guide) | ||
- [Supported Chips](#supported-chips) | ||
- [Matter Example Applications](#matter-example-applications) | ||
- [Building the Example Application](#building-the-example-application) | ||
- [Commissioning](#commissioning) | ||
- [BLE mode](#ble-mode) | ||
- [IP mode](#ip-mode) | ||
- [Shell](#shell) | ||
- [OTA](#ota) | ||
|
||
--- | ||
|
||
## Supported Chips | ||
|
||
The ASR platform is supported on: | ||
|
||
- [ASR582X](http://www.asrmicro.com/en/goods/proinfo/36.html) | ||
- [ASR595X](http://www.asrmicro.com/en/goods/proinfo/42.html) | ||
|
||
## Matter Example Applications | ||
|
||
Sample Matter applications are provided for the ASR platform. They can be used | ||
to speed up development. You can find them in the samples with `/asr` subfolder. | ||
|
||
## Building the Example Application | ||
|
||
- [Setup Matter Environment](./BUILDING.md) | ||
|
||
- Setup toolchain | ||
- for ASR582X | ||
``` | ||
cd toolchain | ||
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 | ||
tar -jxvf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 | ||
export ASR_TOOLCHAIN_PATH={abs-path-to-toolchain}/gcc-arm-none-eabi-9-2019-q4-major/bin/ | ||
``` | ||
- for ASR595X | ||
``` | ||
git clone --depth=1 https://github.com/asriot/Tools.git | ||
cd Tools/toolchain | ||
cat asr_riscv_gnu_toolchain_10.2_ubuntu-16.04.tar.bz2.part* > asr_riscv_gnu_toolchain_10.2_ubuntu-16.04.tar.bz2 | ||
mkdir -p asr_riscv_gnu_toolchain_10.2_ubuntu-16.04 | ||
tar -jxvf asr_riscv_gnu_toolchain_10.2_ubuntu-16.04.tar.bz2 -C asr_riscv_gnu_toolchain_10.2_ubuntu-16.04/ | ||
export ASR_TOOLCHAIN_PATH={abs-path-to-toolchain}/asr_riscv_gnu_toolchain_10.2_ubuntu-16.04/bin/ | ||
``` | ||
- Setup Chip environment | ||
- for ASR582X: | ||
``` | ||
export ASR_BOARD=asr582x | ||
``` | ||
- for ASR595X: | ||
``` | ||
export ASR_BOARD=asr595x | ||
``` | ||
- Building the Application | ||
If the lighting example is to be built: | ||
``` | ||
./scripts/build/build_examples.py --target asr-$ASR_BOARD-lighting build | ||
``` | ||
- The output image files are stored in the subdirectories under `out`, the | ||
subdirectory name is the same as the argument specified after the option | ||
`--target` when build the examples. | ||
- After building the application, `DOGO` tool is used to flash it to the | ||
board. | ||
## Commissioning | ||
There are two commissioning modes supported by ASR platform: | ||
### BLE mode | ||
1. Build and Flash | ||
2. The example will run automatically after booting the ASR board. | ||
3. Restore factory settings using command `recovery` | ||
4. Commissioning with | ||
[Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool),for | ||
example: | ||
``` | ||
./chip-tool pairing ble-wifi <node_id> <ssid> <password> <pin_code> <discriminator> | ||
``` | ||
### IP mode | ||
1. Build and Flash | ||
2. The example will run automatically after booting the ASR board. | ||
3. Restore factory settings using command `recovery` | ||
4. Connect to AP using command `wifi_open sta [ssid] [password]` | ||
5. Commissioning with | ||
[Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool),for | ||
example: | ||
``` | ||
./chip-tool pairing onnetwork-long <node_id> <pin_code> <discriminator> | ||
``` | ||
## Shell | ||
1. To build the example with Matter shell, exactly the same steps as above but | ||
add argument `-shell` when using the `build_examples.py` script. For example: | ||
`./scripts/build/build_examples.py --target asr-$ASR_BOARD-lighting-shell build` | ||
2. The example will run automatically after booting the ASR board. | ||
3. Use `help` command to list all supported commands: | ||
``` | ||
help | ||
base64 Base64 encode / decode utilities | ||
exit Exit the shell application | ||
help List out all top level commands | ||
version Output the software version | ||
ble BLE transport commands | ||
wifi Usage: wifi <subcommand> | ||
config Manage device configuration. Usage to dump value: config [param_name] and to set some values (discriminator): config [param_name] [param_value]. | ||
device Device management commands | ||
onboardingcodes Dump device onboarding codes. Usage: onboardingcodes none|softap|ble|onnetwork [qrcode|qrcodeurl|manualpairingcode] | ||
dns Dns client commands | ||
OnOff OnOff commands. Usage: OnOff [on|off] | ||
Done | ||
``` | ||
## OTA | ||
To build the example with the Matter OTA Requestor functionality, exactly the | ||
same steps as above but add argument `-ota` when using the `build_examples.py` | ||
script. For example: | ||
`./scripts/build/build_examples.py --target asr-$ASR_BOARD-lighting-ota build` |
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
Oops, something went wrong.