Visual Studio NRF Connect on M1, flashing not working

Hi guys,

I am trying to flash my nrf52840 dongle (with the Segger j-link mini) via your awesome NRF Connect Extension on my Apple M1, but I can't get it to work inside of VS. The following error occures:

-- west flash: using runner nrfjprog
-- runners.nrfjprog: Flashing file: nrf52-demo-pwm/build_dongle/zephyr/zephyr.hex
ERROR: JLinkARM DLL load failed. Try again. If it keeps failing, please
ERROR: reinstall latest JLinkARM from Segger webpage.
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 32: nrfjprog --program nrf52-demo-pwm/build_dongle/zephyr/zephyr.hex --sectoranduicrerase -f NRF52 --snr 801036476

If I run the command in my terminal (not rosetta), it works without a problem.

Idea: West is running as an intel app?!

The following versions are installed:

  • Visual Studio 1.61.2, ARM64 Version
  • West version: v0.11.1
  • nrfjprog version: 10.15.0 external
  • JLinkARM.dll version: 7.56a
  • nrf-command-line-tools 10.15.0

I think I should be up-to-date.

Parents Reply Children
  • Sorry, my bet. Forgot to mention that I am using the Segger j-link mini to program it. Which works without a problem. Only inside of visual studio it doesn't work.

    Running:

    nrfjprog --program nrf52-demo-pwm/build_dongle/zephyr/zephyr.hex --sectoranduicrerase -f NRF52 --snr 801036476

    from the bash works like a charm.

    After investigating a little bit further, it boils down to west. The version of west which is shipped with the sdk v1.7.0 is not working correctly on the Apple M1.  Here my test:

    Running SDK v1.7.0 west (does not work)

    ❯ /opt/nordic/ncs/v1.7.0/toolchain/bin/west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfjprog
    ERROR: JLinkARM DLL load failed. Try again. If it keeps failing, please
    ERROR: reinstall latest JLinkARM from Segger webpage.
    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 32: nrfjprog --ids

    Running Python 3.8 Pip Installed West (works)

     west flash
    -- west flash: rebuilding
    ninja: no work to do.
    -- west flash: using runner nrfjprog
    Using board 801036476
    -- runners.nrfjprog: Flashing file: /opt/nordic/ncs/v1.7.0/zephyr/samples/basic/blinky/build/zephyr/zephyr.hex
    Parsing image file.
    Applying system reset.
    Verified OK.
    Enabling pin reset.
    Applying pin reset.
    -- runners.nrfjprog: Board with serial number 801036476 flashed successfully.

    Both have the identical version of v0.11.1. I guess it comes down to the OS arch they have build up on.

  • Hi,

    Thank you for the good information on this.

    Do you think this could be the same problem as described in this post?

    Regards,
    Sigurd Hellesvik

  • Hi Siguard,

    I guess, but sadly using the newest nrf command line tool 10.15.0 doesn't fix the problem.

    My current workaround is to use west from bash.

  • Hi

    The post I mentioned also say that you should use the Intel version of VS code. Have you tried this?
    Here is a comment on this specifically (Posted after you posted your last here)

    Regards,
    Sigurd Hellesvik

  • Just a quick update. With the current version of nRF Connect for VS Code (v2021.11.221) and SDK v1.7.0 debugging and flashing is working from VS on my M1.

    Thanks for your support.

    More versions:

    nrfjprog version: 10.15.0 external
    JLinkARM.dll version: 7.58

    West version: v0.12.0

Related