Skip to content

Commit 0e9ec10

Browse files
srickardtiadabreutirestyled-commits
authored
[cc13x2x7_26x2x7] Fix BLE Provisioning issues for TE#2 (#6152)
* Fix BLE Provisioning issues for TE#2 * Adds default SLAAC configuration to enable final step of BLE provisioning flow with GUA assignment. * Removes unused OpenThread configuration in platform_includes * Addresses runtime issues with BLE provisioning Co-Authored-by: Alexander D'Abreu <[email protected]> * Restyled by gn * Restyled by prettier-markdown * fix ccs programming markdown formatting Code text was not properly quoted. * Restyled by prettier-markdown Co-authored-by: Alexander D'Abreu <[email protected]> Co-authored-by: Restyled.io <[email protected]>
1 parent 60b896d commit 0e9ec10

File tree

9 files changed

+308
-373
lines changed

9 files changed

+308
-373
lines changed

examples/lock-app/cc13x2x7_26x2x7/README.md

+44-10
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ advertisements.
6262
### Preparation
6363

6464
Some initial setup is necessary for preparing the build environment. This
65-
section will need to be done when migrating to new versions of the SDK.
65+
section will need to be done when migrating to new versions of the SDK. This
66+
guide assumes that the environment is linux based, and recommends Ubuntu 20.04.
6667

6768
- An engineering SDK from TI is required. Please request access for it
6869
[here][ti_cc13x2_26x2_r7_chip_request].
@@ -74,8 +75,8 @@ section will need to be done when migrating to new versions of the SDK.
7475
packaged with the TI SDK. Check the following section for a list of
7576
changes needed.
7677

77-
- Download and install [SysConfig][sysconfig]
78-
([sysconfig-1.5.0_1397][sysconfig-1.5.0_1397])
78+
- Download and install [SysConfig][sysconfig] ([recommended
79+
version][sysconfig_recommended])
7980

8081
- This may have already been installed with your SimpleLink SDK install.
8182

