Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Telink]: BLE commissioning (source part) #15723

Merged
merged 38 commits into from
Mar 28, 2022
Merged

[Telink]: BLE commissioning (source part) #15723

merged 38 commits into from
Mar 28, 2022

Conversation

rikorsev
Copy link
Contributor

@rikorsev rikorsev commented Mar 2, 2022

Problem

Currently Zephyr OS does not contain implemented Telink BLE controller yet.
So that, BLE functionality for Matter project is implemented with Telink BLE SDK.
This is Source code part. Docker PR here: #15722
Docker PR shall be merged, built and pushed before This PR merge.
As soon new image will be built, new docker version will be updated in .github/workflows as well

Change overview

  • Add Telink BLE SDK in third_party/telink_sdk
  • Implement BLE functionality for Matter in BLEManagerImpl.cpp
  • Add button and handler to Open Basic commissioning window in AppTask.cpp of lighting-app example
  • Other fixes and cleanups

Testing

Tested manually with chip-tool.
Steps:

  • Run: $ chip-tool pairing ble-thread <...>
  • Wait till success
  • Run: $ chip-tool onoff <...>
  • Check if end device perform command

rikorsev and others added 26 commits March 27, 2022 13:41
…provements

The commit itself is not really stable. It should be definitely cleaned in a future
WARNING: for debug purposes, timeouts in src/platform/DeviceControlServer.cpp and
src/platform/DeviceControlServer.cpp has been hard-coded with bigger value.
The timeouts shall be changed back in the future.
WARNING: This commit shall be reverted before pull request to upstream
@github-actions
Copy link

github-actions bot commented Mar 27, 2022

PR #15723: Size comparison from 58cd5fb to be9519f

Increases above 0.2%:

