]> granicus.if.org Git - esp-idf/commitdiff
app_update: Fix esp_app_desc unused var for Cmake
authorKonstantin Kondrashov <konstantin@espressif.com>
Wed, 5 Dec 2018 06:07:41 +0000 (14:07 +0800)
committerKonstantin Kondrashov <konstantin@espressif.com>
Fri, 7 Dec 2018 04:04:40 +0000 (12:04 +0800)
components/app_update/CMakeLists.txt
components/esp32/cpu_start.c

index 2837244ad465d9605e443386a5bd918de2f519bd..d34462b9ac865dff7e5efb7d827ad7527f0d1011 100644 (file)
@@ -6,6 +6,10 @@ set(COMPONENT_REQUIRES spi_flash partition_table bootloader_support)
 
 register_component()
 
+# esp_app_desc structure is added as an undefined symbol because otherwise the 
+# linker will ignore this structure as it has no other files depending on it.
+target_link_libraries(${COMPONENT_TARGET} "-u esp_app_desc")
+
 set_source_files_properties(
     SOURCE "esp_app_desc.c"
     PROPERTIES COMPILE_DEFINITIONS 
index 92ce879fe0f841620e6623df22ef5bb1313c9c51..739e4188d8ec66fe0c47bebfda463d0672d8f5e0 100644 (file)
@@ -176,20 +176,20 @@ void IRAM_ATTR call_start_cpu0()
 #endif
 
     ESP_EARLY_LOGI(TAG, "Pro cpu up.");
-#if LOG_LOCAL_LEVEL >= ESP_LOG_INFO
-    const esp_app_desc_t *app_desc = esp_ota_get_app_description();
-    ESP_EARLY_LOGI(TAG, "Application information:");
-    ESP_EARLY_LOGI(TAG, "Project name:     %s", app_desc->project_name);
-    ESP_EARLY_LOGI(TAG, "App version:      %s", app_desc->version);
+    if (LOG_LOCAL_LEVEL >= ESP_LOG_INFO) {
+        const esp_app_desc_t *app_desc = esp_ota_get_app_description();
+        ESP_EARLY_LOGI(TAG, "Application information:");
+        ESP_EARLY_LOGI(TAG, "Project name:     %s", app_desc->project_name);
+        ESP_EARLY_LOGI(TAG, "App version:      %s", app_desc->version);
 #ifdef CONFIG_APP_SECURE_VERSION
-    ESP_EARLY_LOGI(TAG, "Secure version:   %x", app_desc->secure_version);
+        ESP_EARLY_LOGI(TAG, "Secure version:   %x", app_desc->secure_version);
 #endif
 #ifdef CONFIG_APP_COMPILE_TIME_DATE
-    ESP_EARLY_LOGI(TAG, "Compile time:     %s", app_desc->time);
-    ESP_EARLY_LOGI(TAG, "Compile date:     %s", app_desc->date);
-#endif
-    ESP_EARLY_LOGI(TAG, "ESP-IDF:          %s", app_desc->idf_ver);
+        ESP_EARLY_LOGI(TAG, "Compile time:     %s", app_desc->time);
+        ESP_EARLY_LOGI(TAG, "Compile date:     %s", app_desc->date);
 #endif
+        ESP_EARLY_LOGI(TAG, "ESP-IDF:          %s", app_desc->idf_ver);
+    }
 
 #if !CONFIG_FREERTOS_UNICORE
     if (REG_GET_BIT(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_DIS_APP_CPU)) {