Skip to content

Commit

Permalink
[cc26x2x7] Update build to match new OpenThread version (#7379)
Browse files Browse the repository at this point in the history
* Update build to match new OpenThread version

Fixes c pre-processor token difference with the current version of OpenThread.
Removes dependency on CLI library and UART code. Modifies documentation for
programming with CCS and UniFlash to point to public User's Guide.

* Restyled by clang-format

* Restyled by prettier-markdown

* clean up platform config

Removed unnecssary defines and fixed some spelling issues.

Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
2 people authored and pull[bot] committed Jun 18, 2021
1 parent b5a29d3 commit 3450730
Show file tree
Hide file tree
Showing 24 changed files with 73 additions and 221 deletions.
2 changes: 1 addition & 1 deletion examples/lock-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ti_simplelink_executable("lock_app") {
":sysconfig",
"${chip_root}/examples/lock-app/lock-common",
"${chip_root}/src/lib",
"${openthread_root}:libopenthread-cli-ftd",
"${openthread_root}:libopenthread-ftd",
]

include_dirs = [
Expand Down
109 changes: 71 additions & 38 deletions examples/lock-app/cc13x2x7_26x2x7/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ CC13X2_26X2 family of Wireless MCUs.
- [Preparation](#preparation)
- [Compilation](#compilation)
- [Programming](#programming)
- [UniFlash](#uniflash)
- [Code Composer Studio](#code-composer-studio)
- [UniFlash](#uniflash)
- [Viewing Logging Output](#viewing-logging-output)
- [Running the Example](#running-the-example)
- [Provisioning](#provisioning)
Expand Down Expand Up @@ -159,8 +159,8 @@ Ninja to build the executable.

```
$ cd ~/connectedhomeip/examples/lock-app/cc13x2x7_26x2x7
$ export TI_SIMPLELINK_SDK_ROOT=<path-to-simplelink-sdk>
$ export TI_SYSCONFIG_ROOT=<path-to-sysconfig-sdk>
$ export TI_SIMPLELINK_SDK_ROOT=$HOME/ti/simplelink_cc13x2_26x2_sdk_4_40_05_02_eng
$ export TI_SYSCONFIG_ROOT=$HOME/ti/sysconfig_1.7.0
$ gn gen out/debug --args="ti_simplelink_sdk_root=\"${TI_SIMPLELINK_SDK_ROOT}\" ti_sysconfig_root=\"${TI_SYSCONFIG_ROOT}\""
$ ninja -C out/debug
Expand All @@ -172,13 +172,63 @@ Loading the built image onto a LaunchPad is supported through two methods;
Uniflash and Code Composer Studio (CCS). UniFlash can be used to load the image.
Code Composer Studio can be used to load the image and debug the source code.

### Code Composer Studio

Programming with CCS will allow for a full debug environment within the IDE.
This is accomplished by creating a target connection to the XDS110 debugger and
starting a project-less debug session. The CCS IDE will attempt to find the
source files on the local machine based on the debug information embedded within
the ELF. CCS may prompt you to find the source code if the image was built on
another machine or the source code is located in a different location than is
recorded within the ELF.

Download and install [Code Composer Studio][ccs].

First open CCS and create a new workspace.

Create a target connection (sometimes called the CCXML) for your target SoC and
debugger as described in the [Manual Method][ccs_manual_method] section of the
CCS User's Guide.

Next initiate a project-less debug session as described in the [Manual
Launch][ccs_manual_launch] section of the CCS User's Guide.

CCS should switch to the debug view described in the [After
Launch][ccs_after_launch] section of the User's Guide. The SoC core will likely
be disconnected and symbols will not be loaded. Connect to the core as described
in the [Debug View][ccs_debug_view] section of the User's Guide. Once the core
is connected, use the `Load` button on the toolbar to load the ELF image.

Note that the default configuration of the CCXML uses 2-wire cJTAG instead of
the full 4-wire JTAG connection to match the default jumper configuration of the
LaunchPad.

### UniFlash

[Programming UniFlash](doc/programming-uniflash.md)
Uniflash is Texas Instrument's uniform programming tool for embedded processors.
This will allow you to erase, flash, and inspect the SoC without setting up a
debugging environment.

### Code Composer Studio
Download and install [UniFlash][uniflash].

First open UniFlash. Debug probes connected to the computer will usually be
displayed under the Detected Devices due to the automatic device detection
feature. If your device does not show up in this view it my be disconnected, or
you may have to create a New Configuration. If you already have a CCXML for your
SoC and debug connection you can use that in the section at the bottom. Once
your device is selected, click the `Start` button within the section to launch
the session.

Select the ELF image to load on the device with the `Browse` button. This file
is placed in the `out/debug` folder by this guide and ends with the `*.out` file
extension.

[Programming and Debugging with CCS](doc/programming-ccs.md)
Finally click the `Load Image` button to load the executable image onto the
device. You should be able to see the log output over the XDS110 User UART.

Note that programming the device through JTAG sets the Halt-in-Boot flag and may
cause issues when performing a software reset. This flag can be reset by
power-cycling the LaunchPad.

## Viewing Logging Output

Expand Down Expand Up @@ -215,42 +265,26 @@ fully provisioned, BLE advertising will stop.

#### Bluetooth LE Rendezvous

In this example, the provisioning procedure (called Rendezvous) is done over
Bluetooth LE between a CHIP device (lock-app) and the CHIP controller
(CHIPTool), where the controller has the commissioner role.

To start the rendezvous, the controller must get the commissioning information
from the CHIP device.

This is done by scanning a QR code. A URL will be displayed on the lock-app's
log ([UART terminal](#viewing-logging-output)). It will look like the following:

```
SetupQRCode: [CH:.81TM -00 0C9SS0]
Copy/paste the below URL in a browser to see the QR Code:
https://dhrishi.github.io/connectedhomeip/qrcode.html?data=CH%3A.81TM%20-00%200C9SS0
```

You can directly navigate to the webpage URL displayed (which has QR payload
pre-loaded). Alternatively, you can navigate to [the QR code
generator][qr_code_generator] and enter in the payload shown in `SetupQRCode`
(in this case `CH:.81TM -00 0C9SS0`).

### CHIP Remote Commands

Once the CHIP device is provisioned and operating on the network, CHIPTool can
be used to control the device. During the provisioning process, the CHIP device
would have sent one of its newly assigned IPv6 addresses to the CHIPTool.

In the app, you should see an On/Off cluster; this corresponds to the lock-app.
You can now control the lock-app CHIP device from the smartphone!
To commission and control this application wtihin a CHIP-eanbled Thread network,
consult the [CHIPTool README](../../../src/android/CHIPTool/README.md) for
information on the Android smartphone application. Reference the Device
Configuration information printed in the Logging Output of this application.

## TI Support

For technical support, please consider creating a post on TI's [E2E forum][e2e].
Additionally, we welcome any feedback.

[chip]: https://github.com/project-chip/connectedhomeip
[ccs]: https://www.ti.com/tool/CCSTUDIO
[ccs_after_launch]:
https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#after-launch
[ccs_debug_view]:
https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#debug-view
[ccs_manual_launch]:
https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#manual-launch
[ccs_manual_method]:
https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#manual-method
[cc1352r1_launchxl]: https://www.ti.com/tool/LAUNCHXL-CC1352R1
[e2e]: https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread
[simplelink_sdk]: https://www.ti.com/tool/SIMPLELINK-CC13X2-26X2-SDK
Expand All @@ -262,6 +296,5 @@ Additionally, we welcome any feedback.
[ti_thread_dnd]:
https://www.ti.com/wireless-connectivity/thread/design-development.html
[ti_cc13x2_26x2_r7_chip_request]: https://ti.com/chip_sdk
[ot_border_router_setup]:
https://openthread.io/guides/border-router/beaglebone-black
[qr_code_generator]: https://dhrishi.github.io/connectedhomeip/qrcode.html
[ot_border_router_setup]: https://openthread.io/guides/border-router/build
[uniflash]: https://www.ti.com/tool/download/UNIFLASH
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
115 changes: 0 additions & 115 deletions examples/lock-app/cc13x2x7_26x2x7/doc/programming-ccs.md

This file was deleted.

23 changes: 0 additions & 23 deletions examples/lock-app/cc13x2x7_26x2x7/doc/programming-uniflash.md

This file was deleted.

16 changes: 0 additions & 16 deletions src/platform/cc13x2_26x2/ThreadStackManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,6 @@ void ThreadStackManagerImpl::_ProcMessage(otInstance * aInstance)
break;
}

case procQueueCmd_uart: {
platformUartProcess(procMsg.arg);
break;
}

case procQueueCmd_random: {
platformRandomProcess();
break;
Expand Down Expand Up @@ -199,17 +194,6 @@ extern "C" void platformRadioSignal(uintptr_t arg)
ThreadStackMgrImpl()._SendProcMessage(msg);
}

/**
* Glue function called by UART processing layer to notify OpenThread the driver needs processing.
*/
extern "C" void platformUartSignal(uintptr_t arg)
{
ThreadStackManagerImpl::procQueueMsg msg;
msg.cmd = ThreadStackManagerImpl::procQueueCmd_uart;
msg.arg = arg;
ThreadStackMgrImpl()._SendProcMessage(msg);
}

/**
* Glue function called directly by the OpenThread stack when tasklet processing work
* is pending.
Expand Down
28 changes: 1 addition & 27 deletions src/platform/cc13x2_26x2/openthread-core-cc13x2_26x2-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,5 @@

#pragma once

/**
* @def OPENTHREAD_CONFIG_PLATFORM_INFO
*
* The platform-specific string to insert into the OpenThread version string.
*
*/
#define OPENTHREAD_CONFIG_PLATFORM_INFO "CC1352"

/**
* @def OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE
*
* Define to 1 to enable otPlatFlash* APIs to support non-volatile storage.
*
* When defined to 1, the platform MUST implement the otPlatFlash* APIs instead of the otPlatSettings* APIs.
*
*/
#define OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE 0

/**
* @def OPENTHREAD_CONFIG_NCP_UART_ENABLE
*
* Define to 1 to enable NCP UART support.
*
*/
#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 0

/* reduced to fit in SRAM */
/* Number of message buffers reduced to fit into CC26x2x3 RAM */
#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 22
1 change: 0 additions & 1 deletion third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ template("ti_simplelink_sdk") {
"${ti_simplelink_sdk_root}/examples/rtos/${ti_simplelink_board}/thread/${openthread_example}/platform/radio.c",
"${ti_simplelink_sdk_root}/examples/rtos/${ti_simplelink_board}/thread/${openthread_example}/platform/settings.c",
"${ti_simplelink_sdk_root}/examples/rtos/${ti_simplelink_board}/thread/${openthread_example}/platform/system.c",
"${ti_simplelink_sdk_root}/examples/rtos/${ti_simplelink_board}/thread/${openthread_example}/platform/uart.c",
]

public_configs = [
Expand Down

0 comments on commit 3450730

Please sign in to comment.