platform target config section 58cd5fb be9519f change % change
telink lighting-app tlsr9518adk80d noinit 37160 40416 3256 8.8
Increases (1 build for telink)
platform target config section 58cd5fb be9519f change % change
telink lighting-app tlsr9518adk80d noinit 37160 40416 3256 8.8
Decreases (1 build for telink)
platform target config section 58cd5fb be9519f change % change
telink lighting-app tlsr9518adk80d (read/write) 897670 786436 -111234 -12.4
bss 87356 69852 -17504 -20.0
text 635054 557334 -77720 -12.2
Full report (26 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 58cd5fb be9519f change % change
cyw30739 light cyw930739m2evb_01 (read/write) 604818 604818 0 0.0
.app_xip_area 511988 511988 0 0.0
.bss 75576 75576 0 0.0
.data 604 604 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 562630 562630 0 0.0
.app_xip_area 471328 471328 0 0.0
.bss 74080 74080 0 0.0
.data 568 568 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 574890 574890 0 0.0
.app_xip_area 473940 473940 0 0.0
.bss 83408 83408 0 0.0
.data 508 508 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 925760 925760 0 0.0
(read/write) 128712 128712 0 0.0
.bss 126712 126712 0 0.0
.data 1996 1996 0 0.0
.text 925752 925752 0 0.0
BRD4161A+rpc (read only) 954576 954576 0 0.0
(read/write) 144664 144664 0 0.0
.bss 142488 142488 0 0.0
.data 2176 2176 0 0.0
.text 954568 954568 0 0.0
window-app BRD4161A (read only) 855180 855180 0 0.0
(read/write) 126672 126672 0 0.0
.bss 124800 124800 0 0.0
.data 1872 1872 0 0.0
.text 855172 855172 0 0.0
esp32 all-clusters-app c3devkit (read only) 966138 966138 0 0.0
(read/write) 1394306 1394306 0 0.0
.dram0.bss 62000 62000 0 0.0
.dram0.data 14204 14204 0 0.0
.flash.rodata 199192 199192 0 0.0
.flash.text 966138 966138 0 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1022583 1022583 0 0.0
(read/write) 462076 462076 0 0.0
.dram0.bss 67528 67528 0 0.0
.dram0.data 34024 34024 0 0.0
.flash.rodata 228688 228688 0 0.0
.flash.text 1017199 1017199 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 703320 703320 0 0.0
.bss 77568 77568 0 0.0
.data 1876 1876 0 0.0
.text 618076 618076 0 0.0
lock k32w061+release (read/write) 702436 702436 0 0.0
.bss 77544 77544 0 0.0
.data 1916 1916 0 0.0
.text 617176 617176 0 0.0
linux chip-tool-ipv6only arm64 (read only) 9813772 9813772 0 0.0
(read/write) 473697 473697 0 0.0
.bss 40737 40737 0 0.0
.data 1144 1144 0 0.0
.data.rel.ro 372656 372656 0 0.0
.dynamic 560 560 0 0.0
.got 55352 55352 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 493972 493972 0 0.0
.text 8266628 8266628 0 0.0
thermostat-no-ble arm64 (read only) 2273828 2273828 0 0.0
(read/write) 148353 148353 0 0.0
.bss 62801 62801 0 0.0
.data 1040 1040 0 0.0
.data.rel.ro 77000 77000 0 0.0
.dynamic 560 560 0 0.0
.got 4504 4504 0 0.0
.init 24 24 0 0.0
.init_array 360 360 0 0.0
.rodata 139780 139780 0 0.0
.text 1910688 1910688 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2354996 2354996 0 0.0
.bss 184620 184620 0 0.0
.data 5760 5760 0 0.0
.text 1317596 1317596 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1141091 1141091 0 0.0
bss 142500 142500 0 0.0
rodata 142060 142060 0 0.0
text 781660 781660 0 0.0
lighting-app nrf52840dk_nrf52840 (read/write) 1126755 1126755 0 0.0
bss 138956 138956 0 0.0
rodata 118796 118796 0 0.0
text 790472 790472 0 0.0
nrf52840dk_nrf52840+rpc (read/write) 1090499 1090499 0 0.0
bss 139192 139192 0 0.0
rodata 110028 110028 0 0.0
text 762292 762292 0 0.0
nrf52840dongle_nrf52840 (read/write) 1140427 1140427 0 0.0
bss 139940 139940 0 0.0
rodata 118456 118456 0 0.0
text 792536 792536 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 1035522 1035522 0 0.0
bss 136020 136020 0 0.0
rodata 111992 111992 0 0.0
text 705652 705652 0 0.0
lock-app nrf52840dk_nrf52840 (read/write) 1027155 1027155 0 0.0
bss 128904 128904 0 0.0
rodata 111524 111524 0 0.0
text 708296 708296 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 936186 936186 0 0.0
bss 126000 126000 0 0.0
rodata 104776 104776 0 0.0
text 623624 623624 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 1045147 1045147 0 0.0
bss 128816 128816 0 0.0
rodata 113452 113452 0 0.0
text 724372 724372 0 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 1028355 1028355 0 0.0
bss 128564 128564 0 0.0
rodata 110020 110020 0 0.0
text 711272 711272 0 0.0
p6 all-clusters-app default (read/write) 2497544 2497544 0 0.0
.bss 118040 118040 0 0.0
.data 2640 2640 0 0.0
.text 1455808 1455808 0 0.0
light-app default (read/write) 2399976 2399976 0 0.0
.bss 111512 111512 0 0.0
.data 2496 2496 0 0.0
.text 1358240 1358240 0 0.0
lock-app default (read/write) 2363512 2363512 0 0.0
.bss 111256 111256 0 0.0
.data 2456 2456 0 0.0
.text 1321776 1321776 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 897670 786436 -111234 -12.4
bss 87356 69852 -17504 -20.0
noinit 37160 40416 3256 8.8
text 635054 557334 -77720 -12.2

@bzbarsky-apple bzbarsky-apple merged commit c1eef52 into project-chip:master Mar 28, 2022
rochaferraz pushed a commit to rochaferraz/connectedhomeip that referenced this pull request Mar 31, 2022
* [Telink]: Add basic skeleton to integrate Telink SDK

* [Telink]: Rework Telink SDK integration skeleton

* [Telink]: Prepare BLEManagerImpl sceleton for implementation

* [Telink]: BLE advertisement is scanable by chip-device-ctrl tool

* [Telink]: Fix mDNS error occurs on commissioning window opening

* [Telink]: Implement Matter BLE connection

* [Telink]: Remove my_ prefix for GATT variables

* [Telink]: Implement Matter GATT Services

* [Telink]: Fix issue with improper structure alignment

* [Telink]: Implement Rx characteristic write handling

* [Telink]: Implement Matter BLE secure connection

* [Telink]: Move Shutdown implementation to .cpp part

* [Telink]: Add data->is_ready flag to manipulate radio driver state

* [Telink]: Adapt solution for Thread 1.2

* [Telink]: Increase size of CHIP thread stack due to stack overflow issue

* [Telink]: Add board name to CMakeLists.txt

* [Telink]: Add HandleThreadStateChange method to automatic BLE disconnection on Thread provisioning

* [Telink]: Refactoring of SwitchToIeee802154 and other cleanups and improvements

The commit itself is not really stable. It should be definitely cleaned in a future
WARNING: for debug purposes, timeouts in src/platform/DeviceControlServer.cpp and
src/platform/DeviceControlServer.cpp has been hard-coded with bigger value.
The timeouts shall be changed back in the future.

* [Telink]: Fix issue with interrupts disabling after commissioning completion

* [Telink]: Fix issue with memory corruption in _InitStack() method

* [Telink]: Remove debug LED initialization form BLEManagerImpl

* [Telink]: Restore default timeouts

* [Telink]: Add tlsr9518adk80d overlay to setup clock frequency to 96MHz

* [Telink]: Fix issue when Matter GATT characteristics are not discoverable after connection

* [Telink]: Modify default CHIP library timeouts to meet Telink IC timings

WARNING: This commit shall be reverted before pull request to upstream

* [Telink]: Adapt solution for latest Zephyr commit

* [Telink]: Change log level

* [Telink]: Remove unnecessary SwitchToIeee802154

* [Telink]: Fix issue with non-logging of Detail log level

* [Telink]: Fix fail at the end of commissioning

* [Telink]: Cleanups

* [Telink]: Restyled fix

* [Telink]: Update lighting example Readme.md

* [Telink]: Remove unnecessary reboot.h include

* [Telink]: Fix spelling mistakes

* [Telink]: Remove restriction for progress logging

* [Telink]: Add HW cryptography support.

* [Telink]: Update docker image version to 0.5.59

Co-authored-by: Alex Tsitsiura <alex.tsitsiura@telink-semi.com>
Co-authored-by: Andrii Bilynskyi <andriy.bilynskyy@gmail.com>
andrei-menzopol pushed a commit to andrei-menzopol/connectedhomeip that referenced this pull request Apr 14, 2022
* [Telink]: Add basic skeleton to integrate Telink SDK

* [Telink]: Rework Telink SDK integration skeleton

* [Telink]: Prepare BLEManagerImpl sceleton for implementation

* [Telink]: BLE advertisement is scanable by chip-device-ctrl tool

* [Telink]: Fix mDNS error occurs on commissioning window opening

* [Telink]: Implement Matter BLE connection

* [Telink]: Remove my_ prefix for GATT variables

* [Telink]: Implement Matter GATT Services

* [Telink]: Fix issue with improper structure alignment

* [Telink]: Implement Rx characteristic write handling

* [Telink]: Implement Matter BLE secure connection

* [Telink]: Move Shutdown implementation to .cpp part

* [Telink]: Add data->is_ready flag to manipulate radio driver state

* [Telink]: Adapt solution for Thread 1.2

* [Telink]: Increase size of CHIP thread stack due to stack overflow issue

* [Telink]: Add board name to CMakeLists.txt

* [Telink]: Add HandleThreadStateChange method to automatic BLE disconnection on Thread provisioning

* [Telink]: Refactoring of SwitchToIeee802154 and other cleanups and improvements

The commit itself is not really stable. It should be definitely cleaned in a future
WARNING: for debug purposes, timeouts in src/platform/DeviceControlServer.cpp and
src/platform/DeviceControlServer.cpp has been hard-coded with bigger value.
The timeouts shall be changed back in the future.

* [Telink]: Fix issue with interrupts disabling after commissioning completion

* [Telink]: Fix issue with memory corruption in _InitStack() method

* [Telink]: Remove debug LED initialization form BLEManagerImpl

* [Telink]: Restore default timeouts

* [Telink]: Add tlsr9518adk80d overlay to setup clock frequency to 96MHz

* [Telink]: Fix issue when Matter GATT characteristics are not discoverable after connection

* [Telink]: Modify default CHIP library timeouts to meet Telink IC timings

WARNING: This commit shall be reverted before pull request to upstream

* [Telink]: Adapt solution for latest Zephyr commit

* [Telink]: Change log level

* [Telink]: Remove unnecessary SwitchToIeee802154

* [Telink]: Fix issue with non-logging of Detail log level

* [Telink]: Fix fail at the end of commissioning

* [Telink]: Cleanups

* [Telink]: Restyled fix

* [Telink]: Update lighting example Readme.md

* [Telink]: Remove unnecessary reboot.h include

* [Telink]: Fix spelling mistakes

* [Telink]: Remove restriction for progress logging

* [Telink]: Add HW cryptography support.

* [Telink]: Update docker image version to 0.5.59

Co-authored-by: Alex Tsitsiura <alex.tsitsiura@telink-semi.com>
Co-authored-by: Andrii Bilynskyi <andriy.bilynskyy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants