Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support debugging for Espressif ESP8266 ESP-12E #280

Open
RobinKamps opened this issue Aug 3, 2022 · 2 comments
Open

Support debugging for Espressif ESP8266 ESP-12E #280

RobinKamps opened this issue Aug 3, 2022 · 2 comments

Comments

@RobinKamps
Copy link

https://docs.platformio.org/en/stable/plus/debugging.html#piodebug does not list ESP8266, so this might be a feature request.

Could not get JTAG Debugging running on platform-io.

adding the following lines to platformio.ini

[env:esp12e]
debug_tool = esp-prog
debug_init_break = tbreak setup

the debug console states:

undefinedError: Currently, PlatformIO does not support debugging for `Espressif ESP8266 ESP-12E`

jtag debugging seems to work on other (unknown) IDEs:
https://rsaxvc.net/blog/2020/2/22/Setting_up_ESP8266_for_sample-based_profiling_and_debugging.html

@modem-man-gmx
Copy link

pls. keep me informed, I have the same question. Tried also to place this qestion, enriched with all my findings on stackoverflow, but they don't accept my question, because they don't understand me (and likely you)

@modem-man-gmx
Copy link

This has been my attempt to place a question in stackoverflow:

Can I somehow remote debug ESP8266 boards? Not talking about "printf()-debugging", I mean real breakpoints or tracepoints, inspect value, step/run a.s.o.

Confused by 20 different websites telling 30 different answers, I like to learn if there is any chance to have a source code level debug session with Espressif ESP8266 µC.

Some say "no way, take ESP32". Okay, and could help generally debug faulty ESP programs, but this was not the question here because ESP8266 has less and different IO ports, less speed, less memory.
Some asian github project claims to also debug 8266, even OTA, if one is willingly to use this patched/forked RTOS. Confusing or unclear requirements. Looks like he is using an Arduino as the JTAG probe, right? - May or may not be true, but I am cautious about insecure sources (noted the Linux xz hack debacle?). Sounds like he made something with the OpenGDB interface.

Background:
I am using a couple of ESP8266 (Wemos Mini, NodeMCU). While ESPhome is quite easy stuff, I would like to completely write own C or C++ applications now, as well as modify/fix/extend some public github libraries. It's okay to use a NodeMCUv2 where the pin count of the Mini D1 is not sufficient. Or, in other words, I am okay with using the NodeMCU as the devboard-for-Mini-D1. Am a bit experienced in C90..C++17 under W32 and Linux, comfortable with make, litte experienced with PlatformIO and the json files under its hood. Usually I debug in IDEs like qtcreator, vscode, or VS20xx, under Linux, or MSYS2, or Windows. No experience with JTAG probes, but seen such since 30 years at the desk of mates ;-)

What I tried so far:

In Windows 11 I installed:

  • Python 3.12
  • USB-SERIAL CH340 driver of 2016 (because newer ones do not work with NodeMCU v2/v3)
  • Visual Studio Code 1.93
  • VSCode Extension "PlatformIO IDE" 6.1.15 (PIO)
  • inside PIO, the ESP8266 Board NodeMCU

Here I opened the shipped "Blink" example as RTOS version, believing FreeRTOS is part of the former packages. Not quite recent compared to stand-alone Espressif IDF RTOS tools, I read. It's still okay for UART and LED 1st steps, right? The example compiles and links without hiccup.

But once I select from PIO extension the "Debug | Start Debugging", a window pops up: "Could not find the specified task". The "Configure Task" button offers all possible and impossible compiler variants to me, to insert it in task.json. Nothing smells like debug spirit. Don't understand, what's missing here:
screenshot of Debug attempt: Could not find the specified task

Then I tried to read and understand if there are solutions aside of the official PlatformIO web site. Some information are perhaps not up to date?

Next I tried to verify, if others are discussing about setup difficulties or usage limits, because such discussions are a valuable indication of real usage.

The professional VisualGDB also claims being able to debug the 8266, anyway it is too expensive for my non-commercial spare time projects, but the point is: If they can, the 8266 is capable of debugging, right?

Another, never answered, Stackoverflow question indicates that someone started OpenOCD JTAG debug support for ESP8266 in 2015, but I can not see, if the questioner also has used it or if he just found the thread. The thread itself reads like a tried ... but ... starved. Or did I just miss the final solution?

So I would expect to get some answers like: "Yes dude, I am sucessfully using ESP8266 with in-system-debugging based on toolchain xxx. But be aware of using only runtime xyz and get occupied pin 13+14+15+16 via FT223 probe", or the like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants