Skip to content

Commit

Permalink
[TI] Create and process OTA header (#17556)
Browse files Browse the repository at this point in the history
* add and process the OTA Image header

* add software trip version for first run

* change isFirstRun to be based on the OTA update process and target SW version

* copy header and c style comments

* add gitignore to ti submodule

* add matter_ prefix to ota parameters

fix location of oad hexfile
  • Loading branch information
srickardti authored and pull[bot] committed Jan 30, 2024
1 parent c788d40 commit 6729ffd
Show file tree
Hide file tree
Showing 19 changed files with 278 additions and 162 deletions.
8 changes: 1 addition & 7 deletions examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ project_dir = "${chip_root}/examples/all-clusters-app/cc13x2x7_26x2x7"

ti_simplelink_sdk("sdk") {
include_dirs = [ "${project_dir}/main/include" ]

defines = []
if (is_debug) {
defines += [ "BUILD_RELEASE=0" ]
} else {
defines += [ "BUILD_RELEASE=1" ]
}
public_configs = [ ":all-clusters-app_config" ]
}

ti_sysconfig("sysconfig") {
Expand Down
5 changes: 5 additions & 0 deletions examples/all-clusters-app/cc13x2x7_26x2x7/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ chip_config_network_layer_ble = true
# Disable lock tracking, since our FreeRTOS configuration does not set
# INCLUDE_xSemaphoreGetMutexHolder
chip_stack_lock_tracking = "none"

matter_device_vid = "0xFFF1"
matter_device_pid = "0x8006"
matter_software_ver = "0x0001"
matter_software_ver_str = "1.0d1"
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,6 @@
*/
#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN"

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
*
* 0xFFF1: Test vendor
*/
#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1

/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
*
* 0x8006: example lock app
*/
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8006

/**
* CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
*
Expand All @@ -72,15 +58,13 @@
#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1

/**
* Values set by args.gni:
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
*
* A string identifying the software version running on the device.
* CHIP currently expects the software version to be in the format
* {MAJOR_VERSION}.0d{MINOR_VERSION}
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0d1"
#endif

/**
* CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
*
Expand Down
8 changes: 1 addition & 7 deletions examples/lock-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ project_dir = "${chip_root}/examples/lock-app/cc13x2x7_26x2x7"

ti_simplelink_sdk("sdk") {
include_dirs = [ "${project_dir}/main/include" ]

defines = []
if (is_debug) {
defines += [ "BUILD_RELEASE=0" ]
} else {
defines += [ "BUILD_RELEASE=1" ]
}
public_configs = [ ":lock_app_config" ]
}

ti_sysconfig("sysconfig") {
Expand Down
7 changes: 7 additions & 0 deletions examples/lock-app/cc13x2x7_26x2x7/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ chip_config_network_layer_ble = true
# Disable lock tracking, since our FreeRTOS configuration does not set
# INCLUDE_xSemaphoreGetMutexHolder
chip_stack_lock_tracking = "none"

chip_openthread_ftd = true

matter_device_vid = "0xFFF1"
matter_device_pid = "0x8006"
matter_software_ver = "0x0001"
matter_software_ver_str = "1.0d1"
5 changes: 4 additions & 1 deletion examples/lock-app/cc13x2x7_26x2x7/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ int AppTask::Init()
while (1)
;
}

#if CHIP_DEVICE_CONFIG_THREAD_FTD
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
#else
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif
if (ret != CHIP_NO_ERROR)
{
PLAT_LOG("ConnectivityMgr().SetThreadDeviceType() failed");
Expand Down
28 changes: 7 additions & 21 deletions examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,6 @@
*/
#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN"

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
*
* 0xFFF1: Test vendor
*/
#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1

/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
*
* 0x8006: example lock app
*/
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8006

/**
* CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
*
Expand All @@ -69,18 +55,18 @@
* physical device, a change to its packaging, and/or a change to its marketing presentation.
* This value is generally *not* incremented for device software versions.
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1
#endif

/**
* Values set by args.gni:
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
*
* A string identifying the software version running on the device.
* CHIP currently expects the software version to be in the format
* {MAJOR_VERSION}.0d{MINOR_VERSION}
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0d1"
#endif

/**
* CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
*
Expand Down
8 changes: 1 addition & 7 deletions examples/pump-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@ project_dir = "${chip_root}/examples/pump-app/cc13x2x7_26x2x7"

ti_simplelink_sdk("sdk") {
include_dirs = [ "${project_dir}/main/include" ]

defines = []
if (is_debug) {
defines += [ "BUILD_RELEASE=0" ]
} else {
defines += [ "BUILD_RELEASE=1" ]
}
public_configs = [ ":pump_app_config" ]
}

ti_sysconfig("sysconfig") {
Expand Down
5 changes: 5 additions & 0 deletions examples/pump-app/cc13x2x7_26x2x7/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ chip_config_network_layer_ble = true
# Disable lock tracking, since our FreeRTOS configuration does not set
# INCLUDE_xSemaphoreGetMutexHolder
chip_stack_lock_tracking = "none"

matter_device_vid = "0xFFF1"
matter_device_pid = "0x800A"
matter_software_ver = "0x0001"
matter_software_ver_str = "1.0d1"
34 changes: 5 additions & 29 deletions examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,6 @@
// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS"

/**
* CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER
*
* Enables the use of a hard-coded default serial number if none
* is found in CHIP NV storage.
*/
#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN"

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
*
* 0xFFF1: Test vendor.
*/
#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1

/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
*
* 0x8011: example pump-app
*/
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x800A

/**
* CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
*
Expand All @@ -75,15 +53,13 @@
#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1

/**
* Values set by args.gni:
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
*
* A string identifying the software version running on the device.
* CHIP currently expects the software version to be in the format
* {MAJOR_VERSION}.0d{MINOR_VERSION}
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0d1"
#endif

/**
* CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
*
Expand Down
8 changes: 1 addition & 7 deletions examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ project_dir = "${chip_root}/examples/pump-controller-app/cc13x2x7_26x2x7"

ti_simplelink_sdk("sdk") {
include_dirs = [ "${project_dir}/main/include" ]

defines = []
if (is_debug) {
defines += [ "BUILD_RELEASE=0" ]
} else {
defines += [ "BUILD_RELEASE=1" ]
}
public_configs = [ ":pump_controller_app_config" ]
}

ti_sysconfig("sysconfig") {
Expand Down
5 changes: 5 additions & 0 deletions examples/pump-controller-app/cc13x2x7_26x2x7/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ chip_config_network_layer_ble = true
# Disable lock tracking, since our FreeRTOS configuration does not set
# INCLUDE_xSemaphoreGetMutexHolder
chip_stack_lock_tracking = "none"

matter_device_vid = "0xFFF1"
matter_device_pid = "0x8011"
matter_software_ver = "0x0001"
matter_software_ver_str = "1.0d1"
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,6 @@
// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_PAIRING_CODE "CHIPUS"

/**
* CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER
*
* Enables the use of a hard-coded default serial number if none
* is found in CHIP NV storage.
*/
#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN"

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
*
* 0xFFF1: Test vendor.
*/
#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1

/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
*
* 0x8009: example pump-controller-app
*/
#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8011

/**
* CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
*
Expand All @@ -75,15 +53,13 @@
#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1

/**
* Values set by args.gni:
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
*
* A string identifying the software version running on the device.
* CHIP currently expects the software version to be in the format
* {MAJOR_VERSION}.0d{MINOR_VERSION}
* CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
*/
#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0d1"
#endif

/**
* CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
*
Expand Down
Loading

0 comments on commit 6729ffd

Please sign in to comment.