Debugging failed

Sysprogs forums Forums VisualGDB Debugging failed

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #36170
    pdpruyne@gmail.com
    Participant

    Trying to try out VisualGdb.  Tired of arduino/platformio, looking to find a real dev environment for microcontroller software development, ESP32’s.

    I am professional developer, longtime VisualStudio user, win11pro, vs2022.  Just downloaded and installed VisualGdb.   My immediate goal: get the debugger running.

    Throughout this, when informed “You don’t have XXX installed, Install it?” I always picked Install, saw no errors reported, was allowed to proceed after each install step.  Anything un-mentioned below, was left at its supplied default.

    ————————————

    Thought I’d start with something easy, this is what happens, tried a couple of rounds, same same:

    1. picked “new arduino project”
    2. (Project Type)    picked “create a new blinking led project”
    3. (Arduino Device)   picked  “Nologo ESP32C3 Super Mini” ,  picked “Com 25”
    4. (Debug Method – Debug using)
      1. from Usb Devices list, picked  “usb-ESP32S3/ESP32Cx built-in JTAG”
        1. (Debug Method – Test)  Fails with pop-up, “USB Composite Device does not appear to have WinUSB driver installed.”  That is correct.  Abandoned path, been down zadig ratholes before.
      2. from Debug Methods list, picked “OpenOCD”
        1. (Debug Method – Test)  Test Works!
    5. Picked finish

    Presto, looks good, a project, a source file.  I pick File/Save-All .

    1. I notice banner “The currently selected Arduino platform produces binaries without debug information…”  I pick “Fix Build Settings”.  Momentary progress bars, then banner disappears.
    2. I select Build, project builds ok.
    3. I hunt around, find “Program FLASH Memory”, works fine, board starts blinking.  Sweet!
    4. Feeling bold, I try F5
      1. VS swaps into its debugging colors, the various debugging sub-windows appear
      2. Get a big pop-up  “Debugging failed”
        1. GDB Session output :Your VisualGDB trial expires in 30 days!
          C:\Users\pdp\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302\bin\\riscv32-esp-elf-gdb –interpreter mi “C:/Usr/Iot/SysProgs/ApBl1/Output/Nologo_ESP32C3_Super_Mini/Debug/ApBl1.ino.elf”
          -gdb-version

           

        2. Exception details: VisualGDB version: 6.0.105.5243
          —————— le3+l2 ——————
          le3+l2: GDB session exited prematurely. Please verify that the project is built, the selected GDB binary exists and the working directory is specified correctly. If GDB reports an internal error, try updating GDB or erasing the target’s FLASH memory using external tools.
          at le3.q()
          at p63.t_2()
          at VisualGDB.GDBDebugEngine.x1(pa3 a, j1 b)
          trace=[le3.q:5068, p63.t_2:39, VisualGDB.GDBDebugEngine.x1:69]
        3. openocd details: Info : Listening on port 6666 for tcl connections
          Info : Listening on port 51087 for telnet connections
          Info : esp_usb_jtag: serial (7C:2C:67:D1:7F:B8)
          Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
          Info : clock speed 3076 kHz
          Info : JTAG tap: esp32c3.cpu tap/device found: 0x00005c25 (mfg: 0x612 (Espressif Systems), part: 0x0005, ver: 0x0)
          Info : [esp32c3] datacount=2 progbufsize=16
          Info : [esp32c3] Examined RISC-V core; found 1 harts
          Info : [esp32c3] XLEN=32, misa=0x40101104
          Info : starting gdb server for esp32c3 on 51089
          Info : Listening on port 51089 for gdb connections
    5. Tried putting the board into “boot mode”, holding boot while pressing reset, same result

    I followed the example here: https://visualgdb.com/tutorials/arduino/esp32/

    My steps differ only in how the jtag is connected.  I feel like the successful debug-method test result validates the choices I made.  The successful flash programming, and the board-doing-the-blink, also argue that things must be pretty-close.

    How should I proceed?  What have I missed?

    #36172
    support
    Keymaster

    Hi,

    Please try running the gdb executable shown in the message (C:\Users\pdp\AppData\Local\Arduino15\packages\esp32\tools\esp-rv32\2302\bin\\riscv32-esp-elf-gdb) manually. Arduino package vendors sometimes forget to ship required libraries with their packages, leading to this type of error.

    #36174
    pdpruyne@gmail.com
    Participant

    Hi.  Thanks for the quick response.

    You got it first try.  That binary is indeed missing in that location.

    Oddly, I find a binary (riscv32-esp-elf-gdb.exe) in 6 different paths.

    The first in a directory structure installed by VisualGdb as part of the process of trying the steps in my post.

    1. C:\SysGCC\esp32\tools\riscv32-esp-elf-gdb\14.2_20240403\riscv32-esp-elf-gdb\bin
    2. C:\Usr\Espressif\tools\riscv32-esp-elf-gdb\14.2_20240403\riscv32-esp-elf-gdb\bin
    3. C:\Users\pdp\.platformio\packages\tool-riscv32-esp-elf-gdb\bin
    4. C:\Users\pdp\.platformio\packages\toolchain-riscv32-esp\bin
    5. C:\Users\pdp\AppData\Local\Arduino15\packages\esp32\tools\riscv32-esp-elf-gdb\12.1_20231023\bin
    6. C:\Usr\Ard15\packages\esp32\tools\riscv32-esp-elf-gdb\12.1_20231023\bin

    1 & 2 are identical binaries.  5 & 6 are identical binaries.  3 is about the same size as the others, while 4 is 20-times larger.

    I tried the quick&dirty trick of mklink to fix the issue, trying both symbolic and hard links.  No change.

    I tried copying the binary in 5 to the specified directory, no change.

    Tried running the copied executable in that directory with the –help option, got no output and a negative return value.  Tried the same thing with that same executable in its original dir, worked – got help output.

    Concluded the executable is somehow chaining to other executables in it’s directory.  There are a whole set of versions there, from 3.3 to 3.12.  Copied ALL of them to the specified directory,.

    Debugging “started” but output window pops the msg in red “Error erasing flash with vFlashErase packet”, followed by a warning message msg in yellow “Could not set a breakpoint on main. Step into a new instance will not work”

    Deleted the copied set of executables.  Tried the single “large” binary in directory 4, same result, debugging starts and pops same error messages in output window about flash erase and breakpoint setting failures.

    So, I conclude quick and dirty fixes are not enough.  Any suggestions on a “clean” fix?

     

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.