nRF Connect for VS Code settings failure and consequences

Hello, this ticket addresses three issues:

1. After installing nrfutil with subcommands device and toolchain-manager and sdk-manager, into %USERPROFILE%\.nrfutil, everything works fine when I set Nrf-connect › Nrfutil: Home in VS Code to that value. However, when I only install subcommands device and toolchain-manager, like the help information paragraph for that variable states, things do not work. So, this ticket I am opening to ask you to update the help information. I realize that sdk-manager is a newer command than toolchain-manager.

2. After setting the Nrf-connect › Nrfutil: Home variable, it is ignored when I attempt to flash a device. Instead, nRF Connect for VS Code insists on using the nrtutil in the toolchain.

3. As you are hopefully aware by now from various tickets that I and others have opened, C:\ncs\toolchains\66cdf9b75e\nrfutil\home\bin\nrfutil-device.exe has a bug and does not work if there are any CH340 or CP2102 devices on the USB bus. I was forced to replace that file in the toolchain with C:\Users\test\.nrfutil\bin\nrfutil-device.exe in order to flash my nRF9160DK when I have a CP2102 device on the USB bus.

The three issues are of course closely interrelated. Please let me know the schedule and plans for fixing these issues.

Regards,

Burt Silverman

Parents
  • Hello,

    I will forward your feedback internally.

    Kenneth

  • Thank you, Kenneth. Please note that the item 3 I listed is something that I would like to be addressed in a shorter time frame than items 1 and 2. I want to be able to tell my colleague, "Nordic says 'do this' to either update the nrfutil-device.exe in v3.2.1 toolchain or something 'equivalent' so he can flash his board from VS Code. He always trusts what comes from DevZone more than he trusts what comes from me--even if I have a good workaround. Thanks.

    Burt S

  • Hi Burt,

    The nrfutil is bundled with the toolchains (in addition to possible local version), so if there are issues that are fixed in later releases then nrfutil needs to be updated. This can for instance be done by opening a nrf connect terminal in VS code and type 'nrfutil upgrade device' for the specific sdk/toolchain. Usually you will get an error message that the file is locked, so you need to follow a description on how to update it.

    Please be aware toolchain-manager is not used for quite some time, sdk-manager replaced it. So please only use sdk-manager when possible.

    The extension bundles both binaries and there's no point configuring nrfutil home, best to clear that setting, so the bundled binaries will be used and not the local version. This setting is only to be used when the user has good reason to use other versions (e.g. to fix issues). Also the value for the setting when referring to an environment variable should be ${env:USERPROFILE}/.nrfutil.

    Regarding 3. As far as I can find, version 2.15.3 of nrfutil device has been released with a fix for this.

    Best regards,
    Kenneth

  • Hi Kenneth,

    Regarding your second paragraph, the issue is not whether or not I use the toolchain-manager or the sdk-manager; the issue is that the built in help information in nRF Connect for VSCode for Nrf-connect › Nrfutil: Home references toolchain-manager rather than sdk-manager. So, it is the nRF Connect for VSCode developers that you need to be informing about the deprecation of toolchain-manager!! Hopefully that has been accomplished as you say you have forwarded the feedback internally.

    Thank you for correcting my syntax ${env:USERPROFILE}/.nrfutil. I may have mistyped when I opened this ticket--regardless, I have set that up correctly now under User Settings. And my original item 2 remains valid and contradicts your suggestion that this can be used to correct errors. You can see this by setting your nRF Connect for VS Code to use the v3.2.1 toolchain for your favorite application. Then do "Open Terminal" from the WELCOME menu. In the terminal, use the PS Get-Command command. You will see something like:

    Working directory: c:\Users\Burt\hci_uart_1
    SDK: nRF Connect SDK v3.2.1
    Toolchain: nRF Connect SDK Toolchain v3.2.1

    PS C:\Users\Burt\hci_uart_1> Get-Command nrfutil

    CommandType Name Version Source
    ----------- ---- ------- ------
    Application nrfutil.exe 0.0.0.0 C:\ncs\toolchains\v3.2.1\nrfutil\bin\nrfutil.exe

    PS C:\Users\Burt\hci_uart_1>

    I think it is safe to conclude that Nrfutil:Home is being IGNORED!

    Please make sure that the developers are aware of this, too.

    Thanks, Kenneth.

    Burt S.

    ps, I exited and restarted VS Code after making the settings change just to be certain that a restart was not necessary. I also tried it before restarting.

