Sending commands via JTAG to the esp32.

CKiamy
Posts: 19
Joined: Wed Nov 23, 2022 3:01 pm

Sending commands via JTAG to the esp32.

Postby CKiamy » Thu Mar 16, 2023 4:04 pm

Hello everyone!

For my project I am currently using the ESP32-WROOM-32UE device and a jlink adapter for JTAG flashing and debugging. Is there a way to send a command through a command window via JTAG that is similar to UART? For example, to read information received via UART, we can use the function:
  1. uart_read_bytes(uart_num, buf, length, ticks_to_wait);
Is there a similar function like this via JTAG? I would like to do some logic in my firmware like:
  1. while(receivingJtagCommand){
  2.     jtagCommand = jtag_read_bytes(ECHO_JTAG_PORT, data, (BUF_SIZE - 1), 20 / portTICK_PERIOD_MS);
  3.     if(jtagCommand == "Hello"){
  4.         runSpecialTask();
  5.         break;
  6.     }
  7. }
This type of logic can be perfectly done via UART, but is it possible via JTAG? I have tried using the esp_apptrace_read command to no avail, and documentation for this type of application is pretty spotty.

CKiamy
Posts: 19
Joined: Wed Nov 23, 2022 3:01 pm

Re: Sending commands via JTAG to the esp32.

Postby CKiamy » Fri Mar 17, 2023 7:06 am

Bump

n47h4n
Posts: 11
Joined: Sun Mar 05, 2023 10:59 am

Re: Sending commands via JTAG to the esp32.

Postby n47h4n » Sat Apr 01, 2023 11:33 am

Hi,

Did you find a way to do that?
I'm very interesting.

n47h4n
Posts: 11
Joined: Sun Mar 05, 2023 10:59 am

Re: Sending commands via JTAG to the esp32.

Postby n47h4n » Sat Apr 01, 2023 8:43 pm

Hi CKiamy,

I have found this:

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((uint8_t*) 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) {
      log_e("Failed to read data from host!");
  }
  if (sz > 0) {
      /* we have data, process them */
  }
I didn't try it, I'm waiting an esp-prog...

Who is online

Users browsing this forum: Bing [Bot] and 93 guests