Skip to content

Commit 2c16a18

Browse files
Add OTA Orchestrator fixes (#107)
* ota-orchestrator: Add multiple enhancements and fixes * Do not suspend OTA agent after successful update. * vOtaNotActiveHook() should be called whenever there are no OTA jobs available. * Use LogDebug and LogError instead of LogInfo to follow the previous ota-for-embedded-iot-sdk library implementation (avoiding new issues). Signed-off-by: Devaraj Ranganna <[email protected]> Signed-off-by: Ahmed Ismail <[email protected]> * mqtt-agent: Increase MQTT Agent keep alive interval The `MQTT_AGENT_KEEP_ALIVE_INTERVAL_SECONDS` is increased to 100 as in case of using SOFTWARE inference with speech recognition application the connection is dropped before the ML Inference is done as the software inference is generally much slower compared to the Ethos NPU. This connection drop cause the ML inference to have wrong results as the task is interrupted. Hence, increasing the keep alive interval to avoid the connection drop. Signed-off-by: Ahmed Ismail <[email protected]> * github-upload-artifact: Upgrade the deprecated version actions/upload-artifact v3 is now deprecated and cannot be used anymore. Hence, updating to v4. `strategy.job-index` is post-fixed to the artifact name to overcome the known issue of upload-artifact v4 not allowing multiple artifacts with the same name on the workflow run. Signed-off-by: Ahmed Ismail <[email protected]> --------- Signed-off-by: Devaraj Ranganna <[email protected]> Signed-off-by: Ahmed Ismail <[email protected]> Co-authored-by: Devaraj Ranganna <[email protected]>
1 parent 09fb523 commit 2c16a18

File tree

5 files changed

+27
-24
lines changed

5 files changed

+27
-24
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023-2024 Arm Limited and/or its affiliates
1+
# Copyright (c) 2023-2025 Arm Limited and/or its affiliates
22
33
# SPDX-License-Identifier: MIT
44

@@ -85,9 +85,9 @@ jobs:
8585
build/${{ matrix.application }}-update_signed.bin \
8686
build/update-signature.txt
8787
- name: Upload Build Artifacts
88-
uses: actions/upload-artifact@v3
88+
uses: actions/upload-artifact@v4
8989
with:
90-
name: FRI-build-logs
90+
name: FRI-build-logs-${{ strategy.job-index }}
9191
path: |
9292
${{ github.workspace }}/${{ matrix.application }}_gnu_build.tar.gz
9393
retention-days: 5

applications/helpers/ota_orchestrator/src/ota_orchestrator.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,7 @@ STATIC void processOTAEvents()
10751075
case OtaPalNewImageBootFailed:
10761076
case OtaPalJobDocProcessingStateInvalid:
10771077
LogInfo( ( "No OTA job available. \n" ) );
1078+
vOtaNotActiveHook();
10781079
break;
10791080
}
10801081

@@ -1171,11 +1172,11 @@ STATIC void processOTAEvents()
11711172
if( activateImage() == true )
11721173
{
11731174
LogInfo( ( "Activated image.\n" ) );
1174-
nextEvent.eventId = OtaAgentEventActivateImage;
1175+
1176+
nextEvent.eventId = OtaAgentEventRequestJobDocument;
11751177
OtaSendEvent_FreeRTOS( &nextEvent );
11761178
}
11771179

1178-
otaAgentState = OtaAgentStateStopped;
11791180
break;
11801181

11811182

