west debug fails, looking for python3.8

Hi,

I recently went through the manual installation instructions for the nRF Connect SDK posted here (https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_installing.html). In addition to these instructions, I installed the nrf command line tools and have nrfjprog in my path. I also installed Jlink. After doing all of this, I can build and flash my nrf9160 project, but when I try to run "west debug" I get the following error:

ting [main] % west debug
-- west debug: rebuilding
[0/15] Performing build step for 'tfm'
ninja: no work to do.
-- west debug: using runner jlink
-- runners.jlink: JLink version: 7.66b
-- runners.jlink: J-Link GDB server running on port 2331; no thread info available
dyld[21613]: Library not loaded: /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/Python
Referenced from: /opt/zephyr-sdk-0.14.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb
Reason: tried: '/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/Python' (no such file), '/Library/Frameworks/Python.framework/Versions/3.8/Python' (no such file), '/System/Library/Frameworks/Python.framework/Versions/3.8/Python' (no such file)
FATAL ERROR: command exited with status -6: /opt/zephyr-sdk-0.14.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb /Users/greg/git/nordic/ting/build/zephyr/zephyr.elf -ex 'target remote :2331' -ex 'monitor halt' -ex 'monitor reset' -ex load
ting [main] %

This is on an Intel Macbook. I have python 3.9 installed (not python 3.8). I don't understand why it is looking for a python3.8 file. I also don't understand why it says the python framework is referenced from ...arm-zephyr-eabi-gdb which is an executable binary, not a python script. So I'm not sure how to fix this. Any help appreciated.

Thanks

Greg

Parents Reply Children
  • In fact, this is a deeper rabbit hole than it appears. arm-zephyr-eabi-gdb is harcoded to python3.8, but on an M1 Mac explicitly installing python3.8 doesn't help because python3.8 is only available as a x86 build, not arm. So then arm-zephyr-eabi-gdb (arm) complains it's the wrong architecture and fails. I spent several hours going around in circles trying to find a work-around ... what a mess. 

    The way I solved it it is to follow the Zephyr Getting Started but install x86 versions of stuff:

    1. Install python3.8 (x86)

    2. Install the x86 version of the Zephyr SDK (zephyr-sdk-0.15.1_macos-x86_64.tar.gz)

    3. Also, despite what the Zephyr Getting Started Instructions say, openocd (for Mac) appears to be not part of that Zephyr SDK. Building openocd from scratch fails again due to mismatch of architectures. However, pyocd is being installed, so you can replace the board_runner_args in your board.cmake with pyocd (pyocd "--target=<board>")

    So far, using the x86 version of the SDK and tools appears to work all the way (I can build examples and flash them), but it's slower, of course. It's frustrating the this hasn't been tested better on the Mac M1 and that Zephyr SDK tools have a hard-coded dependency on phyton3.8 which is not available as arm64.

Related