I want to use pyocd-gdbserver on my M1 Mac mini, but it won't load.
I'm running Python 3.9 (arm64), and I get this long traceback (below) because some .dylib
only has i386
and x86_64
architectures, and what's needed is arm64e
(is that different from arm64
?).
I don't know what .dylib
it is, because pyocd makes an anonymised private copy. I've downloaded the arm64 version of Segger's JLink software, and libusb
is also arm64.
I've been running the same board (BBC micro:bit v1.3B) on an Intel Mac, and pyocd worked fine without having installed Segger's JLink firmware on it; but just in case I installed Segger's firmware - no difference.
Here's the log ... (I've folded the lines at the end)
$ pyocd-gdbserver
Traceback (most recent call last):
File "/Users/simon/Library/Python/3.9/bin/pyocd-gdbserver", line 5, in <module>
from pyocd.tools.gdb_server import main
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pyocd/__init__.py", line 21, in <module>
from . import gdbserver
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pyocd/gdbserver/__init__.py", line 17, in <module>
from .gdbserver import GDBServer
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pyocd/gdbserver/gdbserver.py", line 49, in <module>
from ..commands.commander import ToolExitException
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pyocd/commands/commander.py", line 25, in <module>
from ..core.helpers import ConnectHelper
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pyocd/core/helpers.py", line 26, in <module>
from ..probe.aggregator import DebugProbeAggregator
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pyocd/probe/aggregator.py", line 83, in <module>
load_plugin_classes_of_type('pyocd.probe', PROBE_CLASSES, DebugProbe)
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pyocd/core/plugin.py", line 104, in load_plugin_classes_of_type
if plugin.should_load():
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pyocd/probe/jlink_probe.py", line 377, in should_load
return JLinkProbe._get_jlink() is not None
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pyocd/probe/jlink_probe.py", line 50, in _get_jlink
return pylink.JLink(
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pylink/jlink.py", line 292, in __init__
lib = library.Library()
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pylink/library.py", line 261, in __init__
self.load_default()
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pylink/library.py", line 299, in load_default
return self.load(path)
File "/Users/simon/Library/Python/3.9/lib/python/site-packages/pylink/library.py", line 353, in load
self._lib = ctypes.cdll.LoadLibrary(tf.name)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 452, in LoadLibrary
return self._dlltype(name)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/var/folders/ch/k_zwspdx3qsfbt1_x21zld6m0000gn/T/tmp5g6hpqrt.dylib, 0x0006): tried:
'/var/folders/ch/k_zwspdx3qsfbt1_x21zld6m0000gn/T/tmp5g6hpqrt.dylib'
(fat file, but missing compatible architecture (have (i386,x86_64), need (arm64e))),
'/private/var/folders/ch/k_zwspdx3qsfbt1_x21zld6m0000gn/T/tmp5g6hpqrt.dylib'
(fat file, but missing compatible architecture (have (i386,x86_64), need (arm64e)))