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

m5stack stuck in infinite reset loop #14267

Closed
msandstedt opened this issue Jan 25, 2022 · 1 comment
Closed

m5stack stuck in infinite reset loop #14267

msandstedt opened this issue Jan 25, 2022 · 1 comment

Comments

@msandstedt
Copy link
Contributor

Problem

Appears to be a bad interaction with new OTA code.

Proposed Solution

diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp
index a98e4e9f60c..7845b64f5fd 100644
--- a/examples/all-clusters-app/esp32/main/main.cpp
+++ b/examples/all-clusters-app/esp32/main/main.cpp
@@ -529,6 +529,17 @@ AppCallbacks sCallbacks;
 
 } // namespace
 
+static void InitOTARequestor(void)
+{
+#if CONFIG_ENABLE_OTA_REQUESTOR
+    SetRequestorInstance(&gRequestorCore);
+    gRequestorCore.Init(&Server::GetInstance(), &gRequestorUser, &gDownloader);
+    gImageProcessor.SetOTADownloader(&gDownloader);
+    gDownloader.SetImageProcessorDelegate(&gImageProcessor);
+    gRequestorUser.Init(&gRequestorCore, &gImageProcessor);
+#endif
+}
+
 static void InitServer(intptr_t context)
 {
     // Init ZCL Data Model and CHIP App Server
@@ -539,17 +550,7 @@ static void InitServer(intptr_t context)
     NetWorkCommissioningInstInit();
     SetupPretendDevices();
     InitBindingHandlers();
-}
-
-static void InitOTARequestor(void)
-{
-#if CONFIG_ENABLE_OTA_REQUESTOR
-    SetRequestorInstance(&gRequestorCore);
-    gRequestorCore.Init(&Server::GetInstance(), &gRequestorUser, &gDownloader);
-    gImageProcessor.SetOTADownloader(&gDownloader);
-    gDownloader.SetImageProcessorDelegate(&gImageProcessor);
-    gRequestorUser.Init(&gRequestorCore, &gImageProcessor);
-#endif
+    InitOTARequestor();
 }
 
 extern "C" void app_main()
@@ -610,8 +611,6 @@ extern "C" void app_main()
     // Print QR Code URL 
     PrintOnboardingCodes(chip::RendezvousInformationFlags(CONFIG_RENDEZVOUS_MODE));
 
-    InitOTARequestor();
-
 #if CONFIG_HAVE_DISPLAY
     std::string qrCodeText;
msandstedt added a commit to msandstedt/connectedhomeip that referenced this issue Jan 25, 2022
Some new OTA code is causing the m5stack all-clusters-app to reset
during init, which results in an infinite reset loop.  This fixes it.

Fixes project-chip#14267
@msandstedt
Copy link
Contributor Author

Apparently fixed with #13849.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants