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

Feature request: run openocd from a remote pc #36

Open
abelmeg opened this issue Mar 27, 2018 · 7 comments
Open

Feature request: run openocd from a remote pc #36

abelmeg opened this issue Mar 27, 2018 · 7 comments
Assignees

Comments

@abelmeg
Copy link

abelmeg commented Mar 27, 2018

I have been using the extension and found it to be very nice and valuable tool. Now, I wanted to run openocd from another computer in the same network. I was able to achieve this by modifying the source-code and changing the ip address and port numbers while at the same time disabling the local openocd. This is working fine but I was wondering if this is something you can consider for future releases. This can be in the form of providing optional arguments to disable the local openocd and provide the remote address and port numbers. The remote openocd can be started manually.

Thanks

@Marus
Copy link
Owner

Marus commented Mar 28, 2018

This is certainly something I will consider for future versions - but don't know exactly when I will get to it. Thanks for the suggestion.

@Marus Marus closed this as completed Mar 28, 2018
@Marus Marus reopened this Mar 28, 2018
@Marus Marus self-assigned this Apr 5, 2018
@mariusgreuel
Copy link

With cppdbg, you would start openocd manually and adjust "miDebuggerServerAddress": "localhost:3333" to point to the remote hosts gdb server.

@shlomow
Copy link

shlomow commented Jan 26, 2019

Hi Marus,
Is there any news regarding this feature?

@Marus
Copy link
Owner

Marus commented Jan 27, 2019

This is something that is still fairly low priority for me to officially support.

There is technically a hidden "external" server type which may be able to support this now - something similar to the following for your launch.json may work (The syntax highlighting may show "server type": "external" as an error, but you should be able to ignore it).

{
  "name": "Debug with External",
  "cwd": "${workspaceRoot}",
  "executable": "<path to executable>",
  "request": "launch",
  "type": "cortex-debug",
  "runToMain": true,
  "servertype": "external",
  "preLaunchCommands": [
    "target extended-remote <hostname/ip>:<port>", 
    "monitor halt"
  ]
}

(If you don't want to flash the remote target with the firmware; then you can use "type": "attach" and replace "preLaunchCommands" with "preAttachCommands"; and you may or may not need the monitor halt command)

In this case though it doesn't know that it is specifically connecting to OpenOCD - so some features may to work properly that would otherwise work in an OpenOCD configuration (e.g. RTOS support, SWO output)

@0Grit
Copy link

0Grit commented May 29, 2019

@Marus the "external" recommendation above doesn't seem to be working.

Getting "controller class is not a constructor".

@tbandtg
Copy link

tbandtg commented Jan 26, 2021

Has anyone gotten this to work? I assume you fill in your ip address as such.
"request": "launch",
"type": "cortex-debug",
"runToMain": true,
"servertype": "external",
"preLaunchCommands": [
"target extended-remote <hostname/ip>172.27.9.47:3334",
"monitor halt"
]

        but I get an error, 
        
        External GDB server type must specify the GDB target. This should either be a "hostname:port" combination or a serial port.

@haneefdm
Copy link
Collaborator

I use it all the time from more than a year ago. Here is what is in the change log
. I always use gdbTarget to specify host:port

  • Added new servertype of external for cases where you want to control the GDB server yourself. This could be used for cases where you need to run the GDB server on a different machine, or in cases where there are multiple target cores which may cause the debug server to not operate as expected by cortex-debug. This configuration may require more customizations to the launch.json file than other more automated server types. When this servertype is selected a value for the gdbTarget launch.json property must be supplied.
  • Added new launch.json options (overrideLaunchCommands, overrideRestartCommands and overrideAttachCommands) to be able to override the default commands run on those operations. In most cases this is not needed, but may be required for external server types (by default commands that are compatible with openocd are used for external server types).

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

No branches or pull requests

7 participants