ESP32 FT2232 debugging understanding

Hi,

I want to debug my ESP32 with a FT2232 board (“the green one” from ebay^^) within Visual Studio Code, which I already got to work.

Some points are not clear for me, and I did not find an answer so far:

  1. if I set more then two breakpoints, it tells me maximum of hardware breakpoints is reached. EDIT: every breakpoint I add whereever is added as Hardware Breakpoint. How can I set sw-breakpoints?
  2. maybe VSC-related: do I always have to add a watch variable by typing in the name or copy from code and paste after pressing + in watch? In VS2017 I just had do mark them and pull then over to watch.
  3. the “auto” variables show lots of global variables (I assume by FreeRTOS and so on), but none of my globals are showing up.
    If I f.e. add a vector name to the watch list, it is not loaded right. I already checked adding
    build_unflags = -Os
    build_flags = -O1 -g3 -ggdb
    which lead to problems and did not improve.
  4. When stepping in or over, it takes 1-2 seconds until I reach the next step. Is that normal?
  5. Sometimes breakpoints are not hit / step over reacts as if I pressed F5. Why?

Re question 1: Software breakpoints only work if the code resides in RAM. However, it resides in flash memory. So hardware breakpoints are required. It’s possible to modify the code in flash as if it were in RAM. To the best of my knowledge that’s not implemented (in Espressif’s version of OpenOCD), probably because it has several drawbacks…

Re question 5: Stepping requires a hardware breakpoint as well. So if you have already set two breakpoints, stepping does not stop anymore. It would be nice if there was a warning.

1 Like