Skip to content

Commit

Permalink
add st getting started readme
Browse files Browse the repository at this point in the history
  • Loading branch information
STYoannZamaron committed Aug 28, 2023
1 parent 7d55cac commit 4a53b10
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 47 deletions.
101 changes: 101 additions & 0 deletions docs/guides/stm32_getting_started_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# STM32 Getting Started Guide

The stm32 platform is a [Matter](https://github.com/project-chip/connectedhomeip)
platform that uses stm32 FreeRTOS SDK.

---

- [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)
- [Factory](#factory)

---

## 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

- [Setup Matter Environment](./BUILDING.md)

- Setup 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.
61 changes: 45 additions & 16 deletions examples/lighting-app/stm32/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,52 @@
- Build the example application:
# Matter STM32 Lighting Example

cd ~/connectedhomeip
./scripts/examples/gn_stm32_example.sh ./examples/bridge-app/stm32/ ./out/bridge-app NUCLEO-H753ZI
This example demonstrates the Matter Lighting application on stm32 platform.

* To delete generated executable, libraries and object files use:
---

$ cd ~/connectedhomeip
$ rm -rf ./out/
- [Matter stm32 Lighting Example](#matter-stm32-lighting-example)
- [Building and Commissioning](#building-and-commissioning)
- [Cluster Control](#cluster-control)
- [Indicate current state of lightbulb](#indicate-current-state-of-lightbulb)

OR use GN/Ninja directly
---

## Building and Commissioning

Please refer
[Building and Commissioning](../../../docs/guides/stm32_getting_started_guide.md#building-the-example-application)
guides to get started

```
./scripts/build/build_examples.py --target stm32-$stm32_BOARD-lighting build
```

## Cluster Control

After successful commissioning, use `chip-tool` to control the board

- OnOff Cluster
```
./chip-tool onoff on <NODE ID> 1
./chip-tool onoff off <NODE ID> 1
./chip-tool onoff toggle <NODE ID> 1
```
- LevelControl Cluster
```
./chip-tool levelcontrol move-to-level 128 10 0 0 <NODE ID> 1
```
- ColorControl Cluster
```
./chip-tool colorcontrol move-to-hue-and-saturation 240 100 0 0 0 <NODE ID> 1
```
## Indicate current state of lightbulb
The LCD screen displays "BLE connected" when the BLE rendezvous started.
The LCD screen displays "Network Join" when the board joins thread network.
The LCD screen displays "LED ON" + the light level when the controller enable the light ON and the line is erased when the controller disable the light.
$ cd ~/connectedhomeip/examples/bridge-app/stm32
$ git submodule update --init
$ source third_party/connectedhomeip/scripts/activate.sh
$ export stm32_BOARD=NUCLEO-H753ZI
$ gn gen out/debug
$ ninja -C out/debug
* To delete generated executable, libraries and object files use:
$ cd ~/connectedhomeip/examples/bridge-app/stm32
$ rm -rf out/
31 changes: 0 additions & 31 deletions third_party/st/README.md

This file was deleted.

0 comments on commit 4a53b10

Please sign in to comment.