Skip to content

Commit

Permalink
Merge branch 'master' into telink_image_update
Browse files Browse the repository at this point in the history
  • Loading branch information
s07641069 authored Oct 20, 2023
2 parents aa0c38a + 690d9a0 commit caf3c0a
Show file tree
Hide file tree
Showing 39 changed files with 59,526 additions and 63,006 deletions.
26 changes: 14 additions & 12 deletions examples/lighting-app/bouffalolab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,31 +80,33 @@ Mac OS.
## Build CHIP Lighting App example
The following steps take examples for `BL602-IoT-Matter-V1` bl602 board, BL706
develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board .
The following steps take examples for `BL602-IoT-Matter-V1` BL602 board,
`BL706DK` BL706 board, and `BL704LDK` BL704L board .
- Build lighting app with UART baudrate 2000000
```
./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light build
./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light build
./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light build
./scripts/build/build_examples.py --target bouffalolab-bl706dk-light build
./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-ethernet build
./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-wifi build
./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light build
```
- Build lighting app with UART baudrate 115200
```
./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light-115200 build
./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light-115200 build
./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-light-115200 build
./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light-light-115200 build
```
- Build lighting app with RPC enabled and UART baudrate 115200.
```
./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light-rpc build
./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light-rpc build
./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-light-rpc build
./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light-light-rpc build
```
### Build options with build_examples.py
Expand Down Expand Up @@ -165,27 +167,27 @@ develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board .
- Type following command for image download. Please set serial port
accordingly, here we use /dev/ttyACM0 as a serial port example.
- `bl602-iot-matter-v1`, `xt-zb6-devkit` and `bl704ldk` without
additional build options
- `bl602-iot-matter-v1`, `bl706dk` and `bl704ldk` without additional
build options
```shell
./out/bouffalolab-bl602-iot-matter-v1-light/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0
./out/bouffalolab-xt-zb6-devkit-light/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0
./out/bouffalolab-bl706dk-light/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0
./out/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0
```
- `xt-zb6-devkit` with 115200 baudrate setting
- `bl706dk` with 115200 baudrate setting
```shell
./out/bouffalolab-xt-zb6-devkit-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0
./out/bouffalolab-bl706dk-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0
```
- To wipe out flash and download image, please append `--erase` to the
above command.
```shell
./out/bouffalolab-bl602-iot-matter-v1-light/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0 --erase
./out/bouffalolab-xt-zb6-devkit-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 --erase
./out/bouffalolab-bl706dk-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 --erase
./out/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0 --erase
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ extern "C" {
#include <hal_boot2.h>
#if CHIP_DEVICE_LAYER_TARGET_BL602
#include <wifi_mgmr_ext.h>
#elif CHIP_DEVICE_LAYER_TARGET_BL702L
#include <bl_flash.h>
#endif

#if CHIP_DEVICE_LAYER_TARGET_BL702L
Expand Down Expand Up @@ -373,9 +375,10 @@ extern "C" void app_init(void)
bl_sys_early_init();

#if CHIP_DEVICE_LAYER_TARGET_BL702L
bl_flash_init();

rom_freertos_init(256, 400);
rom_hal_init();
rom_lmac154_hook_init();
#endif

hosal_uart_init(&uart_stdio);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2874,10 +2874,14 @@ endpoint 1 {
ram attribute currentGroup default = 0x0000;
ram attribute sceneValid default = 0x00;
ram attribute nameSupport;
ram attribute sceneTableSize;
callback attribute remainingCapacity;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 3;
ram attribute sceneTableSize default = 16;
callback attribute remainingCapacity default = 8;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 7;
ram attribute clusterRevision default = 5;

handle command AddScene;
handle command AddSceneResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4332,6 +4332,7 @@
"define": "SCENES_CLUSTER",
"side": "server",
"enabled": 1,
"apiMaturity": "provisional",
"commands": [
{
"name": "AddScene",
Expand Down Expand Up @@ -4529,7 +4530,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "16",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -4545,6 +4546,70 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "8",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AcceptedCommandList",
"code": 65529,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EventList",
"code": 65530,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
Expand All @@ -4561,7 +4626,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"defaultValue": "7",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -4577,7 +4642,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "3",
"defaultValue": "5",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -6057,5 +6122,6 @@
"endpointId": 1,
"networkId": 0
}
]
],
"log": []
}
2 changes: 1 addition & 1 deletion integrations/docker/images/base/chip-build/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21 : [chip-build-java] Ensure java is actually available in the docker image
22 : [Telink] Cleanup Docker image
55 changes: 6 additions & 49 deletions integrations/docker/images/stage-2/chip-build-telink/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,20 @@ ARG VERSION=1
FROM ghcr.io/project-chip/chip-build:${VERSION} as build
LABEL org.opencontainers.image.source https://github.com/project-chip/connectedhomeip

RUN set -x \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
&& : # last line

# Setup toolchain
WORKDIR /opt/telink
RUN set -x \
&& mkdir /opt/telink \
&& cd /opt/telink \
&& wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz \
&& wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/sha256.sum | shasum --check --ignore-missing \
&& curl --location https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz --output zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz \
&& tar xvf zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz \
&& rm -rf zephyr-sdk-0.16.1_linux-x86_64_minimal.tar.xz \
&& cd zephyr-sdk-0.16.1 \
&& ./setup.sh -t riscv64-zephyr-elf -h -c \
&& cd / \
&& zephyr-sdk-0.16.1/setup.sh -t riscv64-zephyr-elf \
&& : # last line

# Setup Zephyr
ARG ZEPHYR_REVISION=5e5f3cfde3fb5070b2e6cfb8ab08bc688b5aa3d4
WORKDIR /opt/telink/zephyrproject
RUN set -x \
&& python3 -m pip install -U --no-cache-dir \
west==1.0.0 \
imgtool==1.7.0 \
&& python3 -m pip install -U --no-cache-dir west \
&& git clone https://github.com/telink-semi/zephyr \
&& cd zephyr \
&& git reset ${ZEPHYR_REVISION} --hard \
Expand All @@ -41,45 +27,16 @@ RUN set -x \
&& : # last line

FROM ghcr.io/project-chip/chip-build:${VERSION}
LABEL org.opencontainers.image.source https://github.com/project-chip/connectedhomeip

COPY --from=build /opt/telink/zephyr-sdk-0.16.1/ /opt/telink/zephyr-sdk-0.16.1/
COPY --from=build /opt/telink/zephyrproject/ /opt/telink/zephyrproject/

ENV ZEPHYR_TOOLCHAIN_VARIANT=zephyr
ENV ZEPHYR_SDK_INSTALL_DIR=/opt/telink/zephyr-sdk-0.16.1

RUN set -x \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \
ccache \
dfu-util=0.9-1 \
device-tree-compiler \
gcc-multilib \
g++-multilib \
libsdl2-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
&& python3 -m pip install -U --no-cache-dir \
pyelftools==0.27 \
&& pip3 install --no-cache-dir --user -r /opt/telink/zephyrproject/zephyr/scripts/requirements.txt \
&& : # last line

# Setup Telink tools required for "west flash"
ARG TELINK_TOOLS_BASE=/opt/telink/tools
RUN wget http://wiki.telink-semi.cn/tools_and_sdk/Tools/IDE/telink_riscv_ice_flash_tool.zip -O /opt/telink/tools.zip \
&& unzip /opt/telink/tools.zip -d ${TELINK_TOOLS_BASE} \
&& rm /opt/telink/tools.zip \
&& mv ${TELINK_TOOLS_BASE}/telink_riscv_linux_toolchain/* ${TELINK_TOOLS_BASE} \
&& rm -rf ${TELINK_TOOLS_BASE}/telink_riscv_linux_toolchain \
&& chmod +x ${TELINK_TOOLS_BASE}/flash/bin/SPI_burn \
&& chmod +x ${TELINK_TOOLS_BASE}/ice/ICEman \
&& : # last line

# Add path to Telink tools
ENV PATH="${TELINK_TOOLS_BASE}/flash/bin:${PATH}"
ENV PATH="${TELINK_TOOLS_BASE}/ice:${PATH}"

ARG ZEPHYR_PROJECT_DIR=/opt/telink/zephyrproject
ENV TELINK_ZEPHYR_BASE=${ZEPHYR_PROJECT_DIR}/zephyr
ENV ZEPHYR_BASE=${ZEPHYR_PROJECT_DIR}/zephyr
ENV TELINK_ZEPHYR_BASE=/opt/telink/zephyrproject/zephyr
ENV TELINK_ZEPHYR_SDK_DIR=/opt/telink/zephyr-sdk-0.16.1
4 changes: 4 additions & 0 deletions scripts/py_matter_idl/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ pw_python_package("matter_idl") {
"matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp",
"matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-ReadImpl.cpp",
"matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-InvokeSubscribeImpl.cpp",
"matter_idl/tests/outputs/several_clusters/java/ChipClusters.java",
"matter_idl/tests/outputs/several_clusters/java/ChipEventStructs.java",
"matter_idl/tests/outputs/several_clusters/java/ChipStructs.java",
"matter_idl/tests/outputs/several_clusters/java/ClusterInfoMapping.java",
"matter_idl/tests/outputs/several_clusters/java/ClusterIDMapping.java",
"matter_idl/tests/outputs/several_clusters/java/ClusterWriteMapping.java",
"matter_idl/tests/outputs/several_clusters/jni/FirstClient-ReadImpl.cpp",
Expand Down
Loading

0 comments on commit caf3c0a

Please sign in to comment.