Page 1 of 1

ESPEasy in debug mode (using "ESP-prog")

Posted: 30 Jan 2021, 11:57
by joost d
I like to develop a ESPEasy-plugin in platformio (for using the Nokia 5110) and like to develop ESPEasy in the debug mode. The hardware configuration is the ESP32-Wroom and the hardware-dubugger "ESP-prog". For using the "ESP-log", I’used the instruction of platformio.org. That’s works fine for a example project (blink).
I tried for several days to get ESPEasy to work in the debugmode. Unfortunately without success ;-). When I start the “Start debugging” (F5), I get the error: "Could not find the specified task"

Is there anyone who can advise me?

Re: ESPEasy in debug mode (using "ESP-prog")

Posted: 30 Jan 2021, 12:06
by TD-er
Start debugging (or any "run" task in the menu) uses the "default" PIO environment in platformio.ini.
So either change that one, or debug on the specific pio environment.

However, I have not set all debugging flags for all kind of hardware debuggers.
I only attempted it on the "wrover kit" environment.
Maybe you should look into that configuration?

Re: ESPEasy in debug mode (using "ESP-prog")

Posted: 30 Jan 2021, 23:35
by joost d
I do not exactly understand what you mean. But I have attached several files. Maybe that tell you what course my problem.

Re: ESPEasy in debug mode (using "ESP-prog")

Posted: 31 Jan 2021, 13:30
by joost d
I just discovered the the output gives this information:

Error: The PlatformIO task detection didn't contribute a task for the following configuration:
{
"type": "PlatformIO",
"task": "Build",
"problemMatcher": [
"$platformio"
],
"group": "build",
"label": "PlatformIO: Build"
}
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: Build in debug mode"
}
The task will be ignored.
Error: The PlatformIO task detection didn't contribute a task for the following configuration:
{
"type": "PlatformIO",
"task": "Pre-Debug (esp32dev)",
"problemMatcher": [
"$platformio"
],
"label": "PlatformIO: Build in debug mode (esp32dev)"
}
The task will be ignored.

Re: ESPEasy in debug mode (using "ESP-prog")

Posted: 31 Jan 2021, 13:54
by TD-er
I have never used this "ESP-prog" debugger myself.
Like I mentioned, I have tried the ESP32 WROVER kit a long time ago, but that was quite a struggle to get it to work and when it worked the debugging was quite useless.

Problem with the WROVER kit is that the used USB to UART controller has 2 serial ports.
So you had to use a special tool to get the com port to use the correct drivers and also make sure they were assigned always the same COM port when you replug the device or reboot.

When that's working, you could eventually set a break point (only 1 or 2) and the process of starting/restarting took forever.
The binary of the ESP is also quite a bit larger, so you must really work on a minimal set and timing issues are thus impossible to detect in this setup.

When you enter a break point, you may end up a few steps further in the process, so you may already have exited the function that triggered the break point and variable inspection is thus also quite useless.

Maybe it has improved over the last 2 years, but for me, when I need to debug at a low level, I use a logic analyzer or a scope and just set pins high/low in the code when I really need to track some issue.