Skip to content

Commit

Permalink
[TI] CC13x4_26x4 build fixes (#34682)
Browse files Browse the repository at this point in the history
* lwip pbuf, map file, and hex creation when OTA is disabled

* added cc13x4 family define around the non OTA hex creation

* whitespace fix

* reversed custom factoy data flash with cc13x4 check

* more whitespace fixes
  • Loading branch information
abiradarti authored and pull[bot] committed Oct 2, 2024
1 parent ff87cf2 commit 4333670
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/all-clusters-app/cc13x4_26x4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Ninja to build the executable.
to the GN call.
```
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]"
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true"
```
## Programming
Expand Down
8 changes: 7 additions & 1 deletion examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ AppTask AppTask::sAppTask;

constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void StartTimer(uint32_t aTimeoutMs);
void CancelTimer(void);
#endif

uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff };
Expand All @@ -100,9 +102,9 @@ void InitializeOTARequestor(void)
sDownloader.SetImageProcessorDelegate(&sImageProcessor);
sRequestorUser.Init(&sRequestorCore, &sImageProcessor);
}
#endif

TimerHandle_t sOTAInitTimer = 0;
#endif

// The OTA Init Timer is only started upon the first Thread State Change
// detected if the device is already on a Thread Network, or during the AppTask
Expand Down Expand Up @@ -176,10 +178,12 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg)
#endif
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void OTAInitTimerEventHandler(TimerHandle_t xTimer)
{
InitializeOTARequestor();
}
#endif

int AppTask::StartAppTask()
{
Expand Down Expand Up @@ -224,6 +228,7 @@ int AppTask::Init()
;
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
// Create FreeRTOS sw timer for OTA timer.
sOTAInitTimer = xTimerCreate("OTAInitTmr", // Just a text name, not used by the RTOS kernel
OTAREQUESTOR_INIT_TIMER_DELAY_MS, // timer period (mS)
Expand All @@ -240,6 +245,7 @@ int AppTask::Init()
{
PLAT_LOG("sOTAInitTimer timer created successfully ");
}
#endif

ret = ThreadStackMgr().InitThreadStack();
if (ret != CHIP_NO_ERROR)
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/cc13x4_26x4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Ninja to build the executable.
to the GN call.
```
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]"
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true"
```
## Programming
Expand Down
8 changes: 7 additions & 1 deletion examples/lighting-app/cc13x4_26x4/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ void InitializeOTARequestor(void)
sDownloader.SetImageProcessorDelegate(&sImageProcessor);
sRequestorUser.Init(&sRequestorCore, &sImageProcessor);
}
#endif

TimerHandle_t sOTAInitTimer = 0;
#endif

// The OTA Init Timer is only started upon the first Thread State Change
// detected if the device is already on a Thread Network, or during the AppTask
Expand Down Expand Up @@ -215,10 +215,12 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg)
}
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void OTAInitTimerEventHandler(TimerHandle_t xTimer)
{
InitializeOTARequestor();
}
#endif

int AppTask::Init()
{
Expand All @@ -239,6 +241,7 @@ int AppTask::Init()
;
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
// Create FreeRTOS sw timer for OTA timer.
sOTAInitTimer = xTimerCreate("OTAInitTmr", // Just a text name, not used by the RTOS kernel
OTAREQUESTOR_INIT_TIMER_DELAY_MS, // timer period (mS)
Expand All @@ -255,6 +258,7 @@ int AppTask::Init()
{
PLAT_LOG("sOTAInitTimer timer created successfully ");
}
#endif

ret = ThreadStackMgr().InitThreadStack();
if (ret != CHIP_NO_ERROR)
Expand Down Expand Up @@ -371,6 +375,7 @@ void AppTask::AppTaskMain(void * pvParameter)
}
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void StartTimer(uint32_t aTimeoutMs)
{
PLAT_LOG("Start OTA Init Timer")
Expand All @@ -396,6 +401,7 @@ void CancelTimer(void)
PLAT_LOG("sOTAInitTimer stop() failed");
}
}
#endif

