Remote Debugging with Visual Studio

A remote debugging session consists of a Host-Target connection, where the Visual Studio IDE resides on the host system and the process to be debugged resides on a target system on the local network. This section describes the steps necessary for setting up an eRTOS target PC and a host PC for debugging eRTOS applications remotely with Visual Studio.

Sections in this Topic:

For a more comprehensive example of debugging an eRTOS application, see MiniTutorial: Debugging Applications in Visual Studio.

Target Setup

Setup of the Target system requires the following steps:

Install the eRTOS Runtime:

For remote debugging with Visual Studio, the eRTOS network must be configured on the target system.

Configure remote debugging:

For launch and attach:

• Run eRTOS Visual Studio Remote Debugger by calling Run RtVSMon.ertos.

Note: The eRTOS network MUST be configured with one network interface and connected to the host system running Visual Studio.

• By default, RtVSMon.ertos uses the first available IP address and 9999 as the port number if not specified. For more detailed information, please refer to eRTOS Visual Studio Remote Debug Monitor.

Host Setup

Create or open the project in Visual Studio:

Select the MaxRT eRTOS Debugger:

  1. With the project open in Visual Studio, select the MaxRT eRTOS Debugger from the Debugger drop-down.
  2. In the Property Pages dialog, click Configuration Properties > Debugging. Do the following:
  3. Make sure MaxRT eRTOS Debugger is selected.
  4. Set the Command line to the full local path to the binary you want to launch on the Target system. For example: C:\Debug\eRTOSRemoteApp.ertos.
  5. Set Remote Server Name to the IP address of the eRTOS Target System.
  6. Optionally. If the eRTOS Visual Studio Remote Debug Monitor is listening on a port other than the default port, specify the Remote Server Port.
  7. Specify any Command Arguments.

Note: If the Remote Server IP address you provide is invalid, the following error is encountered: The MaxRT eRTOS debugger is unable to connect to eRTOS target. Debugging will be aborted.

Debug the Target Application

Start RtVsMon:

  1. On the Target system, launch the Visual Studio Remote Debugger from Start > All Programs > Visual Studio 2022/2019.
  2. On the Host system, build the eRTOSDebug configuration of the binary you want to debug, and then copy that binary to the Command line path on the Target system that you specified in Step 2b under Host Setup.
  3. On the Host system, in Visual Studio, press F5 or Debug > Start Debugging to debug the binary on the Target system.

Troubleshooting

If there are any problems connecting the host and target systems:

Note: Visual Studio may close and restart if the connection is lost during remote debugging.

For a more comprehensive example of debugging an eRTOS application, see MiniTutorial: Debugging Applications in Visual Studio.

Related Topics:

MiniTutorials: