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
Parents
  • 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 Øyind,

    I'm still working through NCS issues and I wanted to share some new observations. I decided to buy a macbook air M2 to use as an NCS 'clean machine' (don't laugh!) I manually installed NCS 2.2.0, which I needed because I'm certifying with Verizon and as of August 2023 MCUBoot is not working with NCS 2.3.0. I still had issues on the 'clean machine':

    1. Flashing is problematic. Using NRF Command Line tools 10.23.0, I get nrfjprog DLL error 102 and an intermittent write failure with the nRF9160 DK, JLink Base (v7.88 universal) or my custom PCB. Flashing sometimes works after resetting the board in the Connected Devices pane of nRF Connect Extension. It usually works after power-cycling. Errors and log output are below. I've created a manufacturing shell script to write to UICR, program modem firmware, program the modem shell app, create and upload an nRF Cloud certificate, load a test app and interact with a custom programming rig. The last programming step works only every second time in the macOS Terminal.

    Question 1: What can I do to get rid of this DLL error write=33, general log=102?

    2. Debugging did not work initially in nRF Connect Extension. I got "spawn unknown system error -86". I created a launch.json and reviewed settings.json and the nRF Connect Extension settings. Nothing seemd to work, including using F5. So I installed Segger Ozone, followed the User Guide for nRF Connect Extension, supplying the path as a directory. Ozone was recognized in the Actions pane, but failed to start with the error "it's a directory". A path to the executable was unrecognized. Ozone runs OK standalone. Finally, I tried to run the nRF debugger again: it now worked - who knows? There may be a sticky setting somewhere that running Ozone un-stuck?

    3. I would like to upgrade to Python 3.11 so I edited the Python path in nRF Connect Extension, but samples still build with the Frameworks link to python3.9 in NCS. However, the good news is that the homebrew manual installation of Python does install ARM64 (aarch64) and not  X86 (x86_64) Rust binaries for packages like Cryptography (the Toolchain Manager was always installing X86).

    Question 2: How can I get NCS to use a different version of Python (the way this is customarily done, for example, in JetBrains Pycharm, is to create VENV virtual environments for projects, which is convenient).

    ------------------------------------------

    nrfjprog/west output and log file:

    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: Flashing file: /Users/paullander/nhm2-sensor/fw/samples/sdf_app/build_dk/zephyr/merged.hex
    [ #################### ]   3.277s | Erase file - Done erasing                                                          
    [error] [ Client] - Encountered error -102: Command program_file executed for 172 milliseconds with result -102        
    [error] [  nRF91] - The write access failed, but no cause could be determined.                                         
    [error] [  nRF91] - It may be due to an unaligned access, accessing a nonexistent memory, or a communication issue.
    [error] [  nRF91] - Failed while performing 'Write' operation on target address 0x00000000. 
    -102: An unknown error.
    [error] [  nRF91] - Failed while reading device information.
    [error] [ Worker] - An unknown error.
    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    FATAL ERROR: command exited with status 33: nrfjprog --program /Users/paullander/nhm2-sensor/fw/samples/sdf_app/build_dk/zephyr/merged.hex --sectorerase --verify -f NRF91 --snr 960028613
    
     *  The terminal process terminated with exit code: 33.

    [2023-Aug-14 14:00:42] [debug] --------------------------------------------------------------------------------
    [2023-Aug-14 14:00:42] [debug] nrfjprog --program /opt/nordic/ncs/nrf/samples/nrf9160/http_update/application_update/build/zephyr/merged.hex...
     Code

  • Hi Paul, thanks for providing this information. The attached file seems not to made it. Can you please retry? And please include support information as well?

  • Hi Øyvind, The programming log is big, I tried embedding in a Google doc, but that did not work. It can be accessed here. The Support Info generated by nRF Connect Extension is:

    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.6.0: Wed Jul  5 22:17:35 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T8112",
        "osKernel": "22.6.0",
        "vscode": "1.81.1",
        "electron": "22.3.18",
        "node": "v16.17.1"
      },
      "system": {
        "date": "2023-08-17T15:48:20.575Z",
        "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
        "nrfConnectForDesktopInstalled": false,
        "vscodeUptime": "47:00:14",
        "osUptime": "92:37:49",
        "cpu": {
          "model": "Apple M2",
          "speed": "24 MHz",
          "count": 4
        },
        "memory": {
          "total": "8.00 GB",
          "free": "0.13 GB"
        }
      },
      "workspace": {
        "name": "Untitled (Workspace)",
        "workspaceFile": "1692114949384",
        "folders": [
          "/Users/paullander/nhm2-sensor",
          "/opt/nordic/ncs/nrf/samples/nrf9160/http_update/application_update"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2023.7.129",
            "path": "/Users/paullander/.vscode/extensions/nordic-semiconductor.nrf-connect-2023.7.129-darwin-arm64",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2023.7.47",
            "path": "/Users/paullander/.vscode/extensions/nordic-semiconductor.nrf-terminal-2023.7.47",
            "isActive": true
          },
          "nordic-semiconductor.nrf-devicetree": {
            "version": "2023.7.56",
            "path": "/Users/paullander/.vscode/extensions/nordic-semiconductor.nrf-devicetree-2023.7.56",
            "isActive": true
          },
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2023.6.51",
            "path": "/Users/paullander/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2023.6.51",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": null,
          "ms-vscode.cpptools": "1.17.2",
          "ms-vscode.js-debug": "1.81.0",
          "ms-vscode.js-debug-companion": "1.1.2",
          "ms-vscode.vscode-js-profile-table": "1.0.3",
          "GitHub.vscode-pull-request-github": "0.70.0",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "/Users/paullander/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc": "0.16.1",
        "/Applications/SEGGER/JLink/JLinkExe": "7.88j",
        "/usr/local/bin/nrfjprog": "10.23.0",
        "nrfutil": "Not found",
        "/opt/homebrew/bin/cmake": "3.27.2",
        "/opt/homebrew/bin/west": "1.1.0",
        "/opt/homebrew/bin/python3": "3.11.4",
        "/opt/homebrew/bin/ninja": "1.11.1",
        "/opt/homebrew/bin/gperf": "3.1",
        "/opt/homebrew/bin/dtc": "1.7.0",
        "gn": "Not found",
        "/usr/bin/git": "2.39.2 (Apple Git-143)",
        "gdbPath": "/Users/paullander/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb"
      },
      "sdks": [
        {
          "version": "2.2.0",
          "path": "/opt/nordic/ncs"
        }
      ],
      "toolchains": [],
      "connectedDevices": [],
      "deviceProvider": "nrfutil",
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "",
          "toolchain": {
            "path": "PATH"
          },
          "ozonePath": "/Applications/SEGGER/Ozone_V330b/Ozone",
          "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",
            "${workspaceFolder}/fw/samples/nhm_wpn2f_app"
          ],
          "applicationOptions": {},
          "kconfig": {
            "interface": "kconfig",
            "executeInDefaultShell": false
          },
          "welcome": {
            "showOnStartup": true
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [
            "/Users/paullander/nhm2-sensor/fw"
          ],
          "taskBindings": {},
          "debugging": {
            "flash": true,
            "bindings": {
              "${workspaceFolder}/fw/samples/sdf_app/build_dk": "Launch sdf_app/build_dk"
            }
          },
          "activeAppFollowActiveEditor": true,
          "deviceProvider": "nrfutil"
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        }
      },
      "environment": {
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "/Users/paullander",
          "PATH": "/Users/paullander/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/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/Nordic Semiconductor/bin/",
          "ZEPHYR_BASE": "/opt/nordic/ncs/zephyr",
          "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
          "USER": "paullander"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "/Users/paullander",
          "PATH": "/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/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/Nordic Semiconductor/bin/",
          "USER": "paullander"
        },
        "toolchainPath": "PATH"
      },
      "terminal": {
        "defaultProfile": null
      }
    }
    
    

  • No feedback yet I'm afraid. Still pushing our guys, but difficult to reproduce.

  • Hi Øyvind,

    I have narrowed down the issue, which may be unavoidable with the nRF9160. I first investigated the CTRL-AP (hardware and software protection) features (CONFIG: NRF_APPROTECT_*), but these are not accessible in NCS for the nRF9160.

    In nRF Connect Extension Pack for VS Code, under Actions --> Flash, there are two (very similar looking) flash buttons. The right button starts an "erase then flash" west operation and always works:

    sh -c west flash -d <workspace>app_name/build_dk --skip-rebuild --dev-id 960028613 --erase
    Success.

    The left button (and clicking anywhere in the row) starts a "flash with sector-erase" west operation, usually failing, but sometimes will work by resetting the board in the Connected Devices pane, waiting 2 seconds, then starting:

    sh -c west flash -d /<workspace>/samples/app_name/build_dk --skip-rebuild --dev-id 960028613

    typically failing with:

    FATAL ERROR: command exited with status 33: nrfjprog --program <workspace>app_name/build_dk/zephyr/merged.hex --sectorerase --verify -f NRF91 --snr 960028613

    So, in summary:

    1. If nrfjprog --program includes --sectorerase it may work if you time the operation to start after a reset just right. It seems like there could be something fixable in the nrfjprog DLL, or it might be in the underlying JLink software. The problem is reproducible with the JLink OB and JLink Base debuggers and on mac/PC and with NCS 1.7 thru 2.3.0.
    2. One could just always do a "flash then erase" operation, but this clears UICR.OTP, which we use for immutable device lifetime information that has to survive a firmware upgrade, so it's a nuisance to have to re-program that data with a user-flash-erase either in the Terminal, outside of VS Code, or binding a shell script to one of the two flash buttons.

    Paul

