Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New modular OTA structure #101

Merged

Conversation

chuyue-luo-arm
Copy link
Contributor

Description

Update FRI to use the new modular OTA structure:

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Remove the ota_for_aws_iot_embedded_sdk component, as we will be
replacing it with the new modular OTA.

Signed-off-by: Chuyue Luo <[email protected]>
Add a crt-helpers/ directory within applicatons/helpers. Within this
directory, add a custom implementation of `strnlen` (based on TF-M's
`tfm_strnlen` implementation). This is required because the Arm Compiler
for Embedded (v6.21) does not support `strnlen`.

Signed-off-by: Chuyue Luo <[email protected]>
Add the Jobs-for-AWS-IoT-embedded-sdk repository as a submodule. This
library is used to interact with AWS IoT Jobs (remote operations that
are sent to and executed on devices connected to AWS IoT). It is one of
the two libraries that must be integrated to allow the new modular OTA
to be used - second library (aws-iot-core-mqtt-file-streams-embedded-c)
is integrated in a later commit.

In addition, the required integration CMake files to build the component
are added.

Signed-off-by: Chuyue Luo <[email protected]>
Two patches are added for the Jobs-for-AWS-IoT-embedded-sdk library:
- The Jobs library assumes the OTA job is signed using ECDSA. However,
we currently use RSA. Therefore, add a patch to change the check for an
ECDSA signature to a check for an RSA signature.
- The Jobs library contains calls to the `strnlen` function. However,
this function is not supported by the Arm Compiler for Embedded (v6.21).
Therefore, add a patch which replaces these calls with calls to our
custom implementation `app_strnlen`.

Signed-off-by: Chuyue Luo <[email protected]>
Add the aws-iot-core-mqtt-file-streams-embedded-c repository as a
submodule. This library allows files from a stream (an abstraction for
a list of files) to be transferred to an IoT device. It is the second of
the two libraries that must be integrated to allow the new modular OTA
to be used.

In addition, the required integration CMake files to build the component
are added.

Signed-off-by: Chuyue Luo <[email protected]>
The aws-iot-core-mqtt-file-streams-embedded-c library uses the `strnlen`
function, which is not supported by the Arm Compiler for Embedded
(v6.21). Therefore, add a patch which replaces the call to `strnlen`
with a call to our custom implementation `app_strnlen`.

Signed-off-by: Chuyue Luo <[email protected]>
THe MQTT File Streams library allows a MQTTFileDownloader_config.h file
to be provided, which defines custom values for build configuration
macros. This commit adds a MQTTFileDownloader_config.h file for the
keyword detection example. This file defines the block size that should
be used when downloading the firmware image.

Signed-off-by: Chuyue Luo <[email protected]>
Add a patch for FreeRTOS OTA PAL PSA to allow it to work with the new
modular OTA structure. This patch does the following:
- Update header includes to remove headers from the old
ota-for-aws-iot-embedded-sdk library, replace these with headers from
the new Jobs-for-AWS-IoT-embedded-sdk library
- Remove usage of data structures from ota-for-aws-iot-embedded-sdk
library, replace these with data structures from
Jobs-for-AWS-IoT-embedded-sdk library.

Signed-off-by: Chuyue Luo <[email protected]>
Add an OTA orchestrator as a helper within the applications/ directory.
The OTA orchestrator uses functionality from the Jobs and MQTT File
Streaming libraries to enable OTA updates.

In addition, update the keyword detection CMakeLists.txt to allow this
example to use the new modular OTA.

Signed-off-by: Chuyue Luo <[email protected]>
Update speech recognition CMakeLists.txt and add
MQTTFileDownloader_config.h file to allow this example to use the new
modular OTA.

Signed-off-by: Chuyue Luo <[email protected]>
Update object detection CMakeLists.txt and add
MQTTFileDownloader_config.h file to allow this example to use the new
modular OTA.

Signed-off-by: Chuyue Luo <[email protected]>
Update FreeRTOS IoT Libraries Tests CMakeLists.txt and add
MQTTFileDownloader_config.h file to allow the tests to use the new
modular OTA.

Signed-off-by: Chuyue Luo <[email protected]>
@AniruddhaKanhere AniruddhaKanhere merged commit 0048e5f into FreeRTOS:main Dec 5, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants