Bad CPU type in executable in nrf5sdk-tools

Hi
I want to use nrfutil nrf5sdk-tools in MacOS but when I try to run it I get the following error.

" Error: Failed to spawn inner nrfutil-legacy executable

Caused by:

    Bad CPU type in executable (os error 86) "


Here are the details.
MacOS: 15.3

CPU: M1 and I tried an M3

NRFUTIL DETAILS:

nrfutil 7.12.0 (39003c9 2024-06-10)

commit-hash: 39003c9d0e5d946af0f417cfadf4ac55a6d03c19

commit-date: 2024-06-10

host: aarch64-apple-darwin

build-timestamp: 2024-06-10T15:50:53.137997000Z

classification: nrf-external

Python 3.13.1

Please note that I have another Mac machine that has an M3 Pro CPU and nrf5sdk-tools works okay there.

 

  • Hello,

    There are some limitations with nRF Util when working with macOS. See the section on supported operating systems for nRF Util. Is that the whole log when trying to run? If not, could you provide the complete log?

    Kind Regards,
    Abhijith

  • I recently upgraded to an M3 Max MacBook and I also get this same error when trying to run any of the nrf5sdk-tools commands using nrfutil 7.12.0 (39003c9 2024-06-10). It looks like it tries to spawn the executable installed as ~/.nrfutil/lib/nrfutil-nrf5sdk-tools/pc_nrfutil_legacy_v6.1.7.

    When I do a 'file' on this executable it report that it is: Mach-O 64-bit executable x86_64

    Seems like when you install the nrf5sdk-tools it installs the executable for the wrong architecture. The nrfutil executable is: Mach-O 64-bit executable arm64

    Is it possible to force the install to download the arm64 version of the pc_nrfutil_legacy_v6.1.7 executable when installing nrf5sdk-tools.

  •   

    To fix this issue install Rosetta on your MacOS 

    softwareupdate --install-rosetta

    nrfutil was built for intel based Macs and it needs this translation layer to work. This translation causes the nrfutil on ARM MacOS to be slower compared to Linux or Windows. This is my theory though I haven't tested on a variety of systems.

     Is there a plan to have nrfutil work on MacOS without the need for Rosetta?


  • Thank for your suggestion  . I am trying to avoid using Rosetta 2, the nrf5sdk-tools is the only tool in my development pipeline that requires a non native arm64 executable. 

    It would be nice to know if Nordic has an arm64 version of pc-nrfutil_legacy_v6.1.7 available.

    Looking at their GitHub project for the legacy pc-nrftuil, there seem to be some talk that it is possible to build an ARM version if you jump through a couple of hoop. The pc-ble-driver dependency sounds like one of the big issues.

    The pkg and settings functions are the only thing I need from the nrf5sdk-tools to build DFU packages for projects that are still using the legacy nRF5 SDK.

    Does anyone here know if there is another tool that can generate DFU packages that is more cross platform and ARM friendly.

Related