Uploading sketch using JTAG interface on ESP-PROG errors

I have managed to both upload and debug a sketch via the JTAG port on an ESP-PROG connected to an ESP32 dev board, using PlatformIO. It all seems to work but I’m worried about some error/warning messages and wonder if anyone can suggest a solution?

Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

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()

Many thanks for any help and advice

This is usually a fatal error. It occurs if the FTDI driver blocks access to ESP-Prog. The remedy is to change the driver (using Zadig on Windows) or to unload the driver (on macOS).

If this error message is shown but the upload / debugging still works, it means that OpenOCD tried several USB PID/VID combinations and the first one failed. It then continues to try the next one. The error handling in the FTDI specific code of OpenOCD could need some improvements.

These warnings can be safely ignored. They are related to cleanup at the end of a OpenOCD session. Again, OpenOCD error handling has room for improvement.

Thank you very much for your helpful answer Manuel. I surprised myself as a newcomer to PIO that I could both upload and debug - what an improvement over Arduino IDE! I was just concerned that the error message might cause me a problem in future, but you have reassured me.

Hello Manuel, things have been working well following your advice but since a recent VSC update I have a new problem, if you have any suggestions I would be most grateful:

ESP32 debugger problem

I can do ESP32 debugging for older projects but when I now create a new project it does not work with the following error message - grateful for any help.

Error: The PlatformIO task detection didn’t contribute a task for the following configuration:

{

"type": "PlatformIO",

"task": "Monitor",

"problemMatcher": [

    "$platformio"

],

"label": "PlatformIO: Monitor"

}

The task will be ignored.

Error: The PlatformIO task detection didn’t contribute a task for the following configuration:

{

"type": "PlatformIO",

"task": "Pre-Debug",

"problemMatcher": [

    "$platformio"

],

"label": "PlatformIO: Pre-Debug [build in debug mode]"

}

The task will be ignored.

I can do ESP32 debugging for older projects but when I now create a new project it does not work with the following error message - grateful for any help.

Error: The PlatformIO task detection didn’t contribute a task for the following configuration:

{

"type": "PlatformIO",

"task": "Monitor",

"problemMatcher": [

    "$platformio"

],

"label": "PlatformIO: Monitor"

}

The task will be ignored.

Error: The PlatformIO task detection didn’t contribute a task for the following configuration:

{

"type": "PlatformIO",

"task": "Pre-Debug",

"problemMatcher": [

    "$platformio"

],

"label": "PlatformIO: Pre-Debug [build in debug mode]"

}

The task will be ignored.

Also this:
his is a bug, please report it.

/builds/idf/crosstool-NG/.build/src/gdb-7.10/gdb/regcache.c:697: internal-error: regcache_raw_read_unsigned: Assertion `regnum >= 0 && regnum < regcache->descr->nr_raw_registers’ 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]

2 3 / 3

Hi,
I have the same issue. I have ESP32 devkit v4 and platformio:

Version: 1.47.2 (user setup)
Commit: 17299e413d5590b14ab0340ea477cdd86ff13daf
Date: 2020-07-15T18:22:06.216Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19041
My setup is this:

[env:generic]

platform = ${common_env_data.platform_espressif32}

framework = arduino

board = esp32dev

;debug_tool=minimodule

;upload_protocol = minimodule

debug_tool = minimodule

upload_protocol = minimodule

debug_init_break = tbreak setup

any help would be appreciated.

Thank you
Iman

Which same issue?

Error: The PlatformIO task detection…

or:

/builds/idf/crosstool-NG/.build/src/gdb-7.10/gdb/regcache.c:697: internal-error: regcache_raw_read_unsigned: Assertion `regnum >= 0 && regnum < regcache->descr->nr_raw_registers’ failed.

And please everybody here: Take some time and format your question such that it’s easy to distinguish between copied output and other text such as questions and explanations.

Did the problem start after a VSC update?

The “The PlatformIO task detection didn’t contribute a task…” issue has recently popped up again, though it only affects a few people and couldn’t be reproduced by Ivan.

The issue is just an annoyance. It doesn’t break anything. When it originally appeared a year ago, deleting .vscode/tasks.json solved the problem for the affected project.

I’m more concerned about the “gdb/regcache.c:697: internal-error”. Can you provide more context? What action did you perform when it happened? What’s the log before and after the error?

Both errors occurred when I invoked debugging for an ESP32 project, the issue, you describe as an annoyance, happens every time and affects projects that have .vscode/tasks.json but some projects do not have .vscode/tasks.json and they also produce this error message. I don’t understand why some tasks have .vscode/tasks.json and some do not. The gdb error only happened once and I can’t remember, or recreate, the context or find the log, if it happens again I’ll let you know the details.
Thanks

If you can create a setup that is reproducible for Ivan (see Task error reappearing after update to VSCode 1.47), he is likely going to take care of it.

If I’m not mistaken, the project can start without tasks.json. But once you use the debugger, it needs to be created.

Do I correctly understand your situation: debugging usually works but is a pain to use due to the error messages? Or is debugging broken?

I’ve sent all the info I have re machine setup to Ivan. Immediately post VSC update I could not create the simplest project and run the debugger then after a while the debugging worked again but with the error message every time Error: The PlatformIO task detection didn’t contribute a task for the following configuration: