Skip to content

Commit

Permalink
[TI] CC2674 migration OTA support (#32026)
Browse files Browse the repository at this point in the history
* ota support for cc2674

* Restyled by clang-format

* Restyled by prettier-markdown

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
abiradarti and restyled-commits authored Feb 12, 2024
1 parent bf9c86a commit 7cc357e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 29 deletions.
22 changes: 14 additions & 8 deletions docs/guides/ti/matter_cc2674_migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ project accordingly. Example projects can be found in the following location:
The following must be installed on your system before proceeding:

- [SysConfig](https://www.ti.com/tool/SYSCONFIG) v1.16.2 or later
- [SIMPLELINK-LOWPOWER-F2-SDK](https://www.ti.com/tool/SIMPLELINK-LOWPOWER-SDK)
v7.10.01.24

## Matter source code changes

Expand All @@ -22,12 +20,20 @@ CC2674P10 device

- `examples/[application]/cc13x4_26x4/args.gni`, modify/add the following
defines for the CC2674
- `ti_simplelink_board = CC2674`
- `ti_simplelink_device = CC2674P10RGZ`
- `third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx`, replace this folder
contents with the 7.10.01.24 version from
[TI's downloads page](https://www.ti.com/tool/download/SIMPLELINK-LOWPOWER-F2-SDK/7.10.01.24)
which is required to add support SDK for the CC2674P10 device.
- `ti_simplelink_board = "CC2674"`
- `ti_simplelink_device = "CC2674P10RGZ"`
- `third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx/source/ti/common/flash/no_rtos/extFlash/bsp.h`,
modify the SPI GPIO pins to the value below:

```
#define BSP_IOID_FLASH_CS IOID_20
#define BSP_SPI_MOSI IOID_9
#define BSP_SPI_MISO IOID_8
#define BSP_SPI_CLK_FLASH IOID_10
```

The GPIO pin values for SPI will need to be adjusted based on your design.

## Configuring `chip.syscfg` in the SysConfig GUI

Expand Down
2 changes: 1 addition & 1 deletion third_party/ti_simplelink_sdk/mcuboot/flash_map_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#error "This file must be used with TI_BOOT_USE_EXTERNAL_FLASH enabled"
#endif

#ifdef DeviceFamily_CC13X4
#if defined(DeviceFamily_CC13X4) || defined(DeviceFamily_CC26X4)
#if (MCUBOOT_IMAGE_NUMBER == 2)
#define BOOT_SLOT_1_SIZE 0x0002B000
#define BOOT_SLOT_2_SIZE 0x000CC800
Expand Down
52 changes: 33 additions & 19 deletions third_party/ti_simplelink_sdk/mcuboot/mcuboot.syscfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@
* mcuboot.syscfg
*/


const Board = scripting.addModule("/ti/drivers/Board");
const Button = scripting.addModule("/ti/drivers/apps/Button");
const Button1 = Button.addInstance();
const Button2 = Button.addInstance();
const LED = scripting.addModule("/ti/drivers/apps/LED");
const LED1 = LED.addInstance();
const LED2 = LED.addInstance();

/* ======== Board ======== */
var boardName = system.deviceData.board.name;
const deviceId = system.deviceData.deviceId;

/**
* Import the modules used in this configuration.
Expand All @@ -50,19 +54,19 @@ for(var setting in ccfgSettings)
CCFG[setting] = ccfgSettings[setting];
}

if (boardName.match(/CC13.2.7|CC26.2.7/))
if (deviceId.match(/CC13.2.7|CC26.2.7/))
{
// mcuboot stored at end of flash alongside CCFG
CCFG.setFlashVectorTable = true;
CCFG.addressFlashVectorTable = 0x000AC000;
}
else if (boardName.match(/CC13.4|CC26.[34]/))
else if (deviceId.match(/CC13.4|CC26.[34]/))
{
// mcuboot stored at the beginning of flash
CCFG.setFlashVectorTable = true;
CCFG.addressFlashVectorTable = 0x00000000;
}
else if (boardName.match(/CC23.0/)) {
else if (deviceId.match(/CC23.0/)) {
// Nothing to do. Default pBldrVtor = 0x00000000
}
else
Expand All @@ -73,20 +77,30 @@ else
CCFG.ccfgTemplate.$name = "ti_devices_CCFG_CCFGCC26XXTemplate0";

/* ======== GPIO ======== */
var GPIO = scripting.addModule("/ti/drivers/GPIO");

var gpio0 = GPIO.addInstance();
gpio0.$hardware = system.deviceData.board.components.LED0;
gpio0.$name = "CONFIG_GPIO_LED_0";
Button1.$name = "CONFIG_BTN_LEFT";
if (deviceId.match(/CC2674R/))
{
Button1.button.$assign = "DIO_13";
}
else
{
Button1.button.$assign = "DIO_15";
}
Button1.gpioPin.$name = "CONFIG_GPIO_BTN1";
Button1.gpioPin.pull = "Pull Up";
Button1.gpioPin.interruptTrigger = "Falling Edge";

var gpio1 = GPIO.addInstance();
gpio1.$hardware = system.deviceData.board.components.LED1;
gpio1.$name = "CONFIG_GPIO_LED_1";
Button2.$name = "CONFIG_BTN_RIGHT";
Button2.button.$assign = "DIO_14";
Button2.gpioPin.$name = "CONFIG_GPIO_BTN2";
Button2.gpioPin.pull = "Pull Up";
Button2.gpioPin.interruptTrigger = "Falling Edge";

var gpio2 = GPIO.addInstance();
gpio2.$hardware = system.deviceData.board.components.BUTTON0;
gpio2.$name = "CONFIG_GPIO_BUTTON_0";
LED1.$name = "CONFIG_LED_RED";
LED1.ledPin.$assign = "DIO_6";
LED1.gpioPin.$name = "CONFIG_GPIO_RLED";

var gpio3 = GPIO.addInstance();
gpio3.$hardware = system.deviceData.board.components.BUTTON1;
gpio3.$name = "CONFIG_GPIO_BUTTON_1";
LED2.$name = "CONFIG_LED_GREEN";
LED2.ledPin.$assign = "DIO_7";
LED2.gpioPin.$name = "CONFIG_GPIO_GLED";
2 changes: 1 addition & 1 deletion third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ template("ti_simplelink_sdk") {

defines += [
"ONE_BLE_LIB_SIZE_OPTIMIZATION",
"NVOCMP_NVPAGES=3",
"NVOCMP_NVPAGES=5",
"NVOCMP_NWSAMEITEM=1",
"CC13X2P",
"SYSCFG",
Expand Down

0 comments on commit 7cc357e

Please sign in to comment.