]> granicus.if.org Git - esp-idf/commitdiff
esp32: print ELF file SHA256 in panic handler
authorIvan Grokhotkov <ivan@espressif.com>
Thu, 24 Jan 2019 13:05:08 +0000 (21:05 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Wed, 27 Feb 2019 05:30:25 +0000 (13:30 +0800)
components/esp32/panic.c

index f6a8f8aab3c942f2d18a15e4d1974f93323a6764..64383f5624a43d2b2836a720f53aa9d022a6aa78 100644 (file)
@@ -42,6 +42,7 @@
 #include "esp_app_trace.h"
 #include "esp_system_internal.h"
 #include "sdkconfig.h"
+#include "esp_ota_ops.h"
 #if CONFIG_SYSVIEW_ENABLE
 #include "SEGGER_RTT.h"
 #endif
@@ -473,7 +474,7 @@ static void doBacktrace(XtExcFrame *frame)
             break;
         }
     }
-    panicPutStr("\r\n\r\n");
+    panicPutStr("\r\n");
 }
 
 /*
@@ -541,9 +542,16 @@ static void commonErrorHandler_dump(XtExcFrame *frame, int core_id)
 
     }
 
+    panicPutStr("\r\nELF file SHA256: ");
+    char sha256_buf[65];
+    esp_ota_get_app_elf_sha256(sha256_buf, sizeof(sha256_buf));
+    panicPutStr(sha256_buf);
+    panicPutStr("\r\n");
+
     /* With windowed ABI backtracing is easy, let's do it. */
     doBacktrace(frame);
 
+    panicPutStr("\r\n");
 }
 
 /*