I tried it with the following contents of platformio.ini, is this what you meant?
[env:esp32dev]
platform = https://github.com/platformio/platform-espressif32.git
board = esp32dev
framework = espidf
monitor_speed = 115200
debug_tool = jlink
Now it doesn’t reject the “jlink” value. It first compiles everything and then seems to attempt to start a debug session. This looks better than before.
However, the resulting debug session startup looks exactly like what I pasted above, where I used my “custom” debug_tool configuration. See log output below. It seems that it fails at the same point, and a bit after that, I get a crash notification/report for the process xtensa-esp32-elf-gdb from the macOS crash reporter. I assume that has nothing to do with you and is Espressif’s problem.
Preparing firmware for debugging...
Processing esp32dev (platform: https://github.com/platformio/platform-espressif32.git; board: esp32dev; framework: espidf)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Espressif 32 > Espressif ESP32 Dev Module
SYSTEM: ESP32 240MHz 320KB RAM (4MB Flash)
DEBUG: CURRENT(jlink) EXTERNAL(esp-prog, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 0 compatible libraries
Scanning dependencies...
No dependencies
Retrieving maximum program size .pioenvs/esp32dev/firmware.elf
Checking size .pioenvs/esp32dev/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA: [ ] 3.9% (used 12928 bytes from 327680 bytes)
PROGRAM: [= ] 12.6% (used 131647 bytes from 1048576 bytes)
========================= [SUCCESS] Took 15.68 seconds =========================
Reading symbols from /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/firmware.elf...
done.
PlatformIO Unified Debugger > http://bit.ly/pio-debug
PlatformIO: Initializing remote target...
Open On-Chip Debugger 0.10.0-dev (2018-06-04-09:51)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
esp32 interrupt mask on
force hard breakpoints
Info : tcl server disabled
Info : telnet server disabled
Info : No device selected, using first device.
Info : J-Link V9 compiled Apr 15 2014 19:08:28
Info : Hardware version: 9.00
Info : VTarget = 3.327 V
Info : Reduced speed from 20000 kHz to 15000 kHz (maximum).
Info : Reduced speed from 20000 kHz to 15000 kHz (maximum).
Info : clock speed 20000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : Target halted. PRO_CPU: PC=0x400D0728 (active) APP_CPU: PC=0x400E083E
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
Info : accepting 'gdb' connection from pipe
Info : Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400E083E
Info : Auto-detected flash size 4096 KB
Info : Using flash size 4096 KB
app_main () at src/app_main.c:15
15 {
Hardware assisted breakpoint 1 at 0x400d0728: file src/app_main.c, line 15.
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
Info : esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
esp32: target state: halted
esp32: target state: halted
Info : esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
esp32: target state: halted
esp32: target state: halted
** Programming Started **
** Programming Started **
auto erase enabled
auto erase enabled
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076E0
Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076E0
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076E2
Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076E2
wrote 20480 bytes from file /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/bootloader.bin in 2.774038s (7.210 KiB/s)
wrote 20480 bytes from file /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/bootloader.bin in 2.774038s (7.210 KiB/s)
** Programming Finished **
** Programming Finished **
** Verify Started **
** Verify Started **
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076DD
Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076DD
read 19424 bytes from file /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/bootloader.bin and flash bank 0 at offset 0x00001000 in 1.080790s (17.551 KiB/s)
contents match
read 19424 bytes from file /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/bootloader.bin and flash bank 0 at offset 0x00001000 in 1.080790s (17.551 KiB/s)
contents match
** Verified OK **
** Verified OK **
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
Info : esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
esp32: target state: halted
esp32: target state: halted
Info : esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
esp32: target state: halted
esp32: target state: halted
** Programming Started **
** Programming Started **
auto erase enabled
auto erase enabled
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076E2
Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076E2
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076DD
Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076DD
wrote 4096 bytes from file /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/partitions.bin in 2.337003s (1.712 KiB/s)
wrote 4096 bytes from file /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/partitions.bin in 2.337003s (1.712 KiB/s)
** Programming Finished **
** Programming Finished **
** Verify Started **
** Verify Started **
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076E2
Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076E2
read 3072 bytes from file /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/partitions.bin and flash bank 0 at offset 0x00008000 in 0.865138s (3.468 KiB/s)
contents match
read 3072 bytes from file /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/partitions.bin and flash bank 0 at offset 0x00008000 in 0.865138s (3.468 KiB/s)
contents match
** Verified OK **
** Verified OK **
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
Info : esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
esp32: target state: halted
esp32: target state: halted
Info : esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
esp32: target state: halted
esp32: target state: halted
** Programming Started **
** Programming Started **
auto erase enabled
auto erase enabled
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076E2
Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076E2
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076DD
Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076DD
wrote 135168 bytes from file /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/firmware.bin in 4.759008s (27.737 KiB/s)
wrote 135168 bytes from file /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/firmware.bin in 4.759008s (27.737 KiB/s)
** Programming Finished **
** Programming Finished **
** Verify Started **
** Verify Started **
Info : Use core0 of target 'esp32'
Use core0 of target 'esp32'
Info : Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076E2
Target halted. PRO_CPU: PC=0x40091D07 (active) APP_CPU: PC=0x400076E2
read 133312 bytes from file /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/firmware.bin and flash bank 0 at offset 0x00010000 in 2.408957s (54.043 KiB/s)
contents match
read 133312 bytes from file /Users/liyanage/Dropbox/Documents/esp/esp-workshop/1helloworld/.pioenvs/esp32dev/firmware.bin and flash bank 0 at offset 0x00010000 in 2.408957s (54.043 KiB/s)
contents match
** Verified OK **
** Verified OK **
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu0: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
cpu1: Current bits set: BreakIn BreakOut RunStallIn
Info : esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
esp32: target state: halted
esp32: target state: halted
Info : esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
esp32: target state: halted
esp32: target state: halted
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = thb app_main`
Info : Target halted. PRO_CPU: PC=0x400D0728 (active) APP_CPU: PC=0x400E083E
Target halted. PRO_CPU: PC=0x400D0728 (active) APP_CPU: PC=0x400E083E
Cannot execute this command while the target is running.
Use the "interrupt" command to stop the target
and then try again.
[New Thread 1073510396]
[New Thread 1073508496]
[New Thread 1073513052]
[New Thread 1073500704]
[New Thread 1073497436]
[New Thread 1073499232]
[New Thread 1073501836]
[Switching to Thread 1073506380]
Temporary breakpoint
1, app_main () at src/app_main.c:15
15 {
/Volumes/build/idf/crosstool-NG/.build/src/gdb-7.10/gdb/inline-frame.c:171: internal-error: void inline_frame_this_id(struct frame_info *, void **, struct frame_id *): Assertion `!frame_id_eq (*this_id, outer_frame_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session?
(y or n) [answered Y; input not from terminal]
This is a bug, please report it.
For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.
/Volumes/build/idf/crosstool-NG/.build/src/gdb-7.10/gdb/inline-frame.c:171: internal-error: void inline_frame_this_id(struct frame_info *, void **, struct frame_id *): Assertion `!frame_id_eq (*this_id, outer_frame_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB?
(y or n) [answered Y; input not from terminal]