ARM-software / vscode-cmsis-csolution

Extension support for VS Code CMSIS Project Extension
https://marketplace.visualstudio.com/items?itemName=Arm.cmsis-csolution
Other
25 stars 5 forks source link

launch.json can't find prelaunch task #57

Open vescovd1 opened 7 months ago

vescovd1 commented 7 months ago

Type: Bug Report

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Code sample and logs

`

Screenshots

image

Additional context

I can trigger the individual Flash Device task and that works. Just not from launch.json
vescovd1 commented 7 months ago

I am triggering from the "Debug" icon from the CMSIS view

arekzaluski commented 7 months ago

Hi @vescovd1,

Issue exists because your launch config uses Arm Embedded Debugger extension for debugging and Arm Debugger extension for flashing the application on the device. I recommend adding the new Debug configuration that uses Arm Debugger. You can find more on how to set it up here: Arm Debugger configuration

vescovd1 commented 7 months ago

so I tried changing my launch json to arm-debugger from arm-debug but it still does not work.

launch.json: { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [

    {
        "name": "Arm Debugger",
        "type": "arm-debugger",
        "request": "launch",
        "serialNumber": "${command:device-manager.getSerialNumber}",
        "program": "${command:arm-debugger.getApplicationFile}",
        "cmsisPack": "${command:cmsis-csolution.getTargetPack}",
        "deviceName": "${command:cmsis-csolution.getDeviceName}",
        "processorName": "${command:cmsis-csolution.getProcessorName}",
        "preLaunchTask": "arm-debugger.flash: Flash Device"
    }
]

}

tasks.json: { "version": "2.0.0", "tasks": [ { "label": "arm-debugger.flash: Flash Device", "type": "arm-debugger.flash", "serialNumber": "${command:device-manager.getSerialNumber}", "program": "${command:arm-debugger.getApplicationFile}", "cmsisPack": "${command:cmsis-csolution.getTargetPack}", "deviceName": "${command:cmsis-csolution.getDeviceName}", "processorName": "${command:cmsis-csolution.getProcessorName}", "problemMatcher": [] } ] } cantfind

vescovd1 commented 7 months ago

all I really want to do is press my debug icon in the cmsis context window and have it launch the flash, and flash should have a depends on "build" task. Please tell how to do this as the whole ARM: debug, ARM: debugger and ARM: embedded debugger is very confusing and poorly documented.

vescovd1 commented 7 months ago

with this configuration for task.json: { "version": "2.0.0", "tasks": [ { "label": "Build Context", "type": "cmsis-csolution.build", "solution": "${command:cmsis-csolution.getSolutionPath}", "rebuild": false, "problemMatcher": [], "group": { "kind": "build", "isDefault": true } }, { "label": "arm-debugger.flash: Flash Device", "type": "arm-debugger.flash", "serialNumber": "${command:device-manager.getSerialNumber}", "program": "${command:arm-debugger.getApplicationFile}", "cmsisPack": "${command:cmsis-csolution.getTargetPack}", "deviceName": "${command:cmsis-csolution.getDeviceName}", "processorName": "${command:cmsis-csolution.getProcessorName}", "problemMatcher": [], "dependsOn": "Build Context" } ] }

I can MANUALLY trigger flash task and it works as expected. If build is out of date the build is pretriggered as expected.

I can also launch debugger after MANUALLY triggering flash load if I remove the "preLaunchTask" line from the launch json. Debugger attaches and works just fine. Its only when I add the "preLaunchTask" and point it to flash task does it not work.

thegecko commented 7 months ago

You may be hitting this issue: https://github.com/microsoft/vscode/issues/157041

Can you try running the debug through the debug UI instead of the control in the outline view?

vescovd1 commented 7 months ago

Don't think so as "dependsOn" works just fine. It's the "preLaunchTask" that is the problem.

vescovd1 commented 7 months ago

so its only when you launch the debugger via the CMSIS view. Doing the Run->Debug from top menu works and also by pressing F5 works. See screen shot. debug launch

thegecko commented 7 months ago

so its only when you launch the debugger via the CMSIS view. Doing the Run->Debug from top menu works and also by pressing F5 works. See screen shot.

Yes, so it this bug: https://github.com/microsoft/vscode/issues/157041

I'll update it to mention it occurs with debug too.