nRF Connect for VS Code Generate Support not working properly on Linux

Hi,

This ticket is related to ticket #294825, but I wanted to separate out one definite issue into a separate ticket so it can be more carefully addressed.

The issue is related to these variable definitions in settings.json shown below. In this particular case I am using code from SDK v2.0.2 and a v2.0.0 toolchain, but you can prove to yourself that the same problem will occur if the SDK and the toolchain match. Now, the strange toolchain.path below is the correct path but with some TYPOES inserted. With the typos (or typoes), there is no problem generating support information. HOWEVER, if I remove the TYPOES and spell the toolchain path correctly, then the support information is not printed in the nRF Connect OUTPUT terminal window. If I create a phony toolchain directory (mkdir /home/burt/phony/toolchain) and set the toolchain path to that, the support information is printed. Only with a real toolchain path is the problem seen.

Also please note that up until a short while back, when I tried "the trick" and closed out VS Code, when I restarted it the path would get rewritten to the actual correct path--the one that stops the console output of support information. It's a bit of a mystery what I changed but now that weirdness is not happening. I thought adding the topdir made a difference, but that does not seem to matter.

Please investigate this thoroughly--it won't disappear by my wasting time creating virtual machines, and so forth. Even if there was something weird in my workspace, the system needs to be robust enough to help the user find any fault. But I doubt there are any faults in my downloaded SDK.

Ubuntu 22.04.1 LTS is the operating system.

"nrf-connect.toolchain.path": "T/homeY/burtP/ncsO/v2.0.0E/toolchainS",
"nrf-connect.topdir": "/home/burt/ncs/v2.0.2"
Parents
  • Here are messages when I start Code --verbose from the command line starting a couple of lines before I see "generateSupportInformation" in the log. You can see I highlighted the error about unable to find version in output, and also the first ERROR. This ERROR does not happen when I mistype the nrf-connect.toolchain.path value.

    [119172:0910/143207.149641:INFO:CONSOLE(603)] "%cTRACE color: #888 CommandService#executeCommand setContext", source: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (603)
    [119208:0910/143211.409748:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
    [119172:0910/143211.530004:INFO:CONSOLE(603)] "%cTRACE color: #888 CommandService#executeCommand nrf-connect.generateSupportInformation", source: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (603)
    ^[[90m[main 2022-09-10T18:32:11.681Z]^[[0m menubarService#updateMenubar 1
    [119172:0910/143218.684019:INFO:CONSOLE(87)] "%c[Extension Host] %crejected promise not handled within 1 second: Error: unable to find version in output %c(at console.<anonymous> (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:94751)) color: blue color:  color: grey", source: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (87)
    [119172:0910/143218.684248:INFO:CONSOLE(87)] "%c[Extension Host] %cstack trace: Error: unable to find version in output
      at /home/burt/.vscode/extensions/nordic-semiconductor.nrf-connect-2022.7.242-linux-x64/dist/extension.js:108:13104
      at ChildProcess.exithandler (node:child_process:415:5)
      at ChildProcess.emit (node:events:526:28)
      at maybeClose (node:internal/child_process:1092:16)
      at ChildProcess._handle.onexit (node:internal/child_process:302:5) %c(at console.<anonymous> (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:94751)) color: blue color:  color: grey", source: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (87)
    [119172:0910/143218.684774:INFO:CONSOLE(2284)] "[[object Object]]unable to find version in output", source: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (2284)
    [119172:0910/143218.684839:INFO:CONSOLE(2284)] "Error: unable to find version in output
      at /home/burt/.vscode/extensions/nordic-semiconductor.nrf-connect-2022.7.242-linux-x64/dist/extension.js:108:13104
      at ChildProcess.exithandler (node:child_process:415:5)
      at ChildProcess.emit (node:events:526:28)
      at maybeClose (node:internal/child_process:1092:16)
      at ChildProcess._handle.onexit (node:internal/child_process:302:5)", source: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js (2284)
  • Hi Burt,

    I have contacted experts regarding this and will get back to you soon with a reply.

    Best Regards,

    Priyanka

  • Thank you, Priyanka. I look forward to the experts answer. I see there were some extension updates recently, but they did not make the problem disappear.

    Burt

  • Hi Priyanka, have they looked at this yet?

    Burt

  • Hi Burt,

    I have just heard back from them. They said that in a recent update we improved the exception message that gets thrown in this case. Could you repeat the action which led to the "unable to find version in output" message, and then send the full stacktrace again?

    -Priyanka

Reply Children
  • Hi Priyanka,

    Yes, the exception message answered the most important part of the mystery.

    [6349:1002/093404.425760:INFO:CONSOLE(603)] "%c ERR color: #f33 unable to find JLink version in output: Command failed: "/opt/SEGGER/JLink/JLinkExe" -NoGui 1 -USB 0
    : Error: unable to find JLink version in output: Command failed: "/opt/SEGGER/JLink/JLinkExe" -NoGui 1 -USB 0

    at c._executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:63956)

    My JLinkExe was too old; it was V6.62b from February 2020. That version did not support the -NoGui 1 option. I updated to V7.80c, and the Generate support information has no problem now. The weird thing is that earlier, as I mentioned in the ticket, I could generate the support information by using the phony toolchain directory. Anyway, the old version of JLinkExe produced the version information despite the error message, so it would seem that nRF Connect for VS Code should ignore the error message from JLinkExe as long as it can get the version AND if they want to put up a message telling the user that JLinkExe should be upgraded that would be much better than crashing out. Here is the output from the old JLinkExe:

    $ /opt/SEGGER/JLink/JLinkExe -NoGui 1 -USB 0
    SEGGER J-Link Commander V6.62b (Compiled Feb 17 2020 18:43:08)
    DLL version V6.62b, compiled Feb 17 2020 18:42:57

    Unknown command line option -NoGui.

    I will wait to hear back from you about what the devs think of my idea, before closing the ticket.

    I was now trying to figure out why my JLinkExe had never been updated automatically--I know that on Windows from time to time something I did caused JLink to update. I know it is unrelated to the nrf command line tools. And I just used toolchain manager to install a fresh v2.1.0 and I did not see anything obvious about JLink. Maybe because I had just updated JLinkExe from the SEGGER web site. Oh, well.

    Thanks Priyanka,

    Burt

  • Hi Burt,

    Thank you for the update and help. I have passed on the message to the experts. Slight smile

    We think this is a great idea and we will work on improving how the extension reacts to older J-Link versions!

    -Priyanka

Related