diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1033698..72cbdaf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,4 +56,4 @@ jobs: esp_idf_version: ${{ matrix.esp_idf_version }} target: ${{ matrix.esp_target }} path: './' - command: python -m pip install --upgrade idf-component-manager || idf.py build + command: python -m pip install --upgrade idf-component-manager && idf.py build diff --git a/components/FreeRTOS-Libraries-Integration-Tests/CMakeLists.txt b/components/FreeRTOS-Libraries-Integration-Tests/CMakeLists.txt index f78715b..9c218a1 100644 --- a/components/FreeRTOS-Libraries-Integration-Tests/CMakeLists.txt +++ b/components/FreeRTOS-Libraries-Integration-Tests/CMakeLists.txt @@ -7,9 +7,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/FreeRTOS-Libraries-Integration-Tests/src/trans # This gives MQTT_TEST_SOURCES, and MQTT_TEST_INCLUDE_DIRS include(${CMAKE_CURRENT_LIST_DIR}/FreeRTOS-Libraries-Integration-Tests/src/mqtt_test.cmake) -# This gives OTA_PAL_TEST_SOURCES, and OTA_PAL_TEST_INCLUDE_DIRS -include(${CMAKE_CURRENT_LIST_DIR}/FreeRTOS-Libraries-Integration-Tests/src/ota_pal_test.cmake) - # This gives PKCS11_TEST_SOURCES, and PKCS11_TEST_INCLUDE_DIRS include(${CMAKE_CURRENT_LIST_DIR}/FreeRTOS-Libraries-Integration-Tests/src/pkcs11_test.cmake) diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild index a929b77..12e751e 100644 --- a/main/Kconfig.projbuild +++ b/main/Kconfig.projbuild @@ -44,14 +44,6 @@ menu "Featured FreeRTOS IoT Integration" bool "Transport Interface Test." default n - config GRI_OTA_PAL_TEST_ENABLED - bool "OTA PAL Test." - default n - - config GRI_OTA_E2E_TEST_ENABLED - bool "OTA end-to-end Test." - default n - config GRI_CORE_PKCS11_TEST_ENABLED bool "CorePKCS#11 Test." default n @@ -211,6 +203,10 @@ menu "Featured FreeRTOS IoT Integration" int "OTA demo task stack size." default 3072 + config GRI_OTA_MAX_NUM_DATA_BUFFERS + int "OTA buffer number." + default 2 + endmenu # OTA demo configurations endmenu # Qualification Test Configurations @@ -463,6 +459,10 @@ menu "Featured FreeRTOS IoT Integration" int "Application version build." default 0 + config GRI_OTA_MAX_NUM_DATA_BUFFERS + int "OTA buffer number." + default 2 + endmenu # OTA demo configurations endmenu # Golden Reference Integration diff --git a/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo.c b/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo.c index 47c583b..1a568a3 100644 --- a/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo.c +++ b/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo.c @@ -167,7 +167,6 @@ #define MAX_THING_NAME_SIZE 128U #define MAX_JOB_ID_LENGTH ( 64U ) -#define MAX_NUM_OF_OTA_DATA_BUFFERS ( 2U ) /** * @brief Used to clear bits in a task's notification value. @@ -229,7 +228,7 @@ static uint8_t currentFileId = 0; static uint32_t totalBytesReceived = 0; char globalJobId[ MAX_JOB_ID_LENGTH ] = { 0 }; -static OtaDataEvent_t dataBuffers[ otaconfigMAX_NUM_OTA_DATA_BUFFERS ] = { 0 }; +static OtaDataEvent_t dataBuffers[ otademoconfigMAX_NUM_OTA_DATA_BUFFERS ] = { 0 }; static OtaJobEventData_t jobDocBuffer = { 0 }; static AfrOtaJobDocumentFields_t jobFields = { 0 }; static uint8_t OtaImageSignatureDecoded[ OTA_MAX_SIGNATURE_SIZE ] = { 0 }; @@ -898,7 +897,7 @@ static uint16_t getFreeOTABuffers( void ) if( xSemaphoreTake( bufferSemaphore, portMAX_DELAY ) == pdTRUE ) { - for( ulIndex = 0; ulIndex < MAX_NUM_OF_OTA_DATA_BUFFERS; ulIndex++ ) + for( ulIndex = 0; ulIndex < otademoconfigMAX_NUM_OTA_DATA_BUFFERS; ulIndex++ ) { if( dataBuffers[ ulIndex ].bufferUsed == false ) { @@ -940,7 +939,7 @@ static OtaDataEvent_t * getOtaDataEventBuffer( void ) if( xSemaphoreTake( bufferSemaphore, portMAX_DELAY ) == pdTRUE ) { - for( ulIndex = 0; ulIndex < MAX_NUM_OF_OTA_DATA_BUFFERS; ulIndex++ ) + for( ulIndex = 0; ulIndex < otademoconfigMAX_NUM_OTA_DATA_BUFFERS; ulIndex++ ) { if( dataBuffers[ ulIndex ].bufferUsed == false ) { diff --git a/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo_config.h b/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo_config.h index 453b993..9398a93 100644 --- a/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo_config.h +++ b/main/demo_tasks/ota_over_mqtt_demo/ota_over_mqtt_demo_config.h @@ -43,51 +43,56 @@ /** * @brief The thing name of the device. */ -#define otademoconfigCLIENT_IDENTIFIER ( CONFIG_GRI_THING_NAME ) +#define otademoconfigCLIENT_IDENTIFIER ( CONFIG_GRI_THING_NAME ) /** * @brief The maximum size of the file paths used in the demo. */ -#define otademoconfigMAX_FILE_PATH_SIZE ( CONFIG_GRI_OTA_DEMO_MAX_FILE_PATH_SIZE ) +#define otademoconfigMAX_FILE_PATH_SIZE ( CONFIG_GRI_OTA_DEMO_MAX_FILE_PATH_SIZE ) /** * @brief The maximum size of the stream name required for downloading update file * from streaming service. */ -#define otademoconfigMAX_STREAM_NAME_SIZE ( CONFIG_GRI_OTA_DEMO_MAX_STREAM_NAME_SIZE ) +#define otademoconfigMAX_STREAM_NAME_SIZE ( CONFIG_GRI_OTA_DEMO_MAX_STREAM_NAME_SIZE ) /** * @brief The delay used in the OTA demo task to periodically output the OTA * statistics like number of packets received, dropped, processed and queued per connection. */ -#define otademoconfigTASK_DELAY_MS ( CONFIG_GRI_OTA_DEMO_TASK_DELAY_MS ) +#define otademoconfigTASK_DELAY_MS ( CONFIG_GRI_OTA_DEMO_TASK_DELAY_MS ) /** * @brief The maximum time for which OTA demo waits for an MQTT operation to be complete. * This involves receiving an acknowledgment for broker for SUBSCRIBE, UNSUBSCRIBE and non * QOS0 publishes. */ -#define otademoconfigMQTT_TIMEOUT_MS ( CONFIG_GRI_OTA_DEMO_MQTT_TIMEOUT_MS ) +#define otademoconfigMQTT_TIMEOUT_MS ( CONFIG_GRI_OTA_DEMO_MQTT_TIMEOUT_MS ) /** * @brief The task priority of OTA agent task. */ -#define otademoconfigAGENT_TASK_PRIORITY ( CONFIG_GRI_OTA_DEMO_AGENT_TASK_PRIORITY ) +#define otademoconfigAGENT_TASK_PRIORITY ( CONFIG_GRI_OTA_DEMO_AGENT_TASK_PRIORITY ) /** * @brief The stack size of OTA agent task. */ -#define otademoconfigAGENT_TASK_STACK_SIZE ( CONFIG_GRI_OTA_DEMO_AGENT_TASK_STACK_SIZE ) +#define otademoconfigAGENT_TASK_STACK_SIZE ( CONFIG_GRI_OTA_DEMO_AGENT_TASK_STACK_SIZE ) /** * @brief The task priority of the OTA demo task. */ -#define otademoconfigDEMO_TASK_PRIORITY ( CONFIG_GRI_OTA_DEMO_DEMO_TASK_PRIORITY ) +#define otademoconfigDEMO_TASK_PRIORITY ( CONFIG_GRI_OTA_DEMO_DEMO_TASK_PRIORITY ) /** * @brief The task stack size of the OTA demo task. */ -#define otademoconfigDEMO_TASK_STACK_SIZE ( CONFIG_GRI_OTA_DEMO_DEMO_TASK_STACK_SIZE ) +#define otademoconfigDEMO_TASK_STACK_SIZE ( CONFIG_GRI_OTA_DEMO_DEMO_TASK_STACK_SIZE ) + +/** + * @brief The number of OTA data buffer. + */ +#define otademoconfigMAX_NUM_OTA_DATA_BUFFERS ( CONFIG_GRI_OTA_MAX_NUM_DATA_BUFFERS ) /** * @brief The version for the firmware which is running. OTA agent uses this @@ -95,9 +100,9 @@ * download image should be higher than the current version, otherwise the new image is * rejected in self test phase. */ -#define APP_VERSION_MAJOR ( CONFIG_GRI_OTA_DEMO_APP_VERSION_MAJOR ) -#define APP_VERSION_MINOR ( CONFIG_GRI_OTA_DEMO_APP_VERSION_MINOR ) -#define APP_VERSION_BUILD ( CONFIG_GRI_OTA_DEMO_APP_VERSION_BUILD ) +#define APP_VERSION_MAJOR ( CONFIG_GRI_OTA_DEMO_APP_VERSION_MAJOR ) +#define APP_VERSION_MINOR ( CONFIG_GRI_OTA_DEMO_APP_VERSION_MINOR ) +#define APP_VERSION_BUILD ( CONFIG_GRI_OTA_DEMO_APP_VERSION_BUILD ) /* *INDENT-OFF* */ #ifdef __cplusplus diff --git a/sdkconfig.defaults b/sdkconfig.defaults index d50e27c..a728902 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -40,7 +40,7 @@ CONFIG_LWIP_MAX_SOCKETS=8 # AWS OTA CONFIG_LOG2_FILE_BLOCK_SIZE=12 CONFIG_MAX_NUM_BLOCKS_REQUEST=8 -CONFIG_MAX_NUM_OTA_DATA_BUFFERS=8 +CONFIG_GRI_OTA_MAX_NUM_DATA_BUFFERS=2 CONFIG_ALLOW_DOWNGRADE=0 CONFIG_OTA_DATA_OVER_MQTT=y # CONFIG_OTA_DATA_OVER_HTTP is not set