Reply
  • Hi Øyvind,

    I have narrowed down the issue, which may be unavoidable with the nRF9160. I first investigated the CTRL-AP (hardware and software protection) features (CONFIG: NRF_APPROTECT_*), but these are not accessible in NCS for the nRF9160.

    In nRF Connect Extension Pack for VS Code, under Actions --> Flash, there are two (very similar looking) flash buttons. The right button starts an "erase then flash" west operation and always works:

    sh -c west flash -d <workspace>app_name/build_dk --skip-rebuild --dev-id 960028613 --erase
    Success.

    The left button (and clicking anywhere in the row) starts a "flash with sector-erase" west operation, usually failing, but sometimes will work by resetting the board in the Connected Devices pane, waiting 2 seconds, then starting:

    sh -c west flash -d /<workspace>/samples/app_name/build_dk --skip-rebuild --dev-id 960028613

    typically failing with:

    FATAL ERROR: command exited with status 33: nrfjprog --program <workspace>app_name/build_dk/zephyr/merged.hex --sectorerase --verify -f NRF91 --snr 960028613

    So, in summary:

    1. If nrfjprog --program includes --sectorerase it may work if you time the operation to start after a reset just right. It seems like there could be something fixable in the nrfjprog DLL, or it might be in the underlying JLink software. The problem is reproducible with the JLink OB and JLink Base debuggers and on mac/PC and with NCS 1.7 thru 2.3.0.
    2. One could just always do a "flash then erase" operation, but this clears UICR.OTP, which we use for immutable device lifetime information that has to survive a firmware upgrade, so it's a nuisance to have to re-program that data with a user-flash-erase either in the Terminal, outside of VS Code, or binding a shell script to one of the two flash buttons.

    Paul

Children
Related