How to FULLY UNINSTALL nRF Connect SDK and SES on macOS?

Kind folks,

Automated tools like the nRF Connect SDK environment are wonderful when they work, but can be a Procrustean bed when they break or don't fit the exact requirements.  Case in point: I've gone through installing and reinstalling nRF Connect SDK, SES and the VS extension at least half a dozen time in various combinations of automated and manual procedures.  The goal was to merge two sample apps: nrf_dm from the new Nordic v1.9.1 SDK and the nrf_matrix_led example from within the zephyr repo and run the resulting app on a BBC Micro:Bit V2 (an nRF52833-based SBC).  This involved many Kconfig and Device Tree issues.  You can read about some of the details of my journey in an earlier ticket.

Suffice it to say that I've made multiple attempts to uninstall all of the related software, make sure I have cleared away any remnants, and reinstall nRF Connect, and SES (leaving VS code out of the discussion for the moment) all of this running on the absolutely latest macOS Monterey 12.3.  I have failed in this endeavor several times.  Multiple pieces of "trash" (prior state) seem to remain.  For example, when a freshly installed SES is started by clicking on the Open SES, the SES app opens, showing a dashboard which shows a list of recent project (not a blank list).  Then either upon executing the File | Open nRF Connect Project... command, or automatically without any user interaction, the new nRF Project dialog pops up with a covering error message:

Closing the error message leaves an unresponsive options pane.

So, clearly there's some remembered state from prior installs that's preventing a new installation from being done cleanly.  Searching for uninstall instructions for nRF Connect SDK yielded no useful information.  Even searching for uninstallation instructions for SES yields only one suggestion, which proved to be insufficient and didn't erase prior project history. Therefore, I request:

  1. An uninstaller tool for nRF Connect, its plugins (e.g., tool manager), any "embedded" SES IDE inside it's tool collection, and any other remnants of nRF Connect, or
  2. At least a list of files and directories that need to be deleted to effect a complete uninstallation, and
  3. Probably too much to ask for at the current moment, but it sure would be useful to have a description of the process by which "New nRF Connect Project..." does its work inside SES (including critical script files, locations, etc.)