void AppTask::ActionInitiated(LightingManager::Action_t aAction, int32_t aActor)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/cc13x4_26x4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Ninja to build the executable.
to the GN call.
```
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]"
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true"
```
## Programming
Expand Down
11 changes: 10 additions & 1 deletion examples/lock-app/cc13x4_26x4/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ void uiLocked(void);
void uiUnlocking(void);
void uiUnlocked(void);

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void StartTimer(uint32_t aTimeoutMs);
void CancelTimer(void);
#endif

uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff };
Expand All @@ -118,10 +120,11 @@ void InitializeOTARequestor(void)
sDownloader.SetImageProcessorDelegate(&sImageProcessor);
sRequestorUser.Init(&sRequestorCore, &sImageProcessor);
}
#endif

TimerHandle_t sOTAInitTimer = 0;

#endif

// The OTA Init Timer is only started upon the first Thread State Change
// detected if the device is already on a Thread Network, or during the AppTask
// Init sequence if the device is not yet on a Thread Network. Once the timer
Expand Down Expand Up @@ -207,10 +210,12 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg)
}
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void OTAInitTimerEventHandler(TimerHandle_t xTimer)
{
InitializeOTARequestor();
}
#endif

int AppTask::Init()
{
Expand All @@ -230,6 +235,7 @@ int AppTask::Init()
;
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
// Create FreeRTOS sw timer for OTA timer.
sOTAInitTimer = xTimerCreate("OTAInitTmr", // Just a text name, not used by the RTOS kernel
OTAREQUESTOR_INIT_TIMER_DELAY_MS, // timer period (mS)
Expand All @@ -246,6 +252,7 @@ int AppTask::Init()
{
PLAT_LOG("sOTAInitTimer timer created successfully ");
}
#endif

ret = ThreadStackMgr().InitThreadStack();
if (ret != CHIP_NO_ERROR)
Expand Down Expand Up @@ -418,6 +425,7 @@ void AppTask::AppTaskMain(void * pvParameter)
}
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void StartTimer(uint32_t aTimeoutMs)
{
PLAT_LOG("Start OTA Init Timer")
Expand All @@ -443,6 +451,7 @@ void CancelTimer(void)
PLAT_LOG("sOTAInitTimer stop() failed");
}
}
#endif

void AppTask::ActionInitiated(LockManager::Action_t aAction)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-app/cc13x4_26x4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Ninja to build the executable.
to the GN call.
```
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]"
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true"
```
## Programming
Expand Down
10 changes: 9 additions & 1 deletion examples/pump-app/cc13x4_26x4/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ AppTask AppTask::sAppTask;

static DeviceCallbacks sDeviceCallbacks;

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void StartTimer(uint32_t aTimeoutMs);
void CancelTimer(void);
#endif

uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff };
Expand All @@ -120,9 +122,9 @@ void InitializeOTARequestor(void)
sDownloader.SetImageProcessorDelegate(&sImageProcessor);
sRequestorUser.Init(&sRequestorCore, &sImageProcessor);
}
#endif

TimerHandle_t sOTAInitTimer = 0;
#endif

// The OTA Init Timer is only started upon the first Thread State Change
// detected if the device is already on a Thread Network, or during the AppTask
Expand Down Expand Up @@ -171,10 +173,12 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg)
}
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void OTAInitTimerEventHandler(TimerHandle_t xTimer)
{
InitializeOTARequestor();
}
#endif

int AppTask::StartAppTask()
{
Expand Down Expand Up @@ -217,6 +221,7 @@ int AppTask::Init()
;
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
// Create FreeRTOS sw timer for OTA timer.
sOTAInitTimer = xTimerCreate("OTAInitTmr", // Just a text name, not used by the RTOS kernel
OTAREQUESTOR_INIT_TIMER_DELAY_MS, // timer period (mS)
Expand All @@ -233,6 +238,7 @@ int AppTask::Init()
{
PLAT_LOG("sOTAInitTimer timer created successfully ");
}
#endif

ret = ThreadStackMgr().InitThreadStack();
if (ret != CHIP_NO_ERROR)
Expand Down Expand Up @@ -353,6 +359,7 @@ void AppTask::PostEvent(const AppEvent * aEvent)
}
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void StartTimer(uint32_t aTimeoutMs)
{
PLAT_LOG("Start OTA Init Timer")
Expand All @@ -378,6 +385,7 @@ void CancelTimer(void)
PLAT_LOG("sOTAInitTimer stop() failed");
}
}
#endif

