Skip to content

Commit

Permalink
[cc13x2x7_26x2x7] Fix BLE Provisioning issues for TE#2 (project-chip#…
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
3 people authored Apr 21, 2021
1 parent 60b896d commit 0e9ec10
Show file tree
Hide file tree
Showing 9 changed files with 308 additions and 373 deletions.
54 changes: 44 additions & 10 deletions examples/lock-app/cc13x2x7_26x2x7/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ advertisements.
### Preparation

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

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

- Download and install [SysConfig][sysconfig]
([sysconfig-1.5.0_1397][sysconfig-1.5.0_1397])
- Download and install [SysConfig][sysconfig] ([recommended
version][sysconfig_recommended])

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

Expand All @@ -95,11 +96,43 @@ section will need to be done when migrating to new versions of the SDK.
- You will have to ensure that the default version of Python 3 is Python
3.8.
- Check python3 version:
```
$ python3 --version
Python 3.8.0
```
- If it is not Python 3.8:
```
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
```
- This may affect your environment in other ways if there was a
specific dependency on the prior python3 version (e.g. apt).
After completing the build process for this example, you can
revert the python3 version, for instance:
```
$ sudo update-alternatives --config python3
There are 2 choices for the alternative python3 (providing /usr/bin/python3).
Selection Path Priority Status
-------------------------------------------------------------
0 /usr/bin/python3.8 1 auto mode
1 /usr/bin/python3.6 1 manual mode
* 2 /usr/bin/python3.8 1 manual mode
Press <enter> to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/bin/python3.6 to provide /usr/bin/python3 (python3) in manual mode
```
- Run the bootstrap script to setup the build environment.
```
$ cd ~/connectedhomeip
$ source ./script/bootstrap.sh
$ source ./scripts/bootstrap.sh
```
Expand All @@ -112,19 +145,20 @@ Ninja to build the executable.
```
$ cd ~/connectedhomeip
$ source ./script/activate.sh
$ source ./scripts/activate.sh
```
- Run the build to produce a default executable. By default on Linux both the
TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's
home directory, and you must provide the absolute path to them. For example
`/home/username/ti/simplelink_cc13x2_26x2_sdk_4_40_05_02_eng` and
`/home/username/ti/sysconfig_1.6.0`. On Windows the default directory is
`C:\ti`
`/home/username/ti/sysconfig_1.7.0`. On Windows the default directory is
`C:\ti`. Take note of this install path, as it will be used in the next
step.
```
$ cd ~/connectedhomeip/examples/lock-app/cc13x2_26x2
$ cd ~/connectedhomeip/examples/lock-app/cc13x2x7_26x2x7
$ export TI_SIMPLELINK_SDK_ROOT=<path-to-simplelink-sdk>
$ export TI_SYSCONFIG_ROOT=<path-to-sysconfig-sdk>
$ gn gen out/debug --args="ti_simplelink_sdk_root=\"${TI_SIMPLELINK_SDK_ROOT}\" ti_sysconfig_root=\"${TI_SYSCONFIG_ROOT}\""
Expand Down Expand Up @@ -223,8 +257,8 @@ Additionally, we welcome any feedback.
[simplelink_sdk_4.30.00.54]:
https://www.ti.com/tool/download/SIMPLELINK-CC13X2-26X2-SDK/4.30.00.54
[sysconfig]: https://www.ti.com/tool/SYSCONFIG
[sysconfig-1.5.0_1397]:
http://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.5.0_1397-setup.run
[sysconfig_recommended]:
https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.7.0_1746-setup.run
[ti_thread_dnd]:
https://www.ti.com/wireless-connectivity/thread/design-development.html
[ti_cc13x2_26x2_r7_chip_request]: https://ti.com/chip_sdk
Expand Down
130 changes: 65 additions & 65 deletions examples/lock-app/cc13x2x7_26x2x7/doc/programming-ccs.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,101 +15,101 @@
Copyright (c) 2008-2019 Texas Instruments Incorporated. All rights reserved.
Scanning USB buses for supported XDS110 devices...
```
<<<< Device 0 >>>>
<<<< Device 0 >>>>
VID: 0x0451 PID: 0xbef3 Device Name: XDS110 Embed with CMSIS-DAP Version:
3.0.0.13 Manufacturer: Texas Instruments Serial Num: L4100652 Mode: Runtime
Configuration: Standard
VID: 0x0451 PID: 0xbef3 Device Name: XDS110 Embed with CMSIS-DAP Version:
3.0.0.13 Manufacturer: Texas Instruments Serial Num: L4100652 Mode: Runtime
Configuration: Standard
Found 1 device.
Found 1 device.
```
```
In this example, my LaunchPad's XDS110 has a serial number of `L4100652`.
In this example, my LaunchPad's XDS110 has a serial number of `L4100652`.
- Start a new Code Composer Studio Workspace. This can be named anything you
would like. But it is recommended that you use a blank workspace.
- Start a new Code Composer Studio Workspace. This can be named anything you
would like. But it is recommended that you use a blank workspace.
![CCS step 1](images/ccs-1.jpg)
![CCS step 1](images/ccs-1.jpg)
- Create a new Target Configuration File by selecting `File` >> `New` >>
`Target Configuration File`. This file can also be exported from UniFlash
with the `download ccxml` function.
- Create a new Target Configuration File by selecting `File` >> `New` >>
`Target Configuration File`. This file can also be exported from UniFlash
with the `download ccxml` function.
![CCS step 2](images/ccs-2.jpg)
![CCS step 2](images/ccs-2.jpg)
- Name the new ccxml file a useful name. Here I use the XDS110 serial number
from before. Leave the Location as the shared location and click `Finish` to
create the file.
- Name the new ccxml file a useful name. Here I use the XDS110 serial number
from before. Leave the Location as the shared location and click `Finish` to
create the file.
![CCS step 3](images/ccs-3.jpg)
![CCS step 3](images/ccs-3.jpg)
- In the new ccxml, select the `Connection` and the `Board or Device`. This may
be different for your setup, but all LaunchPads will use the `Texas
Instruments XDS110 USB Debug Probe` for the target connection. And the and a
`CC1352R1F3` is mounted on the `CC1352R1_LAUNCHXL` LaunchPads. Builds for
other LaunchPads should use the corresponding SoC name.
- In the new ccxml, select the `Connection` and the `Board or Device`. This
may be different for your setup, but all LaunchPads will use the
`Texas Instruments XDS110 USB Debug Probe` for the target connection. And
the and a `CC1352R1F3` is mounted on the `CC1352R1_LAUNCHXL` LaunchPads.
Builds for other LaunchPads should use the corresponding SoC name.
![CCS step 4](images/ccs-4.jpg)
![CCS step 4](images/ccs-4.jpg)
- Now set the XDS110 serial number in the advanced tab of the ccxml. First
select the `Advanced` tab at the bottom of the window. Then select the Debug
Probe in the connection tree. Then select `Select by serial number` in the
`Debug Probe Selection`. Then enter the serial number from `xdsdfu` earlier
in the `Enter the serial number` text field. Finally click `Save` to save
your ccxml.
- Now set the XDS110 serial number in the advanced tab of the ccxml. First
select the `Advanced` tab at the bottom of the window. Then select the Debug
Probe in the connection tree. Then select `Select by serial number` in the
`Debug Probe Selection`. Then enter the serial number from `xdsdfu` earlier
in the `Enter the serial number` text field. Finally click `Save` to save
your ccxml.
![CCS step 5](images/ccs-5.jpg)
![CCS step 5](images/ccs-5.jpg)
- Clicking `Test Connection` with the LaunchPad connected will cause a JTAG
Integrity scan with the Debug Probe. This is a nice way to check that your
ccxml is setup correctly.
- Clicking `Test Connection` with the LaunchPad connected will cause a JTAG
Integrity scan with the Debug Probe. This is a nice way to check that your
ccxml is setup correctly.
![CCS step 6](images/ccs-6.jpg)
![CCS step 6](images/ccs-6.jpg)
- Now open the Debug Configurations dialog to setup a new debug configuration.
Select `Run` >> `Debug Configurations...`.
- Now open the Debug Configurations dialog to setup a new debug configuration.
Select `Run` >> `Debug Configurations...`.
![CCS step 7](images/ccs-7.jpg)
![CCS step 7](images/ccs-7.jpg)
- Create a new launch configuration from the default CCS launch configuration.
Select `Code Composer Studio - Device Debugging` and then create a new launch
configuration with the `New launch configuration` button.
- Create a new launch configuration from the default CCS launch configuration.
Select `Code Composer Studio - Device Debugging` and then create a new
launch configuration with the `New launch configuration` button.
![CCS step 8](images/ccs-8.jpg)
![CCS step 8](images/ccs-8.jpg)
- Name your new configuration. Update the `Target Configuration` field with the
ccxml you created earlier. Click `Apply` to save the launch configuration.
- Name your new configuration. Update the `Target Configuration` field with
the ccxml you created earlier. Click `Apply` to save the launch
configuration.
Once the launch configuration is created you do not need to re-create it
every time. The Debug session can be started with the `Debug` button in the
`Debug Configurations` dialog, or by selecting `Run` >> `Debug History` >>
`<launch configuration name>`.
Once the launch configuration is created you do not need to re-create it
every time. The Debug session can be started with the `Debug` button in the
`Debug Configurations` dialog, or by selecting `Run` >> `Debug History` >>
`<launch configuration name>`.
![CCS step 9](images/ccs-9.jpg)
![CCS step 9](images/ccs-9.jpg)
- Now that the Debug session is started we can connect to the target. Make sure
that the right Debug Probe is selected in the `Debug` window and click
`Connect Target`.
- Now that the Debug session is started we can connect to the target. Make
sure that the right Debug Probe is selected in the `Debug` window and click
`Connect Target`.
![CCS step 9](images/ccs-10.jpg)
![CCS step 9](images/ccs-10.jpg)
- The target MCU is connected. The MCU is halted on connection by default.
Select the `Load Program...` option to select the ELF image to load.
- The target MCU is connected. The MCU is halted on connection by default.
Select the `Load Program...` option to select the ELF image to load.
![CCS step 9](images/ccs-11.jpg)
![CCS step 9](images/ccs-11.jpg)
- Navigate to the ELF file
(`${connectedhomeip}/examples/lock-app/cc13x2_26x2/out/debug/chip-cc13x2_26x2-lock-example.out`
file) in the `Load Program` dialog. Click `OK` to begin loading the target.
- Navigate to the ELF file
(`${connectedhomeip}/examples/lock-app/cc13x2_26x2/out/debug/chip-cc13x2_26x2-lock-example.out`
file) in the `Load Program` dialog. Click `OK` to begin loading the target.
![CCS step 9](images/ccs-12.jpg)
![CCS step 9](images/ccs-12.jpg)
- After loacating the source file for `main.cpp` we can step through the code
as it executes.
- After loacating the source file for `main.cpp` we can step through the code
as it executes.
![CCS step 9](images/ccs-13.jpg)
![CCS step 9](images/ccs-13.jpg)
[ccs]: https://www.ti.com/tool/CCSTUDIO
```
10 changes: 8 additions & 2 deletions examples/lock-app/cc13x2x7_26x2x7/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,14 @@ void AppTask::DispatchEvent(AppEvent * aEvent)
// Enable BLE advertisements
if (!ConnectivityMgr().IsBLEAdvertisingEnabled())
{
ConnectivityMgr().SetBLEAdvertisingEnabled(true);
PLAT_LOG("Enabled BLE Advertisements");
if (OpenDefaultPairingWindow(chip::ResetAdmins::kNo) == CHIP_NO_ERROR)
{
PLAT_LOG("Enabled BLE Advertisement");
}
else
{
PLAT_LOG("OpenDefaultPairingWindow() failed");
}
}
}
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
#define UART_AS_SERIAL_TRANSPORT 1
#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1

#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1

// Use the TI-supplied default platform configuration for remainder
#include "openthread-core-cc13x2_26x2-config.h"

Expand Down
Loading

0 comments on commit 0e9ec10

Please sign in to comment.