Просмотр исходного кода

gcov: added dbg stub capabilites and magic number entry to keep backward compatible

Erhan Kurubas 4 лет назад
Родитель
Сommit
e43fedb3f4

+ 4 - 2
components/app_trace/gcov/gcov_rtio.c

@@ -115,7 +115,7 @@ static int esp_dbg_stub_gcov_dump_do(void)
 }
 
 /**
- * @brief Triggers gcov info dump.
+ * @brief Triggers gcov info dump task
  *        This function is to be called by OpenOCD, not by normal user code.
  * TODO: what about interrupted flash access (when cache disabled)???
  *
@@ -123,11 +123,13 @@ static int esp_dbg_stub_gcov_dump_do(void)
  */
 static int esp_dbg_stub_gcov_entry(void)
 {
-    return esp_dbg_stub_gcov_dump_do();
+    s_do_dump = true;
+    return ESP_OK;
 }
 
 int gcov_rtio_atexit(void (*function)(void) __attribute__ ((unused)))
 {
+    uint32_t capabilities = 0;
     ESP_EARLY_LOGV(TAG, "%s", __FUNCTION__);
     esp_dbg_stub_entry_set(ESP_DBG_STUB_ENTRY_GCOV, (uint32_t)&esp_dbg_stub_gcov_entry);
     return 0;

+ 1 - 1
components/asio/asio

@@ -1 +1 @@
-Subproject commit 3b66e5b051381fb70de9c2791df70a06181c64e3
+Subproject commit f31694c9f1746ba189a4bcae2e34db15135ddb22

+ 1 - 1
components/bt/controller/lib

@@ -1 +1 @@
-Subproject commit fb49791b7c1a8a35f06e68124c90022667b4cff1
+Subproject commit cfbb0571fb424ca4a68a0c172cbff1fdc79fd91b

+ 1 - 0
components/bt/controller/lib_esp32c3_family

@@ -0,0 +1 @@
+Subproject commit 7ad49c38b893952bbed155ede2c7684f0307f6d3

+ 1 - 1
components/bt/host/nimble/nimble

@@ -1 +1 @@
-Subproject commit 33179b331639a6157d9196b87a3e2e53f86c7072
+Subproject commit aef55bbf636ed580d4d6408a5c2e75d1f70a875e

+ 1 - 1
components/cbor/tinycbor

@@ -1 +1 @@
-Subproject commit d2dd95cb8841d88d5a801e3ef9c328fd6200e7bd
+Subproject commit 085ca40781f7c39febe6d14fb7e5cba342e1804b

+ 23 - 6
components/esp_common/include/esp_private/dbg_stubs.h

@@ -20,13 +20,18 @@
  * Debug stubs entries IDs
  */
 typedef enum {
-    ESP_DBG_STUB_CONTROL_DATA,	///< stubs descriptor entry
+    ESP_DBG_STUB_MAGIC_NUM,
+    ESP_DBG_STUB_CONTROL_DATA,   ///< stubs descriptor entry
     ESP_DBG_STUB_ENTRY_FIRST,
-    ESP_DBG_STUB_ENTRY_GCOV		///< GCOV entry
-    						= ESP_DBG_STUB_ENTRY_FIRST,
+    ESP_DBG_STUB_ENTRY_GCOV	///< GCOV entry
+        = ESP_DBG_STUB_ENTRY_FIRST,
+    ESP_DBG_STUB_CAPABILITIES,
     ESP_DBG_STUB_ENTRY_MAX
 } esp_dbg_stub_id_t;
 
+#define ESP_DBG_STUB_MAGIC_NUM_VAL      0xFEEDBEEF
+#define ESP_DBG_STUB_CAP_GCOV_TASK      (1 << 0)
+
 /**
  * @brief  Initializes debug stubs.
  *
@@ -41,10 +46,22 @@ void esp_dbg_stubs_init(void);
  *
  * @param id 	Stub ID.
  * @param entry Stub entry. Usually it is stub entry function address,
- *              but can be any value meaningfull for OpenOCD command/code.
- *
+ *              but can be any value meaningfull for OpenOCD command/code
+ *              such as capabilities
  * @return ESP_OK on success, otherwise see esp_err_t
  */
 esp_err_t esp_dbg_stub_entry_set(esp_dbg_stub_id_t id, uint32_t entry);
 
-#endif //ESP_DBG_STUBS_H_
+/**
+ * @brief   Retrives the corresponding stub entry
+ *
+ * @param id 	Stub ID.
+ * @param entry Stub entry. Usually it is stub entry function address,
+ *              but can be any value meaningfull for OpenOCD command/code
+ *              such as capabilities
+ *
+ * @return ESP_OK on success, otherwise see esp_err_t
+ */
+esp_err_t esp_dbg_stub_entry_get(esp_dbg_stub_id_t id, uint32_t *entry);
+
+#endif //ESP_DBG_STUBS_H_

+ 12 - 0
components/esp_common/src/dbg_stubs.c

@@ -76,6 +76,7 @@ void esp_dbg_stubs_init(void)
     s_dbg_stubs_ctl_data.data_alloc     = (uint32_t)esp_dbg_stubs_data_alloc;
     s_dbg_stubs_ctl_data.data_free      = (uint32_t)esp_dbg_stubs_data_free;
 
+    s_stub_entry[ESP_DBG_STUB_MAGIC_NUM] = ESP_DBG_STUB_MAGIC_NUM_VAL;
     s_stub_entry[ESP_DBG_STUB_CONTROL_DATA] = (uint32_t)&s_dbg_stubs_ctl_data;
     eri_write(ESP_DBG_STUBS_TRAX_REG, (uint32_t)s_stub_entry);
     ESP_LOGV(TAG, "%s stubs %x", __func__, eri_read(ESP_DBG_STUBS_TRAX_REG));
@@ -92,4 +93,15 @@ esp_err_t esp_dbg_stub_entry_set(esp_dbg_stub_id_t id, uint32_t entry)
     return ESP_OK;
 }
 
