Debugging ESP32 PICO v4.1 works on Win 10 but fails on Ubuntu 18.04 with error: esp32: Failed to read insn (-4)!

Hi

I have a simple blink sketch that works well on Windows but fails on Ubuntu 18.04 with the following error

Temporary breakpoint 1 at 0x400d0c66: file src/main.cpp, line 21.
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = tbreak setup`
PlatformIO: More configuration options -> http://bit.ly/pio-debug
**Error: esp32: Failed to read insn (-4)!**
Error: esp32: Failed to add SW BP!
Error: can't add breakpoint: resource not available
Error: esp32: Failed to read insn (-4)!
Error: esp32: Failed to add SW BP!
Error: can't add breakpoint: resource not available
**Error: esp32: Failed to read insn (-4)!**
Error: esp32: Failed to add SW BP!
Error: can't add breakpoint: resource not available
Warning:
**Cannot insert breakpoint 1.**
Cannot access memory at address 0x400d0c66**

Here is a copy of my the platformio.ini file

[env:pico32]
platform = espressif32
board = pico32
framework = arduino
debug_tool = esp-prog
debug_init_break = tbreak setup
debug_build_flags = -O0 -ggdb3 -g3
monitor_speed = 115200
build_flags = 
   -D LED_BUILTIN=4

It should be noted

  • I am running the latest pio: PlatformIO, version 5.0.2b2
  • I am running the same hardware on both systems, but again on Win 10 all is good.
  • On Ubuntu 18, once I get this error, I immediate lose access to /dev/ttyUSB0 but /dev/ttyUSB1 is available.
  • I can upload and monitor well on Ubuntu 18.04
  • My HW is PICO V4.1

If you have any ideas, please let me know.

Many thanks in advance.

FYI, I just upgraded the openocd to this version, and it seems to work
https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20200709/openocd-esp32-linux64-0.10.0-esp32-20200709.tar.gz
Whatever it is…it seems to be related to ESP’s version of openOCD

Let us hope that helps someone

Thx guys