Skip to content

Commit 57ccb08

Browse files
committed
esp32: Workaround for GCOV command to work with IDF's debug stubs
1 parent fb49eea commit 57ccb08

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/target/esp108_apptrace.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,20 @@ static int esp108_apptrace_read_status(struct target *target, uint32_t *stat)
586586
return ERROR_OK;
587587
}
588588

589+
int esp108_apptrace_write_status(struct target *target, uint32_t stat)
590+
{
591+
int res = 0;
592+
593+
esp108_queue_nexus_reg_write(target, ESP_APPTRACE_TRAX_STAT_REG, stat);
594+
esp108_queue_tdi_idle(target);
595+
res = jtag_execute_queue();
596+
if (res != ERROR_OK) {
597+
LOG_ERROR("Failed to exec JTAG queue!");
598+
return res;
599+
}
600+
return ERROR_OK;
601+
}
602+
589603
static int esp108_activate_swdbg(struct target *target, int enab)
590604
{
591605
int res;
@@ -2622,6 +2636,13 @@ int esp_cmd_gcov(struct target *target, const char **argv, int argc)
26222636
static struct esp_apptrace_cmd_ctx s_at_cmd_ctx;
26232637
int res = ERROR_OK;
26242638

2639+
// TODO: remove this when gcov debug stubs support will be merged
2640+
res = esp108_apptrace_write_status(target, 0);
2641+
if (res != ERROR_OK) {
2642+
LOG_ERROR("Failed to write gcov status (%d)!", res);
2643+
return res;
2644+
}
2645+
26252646
// init cmd context
26262647
res = esp_gcov_cmd_init(target, &s_at_cmd_ctx, argv, argc);
26272648
if (res != ERROR_OK) {

0 commit comments

Comments
 (0)