Problems with nRF Connect for Visual Studio Code: nrfutil and also Generate Support Information

Generate Support Information fails dramatically:

I don't remember how to find the log. How many average users would have the slightest clue!!! Please help.

The other problem is one I have seen others comment on, but the usual solution makes no sense. They say to switch Device Provider from nrfutil to nrfjprog. But why would we do that? nrfutil works fine on the command line

C:\ncs\v2.5.0\nrf\applications\asset_tracker_v2> nrfutil device list
50100377
product J-Link
traits jlink, seggerUsb, usb

6&33aeebb&0&2
ports COM13
traits serialPorts

Found 2 supported device(s)

PS C:\ncs\v2.5.0\nrf\applications\asset_tracker_v2>

So why doesn't work in VS Code? The reason I find this particularly obnoxious is that the documentation states that nrfutil is the default Device Provider. So, it should just work. It is obviously in my Path, too.

Thanks.

Burt

  • Hi Bence,

    I may have failed to explain the problem clearly enough, or I may have misunderstood your PATH concatenation remarks, but allow me to be verbose here, regardless. You may wish to read my final paragraph first. Let me start by copying your sentence "If that path is not configured, which is the default, then a known bundled version of that utility is used." This is the situation we wish to consider. The utility is nrfutil-device as you have stated.

    Can we agree that the bundled version of nrfutil-device.exe is located at %HOMEPATH%\.vscode\extensions\nordic-semiconductor.nrf-connect-2024.3.25-win32-x64\platform\nrfutil\bin given the 2024.3.25 version of the extension?

    Humor me by opening a Command Prompt and then attempting to execute that version of nrfutil-device.exe. Chances are it will fail because library nrfdl.dll is not found.

    But why does the command "normally" work when run by the extension under VS Code? It works because the extension sets Path to %HOMEPATH%\.vscode\extensions\nordic-semiconductor.rnf-connect-2024.3.25-win32x64\platform\nrfutil\lib\nrfutil-device, where all the libraries are located. I know that because I used Mark Russinovich's Process Explorer to look at the nrfutil-device.exe process that you start. I looked at the environment variable Path.

    The exception occurs when, prior to running VS Code, the variable Path has had its name changed to PATH. The simplest way to do that, for testing, is by the method I showed in my last post, using screenshots to help make that easy to figure out.

    If you do this, you should find that Generate Support Information fails, and you are unable to locate connected devices.

    Now I do see that when I am using Path (as opposed to PATH) my westEnv PATH does include the important library directory. Of course, when I use PATH (not Path), then I cannot Generate Support Information, so I do not know how offhand to see the westEnv PATH. Perhaps your point is that due to a Windows bug, if I use PATH rather than Path, then concatenation does not occur correctly and hence the westEnv PATH does not have the important library directory.?

    Thanks,

    Burt

  • Hi Burt,

    Thank you for all your persistence and investigation, I see we have an edge-case here that is not well covered. We will try to enhance this for the next release.

    Bence

  • Thank you very much, Bence. When the next release comes out, I will see if it can handle the Path/PATH issue!

    Burt

Related