@@ -95,11 +96,43 @@ section will need to be done when migrating to new versions of the SDK.
9596
- You will have to ensure that the default version of Python 3 is Python
9697
3.8.
9798
99+
- Check python3 version:
100+
101+
```
102+
$ python3 --version
103+
Python 3.8.0
104+
```
105+
106+
- If it is not Python 3.8:
107+
108+
```
109+
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
110+
```
111+
112+
- This may affect your environment in other ways if there was a
113+
specific dependency on the prior python3 version (e.g. apt).
114+
After completing the build process for this example, you can
115+
revert the python3 version, for instance:
116+
117+
```
118+
$ sudo update-alternatives --config python3
119+
There are 2 choices for the alternative python3 (providing /usr/bin/python3).
120+
121+
Selection Path Priority Status
122+
-------------------------------------------------------------
123+
0 /usr/bin/python3.8 1 auto mode
124+
1 /usr/bin/python3.6 1 manual mode
125+
* 2 /usr/bin/python3.8 1 manual mode
126+
127+
Press <enter> to keep the current choice[*], or type selection number: 1
128+
update-alternatives: using /usr/bin/python3.6 to provide /usr/bin/python3 (python3) in manual mode
129+
```
130+
98131
- Run the bootstrap script to setup the build environment.
99132
100133
```
101134
$ cd ~/connectedhomeip
102-
$ source ./script/bootstrap.sh
135+
$ source ./scripts/bootstrap.sh
103136
104137
```
105138
@@ -112,19 +145,20 @@ Ninja to build the executable.
112145
113146
```
114147
$ cd ~/connectedhomeip
115-
$ source ./script/activate.sh
148+
$ source ./scripts/activate.sh
116149
117150
```
118151
119152
- Run the build to produce a default executable. By default on Linux both the
120153
TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's
121154
home directory, and you must provide the absolute path to them. For example
122155
`/home/username/ti/simplelink_cc13x2_26x2_sdk_4_40_05_02_eng` and
123-
`/home/username/ti/sysconfig_1.6.0`. On Windows the default directory is
124-
`C:\ti`
156+
`/home/username/ti/sysconfig_1.7.0`. On Windows the default directory is
157+
`C:\ti`. Take note of this install path, as it will be used in the next
158+
step.
125159
126160
```
127-
$ cd ~/connectedhomeip/examples/lock-app/cc13x2_26x2
161+
$ cd ~/connectedhomeip/examples/lock-app/cc13x2x7_26x2x7
128162
$ export TI_SIMPLELINK_SDK_ROOT=<path-to-simplelink-sdk>
129163
$ export TI_SYSCONFIG_ROOT=<path-to-sysconfig-sdk>
130164
$ gn gen out/debug --args="ti_simplelink_sdk_root=\"${TI_SIMPLELINK_SDK_ROOT}\" ti_sysconfig_root=\"${TI_SYSCONFIG_ROOT}\""
@@ -223,8 +257,8 @@ Additionally, we welcome any feedback.
223257
[simplelink_sdk_4.30.00.54]:
224258
https://www.ti.com/tool/download/SIMPLELINK-CC13X2-26X2-SDK/4.30.00.54
225259
[sysconfig]: https://www.ti.com/tool/SYSCONFIG
226-
[sysconfig-1.5.0_1397]:
227-
http://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.5.0_1397-setup.run
260+
[sysconfig_recommended]:
261+
https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.7.0_1746-setup.run
228262
[ti_thread_dnd]:
229263
https://www.ti.com/wireless-connectivity/thread/design-development.html
230264
[ti_cc13x2_26x2_r7_chip_request]: https://ti.com/chip_sdk

examples/lock-app/cc13x2x7_26x2x7/doc/programming-ccs.md

+65-65
Original file line numberDiff line numberDiff line change
@@ -15,101 +15,101 @@
1515
Copyright (c) 2008-2019 Texas Instruments Incorporated. All rights reserved.
1616
1717
Scanning USB buses for supported XDS110 devices...
18-
```
1918
20-
<<<< Device 0 >>>>
19+
<<<< Device 0 >>>>
20+
21+
VID: 0x0451 PID: 0xbef3 Device Name: XDS110 Embed with CMSIS-DAP Version:
22+
3.0.0.13 Manufacturer: Texas Instruments Serial Num: L4100652 Mode: Runtime
23+
Configuration: Standard
2124
22-
VID: 0x0451 PID: 0xbef3 Device Name: XDS110 Embed with CMSIS-DAP Version:
23-
3.0.0.13 Manufacturer: Texas Instruments Serial Num: L4100652 Mode: Runtime
24-
Configuration: Standard
25+
Found 1 device.
2526
26-
Found 1 device.
27+
```
2728
28-
```
29-
In this example, my LaunchPad's XDS110 has a serial number of `L4100652`.
29+
In this example, my LaunchPad's XDS110 has a serial number of `L4100652`.
3030
31-
- Start a new Code Composer Studio Workspace. This can be named anything you
32-
would like. But it is recommended that you use a blank workspace.
31+
- Start a new Code Composer Studio Workspace. This can be named anything you
32+
would like. But it is recommended that you use a blank workspace.
3333
34-
![CCS step 1](images/ccs-1.jpg)
34+
![CCS step 1](images/ccs-1.jpg)
3535
36-
- Create a new Target Configuration File by selecting `File` >> `New` >>
37-
`Target Configuration File`. This file can also be exported from UniFlash
38-
with the `download ccxml` function.
36+
- Create a new Target Configuration File by selecting `File` >> `New` >>
37+
`Target Configuration File`. This file can also be exported from UniFlash
38+
with the `download ccxml` function.
3939
40-
![CCS step 2](images/ccs-2.jpg)
40+
![CCS step 2](images/ccs-2.jpg)
4141
42-
- Name the new ccxml file a useful name. Here I use the XDS110 serial number
43-
from before. Leave the Location as the shared location and click `Finish` to
44-
create the file.
42+
- Name the new ccxml file a useful name. Here I use the XDS110 serial number
43+
from before. Leave the Location as the shared location and click `Finish` to
44+
create the file.
4545
46-
![CCS step 3](images/ccs-3.jpg)
46+
![CCS step 3](images/ccs-3.jpg)
4747
48-
- In the new ccxml, select the `Connection` and the `Board or Device`. This may
49-
be different for your setup, but all LaunchPads will use the `Texas
50-
Instruments XDS110 USB Debug Probe` for the target connection. And the and a
51-
`CC1352R1F3` is mounted on the `CC1352R1_LAUNCHXL` LaunchPads. Builds for
52-
other LaunchPads should use the corresponding SoC name.
48+
- In the new ccxml, select the `Connection` and the `Board or Device`. This
49+
may be different for your setup, but all LaunchPads will use the
50+
`Texas Instruments XDS110 USB Debug Probe` for the target connection. And
51+
the and a `CC1352R1F3` is mounted on the `CC1352R1_LAUNCHXL` LaunchPads.
52+
Builds for other LaunchPads should use the corresponding SoC name.
5353
54-
![CCS step 4](images/ccs-4.jpg)
54+
![CCS step 4](images/ccs-4.jpg)
5555
56-
- Now set the XDS110 serial number in the advanced tab of the ccxml. First
57-
select the `Advanced` tab at the bottom of the window. Then select the Debug
58-
Probe in the connection tree. Then select `Select by serial number` in the
59-
`Debug Probe Selection`. Then enter the serial number from `xdsdfu` earlier
60-
in the `Enter the serial number` text field. Finally click `Save` to save
61-
your ccxml.
56+
- Now set the XDS110 serial number in the advanced tab of the ccxml. First
57+
select the `Advanced` tab at the bottom of the window. Then select the Debug
58+
Probe in the connection tree. Then select `Select by serial number` in the
59+
`Debug Probe Selection`. Then enter the serial number from `xdsdfu` earlier
60+
in the `Enter the serial number` text field. Finally click `Save` to save
61+
your ccxml.
6262
63-
![CCS step 5](images/ccs-5.jpg)
63+
![CCS step 5](images/ccs-5.jpg)
6464
65-
- Clicking `Test Connection` with the LaunchPad connected will cause a JTAG
66-
Integrity scan with the Debug Probe. This is a nice way to check that your
67-
ccxml is setup correctly.
65+
- Clicking `Test Connection` with the LaunchPad connected will cause a JTAG
66+
Integrity scan with the Debug Probe. This is a nice way to check that your
67+
ccxml is setup correctly.
6868
69-
![CCS step 6](images/ccs-6.jpg)
69+
![CCS step 6](images/ccs-6.jpg)
7070
71-
- Now open the Debug Configurations dialog to setup a new debug configuration.
72-
Select `Run` >> `Debug Configurations...`.
71+
- Now open the Debug Configurations dialog to setup a new debug configuration.
72+
Select `Run` >> `Debug Configurations...`.
7373
74-
![CCS step 7](images/ccs-7.jpg)
74+
![CCS step 7](images/ccs-7.jpg)
7575
76-
- Create a new launch configuration from the default CCS launch configuration.
77-
Select `Code Composer Studio - Device Debugging` and then create a new launch
78-
configuration with the `New launch configuration` button.
76+
- Create a new launch configuration from the default CCS launch configuration.
77+
Select `Code Composer Studio - Device Debugging` and then create a new
78+
launch configuration with the `New launch configuration` button.
7979
80-
![CCS step 8](images/ccs-8.jpg)
80+
![CCS step 8](images/ccs-8.jpg)
8181
82-
- Name your new configuration. Update the `Target Configuration` field with the
83-
ccxml you created earlier. Click `Apply` to save the launch configuration.
82+
- Name your new configuration. Update the `Target Configuration` field with
83+
the ccxml you created earlier. Click `Apply` to save the launch
84+
configuration.
8485
85-
Once the launch configuration is created you do not need to re-create it
86-
every time. The Debug session can be started with the `Debug` button in the
87-
`Debug Configurations` dialog, or by selecting `Run` >> `Debug History` >>
88-
`<launch configuration name>`.
86+
Once the launch configuration is created you do not need to re-create it
87+
every time. The Debug session can be started with the `Debug` button in the
88+
`Debug Configurations` dialog, or by selecting `Run` >> `Debug History` >>
89+
`<launch configuration name>`.
8990
90-
![CCS step 9](images/ccs-9.jpg)
91+
![CCS step 9](images/ccs-9.jpg)
9192
92-
- Now that the Debug session is started we can connect to the target. Make sure
93-
that the right Debug Probe is selected in the `Debug` window and click
94-
`Connect Target`.
93+
- Now that the Debug session is started we can connect to the target. Make
94+
sure that the right Debug Probe is selected in the `Debug` window and click
95+
`Connect Target`.
9596
96-
![CCS step 9](images/ccs-10.jpg)
97+
![CCS step 9](images/ccs-10.jpg)
9798
98-
- The target MCU is connected. The MCU is halted on connection by default.
99-
Select the `Load Program...` option to select the ELF image to load.
99+
- The target MCU is connected. The MCU is halted on connection by default.
100+
Select the `Load Program...` option to select the ELF image to load.
100101
101-
![CCS step 9](images/ccs-11.jpg)
102+
![CCS step 9](images/ccs-11.jpg)
102103
103-
- Navigate to the ELF file
104-
(`${connectedhomeip}/examples/lock-app/cc13x2_26x2/out/debug/chip-cc13x2_26x2-lock-example.out`
105-
file) in the `Load Program` dialog. Click `OK` to begin loading the target.
104+
- Navigate to the ELF file
105+
(`${connectedhomeip}/examples/lock-app/cc13x2_26x2/out/debug/chip-cc13x2_26x2-lock-example.out`
106+
file) in the `Load Program` dialog. Click `OK` to begin loading the target.
106107
107-
![CCS step 9](images/ccs-12.jpg)
108+
![CCS step 9](images/ccs-12.jpg)
108109
109-
- After loacating the source file for `main.cpp` we can step through the code
110-
as it executes.
110+
- After loacating the source file for `main.cpp` we can step through the code
111+
as it executes.
111112
112-
![CCS step 9](images/ccs-13.jpg)
113+
![CCS step 9](images/ccs-13.jpg)
113114
114115
[ccs]: https://www.ti.com/tool/CCSTUDIO
115-
```

examples/lock-app/cc13x2x7_26x2x7/main/AppTask.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,14 @@ void AppTask::DispatchEvent(AppEvent * aEvent)
329329
// Enable BLE advertisements
330330
if (!ConnectivityMgr().IsBLEAdvertisingEnabled())
331331
{
332-
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
333-
PLAT_LOG("Enabled BLE Advertisements");
332+
if (OpenDefaultPairingWindow(chip::ResetAdmins::kNo) == CHIP_NO_ERROR)
333+
{
334+
PLAT_LOG("Enabled BLE Advertisement");
335+
}
336+
else
337+
{
338+
PLAT_LOG("OpenDefaultPairingWindow() failed");
339+
}
334340
}
335341
}
336342
break;

examples/lock-app/cc13x2x7_26x2x7/main/include/OpenThreadConfig.h

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
#define UART_AS_SERIAL_TRANSPORT 1
5151
#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1
5252

53+
#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1
54+
5355
// Use the TI-supplied default platform configuration for remainder
5456
#include "openthread-core-cc13x2_26x2-config.h"
5557

0 commit comments

Comments
 (0)