+esp_err_t esp_dbg_stub_entry_get(esp_dbg_stub_id_t id, uint32_t *entry)
+{
+    if (id < ESP_DBG_STUB_ENTRY_FIRST || id >= ESP_DBG_STUB_ENTRY_MAX) {
+        ESP_LOGE(TAG, "Invalid stub id %d!", id);
+        return ESP_ERR_INVALID_ARG;
+    }
+    *entry = s_stub_entry[id];
+
+    return ESP_OK;
+}
+
 #endif

+ 1 - 1
components/esp_wifi/lib

@@ -1 +1 @@
-Subproject commit fbcdc77c26eb0d716927c8bc7d73dbec9a8987c1
+Subproject commit e6945e61f7c63545a77b0575c3770a85b4de948e

+ 1 - 1
components/esptool_py/esptool

@@ -1 +1 @@
-Subproject commit 4698b396730b23fb4aab023c5fb1744db957fc4c
+Subproject commit 258301731780493365bb249553ae7855a3e753ea

+ 1 - 1
components/lwip/lwip

@@ -1 +1 @@
-Subproject commit 2c9c531f0a7e0ee536db9de4f9dc54e453712087
+Subproject commit 2195f7416fb3136831babf3e96c027a73075bd4f

+ 1 - 1
components/mqtt/esp-mqtt

@@ -1 +1 @@
-Subproject commit 9ea804e0ab5368d5ab53ae2301a5fec9d1f12f1a
+Subproject commit f10321a53b53a146ee299cfecc320b89c0cf6611

+ 1 - 1
components/nghttp/nghttp2

@@ -1 +1 @@
-Subproject commit 3bcc416e13cc790e2fb45fcfe9111d38609c5032
+Subproject commit 8f7b008b158e12de0e58247afd170f127dbb6456

+ 1 - 1
components/tinyusb/tinyusb

@@ -1 +1 @@
-Subproject commit 28f89e13473d40637574bcbfe4142633b39899fd
+Subproject commit 334e95fac52a607150157ae5199a19e11f843982

+ 1 - 1
examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib

@@ -1 +1 @@
-Subproject commit c3d3a69021cfec3236ca2c0b63be4048ec6643a4
+Subproject commit bb672b0437485fc7420add178299631692b15ac3