Forum Replies Created
-
AuthorPosts
-
supportKeymaster
Hi,
Please refer to the following tutorial for detailed troubleshooting instructions: https://visualgdb.com/tutorials/arm/import/diagnose/
supportKeymasterHi,
We have just retested it with the latest Raspberry Pi Bullseeye image and it worked just fine.
Please try checking if running OpenOCD on another Linux box works. It doesn’t need to connect to the actual hardware – any output from OpenOCD (e.g. showing its version) indicates that it has launched successfully.
You can also try running sshd on your Raspberry Pi in foreground mode from a physical console:
sudo killall sshd sshd -d
This will force sshd to log every request issued by VisualGDB, so you can double-check whether VisualGDB attempts to launch OpenOCD and what arguments it uses.
supportKeymasterWe have tested this on our side during the release process, so the issue is likely caused by some configuration specific to your Raspberry Pi image.
Either way, you would indeed need to escape the arguments to “ssh” so that the quotes are handled correctly (although it would not affect the way VisualGDB runs commands). An easier way would be to create a script file (e.g. /usr/bin/openocd-test), make it executable and place the command line in there:
#!/bin/sh echo TEST123 echo TEST456 > /tmp/test.txt /usr/bin/openocd <hardcoded arguments>
Then you can select this script as the OpenOCD executable in VisualGDB settings, and see if it works. Specifically, if it shows “TEST123” in the VisualGDB Output window and if it creates a /tmp/test.txt file as well.
The script will ignore the actual arguments passed to it, so you can test it on WSL by just running “ssh pi@chani /usr/bin/openocd-test”.
supportKeymasterThanks for checking this. The OpenOCD view under VisualGDB output should not be blank! It looks like OpenOCD actually never gets a chance to run when launched by VisualGDB.
It could happen if you had 2 different openocd executables in different directories and 2 incompatible values of the PATH variable for the SSH command mode (used by VisualGDB) and the SSH shell mode (used by regular shells).
You can try troubleshooting it further by setting the explicit path to the OpenOCD executable in VisualGDB Project Properties. If it doesn’t help, please try launching OpenOCD via SSH by running the following command from another Linux machine (or WSL):
ssh [user]@[ip address of Raspberry Pi] full-path-to-openocd <command line parameters>
If it doesn’t start a valid OpenOCD session (producing output), something about the SSH configuration is interfering with it.
supportKeymasterHi,
If we understood you correctly, having VisualGDB launch OpenOCD on the target has no effect, but running it manually works.
If this is the case, please follow the steps below:
- Start a debug session with VisualGDB. Click “ignore” when it reports the error.
- Double-check the Debug->Windows->VisualGDB Output->OpenOCD window in Visual Studio. Does OpenOCD show any errors there? Is it still running?
- If OpenOCD appears running, can you see it on the target machine by running “sudo ps -ax”? If not, you might be running it on a different target.
- If OpenOCD exited with an error, what is the error message? Also are you doing anything different when launching it manually (e.g. running it under sudo or connecting the device differently)?
supportKeymasterHi,
No problem, we have updated our MinGW32/MinGW64 packages based on the latest releases from MSYS2.
supportKeymasterNo problem. Please try the following:
- Start a debug session with VisualGDB and take a note of the debug port used by OpenOCD.
- When VisualGDB reports that it cannot connect to the target, press the “ignore” button. Do not stop the debug session, so that VisualGDB keeps OpenOCD running.
- While OpenOCD launched by VisualGDB is still running, try manually running gdb and connecting to the target.
If the manually initiated connection works, please double-check your firewall settings and try disabling it, as it might be specifically blocking the Visual Studio process and gdb launched by it.
If the manually initiated connection doesn’t work, please try ending the debug session in VisualGDB and immediately running OpenOCD with the same command line (please use the complete command line including all environment variables from View->Other Windows->VisualGDB Diagnostics Console).
Please let us know your findings and we will advise you on further diagnostic steps.
supportKeymasterHi,
This could indicate a network/firewall issue. Please try doing the following manually:
- Run OpenOCD on Raspberry Pi
- Run GDB on Windows
- Manually run the “target remote” command in GDB.
If the connection doesn’t work, please try changing the port to a lower value (e.g. 3000).
You can change the port number used by VisualGDB by setting the PreferredGDBPort element in the .vgdbsettings/.vgdbcmake file to a non-zero value. It will override the default logic of picking a random unused port.
supportKeymasterHi,
VisualGDB follows the project structure set by the STM32CubeMX generator, placing all files generated by it (including the main one) into the BSP library, and the user-added files directly into the executable.
As the executables and the BSP libraries are defined in different CMake targets, they have different sets of settings (executables inherit the settings from the BSP libraries) controlled by CMake statements like target_include_directories(). Editing various settings via GUI ultimately generates one or more CMake statements and has exactly the same affect as if these statements were added manually.
Based on the description you provided, you ended up with a set of target_include_directories() statements that do not match the actual targets. The easiest way to troubleshoot it would be to double-check what statements got added to CMakeLists.txt files. If they reference incorrect BSP names (see the find_bsp() statements), you can simply adjust them manually by editing the CMakeLists.txt file. If you can confirm that VisualGDB consistently generates invalid statements in some cases and can share the steps to reproduce the issue we should be able to fix it. Otherwise, simply patching the generated statement manually should work fine as well.
You can read more about CMake targets and how VisualGDB handles them here: https://visualgdb.com/documentation/projects/cmake/
supportKeymasterHi,
As per the documentation page, running OpenOCD remotely is supported starting from the Linux edition. If you are using the lower Embedded edition, you can always upgrade it here: https://sysprogs.com/splm/mykey.
If the feature worked earlier, it was likely during the trial period which is equivalent to the highest available Ultimate edition.
supportKeymasterHi,
Please do check the page we linked in the previous reply – it shows the exact setting for this exact behavior.
supportKeymasterHi,
You can also try using DWARF 5. It is considerably different from DWARF4 and might work around the issue. Another thing to try would be using GDB indexes.
You can troubleshoot the slow gdb response by running the “set debug remote 1” command and checking whether the delay comes from the target answering GDB requests (e.g. OpenOCD) or gdb itself (i.e. happens between a reply and the next request).
supportKeymasterHi,
Our fork of OpenOCD mainly focuses on improved integration with VisualGDB (e.g. faster memory reading API for VisualGDB to use) and does not duplicate any of VisualGDB’s features on its own.
supportKeymasterHi,
Please refer to the following page for more details: https://visualgdb.com/documentation/colors/
supportKeymasterHi,
Sure, you can always click the “select a third-party toolchain” button to import an arbitrary toolchain. VisualGDB will create a Toolchain.xml/CustomToolchain.xml file either in the toolchain directory or under %LOCALAPPDATA%, where it will store the toolchain properties. You can then manually edit the file to customize various settings (e.g. add hardcoded CFLAGS). See this page for a detailed explanation.
-
AuthorPosts