Thanks for any advice.  I am truly stuck and unable to proceed otherwise.

  • Hello, 

    I'm really sorry to hear that you are facing these issues. Please note that the kconfig and device tree issues are not the same as SES and VS code issues.

    Using VS Code extension, can you please go to your command palette (Cmd + Shift + P.) and run the following nRF Connect: Generate Support Information. This should provide an output in the Output of VS Code. Please copy and paste here.

    How did you install the nRF Connect SDK? Manually or Automatically? If you have used the Toolchain Manager you should be able to remove the SDK using the dropdown menu

    It should also be sufficient to delete the folder where you installed the environment.

    Kind regards,
    Øyvind

  • Hi, Øyvind,

    I'll try to respond directly to your questions.

    Here's the support info generated by the nRF Connect plugin in VSCode:

    IMPORTANT: The data below could contain sensitive or confidential information about your environment.
    If you do not wish this to be seen by others, please make sure to remove it before sharing.
    
    For help and support, visit the Nordic DevZone at https://devzone.nordicsemi.com/.
    
    {
      "platform": {
        "os": "darwin",
        "osVersion": "Darwin Kernel Version 21.4.0: Mon Feb 21 20:34:37 PST 2022; root:xnu-8020.101.4~2/RELEASE_X86_64",
        "osKernel": "21.4.0",
        "vscode": "1.65.2",
        "electron": "13.5.2",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2022-03-18T04:44:28.975Z",
        "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:01:15",
        "osUptime": "31:13:56",
        "cpu": {
          "model": "Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz",
          "speed": "2700 MHz",
          "count": 4
        },
        "memory": {
          "total": "8.00 GB",
          "free": "0.02 GB"
        }
      },
      "workspace": {
        "name": "Untitled (Workspace)",
        "workspaceFile": "1647316357859",
        "folders": [
          "/opt/nordic/ncs/v1.9.1/nrf/samples/bluetooth/nrf_dm",
          "/Volumes/Archive2/foo/nrf_led_matrix"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.3.104",
            "path": "/Users/mike/.vscode/extensions/nordic-semiconductor.nrf-connect-2022.3.104",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.3.16",
            "path": "/Users/mike/.vscode/extensions/nordic-semiconductor.nrf-terminal-2022.3.16",
            "isActive": true
          },
          "nordic-semiconductor.devicetree": null,
          "nordic-semiconductor.kconfig": null
        },
        "external": {
          "marus25.cortex-debug": "1.2.2",
          "ms-vscode.cpptools": "1.8.4",
          "ms-vscode.js-debug": "1.65.0",
          "ms-vscode.js-debug-companion": "1.0.15",
          "ms-vscode.references-view": "0.0.85",
          "ms-vscode.vscode-js-profile-table": "0.0.18",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "/Applications/SEGGER/JLink/JLinkExe": "7.62a",
        "/usr/local/bin/nrfjprog": "10.15.3",
        "nrfutil": "Not found",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/cmake": "3.21.1",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/west": "0.12.0",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/python3": "3.9.6",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/ninja": "1.10.2",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/gperf": "3.1",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/dtc": "1.6.1",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/arm-none-eabi-gcc": "9-2019-q4-major",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/gn": "1977",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/git": "2.32.0"
      },
      "sdks": [
        {
          "version": "1.9.1",
          "path": "/Users/mike/ncs"
        },
        {
          "version": "Zephyr 3.0.99",
          "path": "/Users/mike/zephyrproject"
        },
        {
          "version": "1.9.1",
          "path": "/opt/nordic/ncs/v1.9.1"
        }
      ],
      "toolchains": [
        {
          "version": "1.9.1",
          "path": "/opt/nordic/ncs/v1.9.1/toolchain"
        }
      ],
      "connectedDevices": [],
      "deviceProviders": [
        "nrfjprog"
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:1.9.1}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:1.9.1}"
          },
          "ozonePath": "",
          "applications": [
            "${workspaceFolder}",
            "/Volumes/Archive2/foo/nrf_led_matrix"
          ],
          "kconfig": {
            "interface": "kconfig"
          },
          "welcome": {
            "showOnStartup": true
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "enableTelemetry": true
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        },
        "nordic-semiconductor.devicetree": {
          "modules": [
            "${zephyrBase}",
            "${zephyrBase}/../nrf",
            "."
          ],
          "zephyr": "",
          "ctxFile": "",
          "defaultBoard": ""
        },
        "nordic-semiconductor.kconfig": {
          "root": "",
          "env": {},
          "cfiles": true,
          "disable": false,
          "zephyr": {
            "base": ""
          },
          "python": "",
          "liveValue": true
        },
        "marus25.cortex-debug": {
          "armToolchainPath": null,
          "armToolchainPrefix": "arm-none-eabi",
          "gdbPath": null,
          "objdumpPath": null,
          "JLinkGDBServerPath": null,
          "openocdPath": null,
          "pyocdPath": null,
          "PEGDBServerPath": null,
          "stutilPath": null,
          "stlinkPath": null,
          "stm32cubeprogrammer": null,
          "enableTelemetry": true,
          "flattenAnonymous": false,
          "registerUseNaturalFormat": true,
          "variableUseNaturalFormat": true,
          "dbgServerLogfile": null,
          "showDevDebugOutput": "none"
        }
      },
      "environment": {
        "westExe": "/opt/nordic/ncs/v1.9.1/toolchain/bin/west",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "GIT_EXEC_PATH": "/opt/nordic/ncs/v1.9.1/toolchain/Cellar/git/2.32.0_1/libexec/git-core",
          "HOME": "/Users/mike",
          "PATH": "/opt/nordic/ncs/v1.9.1/toolchain/bin:/Users/mike/.asdf/shims:/usr/local/Cellar/asdf/0.9.0/libexec/bin:/usr/local/sbin:/usr/local/opt/ccache/libexec:/Users/mike/Projects/moddable/build/bin/mac/release:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/mike/gn",
          "ZEPHYR_BASE": "/opt/nordic/ncs/v1.9.1/zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "/opt/nordic/ncs/v1.9.1/toolchain",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "USER": "mike"
        },
        "toolchainPath": "/opt/nordic/ncs/v1.9.1/toolchain",
        "toolchainBinPath": "/opt/nordic/ncs/v1.9.1/toolchain/bin",
        "toolchainVersion": "1.9.1"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    

    There are a couple curious items in this output.  I'll note them below.

    I have automatically installed, removed and repeated this sequence several times with SDK v1.9.1.  The resulting Toolchain Manager window below shows that the final configuration Is broken in at least one way -- the Open SES button is missing.

    Here's the directory structure for the installed SDK.  Appears correct at this level of detail:

    I don't believe I've done a recent manual installation of the SDK.  I did however do a separate manual installation of the Zephyr system in order to create a testbed for working out some of my device tree and Kconfig issues without nRF SDK complications.  That installation seems to work OK, and have the recommended directory structure.

    As an additional, possibly useful bit of information, here are the environment variables that are defined when I "Open Terminal" from with Toolchain Mgr (and I presume are active when I start SES from there as well).

    Last login: Thu Mar 17 22:30:21 on ttys000
    cd /opt/nordic/ncs/v1.9.1 ; export PATH=/opt/nordic/ncs/v1.9.1/toolchain/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin ; export GIT_EXEC_PATH=/opt/nordic/ncs/v1.9.1/toolchain/Cellar/git/2.32.0_1/libexec/git-core ; export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb ; export GNUARMEMB_TOOLCHAIN_PATH=/opt/nordic/ncs/v1.9.1/toolchain ; clear
    mike@Mikes-MBP-101 ~ % cd /opt/nordic/ncs/v1.9.1 ; export PATH=/opt/nordic/ncs/v1.9.1/toolchain/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin ; export GIT_EXEC_PATH=/opt/nordic/ncs/v1.9.1/toolchain/Cellar/git/2.32.0_1/libexec/git-core ; export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb ; export GNUARMEMB_TOOLCHAIN_PATH=/opt/nordic/ncs/v1.9.1/toolchain ; clear
    
    
    mike@Mikes-MBP-101 v1.9.1 % printenv
    TERM_SESSION_ID=A80CBA4F-62CD-47AB-B1F1-B2E6B6C76F43
    __CFBundleIdentifier=com.apple.Terminal
    TMPDIR=/var/folders/hp/_vddx6wx4ws6n5wsbb8793l80000gn/T/
    XPC_FLAGS=0x0
    TERM=xterm-256color
    SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.J2qSN75xT9/Listeners
    XPC_SERVICE_NAME=0
    TERM_PROGRAM=Apple_Terminal
    TERM_PROGRAM_VERSION=444
    SHLVL=2
    PWD=/opt/nordic/ncs/v1.9.1
    ORIGINAL_XDG_CURRENT_DESKTOP=undefined
    SHELL=/bin/zsh
    HOME=/Users/mike
    LOGNAME=mike
    USER=mike
    PATH=/opt/nordic/ncs/v1.9.1/toolchain/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
    OLDPWD=/Users/mike
    ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
    GNUARMEMB_TOOLCHAIN_PATH=/opt/nordic/ncs/v1.9.1/toolchain
    ZPROFILETEST=was run
    MODDABLE=/Users/mike/Projects/moddable
    IDF_PYTHON_ENV_PATH=/Users/mike/.espressif/python_env/idf4.4_py3.10_env
    PIP_REQUIRE_VIRTUALENV=false
    ASDF_DIR=/usr/local/Cellar/asdf/0.9.0/libexec
    ZSHRCTEST=was run
    GIT_EXEC_PATH=/opt/nordic/ncs/v1.9.1/toolchain/Cellar/git/2.32.0_1/libexec/git-core
    LANG=en_US.UTF-8
    _=/usr/bin/printenv
    mike@Mikes-MBP-101 v1.9.1 %
    

    You said: "It should also be sufficient to delete the folder where you installed the environment."  Not in my experience After removing and reinstalling the SDK, old project info still persists in SES.

    Hope all this info helps,

    Mike

  • Hi Mike,
    Thanks for sharing these details.

    Mike Wirth said:
    Not in my experience After removing and reinstalling the SDK, old project info still persists in SES.

    First of all, this is a known issue with SES. But what version of SES are you opening, the one that follows Toolchain Manager or a manually installed? I'm not sure what you mean with list of recent projects. The Open nRF Connect Project dialog will list available projects in the nRF Connect SDK folder. This will be samples found under both nrf/samples and zephyr/samples, and you can narrow these down with the different checkboxes. 

    Are you able to see nRF Connect SDK Release and Toolchain versions? Make sure that the Segger Embedded Studio actually points to correct nRF Connect SDK folder. You can check this under Tools --> Options --> nRF Connect --> Directories.

    From the support information you provided, I can see that you have the following SDK versions:

      "sdks": [
        {
          "version": "1.9.1",
          "path": "/Users/mike/ncs"
        },
        {
          "version": "Zephyr 3.0.99",
          "path": "/Users/mike/zephyrproject"
        },
        {
          "version": "1.9.1",
          "path": "/opt/nordic/ncs/v1.9.1"
        }

    If your SES is pointing to /opt/nordic/ncs/v1.9.1 will it still give the script error /syntax error?

    Mike Wirth said:
    The resulting Toolchain Manager window below shows that the final configuration Is broken in at least one way -- the Open SES button is missing.

    I had similar issues when trying to download the SDK via VPN or LTE connection. Are you downloading on a corporate network or using a corporate computer? The solution that worked for me was to use a standard WiFi connection at home or similar (non-restricted connection) to download.

    Mike Wirth said:
    I don't believe I've done a recent manual installation of the SDK.  I did however do a separate manual installation of the Zephyr system in order to create a testbed for working out some of my device tree and Kconfig issues without nRF SDK complications.  That installation seems to work OK, and have the recommended directory structure.

    There are 3 installations. Make sure to use the correct one in e.g. VS Code and SES, i.e. /opt/nordic/ncs/v1.9.1/

    Mike Wirth said:
    As an additional, possibly useful bit of information, here are the environment variables that are defined when I "Open Terminal" from with Toolchain Mgr (and I presume are active when I start SES from there as well).

    Yes, this looks correct as per my last comment above. When opening SES from the Toolchain Manager (as long as you actually have the Open SES button) it should inherit the same settings.

    Kind regards,
    Øyvind

  • Øyvind,

    Thanks for your persistence in trying to deal with the issues I've encountered.  Responding to your message of 18 hrs ago, with your questions indented: (By the way, the Devzone "reply" mechanism seems clumsy, especially when there is a repeated sequence of replies and answers,). And I should note, I'm trying to act as a member of your test team, reporting issues that might cause trouble for other users and suggestions for correcting them.  I hope you find this useful.


    But what version of SES are you opening, the one that follows Toolchain Manager or a manually installed? 

    I'm using the copy of SES that is bundled in your SDK installation, at /opt/nordic/ncs/v1.9.1/toolchain/segger_embedded_studio/SEGGER Embedded Studio for ARM 5.68.app.  I have noted before that manual installations of SES, either directly from Segger, or even the Nordic-configured version from your website can create problems (e.g., with licensing, and with differences in execution environment, so I've removed all SES code except the SDK-bundled version at the path above.

    As an aside, even if I start with your specially configured version of SES, but follow the manual SDK instructions, I suspect it won't end up at the same path as listed above.  Won't this create problems for manual-SDK-installers?

    On another question, after I've done an automatic SDK installation, how am I expected to start an SES session?  Can I invoke the app from the command line at the above listed path?  Or do I need to go through nRF Connect app | Tool Manager plugin | "Start SES" button every time?  The latter ensures certain environment variables are set.  In the former case, I could have invoked SES from some random terminal session and environment.  Seems like this should be in the docs.

    ...The Open nRF Connect Project dialog will list available projects in the nRF Connect SDK folder.

    Perhaps some confusion here.  When I mention old projects appearing, that's in the SES Desktop, not the triangle selector in the "Open nRF Project" Options panel.  And to add a clarification, you say "in the nRF Connect SDK folder".  That's technically correct, but it would probably be useful to note that these samples are in two distinct groups, those at /opt/nordic/ncs/v1.9.1/nrf/samples and at /opt/nordic/ncs/v1.9.1/zephyr/samples.  The triangle selector in the Options panel attempts to list the contents of both, but at least on my MacBook Pro, the performance of scrolling through the list is jumpy and hitting any element is problematic.

    Are you able to see nRF Connect SDK Release and Toolchain versions?

    I presume you mean the following: 

    • The nRF Connect for Desktop app is v3.10.0
    • The Toolchain Manager plugin is v0.10.3
    • The nrf git repository includes the HEAD/v1.9.1 tags from March 4, and are up to date with commits up to today, the origin/main, origin/HEAD tags.
    • The zephyr git repository includes the ncs/V2.7.99-ncs1-1 from Feb. 28, and ncs/test-spec & ncs/main tags from today.

    Are you able to see nRF Connect SDK Release and Toolchain versions? Make sure that the Segger Embedded Studio actually points to correct nRF Connect SDK folder.

    Yes, as shown here:

    If your SES is pointing to /opt/nordic/ncs/v1.9.1 will it still give the script error /syntax error?

    Yes, indeed.  When I start up SES, its Desktop appears (by double clicking the app icon at: /opt/nordic/ncs/v1.9.1/toolchain/segger_embedded_studio/SEGGER Embedded Studio for ARM 5.68.app, the desktop opens.  If I then execute the File | Open nRFConnect SDK Project... command, the nRF Connect Options window opens with the Script Error dialog in the middle:

    If, however, I start SES by clicking on the alias at /opt/nordic/ncs/v1.9.1/toolchain/segger_embedded_studio/SEGGER Embedded Studio.app, SES immediately follows the desktop with opening the nRF Connect Options window with the same error message, without having to execute the File menu command.

    I had similar issues when trying to download the SDK via VPN or LTE connection. Are you downloading on a corporate network or using a corporate computer?

    I'm on a fairly direct, domestic (non-business) connection, 1 Gbps fiber.  So not much issue there.  

    One possible glitch: I'm running the Avast Security v15.2 antivirus software, which does examine incoming files, web pages, email, etc.  It finds  and filters plenty of infected spam email, but I've never had it modify a download.  It should certainly tell me if it has.  I can try an nRF Connect SDK auto install with it disabled to see if it makes any difference.  Your recommendation?

    So, no further ahead from my perspective.  Will await suggestions from you.

    Mike

  • Øyvind,

    The answer to one question would allow me to do some debugging: What's the pathname of the script file which causes the red error dialog in SES: Script Error?

    Thanks,

    Mike

Related