PlatformIO Community

Debugger not starting for multiple platforms

2020-02-05_220838

It’s my 5th day of trying to get the debugger to work in any way. I have a simple process (listed below) which reliably fails with the above message from VSC. I have googled the error message without shedding any light.

I have now tried my minimal process for 3 different platforms: esp8266, esp32, and nrf52840-dk, and for arduino and mbed

My process:

  1. Import the standard blinky example distributed with platformIO for the chosen platform;
  2. Compile and observe that it loads and runs;
  3. Then I add upload_protocol = jlink to .ini
  4. Start debugging (F5), and immediately get the error

I have installed the drivers as per standard documentation.
…platformio\packages\tool-jlink\USBDriver\InstDrivers

I do wish a platfromIO person would notice me!

Please add debug_tool = jlink to the platformio.ini. Can you show the output of the verbose upload task?

1 Like

Hi sorry for delay getting back - flu!

I’ve tried to figure this out by myself, but I’m still scratching my head!

I now gone as far back to basics as I know how:
I have a stock (non-clone) ESP-WROOM-32 dev kit, and the ESP-Prog programmer. It is connected as per the documentation:

ESP32 Pin JTAG Signal
1 CHIP_PU TRST_N
2 MTDO / GPIO15 TDO
3 MTDI / GPIO12 TDI
4 MTCK / GPIO13 TCK
5 MTMS / GPIO14 TMS

Both interface 0 and interface 1 look like this

image

platformio.ini looks like this:

[env:esp-wroom-32-dev-kit]
platform = espressif32
board = esp-wrover-kit
framework = arduino
debug_tool = esp-prog
debug_init_break = tbreak setup
upload_protocol = esp-prog
platform_packages =
    framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
;build_type = debug
;monitor_speed = 115200

Typing into the command window: platformio run --target upload --verbose

