OpenOCD
esp.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Espressif chips common target API for OpenOCD *
5  * Copyright (C) 2021 Espressif Systems Ltd. *
6  ***************************************************************************/
7 
8 #ifndef OPENOCD_TARGET_ESP_H
9 #define OPENOCD_TARGET_ESP_H
10 
11 #include <stdint.h>
12 #include <helper/bits.h>
13 
14 /* must be in sync with ESP-IDF version */
17 #define ESP_DBG_STUBS_CODE_BUF_SIZE 32 /* TODO: move this info to esp_dbg_stubs_desc */
20 #define ESP_DBG_STUBS_STACK_MIN_SIZE 2048/* TODO: move this info to esp_dbg_stubs_desc */
21 
31  ESP_DBG_STUB_DESC = ESP_DBG_STUB_TABLE_START, /*< Stubs descriptor ID */
35  /* add new stub entries here */
37 };
38 
39 #define ESP_DBG_STUB_MAGIC_NUM_VAL 0xFEEDBEEF
40 #define ESP_DBG_STUB_CAP_GCOV_THREAD BIT(0)
41 
51  uint32_t tramp_addr;
58  uint32_t min_stack_addr;
60  uint32_t data_alloc;
62  uint32_t data_free;
63 };
64 
68 struct esp_dbg_stubs {
70  uint32_t base;
74  uint32_t entries_count;
76  struct esp_dbg_stubs_desc desc;
77 };
78 
79 struct esp_common {
80  const struct esp_algorithm_hw *algo_hw;
81  struct esp_dbg_stubs dbg_stubs;
82 };
83 
84 int esp_common_init(struct esp_common *esp, const struct esp_algorithm_hw *algo_hw);
85 int esp_dbgstubs_table_read(struct target *target, struct esp_dbg_stubs *dbg_stubs);
86 
87 #endif /* OPENOCD_TARGET_ESP_H */
esp_dbg_stub_id
Debug stubs table entries IDs.
Definition: esp.h:27
@ ESP_DBG_STUB_TABLE_SIZE
Definition: esp.h:29
@ ESP_DBG_STUB_TABLE_START
Definition: esp.h:30
@ ESP_DBG_STUB_ENTRY_FIRST
Definition: esp.h:32
@ ESP_DBG_STUB_CAPABILITIES
Definition: esp.h:34
@ ESP_DBG_STUB_DESC
Definition: esp.h:31
@ ESP_DBG_STUB_ENTRY_MAGIC_NUM
Definition: esp.h:28
@ ESP_DBG_STUB_ENTRY_MAX
Definition: esp.h:36
@ ESP_DBG_STUB_ENTRY_GCOV
Definition: esp.h:33
int esp_dbgstubs_table_read(struct target *target, struct esp_dbg_stubs *dbg_stubs)
Definition: esp.c:27
int esp_common_init(struct esp_common *esp, const struct esp_algorithm_hw *algo_hw)
Definition: esp.c:17
Definition: esp.h:79
const struct esp_algorithm_hw * algo_hw
Definition: esp.h:80
struct esp_dbg_stubs dbg_stubs
Definition: esp.h:81
Debug stubs descriptor.
Definition: esp.h:47
uint32_t min_stack_addr
Pre-compiled target buffer's addr for stack.
Definition: esp.h:58
uint32_t data_free
Address of free-like function to free buffer allocated with data_alloc.
Definition: esp.h:62
uint32_t tramp_addr
Address of pre-compiled target buffer for stub trampoline.
Definition: esp.h:51
uint32_t data_alloc
Address of malloc-like function to allocate buffer on target.
Definition: esp.h:60
Debug stubs info.
Definition: esp.h:68
uint32_t entries[ESP_DBG_STUB_ENTRY_MAX]
Table contents.
Definition: esp.h:72
struct esp_dbg_stubs_desc desc
Debug stubs decsriptor.
Definition: esp.h:76
uint32_t entries_count
Number of table entries.
Definition: esp.h:74
uint32_t base
Address.
Definition: esp.h:70
Definition: target.h:116