Skip to content

Commit

Permalink
keyword-detection: Add AWS Device Advisor validation
Browse files Browse the repository at this point in the history
This addition is used to validate that the applications's
software conforms with TLS, MQTT, Device Shadow,
and IoT Jobs best practices.

Signed-off-by: Ahmed Ismail <[email protected]>
  • Loading branch information
AhmedIsmail02 authored and urutva committed Feb 28, 2024
1 parent 3d76393 commit 6061e7d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 deletions.
1 change: 1 addition & 0 deletions applications/keyword_detection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ target_link_libraries(keyword-detection
freertos_kernel
freertos-ota-pal-psa
fri-bsp
helpers-device-advisor
helpers-events
mbedtls
mbedtls-threading-freertos
Expand Down
27 changes: 18 additions & 9 deletions applications/keyword_detection/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2023 Arm Limited and/or its affiliates
/* Copyright 2023-2024 Arm Limited and/or its affiliates
* <[email protected]>
* SPDX-License-Identifier: MIT
*/
Expand All @@ -12,6 +12,7 @@

#include "app_config.h"
#include "aws_clientcredential.h"
#include "aws_device_advisor_task.h"
#include "blink_task.h"
#include "dev_mode_key_provisioning.h"
#include "events.h"
Expand Down Expand Up @@ -87,7 +88,9 @@ void vOtaActiveHook( void )

void vOtaNotActiveHook( void )
{
vMlTaskInferenceStart();
#if ( appCONFIG_DEVICE_ADVISOR_TEST_ACTIVE == 0 )
vMlTaskInferenceStart();
#endif
}

void vAssertCalled( const char * pcFile,
Expand Down Expand Up @@ -207,24 +210,30 @@ int main( void )
return EXIT_FAILURE;
}

vStartMlMqttTask();

vStartMqttAgentTask();

vStartOtaTask();

#if ( appCONFIG_DEVICE_ADVISOR_TEST_ACTIVE == 1 )
vStartDeviceAdvisorTask();
#else
vStartMlMqttTask();
#endif
}
else
{
vMlTaskInferenceStart();
}

vStartBlinkTask();
#if ( appCONFIG_DEVICE_ADVISOR_TEST_ACTIVE == 0 )
vStartBlinkTask();

#ifdef AUDIO_VSI
prvStartVsiCallbackTask();
#endif
#ifdef AUDIO_VSI
prvStartVsiCallbackTask();
#endif

vStartMlTask();
vStartMlTask();
#endif

vTaskStartScheduler();

Expand Down
1 change: 1 addition & 0 deletions docs/project_organisation.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ target_link_libraries(keyword-detection
freertos_kernel
freertos-ota-pal-psa
fri-bsp
helpers-device-advisor
helpers-events
kws_api
kws_model
Expand Down
25 changes: 7 additions & 18 deletions docs/running_aws_iot_core_device_advisor_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,34 +59,20 @@ user defines called out below.

Save and close the file.


Next insert the keys that are in the certificates you have downloaded when you
created the thing. Edit the file
`configs/aws_configs/aws_clientcredential_keys.h` replacing the existing keys
with yours.

`keyCLIENT_CERTIFICATE_PEM`

* Replace with contents from
`<your-thing-certificate-unique-string>-certificate.pem.crt`.

`keyCLIENT_PRIVATE_KEY_PEM`

* Replace with contents from
`<your-thing-certificate-unique-string>-private.pem.key`.

## Building the application

To build the application, run the following command:

```bash
./tools/scripts/build.sh ${APPLICATION_NAME}
./tools/scripts/build.sh ${APPLICATION_NAME} --certificate_path <certificate pem's path> --private_key_path <private key pem's path> --target <corstone300/corstone310>
```

* The `certificate pem's path` and `private key pem's path` should be the downloaded key's and certificate's paths during the Thing creation.

Or, run the command below to perform a clean build:

```bash
./tools/scripts/build.sh ${APPLICATION_NAME} -c
./tools/scripts/build.sh ${APPLICATION_NAME} --certificate_path <certificate pem's path> --private_key_path <private key pem's path> --target <corstone300/corstone310> -c
```

## Running the application
Expand All @@ -108,3 +94,6 @@ IoT Core Qualification report by following the instructions in the [page](https:

[creating-an-iot-thing-for-your-device]: ./setting_up_aws_connectivity.md#creating-an-iot-thing-for-your-device
[creating-a-policy-and-attach-it-to-your-certificate]: ./setting_up_aws_connectivity.md#creating-a-policy-and-attach-it-to-your-certificate

## Note
AWS IoT Core Device Advisor Tests are supported on `keyword-detection` application only.
3 changes: 3 additions & 0 deletions release_changes/202402131352.change
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
aws-iot-example: Remove example.
ci: Build ML apps in Github Actions
keyword-detection: Add AWS Device Advisor validation.

0 comments on commit 6061e7d

Please sign in to comment.