void AppTask::ActionInitiated(PumpManager::Action_t aAction, int32_t aActor)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-controller-app/cc13x4_26x4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Ninja to build the executable.
to the GN call.
```
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]"
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true"
```
## Programming
Expand Down
11 changes: 10 additions & 1 deletion examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ static Button_Handle sAppRightHandle;

AppTask AppTask::sAppTask;

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void StartTimer(uint32_t aTimeoutMs);
void CancelTimer(void);
#endif

uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff };
Expand All @@ -107,10 +109,11 @@ void InitializeOTARequestor(void)
sDownloader.SetImageProcessorDelegate(&sImageProcessor);
sRequestorUser.Init(&sRequestorCore, &sImageProcessor);
}
#endif

TimerHandle_t sOTAInitTimer = 0;

#endif

// The OTA Init Timer is only started upon the first Thread State Change
// detected if the device is already on a Thread Network, or during the AppTask
// Init sequence if the device is not yet on a Thread Network. Once the timer
Expand Down Expand Up @@ -199,10 +202,12 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg)
}
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void OTAInitTimerEventHandler(TimerHandle_t xTimer)
{
InitializeOTARequestor();
}
#endif

int AppTask::Init()
{
Expand All @@ -222,6 +227,7 @@ int AppTask::Init()
;
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
// Create FreeRTOS sw timer for OTA timer.
sOTAInitTimer = xTimerCreate("OTAInitTmr", // Just a text name, not used by the RTOS kernel
OTAREQUESTOR_INIT_TIMER_DELAY_MS, // timer period (mS)
Expand All @@ -238,6 +244,7 @@ int AppTask::Init()
{
PLAT_LOG("sOTAInitTimer timer created successfully ");
}
#endif

ret = ThreadStackMgr().InitThreadStack();
if (ret != CHIP_NO_ERROR)
Expand Down Expand Up @@ -352,6 +359,7 @@ void AppTask::PostEvent(const AppEvent * aEvent)
}
}

#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
void StartTimer(uint32_t aTimeoutMs)
{
PLAT_LOG("Start OTA Init Timer")
Expand All @@ -377,6 +385,7 @@ void CancelTimer(void)
PLAT_LOG("sOTAInitTimer stop() failed");
}
}
#endif

void AppTask::ActionInitiated(PumpManager::Action_t aAction, int32_t aActor)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/shell/cc13x4_26x4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Ninja to build the executable.
to the GN call.
```
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]"
gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true"
```
## Programming
Expand Down
2 changes: 1 addition & 1 deletion src/lwip/cc13xx_26xx/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
#define MEMP_SEPARATE_POOLS (1)
#define LWIP_PBUF_FROM_CUSTOM_POOLS (0)
#define MEMP_USE_CUSTOM_POOLS (0)
#define PBUF_POOL_SIZE (12)
#define PBUF_POOL_SIZE (18)
#define PBUF_POOL_BUFSIZE (1280)
#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL)
#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE)
Expand Down
3 changes: 3 additions & 0 deletions third_party/ti_simplelink_sdk/ti_simplelink_executable.gni
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ template("ti_simplelink_executable") {
} else {
# The executable is the final target.
data_deps = [ ":${simplelink_target_name}.out" ]
if (ti_simplelink_device_family == "cc13x4_26x4" && custom_factory_data) {
data_deps += [ ":${simplelink_target_name}-and-factory-data.hex" ]
}
}

if (defined(invoker.data_deps)) {
Expand Down

0 comments on commit 4333670

Please sign in to comment.