I try to use the JTAG debugger on my ESP-WROVER-KIT-VE in an Arduino and the esp-idf environment with Visual Studio Code and PlatformIO. I wrote a small program to test the debugger:
Code: Select all
static void applicationTask(void* p_Parameter)
{
setup();
while(true)
{
TIMERG0.wdt_wprotect = TIMG_WDT_WKEY_VALUE;
TIMERG0.wdt_feed = 1;
TIMERG0.wdt_wprotect = 0;
micros();
loop();
}
}
static void StartApplication(void)
{
initArduino();
applicationHandle = xTaskCreateStaticPinnedToCore(applicationTask, "applicationTask", CONFIG_ARDUINO_LOOP_STACK_SIZE, NULL, 1, applicationStack, &applicationBuffer, CONFIG_ARDUINO_RUNNING_CORE);
if(applicationHandle == NULL)
{
}
}
extern "C" void app_main(void)
{
StartApplication();
}
#include <Arduino.h>
void setup(void)
{
Serial.begin(115200);
}
void loop(void)
{
Serial.print("Hello\n\r");
delay(1000);
}
Code: Select all
[platformio]
src_dir = src
[env]
board = esp-wrover-kit
platform = espressif32@1.12.4
framework = arduino, espidf
board_upload.flash_size = 4MB
board_upload.maximum_size = 4194304
board_build.partitions = other/partitions.csv
upload_speed = 921600
upload_port = COM6
monitor_speed = 115200
monitor_port = COM6
monitor_filters = esp32_exception_decoder
debug_tool = ftdi
debug_init_break = tbreak app_main
platform_packages =
framework-arduinoespressif32 @ https://github.com/marcovannoord/arduino-esp32.git#idf-release/v4.0
toolchain-xtensa32@3.80200.200512
[common]
build_flags =
# ESP32 specific
-D ARDUINO_ESP32_DEV
-D BOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
lib_deps_builtin =
lib_deps_external =
[env:debug]
build_type = debug
build_flags =
${common.build_flags}
-D DEBUG
lib_deps =
${common.lib_deps_builtin}
${common.lib_deps_external}
JP2:
RXD <-> TXD0
TXD <-> RXD0
MTMS <-> TMS
MTDO <-> TDO
MTDI <-> TDI
MTCK <-> TCK
The board is powered over USB.
I got the following output when PlatformIO starts OpenOCD:
Code: Select all
Reading symbols from D:\ESP32-Dev\.pio\build\debug\firmware.elf...
done.
PlatformIO Unified Debugger -> http://bit.ly/pio-debug
PlatformIO: debug_tool = ftdi
PlatformIO: Initializing remote target...
Open On-Chip Debugger v0.10.0-esp32-20190708 (2019-07-08-11:04)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 20000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
Info : tcl server disabled
Info : telnet server disabled
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 20000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : accepting 'gdb' connection from pipe
Error: No symbols for FreeRTOS
Error: Target not examined yet
2
Error: Target not halted
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
Error: error during select: Unknown error
Warn : Flash driver of esp32.flash does not support free_driver_priv()
Warn : Flash driver of irom does not support free_driver_priv()
Warn : Flash driver of drom does not support free_driver_priv()
.pioinit:11: Error in sourced command file:
Remote communication error. Target disconnected.: Success.
Please note: I have already asked in the PlatformIO forum, but they can´t help me.