From 926e33e08dec51f58793776f07ac91697cfbdb5e Mon Sep 17 00:00:00 2001 From: AniruddhaKanhere <60444055+AniruddhaKanhere@users.noreply.github.com> Date: Mon, 18 Mar 2024 14:24:47 -0700 Subject: [PATCH] Fix all projects --- examples/common/ota/ota_pal.c | 4 +- examples/common/ota/ota_update.c | 5 +- .../bootloader/signing_pub_key.c | 83 +++++++++---------- examples/evkbmimxrt1060/pubsub/app_main.c | 6 +- projects/evkmimxrt1060/defender/.cproject | 32 ++++--- projects/evkmimxrt1060/defender/.project | 25 ++++++ projects/evkmimxrt1060/shadow/.cproject | 32 ++++--- projects/evkmimxrt1060/shadow/.project | 38 ++++----- projects/evkmimxrt1060/test/.cproject | 5 ++ projects/evkmimxrt1060/test/.project | 15 ++++ 10 files changed, 147 insertions(+), 98 deletions(-) diff --git a/examples/common/ota/ota_pal.c b/examples/common/ota/ota_pal.c index d3960f3..c2cf20c 100644 --- a/examples/common/ota/ota_pal.c +++ b/examples/common/ota/ota_pal.c @@ -95,9 +95,9 @@ OtaPalJobDocProcessingResult_t otaPal_CreateFileForRx( AfrOtaJobDocumentFields_t LogDebug( ( "[OTA-NXP] CreateFileForRx" ) ); - if( otaPal_GetPlatformImageState( pFileContext ) == OtaPalImageStateValid ) + if( otaPal_SetPlatformImageState( pFileContext ,OtaImageStateAccepted ) == OtaPalSuccess ) { - /* TODO: Check here if anything is to be checked before sending the + /* TODO: Check here if anything is to be verified before sending the * success message to IoT core. */ return OtaPalNewImageBooted; } diff --git a/examples/common/ota/ota_update.c b/examples/common/ota/ota_update.c index 6673a04..4fe09e5 100644 --- a/examples/common/ota/ota_update.c +++ b/examples/common/ota/ota_update.c @@ -926,8 +926,9 @@ static void processOTAEvents( void ) case OtaPalNewImageBooted: ( void ) sendSuccessMessage(); - /* Short delay before restarting the loop. */ - vTaskDelay( pdMS_TO_TICKS( 1000 ) ); + /* Short delay before restarting the loop. This allows IoT core + * to update the status of the job. */ + vTaskDelay( pdMS_TO_TICKS( 5000 ) ); /* Get ready for new OTA job. */ nextEvent.eventId = OtaAgentEventRequestJobDocument; diff --git a/examples/evkbmimxrt1060/bootloader/signing_pub_key.c b/examples/evkbmimxrt1060/bootloader/signing_pub_key.c index dc0943f..0fe2f1e 100644 --- a/examples/evkbmimxrt1060/bootloader/signing_pub_key.c +++ b/examples/evkbmimxrt1060/bootloader/signing_pub_key.c @@ -1,45 +1,38 @@ -/* - * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - * - * 1 tab == 4 spaces! - */ - -#include "mcuboot_config.h" - -#if defined( MCUBOOT_SIGN_RSA ) - -#error Please use MCUBoot imgtool.py to generate an RSA signing key \ - and replace this file with the output of the tool. - -const unsigned char rsa_pub_key[] = { 0x00 }; -const unsigned int rsa_pub_key_len = 0; - -#elif defined( MCUBOOT_SIGN_EC256 ) - -#error Please use MCUBoot imgtool.py to generate an EC signing key \ - and replace this file with the output of the tool. - -const unsigned char ecdsa_pub_key[] = { 0x00 }; -const unsigned int ecdsa_pub_key_len = 0; - -#endif /* if defined( MCUBOOT_SIGN_RSA ) */ +/* Autogenerated by imgtool.py, do not edit. */ +const unsigned char rsa_pub_key[] = { + 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0xc7, 0x86, 0xd3, 0xf4, 0x7f, 0xf1, 0xba, + 0xfd, 0xa4, 0x63, 0x4f, 0x33, 0x13, 0x35, 0x9a, + 0xa1, 0xdc, 0x37, 0x87, 0x69, 0x96, 0x8d, 0xb5, + 0x2b, 0x82, 0xa6, 0x37, 0x6c, 0x20, 0x6d, 0x73, + 0x28, 0x36, 0x3d, 0x8e, 0x81, 0x96, 0x85, 0xe5, + 0xb8, 0x92, 0x2d, 0xd8, 0xb3, 0x7b, 0x8c, 0x36, + 0x74, 0xdf, 0x42, 0x5a, 0x2b, 0xc9, 0x71, 0xa2, + 0xd2, 0xc5, 0xd5, 0x7d, 0x68, 0x02, 0x8a, 0x91, + 0xd4, 0x37, 0x28, 0x62, 0x16, 0x10, 0xcc, 0xf0, + 0xdc, 0x94, 0x18, 0x4a, 0xc7, 0x74, 0xa4, 0x62, + 0x8d, 0x32, 0x4b, 0xb2, 0x26, 0xbd, 0x14, 0x7f, + 0x50, 0xca, 0x03, 0xf2, 0x8c, 0x1b, 0x75, 0x45, + 0x36, 0xb6, 0x17, 0xbd, 0x39, 0x05, 0x2e, 0xa0, + 0xdd, 0xab, 0xaa, 0xad, 0x8f, 0x9b, 0xe6, 0x6a, + 0x4a, 0xbc, 0xce, 0xc4, 0x23, 0xe9, 0x64, 0xbe, + 0xfb, 0x2a, 0x99, 0x32, 0x77, 0xe4, 0x83, 0x2e, + 0xa1, 0xc5, 0x89, 0xdb, 0x7d, 0x2b, 0xd1, 0x2b, + 0xdf, 0xcc, 0xee, 0xaf, 0xee, 0x60, 0xbe, 0xa8, + 0xeb, 0x08, 0xe4, 0xd0, 0x24, 0x56, 0xb3, 0xe6, + 0x7d, 0xd9, 0xf0, 0xec, 0x94, 0x89, 0xb6, 0x01, + 0xae, 0x66, 0xe7, 0xc7, 0xd3, 0xa1, 0xa0, 0xd1, + 0x96, 0xd7, 0x86, 0x1a, 0x91, 0x0c, 0xf5, 0xda, + 0x7b, 0xd2, 0xda, 0x7d, 0xdb, 0x23, 0x42, 0xda, + 0x61, 0xc1, 0xbf, 0x2e, 0xbe, 0x26, 0x47, 0xce, + 0xca, 0xd7, 0xe8, 0xb6, 0xc2, 0x8e, 0x6f, 0xa8, + 0xfc, 0xee, 0x53, 0x28, 0x1e, 0x9f, 0x32, 0x6f, + 0x95, 0xa9, 0x27, 0x8a, 0x3c, 0xb4, 0xcc, 0xca, + 0x70, 0xa7, 0x4d, 0xc2, 0xbe, 0x24, 0x2b, 0x52, + 0xa1, 0xe0, 0x24, 0x20, 0xed, 0x52, 0x60, 0xab, + 0x6a, 0xfe, 0x9f, 0x8f, 0x3c, 0xf2, 0xf9, 0x57, + 0xed, 0x78, 0xc4, 0x53, 0x9d, 0xc1, 0x88, 0x4a, + 0x56, 0xa8, 0xae, 0xd4, 0x2b, 0x3a, 0x25, 0x89, + 0x69, 0x02, 0x03, 0x01, 0x00, 0x01, +}; +const unsigned int rsa_pub_key_len = 270; diff --git a/examples/evkbmimxrt1060/pubsub/app_main.c b/examples/evkbmimxrt1060/pubsub/app_main.c index 107558d..a6a2467 100644 --- a/examples/evkbmimxrt1060/pubsub/app_main.c +++ b/examples/evkbmimxrt1060/pubsub/app_main.c @@ -47,7 +47,7 @@ * information for the device to connect to broker and perform OTA updates. Disabling the flag results * in disabling the CLI task and execution of the demo tasks in normal device operation mode. */ -#define appmainPROVISIONING_MODE ( 1 ) +#define appmainPROVISIONING_MODE ( 0 ) /** * @brief Subscribe Publish demo tasks configuration. @@ -55,7 +55,7 @@ * to a topic, publishing messages to a topic and reporting the incoming messages on subscribed topic. * Number of subscribe publish demo tasks to be spawned is configurable. */ -#define appmainMQTT_NUM_PUBSUB_TASKS ( 2 ) +#define appmainMQTT_NUM_PUBSUB_TASKS ( 0 ) #define appmainMQTT_PUBSUB_TASK_STACK_SIZE ( 2048 ) #define appmainMQTT_PUBSUB_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) @@ -97,6 +97,8 @@ int app_main( void ) xResult = KVStore_init(); + configPRINTF( ( "Version 0.1.0" ) ); + if( xResult == pdFAIL ) { configPRINTF( ( "Failed to initialize key value configuration store.\r\n" ) ); diff --git a/projects/evkmimxrt1060/defender/.cproject b/projects/evkmimxrt1060/defender/.cproject index 448b5d3..02304a3 100644 --- a/projects/evkmimxrt1060/defender/.cproject +++ b/projects/evkmimxrt1060/defender/.cproject @@ -133,10 +133,15 @@ - + + + + + + @@ -399,15 +409,6 @@ </TargetConfig> - - - - - - - - - @@ -425,4 +426,13 @@ cm7 core0_MIMXRT1062xxxxB + + + + + + + + + \ No newline at end of file diff --git a/projects/evkmimxrt1060/defender/.project b/projects/evkmimxrt1060/defender/.project index 1f26cbf..2d3d735 100644 --- a/projects/evkmimxrt1060/defender/.project +++ b/projects/evkmimxrt1060/defender/.project @@ -86,6 +86,11 @@ 2 PARENT-3-PROJECT_LOC/examples/evkbmimxrt1060/defender/include + + jobs + 2 + virtual:/virtual + linkscripts 2 @@ -106,6 +111,11 @@ 2 PARENT-3-PROJECT_LOC/core/components/phy/mdio/enet + + mqtt-stream + 2 + virtual:/virtual + ota 2 @@ -316,6 +326,11 @@ 1 PARENT-3-PROJECT_LOC/core/drivers/trng/fsl_trng.h + + jobs/source + 2 + /Users/kanherea/Desktop/nxp_gri/iot-reference-nxp-rt1060/Middleware/AWS/jobs/source + lwip/port 2 @@ -341,6 +356,11 @@ 2 virtual:/virtual + + mqtt-stream/source + 2 + /Users/kanherea/Desktop/nxp_gri/iot-reference-nxp-rt1060/Middleware/AWS/mqtt-stream/source + pkcs11/corePKCS11 2 @@ -426,6 +446,11 @@ 2 PARENT-3-PROJECT_LOC/examples/common/mqtt_agent + + source/mqtt_wrapper + 2 + /Users/kanherea/Desktop/nxp_gri/iot-reference-nxp-rt1060/examples/common/mqtt_wrapper + source/ota 2 diff --git a/projects/evkmimxrt1060/shadow/.cproject b/projects/evkmimxrt1060/shadow/.cproject index e065050..a8a8195 100644 --- a/projects/evkmimxrt1060/shadow/.cproject +++ b/projects/evkmimxrt1060/shadow/.cproject @@ -123,9 +123,7 @@ - - @@ -137,6 +135,11 @@ + + + + + @@ -399,15 +405,6 @@ </TargetConfig> - - - - - - - - - @@ -425,4 +422,13 @@ cm7 core0_MIMXRT1062xxxxB + + + + + + + + + \ No newline at end of file diff --git a/projects/evkmimxrt1060/shadow/.project b/projects/evkmimxrt1060/shadow/.project index 1adf530..923b719 100644 --- a/projects/evkmimxrt1060/shadow/.project +++ b/projects/evkmimxrt1060/shadow/.project @@ -106,11 +106,6 @@ 2 PARENT-3-PROJECT_LOC/core/components/phy/mdio/enet - - ota - 2 - PARENT-3-PROJECT_LOC/Middleware/AWS/ota - phy 2 @@ -316,6 +311,11 @@ 1 PARENT-3-PROJECT_LOC/core/drivers/trng/fsl_trng.h + + jobs/source + 2 + /Users/kanherea/Desktop/nxp_gri/iot-reference-nxp-rt1060/Middleware/AWS/jobs/source + lwip/port 2 @@ -341,6 +341,11 @@ 2 virtual:/virtual + + mqtt-streams/source + 2 + /Users/kanherea/Desktop/nxp_gri/iot-reference-nxp-rt1060/Middleware/AWS/mqtt-stream/source + pkcs11/corePKCS11 2 @@ -396,6 +401,11 @@ 2 PARENT-3-PROJECT_LOC/examples/common/mqtt_agent + + source/mqtt_wrapper + 2 + /Users/kanherea/Desktop/nxp_gri/iot-reference-nxp-rt1060/examples/common/mqtt_wrapper + source/ota 2 @@ -553,24 +563,6 @@ 1.0-name-matches-false-false-* - - 1640798696866 - ota - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-source - - - - 1640798696880 - ota - 6 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-* - - 1640798916246 tinycbor diff --git a/projects/evkmimxrt1060/test/.cproject b/projects/evkmimxrt1060/test/.cproject index 7e09cb3..7a13c90 100644 --- a/projects/evkmimxrt1060/test/.cproject +++ b/projects/evkmimxrt1060/test/.cproject @@ -147,6 +147,11 @@ + + + + +