applications/helpers/ota_orchestrator/src/ota_os_freertos.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright Amazon.com, Inc. and its affiliates. All Rights Reserved.
3-
* Copyright 2024 Arm Limited and/or its affiliates
3+
* Copyright 2024-2025 Arm Limited and/or its affiliates
44
55
*
66
* SPDX-License-Identifier: MIT
@@ -67,14 +67,14 @@ OtaOsStatus_t OtaInitEvent_FreeRTOS()
6767
{
6868
otaOsStatus = OtaOsEventQueueCreateFailed;
6969

70-
LogInfo( ( "Failed to create OTA Event queue: "
71-
"xQueueCreateStatic returned error: "
72-
"OtaOsStatus_t=%d \n",
73-
( int ) otaOsStatus ) );
70+
LogError( ( "Failed to create OTA Event queue: "
71+
"xQueueCreateStatic returned error: "
72+
"OtaOsStatus_t=%d \n",
73+
( int ) otaOsStatus ) );
7474
}
7575
else
7676
{
77-
LogInfo( ( "OTA Event Queue created.\n" ) );
77+
LogDebug( ( "OTA Event Queue created.\n" ) );
7878
}
7979

8080
return otaOsStatus;
@@ -90,16 +90,16 @@ OtaOsStatus_t OtaSendEvent_FreeRTOS( const void * pEventMsg )
9090

9191
if( retVal == pdTRUE )
9292
{
93-
LogInfo( ( "OTA Event sent.\n" ) );
93+
LogDebug( ( "OTA Event sent.\n" ) );
9494
}
9595
else
9696
{
9797
otaOsStatus = OtaOsEventQueueSendFailed;
9898

99-
LogInfo( ( "Failed to send event to OTA Event Queue: "
100-
"xQueueSendToBack returned error: "
101-
"OtaOsStatus_t=%d \n",
102-
( int ) otaOsStatus ) );
99+
LogError( ( "Failed to send event to OTA Event Queue: "
100+
"xQueueSendToBack returned error: "
101+
"OtaOsStatus_t=%d \n",
102+
( int ) otaOsStatus ) );
103103
}
104104

105105
return otaOsStatus;
@@ -114,16 +114,16 @@ OtaOsStatus_t OtaReceiveEvent_FreeRTOS( void * pEventMsg )
114114

115115
if( retVal == pdTRUE )
116116
{
117-
LogInfo( ( "OTA Event received \n" ) );
117+
LogDebug( ( "OTA Event received \n" ) );
118118
}
119119
else
120120
{
121121
otaOsStatus = OtaOsEventQueueReceiveFailed;
122122

123-
LogInfo( ( "Failed to receive event or timeout from OTA Event Queue: "
124-
"xQueueReceive returned error: "
125-
"OtaOsStatus_t=%d \n",
126-
( int ) otaOsStatus ) );
123+
LogDebug( ( "Failed to receive event or timeout from OTA Event Queue: "
124+
"xQueueReceive returned error: "
125+
"OtaOsStatus_t=%d \n",
126+
( int ) otaOsStatus ) );
127127
}
128128

129129
return otaOsStatus;
@@ -133,5 +133,5 @@ void OtaDeinitEvent_FreeRTOS()
133133
{
134134
vQueueDelete( otaEventQueue );
135135

136-
LogInfo( ( "OTA Event Queue Deleted. \n" ) );
136+
LogDebug( ( "OTA Event Queue Deleted. \n" ) );
137137
}

components/aws_iot/coremqtt_agent/integration/src/mqtt_agent_task.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* FreeRTOS V202012.00
33
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4-
* Copyright 2023-2024 Arm Limited and/or its affiliates
4+
* Copyright 2023-2025 Arm Limited and/or its affiliates
55
66
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -141,7 +141,7 @@
141141
* absence of sending any other Control Packets, the Client MUST send a
142142
* PINGREQ Packet.
143143
*/
144-
#define MQTT_AGENT_KEEP_ALIVE_INTERVAL_SECONDS ( 60U )
144+
#define MQTT_AGENT_KEEP_ALIVE_INTERVAL_SECONDS ( 100U )
145145

146146
/**
147147
* @brief Socket send and receive timeouts to use. Specified in milliseconds.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ota-orchestrator: Add multiple enhancements and fixes.
2+
mqtt-agent: Increase MQTT Agent keep alive interval.

0 commit comments

Comments
 (0)