-
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.
[ST] Adding STM32 platform and lighting app example with STM32WB5MM-D…
…K board (#28889) * add stm32cubewb submodule * move submodule stm32cubewb to tag v1.17.0 * fix align in gitmodules * add st in third_party * add builds and scripts to compile stm32 examples * add stm32 platform in matter source files and modifi gn files to use st as a third party * add stm32 lighting app example using stm32wb5mm-dk board * put chip_detail_logging to false to optimize the size of the flash * add support for st CI * typo fixs for ci * add st getting started readme * remove duplicate license * minor fixs in readme and stm32 getting started and add st getting started to the guides/readme * typo fix * mispells fix * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Restyled by prettier-markdown * Restyled by shellharden * Restyled by shfmt * Restyled by isort * Revert "Restyled by clang-format" This reverts commit 90c6d8f. * move otp to example and fix misspell and remove case sensitive in wordlist * remove unused defines and change return message for unused fonctions * Update docs/guides/stm32_getting_started_guide.md Co-authored-by: Boris Zbarsky <[email protected]> * Update docs/guides/stm32_getting_started_guide.md Co-authored-by: Boris Zbarsky <[email protected]> * Restyled by whitespace * convert windows to linux file * convert windows to linux files * Restyled by whitespace * Restyled by clang-format * add missing include * removed unused arguments * update shutdown to call the upper class --------- Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]>
- Loading branch information
Showing
120 changed files
with
19,412 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Copyright (c) 2020-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 - stm32 | ||
|
||
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 | ||
|
||
jobs: | ||
stm32: | ||
name: stm32 | ||
timeout-minutes: 60 | ||
|
||
env: | ||
BUILD_TYPE: gn_stm32 | ||
|
||
runs-on: ubuntu-latest | ||
if: github.actor != 'restyled-io[bot]' | ||
|
||
container: | ||
image: ghcr.io/project-chip/chip-build:1 | ||
volumes: | ||
- "/tmp/bloat_reports:/tmp/bloat_reports" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Checkout submodules & Bootstrap | ||
uses: ./.github/actions/checkout-submodules-and-bootstrap | ||
with: | ||
platform: stm32 | ||
|
||
- name: Set up environment for size reports | ||
uses: ./.github/actions/setup-size-reports | ||
if: ${{ !env.ACT }} | ||
with: | ||
gh-context: ${{ toJson(github) }} | ||
|
||
- name: Build stm32 example apps | ||
timeout-minutes: 20 | ||
run: | | ||
./scripts/run_in_build_env.sh \ | ||
"./scripts/build/build_examples.py \ | ||
--target stm32-STM32WB5MM-DK-light build \ | ||
" | ||
- name: Uploading Size Reports | ||
uses: ./.github/actions/upload-size-reports | ||
if: ${{ !env.ACT }} | ||
with: | ||
platform-name: stm32 | ||
|
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,18 @@ | ||
# 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. | ||
|
||
declare_args() { | ||
# Root directory for stm32 SDK build files. | ||
stm32_sdk_build_root = "//third_party/st" | ||
} |
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,25 @@ | ||
# 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. | ||
|
||
import("//build_overrides/build.gni") | ||
import("//build_overrides/chip.gni") | ||
|
||
import("${build_root}/toolchain/arm_gcc/arm_toolchain.gni") | ||
|
||
arm_toolchain("stm32_lighting_app") { | ||
toolchain_args = { | ||
current_os = "freertos" | ||
import("${chip_root}/examples/lighting-app/stm32/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,103 @@ | ||
# STM32 Getting Started Guide | ||
|
||
The stm32 platform uses | ||
[Matter](https://github.com/project-chip/connectedhomeip) sdk with FreeRTOS. | ||
|
||
--- | ||
|
||
- [stm32 Getting Started Guide](#stm32-getting-started-guide) | ||
- [Supported Chips](#supported-chips) | ||
- [Matter Example Applications](#matter-example-applications) | ||
- [Building the Example Application](#building-the-example-application) | ||
- [Commissioning](#commissioning) | ||
- [BLE-Thread mode](#ble-thread-mode) | ||
|
||
--- | ||
|
||
## Supported Chips | ||
|
||
The stm32 platform is supported on: | ||
|
||
- [STM32WB5MM-DK](https://www.st.com/en/evaluation-tools/stm32wb5mm-dk.html) | ||
|
||
## Matter Example Applications | ||
|
||
Sample Matter applications are provided for the stm32 platform. They can be used | ||
to speed up development. You can find them in the samples with `/stm32` | ||
subfolder. | ||
|
||
## Building the Example Application | ||
|
||
- [Set Up Matter Environment](./BUILDING.md) | ||
|
||
- Set up STLINK tools | ||
|
||
``` | ||
apt-get install stlink-tools | ||
``` | ||
- Building the Application | ||
If the lighting example is to be built: | ||
``` | ||
./scripts/build/build_examples.py --target stm32-$stm32_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, `ST-LINK` tool is used to flash it to the | ||
board. Before flashing the application, you will need to flash the fuse and | ||
the co processor binary. The co processor binary and fuse are available | ||
[here](https://github.com/stm32-hotspot/stm32wb-matter-device-over-thread/tree/main/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x) | ||
Dynamic Concurrent Mode BLE Thread for Matter (Supports Full BLE Stack 5.2 | ||
certified and Minimal Thread Device ready v1.3) | ||
``` | ||
sudo st-flash write chip-stm32-lighting-example.bin 0x08000000 | ||
``` | ||
## Commissioning | ||
There is one commissioning modes supported by stm32 platform: | ||
### BLE-Thread mode | ||
1. Build and Flash | ||
2. The example will run automatically after booting the stm32 board. | ||
3. Restore factory settings using B1 button by pressing at least 10 seconds | ||
4. Commissioning with | ||
[Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool),for | ||
example: | ||
``` | ||
./chip-tool pairing ble-thread <node_id> <hex:xxx> <pin_code> <discriminator> | ||
``` | ||
### Bluetooth LE advertising | ||
In this example, to commission the device onto a Matter network, it must be | ||
discoverable over Bluetooth LE. After powering up the device, the device will | ||
advertise automatically for 30 seconds. After this delay, you will need to reset | ||
the device to start the commissioning procedure. | ||
### Bluetooth LE rendezvous | ||
In Matter, the commissioning procedure is done over Bluetooth LE between a | ||
Matter device and the Matter controller(, where the controller has the | ||
commissioner role. | ||
To start the rendezvous, the controller must get the commissioning information | ||
from the Matter device. The data payload is encoded within a QR code, printed to | ||
the UART console. | ||
### Thread provisioning | ||
The provisioning operation, which is the Last part of the rendezvous procedure, | ||
involves sending the Thread network credentials from the Matter controller to | ||
the Matter device. As a result, the device joins the Thread network via a | ||
OpenThread border Router (OTBR) and can communicate with other devices in the | ||
network. |
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 stm32 SDK. | ||
stm32_sdk_build_root = "//third_party/connectedhomeip/third_party/st" | ||
} |
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,28 @@ | ||
# 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") | ||
|
||
# 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 = "arm" | ||
target_os = "freertos" | ||
|
||
import("//args.gni") | ||
} |
Oops, something went wrong.