-
Notifications
You must be signed in to change notification settings - Fork 115
Doesn't work on Mac M1 #202
Comments
It's possible to compile pc-ble-driver with the proper architecture with a few tweaks. |
I managed to package a python package that "kind of work". It's missing this file: pc_ble_driver_py/hex/sd_api_v5/connectivity_4.1.4_1m_with_s132_5.1.0.hex How are these hex files packaged? |
It seems like this closed issue might have some relevant information: |
I've been struggling with this too and have been trying to build everything from scratch. I think I've managed to build the underlying driver properly but the Python binding I'm still struggling with. See here for the Dev Zone ticket. It would be great to find out how to get past the packaging stage. |
Hi Nordic, any word on when a native M1 build will be released? I currently have it working through Rosetta but it would be great to understand the roadmap. |
@whodeenie I did some of the leg work on this as well, and even created a PR (NordicSemiconductor/pc-ble-driver#271) to simplify things... As I even got nrf-util working as it should 🥇 If you're referrning to an M1 specifily here's my whole process:
git clone https://github.com/NordicSemiconductor/pc-ble-driver.git --branch release/4.1.4
cd pc-ble-driver
git fetch origin pull/271/head:master
git checkout master
mkdir build
cd build
cmake -G Ninja -DARCH=arm64 -DNRF_BLE_DRIVER_VERSION=4.1.4 -DCONNECTIVITY_VERSION=4.1.4 ..
cmake --build . # you can add -j8 if you want to push it :)
mkdir dist
cmake --install . --prefix dist
cd ..
cd .. now inside
git clone https://github.com/NordicSemiconductor/pc-ble-driver-py.git --branch release/0.16.2
cd pc-ble-driver-py
python3 -m venv venv
source ./venv/bin/activate
pip3 install --upgrade pip scikit-build
pip3 install -r requirements-dev.txt
export CMAKE_PREFIX_PATH=$(pwd)/../pc-ble-driver/build/dist
export MACOSX_DEPLOYMENT_TARGET=11.0
python3 setup.py bdist_wheel To exit from the venv, simply
pip3 install (workdir path from before)/pc-ble-driver-py/dist/pc_ble_driver_py-0.16.2-cp39-cp39-macosx_11_0_arm64.whl
pip3 install nrfutil # if you need this one as well, as pc-ble-driver-py is already satisfied, everything is good |
@ShaharHD Thank you for this effort. I haven't yet had a chance to follow this through but will do soon and feedback to you. |
@edglue Nordic actually approved the PR (not merged yet) pretty quick. But I got feedback from another person who had this issue and it resolved the issue for him. |
Any information about it, when it will be available from nordic? |
@wiesener I'm afraid not. As I responed here NordicSemiconductor/pc-nrfutil#361 |
I see that NordicSemiconductor/pc-ble-driver#271 was merged 2 weeks ago. |
Read my walkthrough - it'll give you a simple package you can install on any macOS |
I was missing a key definition on cmake configuration files generation -
Build fails with the following:
|
@aryeko you're not following all the prequisite steps for setting up the build enviroment from
pc_ble_driver_py-0.16.2-cp39-cp39-macosx_11_0_arm64.whl.zip |
@ShaharHD Thanks for the amazing step by step tutorial. |
@knoandco try to add the following before running the export LDFLAGS=-lintl Building libraries like those on macOS usually involve setting up build enviroments using HomeBrew or similar. pip3 install pc_ble_driver_py-0.16.2-cp39-cp39-macosx_11_0_arm64.whl
pip3 install nrfutil |
Hi @ShaharHD, thanks for answering... |
@knoandco Because So you might want to move back to Python 3.9 and make sure you install Python 3.9 arm64 verison. I do not know what The latest nrfutil version is |
@ShaharHD Right, I misspelled the nrf_util tool (my machine is still auto-correcting...). |
Hi @ShaharHD, |
@wiesener ... Nordic should be ashamed it's been over two years now and still no proper support for Apple Silicon on such a basic tool required for development. I'm guessing you are running a different version of python... do the following verify your python environment and post it back: pip3 --version
python3 --version
file $(which python3) |
% pip3 --version |
Are you on Monterey ( Make sure to change Also worth mentioning my Pull Request on Built it for you - try this |
I am able to follow the instructions above and build
|
@nehalkpatel I would follow up with Nordic about this. They seems to simply not care about Apple Silicon at this moment... |
Okay as you can see in this thread: https://devzone.nordicsemi.com/f/nordic-q-a/91553/nrfutil-not-working-on-m1 |
Nordic has decided to abandon all nRF5-SDK related projects as they focus only on nRF Connect SDK (which is a shame IMHO). Just ranting here, and I'm guessting it will not change anything on Nordic end, but this workaround will work for a while, but usually when you start to have those workaround, based on my personal experience is when things start to break because of incomptabilty. @nehalkpatel did you resolve it in the end? |
Nope. M1 won't run. So I basically have a dummy, broken package for now and tell people to use x86 or Linux instead. |
sorry to hear that, I'm guessing there's something unique about your system. |
Getting this error:
/pc_ble_driver_py/lib/macos_osx/libpc_ble_driver_shared_sd_api_v3.dylib: mach-o, but wrong architecture'.
The text was updated successfully, but these errors were encountered: