Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Troubleshooting

This page lists common problems and how to fix them. If yours isn’t here, ask in our Discord server.

v5gdb is not recognized / command not found

Your terminal can’t find the v5gdb command.

  1. Close and reopen the terminal, or restart VS Code. The installer should add v5gdb to your shell PATH, but terminals that were already open might not see v5gdb until they’re re-opened.
  2. Run v5gdb --help to check that it’s now working. If it still isn’t found, run the installer again and read its output for errors.

“No V5 device is connected”

v5gdb can’t communicate with your V5 brain. It might be turned off or unplugged.

  • Check that the brain is on and plugged into your computer with a USB cable. A controller connected to the brain over USB may also work, but is not recommended.
  • Try a different cable or USB port. Some cables are only for power.

“Address already in use”

A different program is using your V5 brain and preventing v5gdb from connecting to it.

  • Close anything else that might be using the brain’s USB connection, such as another terminal running pros terminal, cargo v5, or vexcom. Only one program can use the V5 at a time.

“Device disconnected” or “Device not configured”

The USB cable was disconnected during the session, or the V5 brain turned off. Reconnect the cable, then run v5gdb again. If the brain was turned off or the program was stopped, start the program again first.

v5gdb can’t find a debugger

v5gdb needs GDB to be installed. It looks for these, in order:

  1. arm-none-eabi-gdb
  2. GDB from the PROS toolchain named in the PROS_TOOLCHAIN environment variable
  3. GDB from the PROS toolchain installed by the PROS VS Code extension
  4. gdb-multiarch
  5. gdb

If you use PROS through VS Code, make sure the extension has finished installing its toolchain. Otherwise, see the GDB installation instructions in the Rust setup guide, or tell v5gdb which GDB program to use with --client.

GDB starts, but my program never stops at breakpoints

  • GDB may have lost connection at some point; try quitting and re-running v5gdb.
  • Make sure you rebuilt and uploaded after adding v5gdb::install() (PROS: pros mu).
  • Make sure v5gdb::install() is actually being run. In PROS it should be near the start of initialize().
  • Make sure the program is running on the brain before you start v5gdb.
  • Check that the breakpoint is on a line that is actually being run. For example, a breakpoint in autonomous() won’t be run during driver control.

GDB shows the wrong code, or line numbers don’t match

  • The program on the brain may be older than the code on your computer. Build and upload again, then restart v5gdb.
  • v5gdb might not have found the robot code on your computer. Make sure you’re running v5gdb from inside your PROS project. For Rust, make sure you’ve specified the ELF file you’re debugging.

Variables are <optimized out>, or stepping skips lines

The compiler rearranged or removed some code to make your program faster. This is normal when optimizations are on. Try setting a breakpoint on a later line where the variable is used, instead of stepping. For Rust, debug without --release (see Considerations).

My printf output looks garbled

PROS encodes program output in a special format. v5gdb normally detects this in PROS projects, but if you run v5gdb from outside your project folder, it might not. Run it from your project folder, or pass --user-io pros. See --user-io.

The robot keeps moving while paused

Pausing the program doesn’t stop motors by default. Stop them with monitor stop, or turn on automatic stopping:

  • From GDB: monitor autostop true
  • In C++: v5gdb::install({.stop_motors_on_break = true});
  • In Rust: v5gdb::install(V5Debugger::stdio().stop_motors_on_break(true));

Uploads fail while v5gdb is running

When v5gdb is running, other programs aren’t able to connect to the V5 brain.

Quit v5gdb (type quit) before uploading, and start it again after the upload.