Skip to content

Commit

Permalink
[Telink] Readme files update & Add USB target to CI (#34502)
Browse files Browse the repository at this point in the history
* [Telink] Add USB target to CI

* [Telink] update readme files

* [Telink] fix the unit test
  • Loading branch information
s07641069 authored and pull[bot] committed Aug 21, 2024
1 parent 3c45d7a commit bd2aef0
Show file tree
Hide file tree
Showing 20 changed files with 436 additions and 170 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ jobs:
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B91) Pump App
- name: Build example Telink (B91 USB) Pump App
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump' build"
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump-usb' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d pump-app \
out/telink-tlsr9518adk80d-pump/zephyr/zephyr.elf \
telink tlsr9518adk80d pump-app-usb \
out/telink-tlsr9518adk80d-pump-usb/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
Expand Down
36 changes: 26 additions & 10 deletions examples/air-quality-sensor-app/telink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ You can use this example as a reference for creating your own application.

![Telink B91 EVK](http://wiki.telink-semi.cn/wiki/assets/Hardware/B91_Generic_Starter_Kit_Hardware_Guide/connection_chart.png)

## Supported devices

The example supports building and running on the following devices:

| Board/SoC | Build target | Zephyr Board Info |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| [B91](https://wiki.telink-semi.cn/wiki/Hardware/B91_Generic_Starter_Kit_Hardware_Guide) [TLSR9518ADK80D](https://wiki.telink-semi.cn/wiki/chip-series/TLSR951x-Series) | `tlsr9518adk80d`, `tlsr9518adk80d-mars`, `tlsr9518adk80d-usb` | [TLSR9518ADK80D](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9518adk80d/doc/index.rst) |
| [B92](https://wiki.telink-semi.cn/wiki/Hardware/B92_Generic_Starter_Kit_Hardware_Guide) [TLSR9528A](https://wiki.telink-semi.cn/wiki/chip-series/TLSR952x-Series) | `tlsr9528a`, `tlsr9528a_retention` | [TLSR9528A](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9528a/doc/index.rst) |
| [B95](https://wiki.telink-semi.cn/wiki/Hardware/B95_Generic_Starter_Kit_Hardware_Guide) [TLSR9258A](https://wiki.telink-semi.cn/wiki/chip-series/TLSR925x-Series) | `tlsr9258a` | [TLSR9258A](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9258a/doc/index.rst) |
| [W91](https://wiki.telink-semi.cn/wiki/Hardware/W91_Generic_Starter_Kit_Hardware_Guide) [TLSR9118BDK40D](https://wiki.telink-semi.cn/wiki/chip-series/TLSR911x-Series) | `tlsr9118bdk40d` | [TLSR9118BDK40D](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9118bdk40d/doc/index.rst) |

## Build and flash

1. Run the Docker container:
Expand All @@ -12,7 +23,7 @@ You can use this example as a reference for creating your own application.
$ docker run -it --rm -v $PWD:/host -w /host ghcr.io/project-chip/chip-build-telink:$(wget -q -O - https://raw.githubusercontent.com/project-chip/connectedhomeip/master/.github/workflows/examples-telink.yaml 2> /dev/null | grep chip-build-telink | awk -F: '{print $NF}')
```

Compatible docker image version can be found in next file:
You can find the compatible Docker image version in the file:

```bash
$ .github/workflows/examples-telink.yaml
Expand All @@ -24,8 +35,8 @@ You can use this example as a reference for creating your own application.
$ source ./scripts/activate.sh -p all,telink
```

3. In the example dir run (replace _<build_target>_ with your board name, for
example, `tlsr9118bdk40d`, `tlsr9518adk80d`, `tlsr9528a` or `tlsr9258a`):
3. Build the example (replace _<build_target>_ with your board name, see
[Supported devices](#supported-devices)):

```bash
$ west build -b <build_target>
Expand All @@ -35,9 +46,12 @@ You can use this example as a reference for creating your own application.
MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=4m`:

```bash
$ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m
$ west build -b <build_target> -- -DFLASH_SIZE=4m
```

You can find the target built file called **_zephyr.bin_** under the
**_build/zephyr_** directory.

4. Flash binary:

```
Expand All @@ -56,16 +70,18 @@ To get output from device, connect UART to following pins:
| TX | PB2 (pin 16 of J34 connector) |
| GND | GND |

Baud rate: 115200 bits/s

### Buttons

The following buttons are available on **tlsr9518adk80d** board:

| Name | Function | Description |
| :------- | :--------------------- | :----------------------------------------------------------------------------------------------------- |
| Button 1 | Factory reset | Perform factory reset to forget currently commissioned Thread network and back to uncommissioned state |
| Button 2 | `AirQuality` control | Manually triggers the `AirQuality` state |
| Button 3 | Thread start | Commission thread with static credentials and enables the Thread on device |
| Button 4 | Open commission window | The button is opening commissioning window to perform commissioning over BLE |
| Name | Function | Description |
| :------- | :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ |
| Button 1 | Factory reset | Perform factory reset to forget currently commissioned Thread network and return to a decommissioned state (to activate, push the button 3 times) |
| Button 2 | `AirQuality` control | Manually triggers the `AirQuality` state |
| Button 3 | Thread start | Commission thread with static credentials and enables the Thread on device |
| Button 4 | Open commission window | The button is opening commissioning window to perform commissioning over BLE |

### LEDs

Expand Down
36 changes: 26 additions & 10 deletions examples/all-clusters-app/telink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ creating your own application.

![Telink B91 EVK](http://wiki.telink-semi.cn/wiki/assets/Hardware/B91_Generic_Starter_Kit_Hardware_Guide/connection_chart.png)

## Supported devices

The example supports building and running on the following devices:

| Board/SoC | Build target | Zephyr Board Info |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| [B91](https://wiki.telink-semi.cn/wiki/Hardware/B91_Generic_Starter_Kit_Hardware_Guide) [TLSR9518ADK80D](https://wiki.telink-semi.cn/wiki/chip-series/TLSR951x-Series) | `tlsr9518adk80d`, `tlsr9518adk80d-mars`, `tlsr9518adk80d-usb` | [TLSR9518ADK80D](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9518adk80d/doc/index.rst) |
| [B92](https://wiki.telink-semi.cn/wiki/Hardware/B92_Generic_Starter_Kit_Hardware_Guide) [TLSR9528A](https://wiki.telink-semi.cn/wiki/chip-series/TLSR952x-Series) | `tlsr9528a`, `tlsr9528a_retention` | [TLSR9528A](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9528a/doc/index.rst) |
| [B95](https://wiki.telink-semi.cn/wiki/Hardware/B95_Generic_Starter_Kit_Hardware_Guide) [TLSR9258A](https://wiki.telink-semi.cn/wiki/chip-series/TLSR925x-Series) | `tlsr9258a` | [TLSR9258A](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9258a/doc/index.rst) |
| [W91](https://wiki.telink-semi.cn/wiki/Hardware/W91_Generic_Starter_Kit_Hardware_Guide) [TLSR9118BDK40D](https://wiki.telink-semi.cn/wiki/chip-series/TLSR911x-Series) | `tlsr9118bdk40d` | [TLSR9118BDK40D](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9118bdk40d/doc/index.rst) |

## Build and flash

1. Run the Docker container:
Expand All @@ -14,7 +25,7 @@ creating your own application.
$ docker run -it --rm -v $PWD:/host -w /host ghcr.io/project-chip/chip-build-telink:$(wget -q -O - https://raw.githubusercontent.com/project-chip/connectedhomeip/master/.github/workflows/examples-telink.yaml 2> /dev/null | grep chip-build-telink | awk -F: '{print $NF}')
```

Compatible docker image version can be found in next file:
You can find the compatible Docker image version in the file:

```bash
$ .github/workflows/examples-telink.yaml
Expand All @@ -26,8 +37,8 @@ creating your own application.
$ source ./scripts/activate.sh -p all,telink
```

3. In the example dir run (replace _<build_target>_ with your board name, for
example, `tlsr9118bdk40d`, `tlsr9518adk80d`, `tlsr9528a` or `tlsr9258a`):
3. Build the example (replace _<build_target>_ with your board name, see
[Supported devices](#supported-devices)):

```bash
$ west build -b <build_target>
Expand All @@ -37,9 +48,12 @@ creating your own application.
MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=4m`:

```bash
$ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m
$ west build -b <build_target> -- -DFLASH_SIZE=4m
```

You can find the target built file called **_zephyr.bin_** under the
**_build/zephyr_** directory.

4. Flash binary:

```
Expand All @@ -58,16 +72,18 @@ To get output from device, connect UART to following pins:
| TX | PB2 (pin 16 of J34 connector) |
| GND | GND |

Baud rate: 115200 bits/s

### Buttons

The following buttons are available on **tlsr9518adk80d** board:

| Name | Function | Description |
| :------- | :--------------------- | :----------------------------------------------------------------------------------------------------- |
| Button 1 | Factory reset | Perform factory reset to forget currently commissioned Thread network and back to uncommissioned state |
| Button 2 | Not used | Not used |
| Button 3 | Thread start | Commission thread with static credentials and enables the Thread on device |
| Button 4 | Open commission window | The button is opening commissioning window to perform commissioning over BLE |
| Name | Function | Description |
| :------- | :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ |
| Button 1 | Factory reset | Perform factory reset to forget currently commissioned Thread network and return to a decommissioned state (to activate, push the button 3 times) |
| Button 2 | Not used | Not used |
| Button 3 | Thread start | Commission thread with static credentials and enables the Thread on device |
| Button 4 | Open commission window | The button is opening commissioning window to perform commissioning over BLE |

### LEDs

Expand Down
44 changes: 31 additions & 13 deletions examples/all-clusters-minimal-app/telink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ for creating your own application.

![Telink B91 EVK](http://wiki.telink-semi.cn/wiki/assets/Hardware/B91_Generic_Starter_Kit_Hardware_Guide/connection_chart.png)

## Supported devices

The example supports building and running on the following devices:

| Board/SoC | Build target | Zephyr Board Info |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| [B91](https://wiki.telink-semi.cn/wiki/Hardware/B91_Generic_Starter_Kit_Hardware_Guide) [TLSR9518ADK80D](https://wiki.telink-semi.cn/wiki/chip-series/TLSR951x-Series) | `tlsr9518adk80d`, `tlsr9518adk80d-mars`, `tlsr9518adk80d-usb` | [TLSR9518ADK80D](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9518adk80d/doc/index.rst) |
| [B92](https://wiki.telink-semi.cn/wiki/Hardware/B92_Generic_Starter_Kit_Hardware_Guide) [TLSR9528A](https://wiki.telink-semi.cn/wiki/chip-series/TLSR952x-Series) | `tlsr9528a`, `tlsr9528a_retention` | [TLSR9528A](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9528a/doc/index.rst) |
| [B95](https://wiki.telink-semi.cn/wiki/Hardware/B95_Generic_Starter_Kit_Hardware_Guide) [TLSR9258A](https://wiki.telink-semi.cn/wiki/chip-series/TLSR925x-Series) | `tlsr9258a` | [TLSR9258A](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9258a/doc/index.rst) |
| [W91](https://wiki.telink-semi.cn/wiki/Hardware/W91_Generic_Starter_Kit_Hardware_Guide) [TLSR9118BDK40D](https://wiki.telink-semi.cn/wiki/chip-series/TLSR911x-Series) | `tlsr9118bdk40d` | [TLSR9118BDK40D](https://github.com/telink-semi/zephyr/blob/develop/boards/riscv/tlsr9118bdk40d/doc/index.rst) |

## Build and flash

1. Run the Docker container:
Expand All @@ -14,7 +25,7 @@ for creating your own application.
$ docker run -it --rm -v $PWD:/host -w /host ghcr.io/project-chip/chip-build-telink:$(wget -q -O - https://raw.githubusercontent.com/project-chip/connectedhomeip/master/.github/workflows/examples-telink.yaml 2> /dev/null | grep chip-build-telink | awk -F: '{print $NF}')
```

Compatible docker image version can be found in next file:
You can find the compatible Docker image version in the file:

```bash
$ .github/workflows/examples-telink.yaml
Expand All @@ -26,8 +37,8 @@ for creating your own application.
$ source ./scripts/activate.sh -p all,telink
```

3. In the example dir run (replace _<build_target>_ with your board name, for
example, `tlsr9118bdk40d`, `tlsr9518adk80d`, `tlsr9528a` or `tlsr9258a`):
3. Build the example (replace _<build_target>_ with your board name, see
[Supported devices](#supported-devices)):

```bash
$ west build -b <build_target>
Expand All @@ -37,9 +48,12 @@ for creating your own application.
MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=4m`:

```bash
$ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m
$ west build -b <build_target> -- -DFLASH_SIZE=4m
```

You can find the target built file called **_zephyr.bin_** under the
**_build/zephyr_** directory.

4. Flash binary:

```
Expand All @@ -58,27 +72,31 @@ To get output from device, connect UART to following pins:
| TX | PB2 (pin 16 of J34 connector) |
| GND | GND |

Baud rate: 115200 bits/s

### Buttons

The following buttons are available on **tlsr9518adk80d** board:

| Name | Function | Description |
| :------- | :--------------------- | :----------------------------------------------------------------------------------------------------- |
| Button 1 | Factory reset | Perform factory reset to forget currently commissioned Thread network and back to uncommissioned state |
| Button 2 | Not used | Not used |
| Button 2 | Not used | Not used |
| Button 4 | Open commission window | The button is opening commissioning window to perform commissioning over BLE |
| Name | Function | Description |
| :------- | :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ |
| Button 1 | Factory reset | Perform factory reset to forget currently commissioned Thread network and return to a decommissioned state (to activate, push the button 3 times) |
| Button 2 | Not used | Not used |
| Button 2 | Not used | Not used |
| Button 4 | Open commission window | The button is opening commissioning window to perform commissioning over BLE |

### LEDs

**Red** LED indicates current state of Thread network. It ables to be in
#### Indicate current state of Thread network

**Red** LED indicates current state of Thread network. It is able to be in
following states:

| State | Description |
| :-------------------------- | :--------------------------------------------------------------------------- |
| Blinks with short pulses | Device is not commissioned to Thread, Thread is disabled |
| Blinls with frequent pulses | Device is commissioned, Thread enabled. Device trying to JOIN thread network |
| Blinks with whde pulses | Device commissioned and joined to thread network as CHILD |
| Blinks with frequent pulses | Device is commissioned, Thread enabled. Device trying to JOIN thread network |
| Blinks with wide pulses | Device commissioned and joined to thread network as CHILD |

### CHIP tool commands

Expand Down
Loading

0 comments on commit bd2aef0

Please sign in to comment.