Skip to content

Enable JLink in JTAG instead of SWD mode for debugging #71

@maxgerhardt

Description

@maxgerhardt

The code at

debug['tools']['jlink'] = {
"server": {
"package": "tool-jlink",
"arguments": [
"-singlerun",
"-if", "SWD",
"-select", "USB",
"-device", debug.get("jlink_device"),
"-port", "2331"
],

Configures the debug_tool = jlink debugging method to hardcode SWD as the debugging protocol. There is no way to specify jtag here instead of swd normally, a user would have to specify a custom debug_server and friends command (which was e.g. done in this community post).

Interestingly, for uploading, such option is respected

UPLOADERFLAGS=[
"-device", board_config.get("debug", {}).get("jlink_device"),
"-speed", "4000",
"-if", ("jtag" if upload_protocol == "jlink-jtag" else "swd"),
"-autoconnect", "1",
"-NoGui", "1"
],

And it then does a -if jtag.

Can the code be adapted so that if a user e.g. writes debug_tool = jlink-jtag, that change is also carried over?

The documentation at https://docs.platformio.org/en/latest/plus/debug-tools/jlink.html should be adapted accordingly then.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions