Skip to content

Commit 92316f1

Browse files
committed
Move OTA max data buffer number to project configurations.
1 parent 87cc57a commit 92316f1

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

components/FreeRTOS-Libraries-Integration-Tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/FreeRTOS-Libraries-Integration-Tests/src/trans
88
include(${CMAKE_CURRENT_LIST_DIR}/FreeRTOS-Libraries-Integration-Tests/src/mqtt_test.cmake)
99

1010
# This gives OTA_PAL_TEST_SOURCES, and OTA_PAL_TEST_INCLUDE_DIRS
11-
include(${CMAKE_CURRENT_LIST_DIR}/FreeRTOS-Libraries-Integration-Tests/src/ota_pal_test.cmake)
11+
# include(${CMAKE_CURRENT_LIST_DIR}/FreeRTOS-Libraries-Integration-Tests/src/ota_pal_test.cmake)
1212

1313
# This gives PKCS11_TEST_SOURCES, and PKCS11_TEST_INCLUDE_DIRS
1414
include(${CMAKE_CURRENT_LIST_DIR}/FreeRTOS-Libraries-Integration-Tests/src/pkcs11_test.cmake)

main/Kconfig.projbuild

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ menu "Featured FreeRTOS IoT Integration"
4444
bool "Transport Interface Test."
4545
default n
4646

47-
config GRI_OTA_PAL_TEST_ENABLED
48-
bool "OTA PAL Test."
49-
default n
50-
51-
config GRI_OTA_E2E_TEST_ENABLED
52-
bool "OTA end-to-end Test."
53-
default n
54-
5547
config GRI_CORE_PKCS11_TEST_ENABLED
5648
bool "CorePKCS#11 Test."
5749
default n
@@ -211,6 +203,10 @@ menu "Featured FreeRTOS IoT Integration"
211203
int "OTA demo task stack size."
212204
default 3072
213205

206+
config GRI_OTA_MAX_NUM_DATA_BUFFERS
207+
int "OTA buffer number."
208+
default 2
209+
214210
endmenu # OTA demo configurations
215211
endmenu # Qualification Test Configurations
216212

@@ -463,6 +459,10 @@ menu "Featured FreeRTOS IoT Integration"
463459
int "Application version build."
464460
default 0
465461

462+
config GRI_OTA_MAX_NUM_DATA_BUFFERS
463+
int "OTA buffer number."
464+
default 2
465+
466466
endmenu # OTA demo configurations
467467

468468
endmenu # Golden Reference Integration

main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@
167167
#define MAX_THING_NAME_SIZE 128U
168168

169169
#define MAX_JOB_ID_LENGTH ( 64U )
170-
#define MAX_NUM_OF_OTA_DATA_BUFFERS ( 2U )
171170

172171
/**
173172
* @brief Used to clear bits in a task's notification value.
@@ -898,7 +897,7 @@ static uint16_t getFreeOTABuffers( void )
898897

899898
if( xSemaphoreTake( bufferSemaphore, portMAX_DELAY ) == pdTRUE )
900899
{
901-
for( ulIndex = 0; ulIndex < MAX_NUM_OF_OTA_DATA_BUFFERS; ulIndex++ )
900+
for( ulIndex = 0; ulIndex < otaconfigMAX_NUM_OTA_DATA_BUFFERS; ulIndex++ )
902901
{
903902
if( dataBuffers[ ulIndex ].bufferUsed == false )
904903
{
@@ -940,7 +939,7 @@ static OtaDataEvent_t * getOtaDataEventBuffer( void )
940939

941940
if( xSemaphoreTake( bufferSemaphore, portMAX_DELAY ) == pdTRUE )
942941
{
943-
for( ulIndex = 0; ulIndex < MAX_NUM_OF_OTA_DATA_BUFFERS; ulIndex++ )
942+
for( ulIndex = 0; ulIndex < otaconfigMAX_NUM_OTA_DATA_BUFFERS; ulIndex++ )
944943
{
945944
if( dataBuffers[ ulIndex ].bufferUsed == false )
946945
{

main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo_config.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@
8989
*/
9090
#define otademoconfigDEMO_TASK_STACK_SIZE ( CONFIG_GRI_OTA_DEMO_DEMO_TASK_STACK_SIZE )
9191

92+
/**
93+
* @brief The number of OTA data buffer.
94+
*/
95+
#define otaconfigMAX_NUM_OTA_DATA_BUFFERS ( CONFIG_GRI_OTA_MAX_NUM_DATA_BUFFERS )
96+
9297
/**
9398
* @brief The version for the firmware which is running. OTA agent uses this
9499
* version number to perform anti-rollback validation. The firmware version for the

sdkconfig.defaults

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ CONFIG_LWIP_MAX_SOCKETS=8
4040
# AWS OTA
4141
CONFIG_LOG2_FILE_BLOCK_SIZE=12
4242
CONFIG_MAX_NUM_BLOCKS_REQUEST=8
43-
CONFIG_MAX_NUM_OTA_DATA_BUFFERS=8
43+
CONFIG_GRI_OTA_MAX_NUM_DATA_BUFFERS=2
4444
CONFIG_ALLOW_DOWNGRADE=0
4545
CONFIG_OTA_DATA_OVER_MQTT=y
4646
# CONFIG_OTA_DATA_OVER_HTTP is not set

0 commit comments

Comments
 (0)