Reply
  • Hi Kenneth,

    Regarding your second paragraph, the issue is not whether or not I use the toolchain-manager or the sdk-manager; the issue is that the built in help information in nRF Connect for VSCode for Nrf-connect › Nrfutil: Home references toolchain-manager rather than sdk-manager. So, it is the nRF Connect for VSCode developers that you need to be informing about the deprecation of toolchain-manager!! Hopefully that has been accomplished as you say you have forwarded the feedback internally.

    Thank you for correcting my syntax ${env:USERPROFILE}/.nrfutil. I may have mistyped when I opened this ticket--regardless, I have set that up correctly now under User Settings. And my original item 2 remains valid and contradicts your suggestion that this can be used to correct errors. You can see this by setting your nRF Connect for VS Code to use the v3.2.1 toolchain for your favorite application. Then do "Open Terminal" from the WELCOME menu. In the terminal, use the PS Get-Command command. You will see something like:

    Working directory: c:\Users\Burt\hci_uart_1
    SDK: nRF Connect SDK v3.2.1
    Toolchain: nRF Connect SDK Toolchain v3.2.1

    PS C:\Users\Burt\hci_uart_1> Get-Command nrfutil

    CommandType Name Version Source
    ----------- ---- ------- ------
    Application nrfutil.exe 0.0.0.0 C:\ncs\toolchains\v3.2.1\nrfutil\bin\nrfutil.exe

    PS C:\Users\Burt\hci_uart_1>

    I think it is safe to conclude that Nrfutil:Home is being IGNORED!

    Please make sure that the developers are aware of this, too.

    Thanks, Kenneth.

    Burt S.

    ps, I exited and restarted VS Code after making the settings change just to be certain that a restart was not necessary. I also tried it before restarting.

Children
  • Be aware that when you open a toolchain the nrfutil home is inside the toolchain to use the nrfutil that is bundled with the toolchain. They will update relevant help text to clarify.

    Kenneth

  • Thank you, Kenneth, I will look forward to seeing what they change in upcoming releases.

    Burt

  • What does it mean in the Changelog for the most recent version when they say under Actions:

    • Updated the nrfutil device binary bundled with the extension to v2.15.6.

    In other words, under what conditions will one see 2.15.6 as opposed to whatever is bundled with the toolchain? Are they saying if you pick some old toolchain that does not have nrfutil bundled, then you would see 2.15.6 for nrfutil device? In any case, currently I can only see either the nrfutil device that is installed on my base Ubuntu Linux system or the nrfutil device bundled with the toolchain -- depending upon how I open the terminal. Forgive me if it sounds like I am repeating myself, but this is the first time I have looked at the Changelog.

    Burt

  • Hi Burt,

    To clarify, when the extension lists/installs/uninstalls SDKs and toolchains, also when generating an process environment for the combination of these, it uses a bundled sdk-manager binary. Bundled meaning bundled in the extension, not in the toolchain.

    Similarly when it enumerates connected devices, and for actions like erase/recover/reset, it uses the bundled device binary.

    Any other call that the user does in the terminal, or via any SDK script or west command (e.g. flash) will use nrfutil from the toolchain or PATH.

    Kenneth

  • Thanks for the good information, Kenneth. I reconfirmed that flash uses nrfutil from the toolchain or PATH by temporarily removing all of those instances of the device subcommand and seeing the flash failure. I will close the ticket. Also, I guess it is consistent with the fact that I could not change flash behavior by adjusting the Nrfutil:Home variable in the extension settings. It's complicated but I"m confident there are logical reasons for the designers to come up with what they did.

    Burt

Related