probe-rs / vscode

VSCode debug extension for probe-rs. It uses the MS DAP protocol to communicate directly with the probe (via probe-rs), and supports basic command line debugging in addition to VSCode UI.
https://probe.rs/
Other
66 stars 6 forks source link

Documentation is inaccurate. #35

Closed curiousmuch closed 2 years ago

curiousmuch commented 2 years ago

Hello!

I've installed the latest release v0.4.0 of the VSC extension w/ the latest version for probe-rs-debugger as specified. Using the example configuration files - the debugger will never run. Further, there is a missing comma in the second launch example and inconsistencies between the examples (some placed "chip" in the "coreConfigs" and some don't).

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "probe-rs-debug",
            "request": "launch",
            "name": "probe_rs Executable launch example",
            "cwd": "${workspaceFolder}",
            "connectUnderReset": true,
            "speed": 24000, //!MODIFY (or remove)
            "probe": "PID:VID:<Serial>", //!MODIFY (or remove)
            "runtimeExecutable": "probe-rs-debugger",
            "runtimeArgs": [
                "debug"
            ],
            "coreIndex": 0,    // VSCODE COMPLAINS IS INVALID OPTION. 
            "flashingConfig": {
                "flashingEnabled": true,
                "resetAfterFlashing": true,
                "haltAfterReset": true,
            } // MISSING COMMA HERE
            "coreConfigs": [
                {
                    "programBinary": "Relative or fully qualified path to your programBinary", //!MODIFY
                    "chip": "STM32H745ZITx", //!MODIFY
                    "svdFile": "Relative or fully qualified path to your programBinary", //!MODIFY
                }
            ],
            "consoleLogLevel": "Info", //Error, Warn, Info, Debug, Trace 
        }
    ]
}

I was able to start a debug session with the following:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "probe-rs-debug",
            "request": "launch",
            "name": "probe_rs Executable launch example",
            "cwd": "${workspaceFolder}",
            "connectUnderReset": true,
            "speed": 24000, //!MODIFY (or remove)
            // "probe": "PID:VID:<Serial>", //!MODIFY (or remove)
            "runtimeExecutable": "probe-rs-debugger",
            "runtimeArgs": [
                "debug"
            ],
            "flashingConfig": {
                "flashingEnabled": true,
                "resetAfterFlashing": true,
                "haltAfterReset": true,
            },
            "chip": "STM32H723ZGTx", //!MODIFY
            "coreConfigs": [
                {
                    "coreIndex": 0,
                    "programBinary": "target/thumbv7em-none-eabihf/debug/blinky", //!MODIFY
                    // "svdFile": "Relative or fully qualified path to your programBinary", //!MODIFY
                }
            ],
            "consoleLogLevel": "Info", //Error, Warn, Info, Debug, Trace 
        }
    ]
}

Please let me know if there is anything else I can do to assist.

noppej commented 2 years ago

Thanks for catching these. There were some changes in the config and these errors slipped through in the docs.

noppej commented 2 years ago

Fix for this has been submitted in https://github.com/probe-rs/webpage/pull/51