]> granicus.if.org Git - esp-idf/commitdiff
Added proper handling of apptrace and pthread initialization errors
authorAlexey Gerenkov <alexey@espressif.com>
Thu, 14 Sep 2017 16:36:10 +0000 (19:36 +0300)
committerkrzychb <krzychb@gazeta.pl>
Thu, 14 Sep 2017 18:47:43 +0000 (20:47 +0200)
components/esp32/cpu_start.c

index 2ceb87f58a7f5a47ca56cf61dd011cdd7c235531..25e31de45f6b81e869884c8e3ce21b0890f5e2f1 100644 (file)
@@ -302,17 +302,13 @@ void start_cpu0_default(void)
     esp_set_time_from_rtc();
 #if CONFIG_ESP32_APPTRACE_ENABLE
     err = esp_apptrace_init();
-    if (err != ESP_OK) {
-        ESP_EARLY_LOGE(TAG, "Failed to init apptrace module on CPU0 (%d)!", err);
-    }
+    assert(err == ESP_OK && "Failed to init apptrace module on PRO CPU!");
 #endif
 #if CONFIG_SYSVIEW_ENABLE
     SEGGER_SYSVIEW_Conf();
 #endif
     err = esp_pthread_init();
-    if (err != ESP_OK) {
-        ESP_EARLY_LOGE(TAG, "Failed to init pthread module (%d)!", err);
-    }
+    assert(err == ESP_OK && "Failed to init pthread module!");
 
     do_global_ctors();
 #if CONFIG_INT_WDT
@@ -356,9 +352,7 @@ void start_cpu1_default(void)
 #endif
 #if CONFIG_ESP32_APPTRACE_ENABLE
     esp_err_t err = esp_apptrace_init();
-    if (err != ESP_OK) {
-        ESP_EARLY_LOGE(TAG, "Failed to init apptrace module on CPU1 (%d)!", err);
-    }
+    assert(err == ESP_OK && "Failed to init apptrace module on APP CPU!");
 #endif
     //Take care putting stuff here: if asked, FreeRTOS will happily tell you the scheduler
     //has started, but it isn't active *on this CPU* yet.