callwyat / mplab-extension

Build, Program, and Debug MPLAB Projects from the comfort of VS Code
Other
22 stars 9 forks source link

Debug launch requires a configuration named "default" #4

Closed JMRibault-Perso closed 1 year ago

JMRibault-Perso commented 1 year ago

Hi, - great work BTW - I think there is an issue if there is no configuration named"default". I cannot launch the debugger, and get the following error instead.

"Failure to find a "default" configuration in [object Object]"

Here is my task,json { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "MPLABX Build release 4420", "type": "mplabx", "task": "build", "projectFolder": "${workspaceFolder}", "configuration": "release4420", "problemMatcher": [ { "base": "$xc", "fileLocation": [ "relative", "${workspaceFolder}" ], } ], "group": { "kind": "build", "isDefault": true } }, { "label": "MPLABX Build release 4620", "type": "mplabx", "task": "build", "projectFolder": "${workspaceFolder}", "configuration": "release4620", "problemMatcher": [ { "base": "$xc", "fileLocation": [ "relative", "${workspaceFolder}" ], } ], "group": { "kind": "build", "isDefault": false } }, { "label": "MPLABX Build debug 4420", "type": "mplabx", "task": "build", "projectFolder": "${workspaceFolder}", "configuration": "debug4420", "problemMatcher": [ { "base": "$xc", "fileLocation": [ "relative", "${workspaceFolder}" ], } ], "group": { "kind": "build", "isDefault": false } }, { "label": "MPLABX Build debug 4620", "type": "mplabx", "task": "build", "projectFolder": "${workspaceFolder}", "configuration": "debug4620", "problemMatcher": [ { "base": "$xc", "fileLocation": [ "relative", "${workspaceFolder}" ], } ], "group": { "kind": "build", "isDefault": false } } ] }

Lanch .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": [ { "type": "mplabx", "request": "launch", "name": "debug4420", "program": "${workspaceFolder}/", "stopOnEntry": true, "preLaunchTask": "MPLABX Build debug 4420", "trace": true

    },
    {
        "type": "mplabx",
        "request": "launch",
        "name": "debug4620",
        "program": "${workspaceFolder}/",
        "stopOnEntry": true,
        "preLaunchTask": "MPLABX Build debug 4620"
    }
]

}

My project is set to create release and debug for PIC18F4420 and 4620, I'll try to create a default config in MPLAB to see if I can move forward but just wanted to let you know. - lmk if you need more details

JMRibault-Perso commented 1 year ago

I tried to create a "default" Configuration, but still get the same message

JMRibault-Perso commented 1 year ago

configurations.xml configurations.xml.txt

callwyat commented 1 year ago

Thanks for creating an issue for this. What method are you using to trigger the build? Is it using ‘>Run Task‘ from the command pallet, triggering the default build?

JMRibault-Perso commented 1 year ago

Build works fine, I only get this message when trying to launch in debug. I have a PicKit4.

On Sat, Jan 21, 2023, 23:47 callwyat @.***> wrote:

Thanks for creating an issue for this. What method are you using to trigger the build? Is it using ‘>Run Task‘ from the command pallet, triggering the default build?

— Reply to this email directly, view it on GitHub https://github.com/callwyat/mplab-extension/issues/4#issuecomment-1399404129, or unsubscribe https://github.com/notifications/unsubscribe-auth/APHVWE453ZYIFNOSW63CGJTWTS3UTANCNFSM6AAAAAAUCTRGPU . You are receiving this because you authored the thread.Message ID: @.***>

callwyat commented 1 year ago

The release of version 0.1.2 should remedy this issue. Can you please confirm before I close this issue?

jasonkelly214 commented 1 year ago

I just spent a bit of time with an issue trying to run debugging. What I found is that it doesn't matter the name, but it only grabs the first configuration in the mplab configuration.xml file. I wasn't understanding the error which took me a while to trace.

It says it "can't find configuration "config name' in object Object"

I edited the xml file (I think you can also rearrange in mplab) to put my configuration at the top, and now it gets past that error and goes towards debugging. I'm getting a new error "failed to connect to target device" pops up, and the debug console shows HwTool undefined. I saw the notes about config name needing to match, but I'm not sure what it's supposed to match and where to find it.

JMRibault-Perso commented 1 year ago

Sorry for the delayed answer, I still get the same message with the newer version of the (0.1.2) and I still get the message. This occurs on selecting the debug run (F5). Let me know if you want me to run some log tools etc... to help with that issue

KelwinCrasta-EnstinLabs commented 1 year ago

I am also facing a same issue if my configuration is set to default i am able to debug the project other wise i get cannot convert object to primitive value error message

KB3HNS commented 1 year ago

I have experienced the issue described by @KelwinCrasta-EnstinLabs . We have the project located inside a larger source tree and have created both a "Debug" and "Release" build where the release build uses a different linker file and appends a digital signature for use with a bootloader. Getting the cannot convert object to primitive value error. I am blocked moving forward.

GenProt161 commented 1 year ago

same here image when omitting the "configuration" variable in launch, I get the following: image (dsPIC33CH128MP505 is not used in the actual build - here it is the 256 - , but is available as a configuration)

callwyat commented 1 year ago

My apologies to everyone who has been having difficulties with this issue. My free time has been extremely limited lately and I haven’t been able to address this issues. Could one of you try to find a solution for this and submit a pull request?

GenProt161 commented 1 year ago

My apologies to everyone who has been having difficulties with this issue. My free time has been extremely limited lately and I haven’t been able to address this issues. Could one of you try to find a solution for this and submit a pull request?

sadly I don't have any experience with vsCode extensions. But when there's no quick solution, we have to wait for the next IDE release from Microchip. They'll switch to vsCode, too. ;)

callwyat commented 1 year ago

A fix for this issue has been published on PreRelease 0.1.13. Please give it a try and let me know if the problem persists!

GenProt161 commented 1 year ago

thanks, now it debugs... nice work! thanks again!