Hi,
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. I wrote a small program to test the debugger:
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);
}
And my configuration file:
[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}
The code is working on the development board, but the debugger doesn´t start. I´m clicking on PIO Debug
inside of the debug menu and I got the following output:
Processing debug (board: esp-wrover-kit; platform: espressif32@1.12.4; framework: arduino, espidf)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp-wrover-kit.html
PLATFORM: Espressif 32 (1.12.4) > Espressif ESP-WROVER-KIT
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (ftdi) On-board (ftdi) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 0.0.0+sha.d011dd7
- framework-espidf 3.40001.200521 (4.0.1)
- tool-cmake 3.16.4
- tool-esptoolpy 1.20600.0 (2.6.0)
- tool-idf 1.0.1
- tool-mconf 1.4060000.20190628 (406.0.0)
- tool-ninja 1.9.0
- toolchain-esp32ulp 1.22851.191205 (2.28.51)
- toolchain-xtensa32 3.80200.200512 (8.2.0)
Reading CMake configuration...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 2 compatible libraries
Scanning dependencies...
Dependency Graph
Building in debug mode
Retrieving maximum program size .pio\build\debug\firmware.elf
Checking size .pio\build\debug\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 6.6% (used 21656 bytes from 327680 bytes)
Flash: [= ] 7.4% (used 194487 bytes from 2621440 bytes)
Sometimes the debugger starts and throws this error:
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separat
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
What is wrong here?