Skip to content

Cortex-debug with dev-container. How to connect to JLinkRemoteServer outside docker? #511

@andyinno

Description

@andyinno

Upon @haneefdm comment I am creating a new issue for this question.

I am trying to connect to my JLink adapter but vscode stops the debug as soon as I connect.

I am launching JLinkRemoteServerExe on host computer

I am using this configuration:

  {
            "type": "cortex-debug",
            "name": "Remote",
            "servertype": "jlink",
            "ipAddress": "192.168.1.87",
            "device": "ATSAM3A4C",
            "serverpath": "JLinkGDBServerCLExe",
            "request": "launch",
            "executable": "${workspaceRoot}/build/test_executable.elf",
            "runToMain": true,
            "svdFile": "${workspaceRoot}/.vscode/ATSAM3A4C.svd",
            "serverArgs": [
                "-rtos",
                "GDBServer/RTOSPlugin_FreeRTOS"
            ],
            "swoConfig": {
                "enabled": true,
                "cpuFrequency": 84000000,
                "swoFrequency": 7500000,
                "source": "probe",
                "decoders": [
                    {
                        "type": "console",
                        "label": "ITM0",
                        "port": 0,
                        "encoding": "ascii"
                    }
                ]
            }
        },

What I get on the vscode terminal is:

Connecting to J-Link...
J-Link is connected.
...
Checking target voltage...
Target voltage: 3.28 V

Therefore docker connects to host and host query the JLink device... but after some line (less than a second):

Waiting for GDB connection...SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

My host is a ubuntu OS. I just want to have my own docker instance with all the tools already setup.

thank you in advance

If I try to connect from outside the docker instance (reopen folder on host) I can connect to the board with this setup.

As a sidenote:

@haneefdm you are right that I was polluting a different topic with this question, however your comment

You are doing something this tool was not designed for

Is something unexpected to me. Can you elaborate on this? I think that:

  • Windows -> WSL -> Toolchain in Docker

is really similar to:

  • Any Linux distro -> Docker -> Toolchain in Docker

We both want to be able to use standardized tools on different hosts and being able to code and debug our software

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions