Installation of NCS 2.3.0 under macOS

Hi,

I first installed the command line tools (nrfjprog + JLink ARM), followed by nRF Connect for Desktop v4.1.1. I then installed nRF Connect SDK v2.3.0 using Toolchain Manager v1.2.4 on two computers: 1. Apple x86, macOS 11.x and 2. Apple M1, macOS 13.x. I let Toolchain Manager install nRF Connect extension v2023.4.179 for VS Code (v1.78.2 Universal). On both computers I had some issues:

  1. I manually installed the C/C++ extension v1.15.4 for Apple M1; this required deleting the extension folder for the non-universal version that had been installed by Toolchain Manager
  2. From Toolchain Manager I had to run the option "Generate environment script" and run this in the macOS Terminal with the sh command from inside the workspace repo folder
  3. I edited the include and browse paths in c_cpp_settings.json, explicitly adding the include path for NRFXLIB NRF_MODEM
  4. I edited the include path in nrf connect extension (partly because it does not recognize all legal VS Code syntax from c_cpp_settings.json)
  5. I added "NRF9160_XXAA" in the "defines" section of c_cpp_settings.json
  6. I installed nrfjprog version 10.21.0 external for macOS 13.x & version 10.15.x for macOS 11
  7. I installed JLinkARM.dll v7.88b (Universal) for all versions of macOS
I have some remaining issues:
  1. The west command runs successfully after a build configuration, but west is not recognized in the macOS or VS Code terminals
  2. newlib.h refers to picolibc.h, which is not included in NCS 2.3.0 - everything builds OK, but it causes distracting red squiggles in VS Code
  3. Flashing larger merged hex files to the nRF9160 DK fails frequently with varying errors
I know of other users who have encountered similar issues with macOS. Does anyone have a template, or link(s) to documentation, showing the required settings ("defines", include & browse paths, nRF Connect extension, project workspace and macOS $PATH)? Thanks,
Paul
  • Hello Paul, 

    Are you able to provide some logs for us? Can you please attach the output from nRF Connect: Generate Support Information (in VS Code)?

    Kind regards,
    Øyvind

  • Hi Øyvid,

    nRF Connect Support Information and the $PATH variable are below. Running pip3 show -f west in the macOS Terminal gives a warning: Package not found. Also, I notice that nrfutil is "not found" (see below).

    I added /opt/nordic/ncs/toolchains/v2.3.0/bin to $PATH. west is now recognized in macOS Terminal from my home directory with west --version (not show), but west --version is not recognized in VS Code Terminal.

    Building one of my samples in VS Code generates:

    Building nhm_logic_app
    /bin/sh -c west build --build-dir /Users/paul/nhm2_sensor_m1/nhm2-sensor/fw/samples/nhm_logic_app/build_dk /Users/paul/nhm2_sensor_m1/nhm2-sensor/fw/samples/nhm_logic_app --pristine --board [email protected] -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="/Users/paul/nhm2_sensor_m1/nhm2-sensor/fw;/Users/paul/nhm2_sensor_m1/nhm2-sensor" -DDTC_OVERLAY_FILE:STRING="/Users/paul/nhm2_sensor_m1/nhm2-sensor/fw/samples/nhm_logic_app/nrf9160dk_nrf9160_ns.overlay" -DCONFIG_DEBUG_OPTIMIZATIONS:STRING="y" -DCONFIG_DEBUG_THREAD_INFO:STRING="y"

    Is "NONE" correct in the bold highlight above?

    Thanks,

    Paul

    /Library/Frameworks/Python.framework/Versions/3.9/bin:/Users/paul/esp/xtensa-esp32-elf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/paul/Library/Python/3.7/lib/python/site-packages:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin

    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 22.4.0: Mon Mar  6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000",
        "osKernel": "22.4.0",
        "vscode": "1.78.2",
        "electron": "22.5.2",
        "node": "v16.17.1"
      },
      "system": {
        "date": "2023-05-30T16:12:28.756Z",
        "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "71:38:27",
        "osUptime": "355:46:04",
        "cpu": {
          "model": "Apple M1 Pro",
          "speed": "24 MHz",
          "count": 5
        },
        "memory": {
          "total": "16.00 GB",
          "free": "0.08 GB"
        }
      },
      "workspace": {
        "name": "nhm2-sensor",
        "workspaceFile": null,
        "folders": [
          "/Users/paul/nhm2_sensor_m1/nhm2-sensor"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2023.4.179",
            "path": "/Users/paul/.vscode/extensions/nordic-semiconductor.nrf-connect-2023.4.179-darwin-x64",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2023.4.15",
            "path": "/Users/paul/.vscode/extensions/nordic-semiconductor.nrf-terminal-2023.4.15",
            "isActive": true
          },
          "nordic-semiconductor.nrf-devicetree": {
            "version": "2023.4.61",
            "path": "/Users/paul/.vscode/extensions/nordic-semiconductor.nrf-devicetree-2023.4.61",
            "isActive": true
          },
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2023.4.17",
            "path": "/Users/paul/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2023.4.17",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": null,
          "ms-vscode.cpptools": "1.15.4",
          "ms-vscode.js-debug": "1.78.0",
          "ms-vscode.js-debug-companion": "1.0.18",
          "ms-vscode.vscode-js-profile-table": "1.0.3",
          "GitHub.vscode-pull-request-github": "0.64.0",
          "ms-vscode.hexeditor": "1.9.11",
          "ms-vsliveshare.vsliveshare": "1.0.5864",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc": "0.15.2",
        "/Applications/SEGGER/JLink/JLinkExe": "7.88b",
        "/usr/local/bin/nrfjprog": "10.21.0",
        "nrfutil": "Not found",
        "/opt/nordic/ncs/toolchains/v2.3.0/bin/cmake": "3.20.5",
        "/opt/nordic/ncs/toolchains/v2.3.0/bin/west": "0.14.0",
        "/opt/nordic/ncs/toolchains/v2.3.0/bin/python3": "3.9.6",
        "/opt/nordic/ncs/toolchains/v2.3.0/bin/ninja": "1.10.2",
        "/opt/nordic/ncs/toolchains/v2.3.0/bin/gperf": "3.1",
        "/opt/nordic/ncs/toolchains/v2.3.0/bin/dtc": "1.6.1",
        "/opt/nordic/ncs/toolchains/v2.3.0/bin/gn": "2082",
        "/opt/nordic/ncs/toolchains/v2.3.0/bin/git": "2.37.3",
        "gdbPath": "/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb"
      },
      "sdks": [
        {
          "version": "1.7.0",
          "path": "/opt/nordic/ncs/v1.7.0"
        },
        {
          "version": "2.3.0",
          "path": "/opt/nordic/ncs/v2.3.0"
        }
      ],
      "toolchains": [
        {
          "version": "1.7.0",
          "path": "/opt/nordic/ncs/v1.7.0/toolchain"
        },
        {
          "version": "2.3.0",
          "path": "/opt/nordic/ncs/toolchains/v2.3.0"
        }
      ],
      "connectedDevices": [],
      "deviceProvider": "nrfutil",
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:2.3.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:2.3.0}"
          },
          "ozonePath": "",
          "applications": [
            "${workspaceFolder}/fw/samples/sdf_app",
            "${workspaceFolder}/fw/samples/nhm_wpn2s_app",
            "${workspaceFolder}/fw/samples/wdt_app",
            "${workspaceFolder}/fw/samples/timers_app",
            "${workspaceFolder}/fw/samples/tasks_app",
            "${workspaceFolder}/fw/samples/sampling_app",
            "${workspaceFolder}/fw/samples/power_measure_app",
            "${workspaceFolder}/fw/samples/nhm_logic_app",
            "${workspaceFolder}/fw/samples/modem_app",
            "${workspaceFolder}/fw/samples/certs_app",
            "${workspaceFolder}/fw/samples/gnss_app",
            "${workspaceFolder}/fw/samples/nhm_wpn2m_app",
            "${workspaceFolder}/fw/applications/nhm_sensor",
            "${workspaceFolder}/fw/samples/uicr_app",
            "${workspaceFolder}/fw/samples/time_sync_app"
          ],
          "applicationOptions": {},
          "kconfig": {
            "interface": "kconfig",
            "executeInDefaultShell": false
          },
          "welcome": {
            "showOnStartup": false
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [
            "${workspaceFolder}/fw"
          ],
          "enableTelemetry": true,
          "taskBindings": {},
          "debugging": {
            "backend": "nRF Debug",
            "flash": true,
            "bindings": {}
          },
          "activeAppFollowActiveEditor": true,
          "deviceProvider": "nrfutil"
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        }
      },
      "environment": {
        "westExe": "west",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "GIT_EXEC_PATH": "/opt/nordic/ncs/toolchains/v2.3.0/Cellar/git/2.37.3/libexec/git-core",
          "HOME": "/Users/paul",
          "PATH": "/opt/nordic/ncs/toolchains/v2.3.0/bin:/opt/nordic/ncs/toolchains/v2.3.0/opt/bin:/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin:/opt/nordic/ncs/toolchains/v2.3.0/arm-zephyr-eabi/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/Users/paul/esp/xtensa-esp32-elf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/paul/Library/Python/3.7/lib/python/site-packages:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin",
          "ZEPHYR_BASE": "/opt/nordic/ncs/v2.3.0/zephyr",
          "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
          "ZEPHYR_SDK_INSTALL_DIR": "/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk",
          "USER": "paul"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "/Users/paul",
          "PATH": "/Library/Frameworks/Python.framework/Versions/3.9/bin:/Users/paul/esp/xtensa-esp32-elf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/paul/Library/Python/3.7/lib/python/site-packages:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin",
          "USER": "paul"
        },
        "toolchainPath": "/opt/nordic/ncs/toolchains/v2.3.0",
        "toolchainBinPath": "/opt/nordic/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin",
        "toolchainVersion": "2.3.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    

  • Hi Paul, I have reached out to our developers and forwarded your information. The responsible team is a little pre-occupied at the moment, but I will get back to you as soon as I have an answer.

    Sorry for the inconvenience. 

    Kind regards,
    Øyvind

  • Hi Øyvind,

    Thanks for the reply. I can understand the developers are stretched, supporting 3 platforms with variations. For example, I found another issue with Apple M1: the nR9160 HTTP FOTA update samples do not build because Python 3.9.6 does not have ARM64 builds of the Rust cryptography binaries.

    A general question: is the 'ideal' build environment for nRF Connect SDK a Windows 10 PC? What do you and the developers use every day? Thanks,

    Paul

  • Hi Paul, our developers are not sure what to answer.

    I manually installed the C/C++ extension v1.15.4 for Apple M1; this required deleting the extension folder for the non-universal version that had been installed by Toolchain Manager

    What is the reason for installing C/C++ extension, and adding settings to c_cpp_settings.json? 

    paul.lander said:
    does not have ARM64 builds of the Rust cryptography binaries

    I'm not aware of any official support for Rust. Do you have any links to point me to?

    paul.lander said:
    A general question: is the 'ideal' build environment for nRF Connect SDK a Windows 10 PC? What do you and the developers use every day? Thanks,


    I work on a Windows 10 PC and use the Toolchain Manager and VS Code extension out of the box. The same goes for my Apple M2 and Linux machine. Our developers are mainly working on Linux machines, with the NCS environment installed as described under Installing Manually

    Kind regards,
    Øyvind

Related