Compilation fails when using esp_apptrace_init() - JTAG
Posted: Sun Apr 02, 2023 8:00 am
Hello everyone.
I'm trying to build a small program for testing JTAG 2-ways communication.
I have the error:
This error disappears if I remove the line containing a call to esp_apptrace_init()
I'm working under platformIO in CLI mode.
I'm lost...
Here's the small code:
And here's the platformio.ini file:
Is this an espressif issue or a platformIO one?
Any help would be greatly appreciated.
Thanks in advance.
Nathan.
I'm trying to build a small program for testing JTAG 2-ways communication.
I have the error:
Code: Select all
/Users/nb/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/nb/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libapp_trace.a(app_trace.c.obj):(.literal.esp_apptrace_init+0x10): undefined reference to `esp_apptrace_jtag_hw_get'
/Users/nb/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /Users/nb/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libapp_trace.a(app_trace.c.obj):(.literal.esp_apptrace_init+0x14): undefined reference to `esp_apptrace_uart_hw_get'
[...]
collect2: error: ld returned 1 exit status
*** [.pio/build/esp-wrover-kit/firmware.elf] Error 1
I'm working under platformIO in CLI mode.
I'm lost...
Here's the small code:
Code: Select all
#include <Arduino.h>
#include "esp_app_trace.h"
esp_err_t res;
void setup() {
Serial.begin(115200);
/* Init communication JTAG */
res = esp_apptrace_init(); <====== line that cause the error
if (res != ESP_OK) {
log_e("Failed to init JTAG communication");
}
}
void loop() {
/* Send to PC */
char buf_to_pc[] = "Hello World!";
res = esp_apptrace_write(ESP_APPTRACE_DEST_JTAG, buf_to_pc, strlen(buf_to_pc), ESP_APPTRACE_TMO_INFINITE);
if (res != ESP_OK) {
log_e("Failed to write data to host!");
}
res = esp_apptrace_flush(ESP_APPTRACE_DEST_JTAG, ESP_APPTRACE_TMO_INFINITE);
if (res != ESP_OK) {
log_e("Failed to flush data to host!");
}
/* Receive from PC */
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 */
res = esp_apptrace_read(ESP_APPTRACE_DEST_JTAG, 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 */
}
}
Code: Select all
[env:esp-wrover-kit]
platform = espressif32
board = esp-wrover-kit
framework = arduino
upload_speed = 921600
monitor_speed = 115200
build_type = debug
debug_tool = esp-prog
build_flags = -DBOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
-DCORE_DEBUG_LEVEL=4
Any help would be greatly appreciated.
Thanks in advance.
Nathan.