Spews out this:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Users\lamming\Documents\PlatformIO\Projects_test2\platformio_repo\BlinkESP32> platformio run --target upload --verbose
Processing esp-wroom-32-dev-kit (platform: espressif32; board: esp-wrover-kit; framework: arduino; debug_tool: esp-prog; debug_init_break: tbreak setup; upload_protocol: esp-prog; platform_packages: framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp-wrover-kit.html
PLATFORM: Espressif 32 1.11.1 > Espressif ESP-WROVER-KIT
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) 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 9b75c65 (git+https://github.com/espressif/arduino-esp32.git)
 - tool-esptoolpy 1.20600.0 (2.6.0)
 - tool-mkspiffs 2.230.0 (2.30)
 - tool-openocd-esp32 1.1000.20190708 (10.0)
 - toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 27 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
xtensa-esp32-elf-g++ -o .pio\build\esp-wroom-32-dev-kit\src\main.cpp.o -c -fno-rtti -fno-exceptions -std=gnu++11 -Os -g3 -Wall -nostdlib -Wpointer-arith -Wno-error=unused-but-set-variable -Wno-error=unused-variable -mlongcalls -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -Wno-error=deprecated-declarations -Wno-error=unused-function -Wno-unused-parameter -Wno-sign-compare -fstack-protector -fexceptions -Werror=reorder -DPLATFORMIO=40200 -DARDUINO_ESP32_DEV -DESP32 -DESP_PLATFORM -DF_CPU=240000000L -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DARDUINO=10805 -DARDUINO_ARCH_ESP32 -DARDUINO_VARIANT=\"esp32\" "-DARDUINO_BOARD=\"Espressif ESP-WROVER-KIT\"" 

[trimmed for space]

@"C:\Users\lamming\Documents\PlatformIO\Projects_test2\platformio_repo\BlinkESP32\.pio\build\esp-wroom-32-dev-kit\longcmd-5e8405a87c6fbf2b34ac1864241cb5a7" C:\Users\lamming\.platformio\packages\framework-arduinoespressif32@src-537c58760dafe7fcc8a1d9bbcf00b6f6\cores\esp32\wiring_pulse.c
xtensa-esp32-elf-gcc -o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\wiring_shift.c.o -c -std=gnu99 -Wno-old-style-declaration -Os -g3 -Wall -nostdlib -Wpointer-arith -Wno-error=unused-but-set-variable -Wno-error=unused-variable -mlongcalls -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -Wno-error=deprecated-declarations -Wno-error=unused-function -Wno-unused-parameter -Wno-sign-compare -fstack-protector -fexceptions -Werror=reorder -DPLATFORMIO=40200 -DARDUINO_ESP32_DEV -DESP32 -DESP_PLATFORM -DF_CPU=240000000L -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DARDUINO=10805 -DARDUINO_ARCH_ESP32 -DARDUINO_VARIANT=\"esp32\" "-DARDUINO_BOARD=\"Espressif ESP-WROVER-KIT\"" @"C:\Users\lamming\Documents\PlatformIO\Projects_test2\platformio_repo\BlinkESP32\.pio\build\esp-wroom-32-dev-kit\longcmd-5e8405a87c6fbf2b34ac1864241cb5a7" C:\Users\lamming\.platformio\packages\framework-arduinoespressif32@src-537c58760dafe7fcc8a1d9bbcf00b6f6\cores\esp32\wiring_shift.c
xtensa-esp32-elf-ar rc .pio\build\esp-wroom-32-dev-kit\libFrameworkArduino.a .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\Esp.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\FunctionalInterrupt.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\HardwareSerial.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\IPAddress.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\IPv6Address.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\MD5Builder.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\Print.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\Stream.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\StreamString.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\WMath.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\WString.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\base64.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\cbuf.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-adc.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-bt.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-cpu.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-dac.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-gpio.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-i2c.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-ledc.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-matrix.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-misc.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-psram.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-rmt.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-sigmadelta.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-spi.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-time.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-timer.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-touch.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\esp32-hal-uart.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\libb64\cdecode.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\libb64\cencode.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\main.cpp.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\stdlib_noniso.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\wiring_pulse.c.o .pio\build\esp-wroom-32-dev-kit\FrameworkArduino\wiring_shift.c.o
xtensa-esp32-elf-g++ -o .pio\build\esp-wroom-32-dev-kit\firmware.elf -T esp32_out.ld -nostdlib -Wl,-static -u call_user_start_cpu0 -Wl,--undefined=uxTopUsedPriority -Wl,--gc-sections -Wl,-EL -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u __cxa_guard_dummy -u __cxx_fatal_exception .pio\build\esp-wroom-32-dev-kit\src\main.cpp.o -L.pio\build\esp-wroom-32-dev-kit -LC:\Users\lamming\.platformio\packages\framework-arduinoespressif32@src-537c58760dafe7fcc8a1d9bbcf00b6f6\tools\sdk\lib -LC:\Users\lamming\.platformio\packages\framework-arduinoespressif32@src-537c58760dafe7fcc8a1d9bbcf00b6f6\tools\sdk\ld -Wl,--start-group .pio\build\esp-wroom-32-dev-kit\libFrameworkArduinoVariant.a .pio\build\esp-wroom-32-dev-kit\libFrameworkArduino.a -lgcc -lfreertos -lmesh -lod -lwear_levelling -lfb_gfx -lesp_adc_cal -lc_nano -lesp32 -ldriver -lhal -ljsmn -lsmartconfig -lesp_http_server -lprotocomm -lface_recognition -lespnow -ltcpip_adapter -lface_detection -lunity -lc -llibsodium -lesp_http_client -lapp_update -lnewlib -lcxx -ltcp_transport -lm -lefuse -lopenssl -lwifi_provisioning -lespcoredump -llog -lmbedtls -lesp_ringbuf -lwps -lnet80211 -lmqtt -lesp_https_server -lapp_trace -lesp_event -lesp32-camera -lsoc -lheap -llwip -lwpa -lrtc -lxtensa-debug-module -lspi_flash -lphy -lfr -lconsole -lcoap -lbtdm_app -lsdmmc -lfd -lmicro-ecc -ljson -lcore -lprotobuf-c -lethernet -lspiffs -lnvs_flash -lwpa_supplicant
-lvfs -lasio -lwpa2 -lpp -lbootloader_support -limage_util -ldl_lib -lulp -lnghttp -lpthread -lfreemodbus -lexpat -lfatfs -lsmartconfig_ack -lmdns -lcoexist -lesp-tls -lesp_https_ota -lbt -lstdc++ -Wl,--end-group
<lambda>(["checkprogsize"], [".pio\build\esp-wroom-32-dev-kit\firmware.elf"])
MethodWrapper(["checkprogsize"], [".pio\build\esp-wroom-32-dev-kit\firmware.elf"])
"c:\users\lamming\.platformio\penv\scripts\python.exe" "C:\Users\lamming\.platformio\packages\tool-esptoolpy@1.20600.0\esptool.py" --chip esp32 elf2image --flash_mode dio --flash_freq 40m --flash_size 4MB -o .pio\build\esp-wroom-32-dev-kit\firmware.bin
.pio\build\esp-wroom-32-dev-kit\firmware.elf
esptool.py v2.6
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   4.0% (used 13212 bytes from 327680 bytes)
Flash: [==        ]  15.3% (used 200067 bytes from 1310720 bytes)
.pio\build\esp-wroom-32-dev-kit\firmware.elf  :
section                                                         size         addr
.rtc.text                                                          0   1074528256
.rtc.dummy                                                         0   1073217536
.rtc.force_fast                                                    0   1073217536
.rtc_noinit                                                        0   1342177792
.rtc.force_slow                                                    0   1342177792
.iram0.vectors                                                  1024   1074266112
.iram0.text                                                    43799   1074267136
.dram0.data                                                     8812   1073470304
.noinit                                                            0   1073479116
.dram0.bss                                                      4400   1073479120
.flash.rodata                                                  46680   1061158944
.flash.text                                                    99752   1074593816
.debug_frame                                                   81232            0
.debug_info                                                  1424887            0
.debug_abbrev                                                 179166            0
.debug_aranges                                                 31896            0
.debug_ranges                                                  34632            0
.debug_macro                                                  157197            0
.debug_line                                                   719428            0
.debug_str                                                    904437            0
.comment                                                         419            0
.xtensa.info                                                      56            0
.xt.lit._ZN9IPAddressD5Ev                                          0            0
.xt.prop._ZN9IPAddressD5Ev                                         0            0
.xt.prop._ZN9IPAddressD2Ev                                        36            0
.xt.prop._ZN9IPAddressD0Ev                                        36            0
.xt.prop._ZTV9IPAddress                                           12            0
.xt.lit._ZN5Print5writeEPKc                                        8            0
.xt.prop._ZN5Print5writeEPKc                                      60            0
.xt.lit._ZN6String4initEv                                          8            0
.xt.prop._ZN6String4initEv                                        60            0
.xt.prop._ZNK6String3lenEv                                        60            0
.xt.prop._ZN6String6setLenEi                                      60            0
.xt.prop._ZNK6String7wbufferEv                                    48            0
.xt.prop._ZTISt9exception                                         12            0
.xt.prop._ZTISt9bad_alloc                                         12            0
.xt.prop._ZTVN10__cxxabiv117__class_type_infoE                    12            0
.xt.lit._ZNK9__gnu_cxx24__concurrence_lock_error4whatEv            8            0
.xt.lit._ZNK9__gnu_cxx26__concurrence_unlock_error4whatEv          8            0
.xt.lit._ZN9__gnu_cxx24__concurrence_lock_errorD5Ev                8            0
.xt.lit._ZN9__gnu_cxx26__concurrence_unlock_errorD5Ev              8            0
.xt.lit._ZN9__gnu_cxx7__mutex4lockEv                               8            0
.xt.lit._ZN9__gnu_cxx13__scoped_lockD5Ev                           8            0
.xt.prop._ZNK9__gnu_cxx24__concurrence_lock_error4whatEv          48            0
.xt.prop._ZNK9__gnu_cxx26__concurrence_unlock_error4whatEv        48            0
.xt.prop._ZN9__gnu_cxx24__concurrence_lock_errorD5Ev              12            0
.xt.prop._ZN9__gnu_cxx26__concurrence_unlock_errorD5Ev            12            0
.xt.prop._ZN9__gnu_cxx7__mutex4lockEv                             60            0
.xt.prop._ZN9__gnu_cxx13__scoped_lockD5Ev                         12            0
.xt.prop._ZN9__gnu_cxx24__concurrence_lock_errorD2Ev              36            0
.xt.prop._ZN9__gnu_cxx26__concurrence_unlock_errorD2Ev            36            0
.xt.prop._ZN9__gnu_cxx24__concurrence_lock_errorD0Ev              36            0
.xt.prop._ZN9__gnu_cxx26__concurrence_unlock_errorD0Ev            36            0
.xt.prop._ZN9__gnu_cxx13__scoped_lockD2Ev                         72            0
.xt.prop._ZTIN9__gnu_cxx24__concurrence_lock_errorE               12            0
.xt.prop._ZTIN9__gnu_cxx26__concurrence_unlock_errorE             12            0
.xt.prop._ZTVN9__gnu_cxx24__concurrence_lock_errorE               12            0
.xt.prop._ZTVN9__gnu_cxx26__concurrence_unlock_errorE             12            0
.xt.prop._ZTVSt9bad_alloc                                         12            0
.xt.prop._ZTVN10__cxxabiv120__si_class_type_infoE                 12            0
.debug_loc                                                    523948            0
Total                                                        4262717
<lambda>(["upload"], [".pio\build\esp-wroom-32-dev-kit\firmware.bin"])
AVAILABLE: esp-prog, espota, esptool, ftdi, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esp-prog
openocd -d2 -s C:/Users/lamming/.platformio/packages/tool-openocd-esp32/share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32-wrover.cfg -c "program_esp32 {{.pio\build\esp-wroom-32-dev-kit\firmware.bin}} 0x10000 verify" -c "program_esp32 {{C:/Users/lamming/.platformio/packages/framework-arduinoespressif32@src-537c58760dafe7fcc8a1d9bbcf00b6f6/tools/sdk/bin/bootloader_dio_40m.bin}} 0x1000 verify" -c "program_esp32 {{C:/Users/lamming/Documents/PlatformIO/Projects_test2/platformio_repo/BlinkESP32/.pio/build/esp-wroom-32-dev-kit/partitions.bin}} 0x8000 verify" -c "program_esp32 {{C:/Users/lamming/.platformio/packages/framework-arduinoespressif32@src-537c58760dafe7fcc8a1d9bbcf00b6f6/tools/partitions/boot_app0.bin}} 0xe000 verify" -c
"reset run; shutdown"
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
debug_level: 2
none separate
adapter speed: 20000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
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 : Listening on port 3333 for gdb connections
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
*** [upload] Error 253

Seems like the same error described in Issue with ESP32: JTAG scan chain interrogation failed for the Wrover kit.

Have you set all requiered jumpers (especially JP2) per https://docs.espressif.com/projects/esp-idf/en/latest/hw-reference/get-started-wrover-kit.html#get-started-esp-wrover-kit-v4-1-setup-options?

Max, Sadly it was an RTFM issue. I had read everything I could lay my hands on, but was tripped up when I watched a video setting up a debug session, and of course not noticed that a few steps had been omitted. - namely creating a correct launch.json script. All the other myriad things were red herrings.

Only wasted a week on this dumb problem. Thank you for your help
M

1 Like