Apptrace - Read data from host

mikbeng
Posts: 2
Joined: Wed Jul 10, 2019 7:28 am

Apptrace - Read data from host

Postby mikbeng » Tue Aug 04, 2020 3:19 pm

I have some questions using the apptrace library to read data from host via jtag and openocd-esp32. I've successfully got communication working from target to host with the example in the documentation: https://docs.espressif.com/projects/esp ... ic-tracing:

Code: Select all

#include "esp_app_trace.h"
...
char buf[] = "Hello World!";
esp_err_t res = esp_apptrace_write(ESP_APPTRACE_DEST_TRAX, buf, strlen(buf), ESP_APPTRACE_TMO_INFINITE);
if (res != ESP_OK) {
    ESP_LOGE(TAG, "Failed to write data to host!");
    return res;
}
What I'm wondering is how to set up the host in order to write data to the target. The apptrace library provides API for reading data from host:

Code: Select all

#include "esp_app_trace.h"
...
char buf[32];
char down_buf[32];
size_t sz = sizeof(buf);

/* config down buffer */
esp_apptrace_down_buffer_config(down_buf, sizeof(down_buf));
/* check for incoming data and read them if any */
esp_err_t res = esp_apptrace_read(ESP_APPTRACE_DEST_TRAX, buf, &sz, 0/*do not wait*/);
if (res != ESP_OK) {
    ESP_LOGE(TAG, "Failed to read data from host!");
    return res;
}
if (sz > 0) {
    /* we have data, process them */
    ...
}
But there is no information on how to set up this on the host side. Anyone that has done this? Is it possible to send data via openocd-esp32 with some command?

Any tips are helpful!

samyozn@gmail.com
Posts: 1
Joined: Wed Nov 30, 2022 1:20 pm

Re: Apptrace - Read data from host

Postby samyozn@gmail.com » Wed Nov 30, 2022 1:23 pm

have you found a solution to it? it is 2023 and they still not having example in the API guide.

Who is online

Users browsing this forum: Bing [Bot], emaayan, ignisuti and 125 guests