Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyocd_pemicro/pemicro_probe: AttributeError: 'PEMicroException' object has no attribute 'message' + FreeBSD/*BSD detection blocker #1158

Open
cederom opened this issue May 12, 2021 · 2 comments

Comments

@cederom
Copy link
Contributor

cederom commented May 12, 2021

Hello world :-)

I have encountered a blocker traceback on pyocd (i.e. pyocd list or pyocd flash) related to pyocd_pemicro/pemicro_probe:

(venv37zephyr) pyocd list
0001271:CRITICAL:__main__:uncaught exception: 'PEMicroException' object has no attribute 'message'
Traceback (most recent call last):
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pypemicro/pemicro.py", line 401, in get_pemicro_lib
    libs_list = PyPemicro.get_pemicro_lib_list(dllpath=dllpath)
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pypemicro/pemicro.py", line 142, in get_pemicro_lib_list
    lib_name = PyPemicro.get_library_name()
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pypemicro/pemicro.py", line 99, in get_library_name
    raise PEMicroException(f"Unable to determinate running operation system ({system_name})")
pypemicro.pemicro.PEMicroException: Unable to determinate running operation system (FreeBSD)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pypemicro/pemicro.py", line 419, in list_ports
    lib = PyPemicro.get_pemicro_lib()
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pypemicro/pemicro.py", line 407, in get_pemicro_lib
    raise PEMicroException(str(exc))
pypemicro.pemicro.PEMicroException: Unable to determinate running operation system (FreeBSD)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd_pemicro/pemicro_probe.py", line 82, in get_all_connected_probes
    port_list = pemicro.list_ports()
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pypemicro/pemicro.py", line 421, in list_ports
    raise PEMicroException(str(exc))
pypemicro.pemicro.PEMicroException: Unable to determinate running operation system (FreeBSD)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.30.4.dev31-py3.7.egg/pyocd/__main__.py", line 150, in run
    status = cmd.invoke()
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.30.4.dev31-py3.7.egg/pyocd/subcommands/list_cmd.py", line 93, in invoke
    ConnectHelper.list_connected_probes()
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.30.4.dev31-py3.7.egg/pyocd/core/helpers.py", line 109, in list_connected_probes
    allProbes = ConnectHelper.get_all_connected_probes(blocking=False)
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.30.4.dev31-py3.7.egg/pyocd/core/helpers.py", line 82, in get_all_connected_probes
    allProbes = DebugProbeAggregator.get_all_connected_probes(unique_id=unique_id)
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.30.4.dev31-py3.7.egg/pyocd/probe/aggregator.py", line 64, in get_all_connected_probes
    probes += cls.get_all_connected_probes(unique_id, is_explicit)
  File "/home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd_pemicro/pemicro_probe.py", line 89, in get_all_connected_probes
    if cls.NO_LIBRARY_ERR in exc.message:
AttributeError: 'PEMicroException' object has no attribute 'message'

My envronment:

(venv37zephyr) uname -a
FreeBSD hexagon 12.2-RELEASE-p6 FreeBSD 12.2-RELEASE-p6 GENERIC  amd64

(venv37zephyr) pip show pyocd
Name: pyocd
Version: 0.30.4.dev31
Summary: Cortex-M debugger for Python
Home-page: https://github.com/pyocd/pyOCD
Author: Chris Reed, Martin Kojtal
Author-email: chris.reed@arm.com, martin.kojtal@arm.com
License: Apache 2.0
Location: /home/x/usr/local/venv37zephyr/lib/python3.7/site-packages/pyocd-0.30.4.dev31-py3.7.egg
Requires: capstone, cmsis-pack-manager, colorama, intelhex, intervaltree, naturalsort, prettytable, pyelftools, pylink-square, pyocd-pemicro, pyusb, pyyaml, six, hidapi
Required-by:

(venv37zephyr) pip show pyocd-pemicro
Name: pyocd-pemicro
Version: 1.0.3
Summary: PyOCD debug probe plugin for PEMicro debug probes
Home-page: https://github.com/pyocd/pyocd-pemicro
Author: Petr Gargulak
Author-email: petr.gargulak@nxp.com
License: BSD-3-Clause
Location: /home/x/usr/local/venv37zephyr/lib/python3.7/site-packages
Requires: pypemicro, six
Required-by: pyocd

Either version mismatch between pyocd and pyocd-pemicro or no support for FreeBSD (*BSD) on pyocd-pemicro. Work in progress :-)

Btw. why separate pyocd-pemicro dependency to pyocd?

@cederom
Copy link
Contributor Author

cederom commented May 12, 2021

Okay, this problem seems to be reported in pyocd/pyocd-pemicro#2 and fixed already in the upstream master.

I now have OS detection problem that I will reported here pyocd/pyocd-pemicro#4.

@cederom cederom changed the title pyocd_pemicro/pemicro_probe: AttributeError: 'PEMicroException' object has no attribute 'message' pyocd_pemicro/pemicro_probe: AttributeError: 'PEMicroException' object has no attribute 'message' + FreeBSD/*BSD detection blocker May 12, 2021
@cederom
Copy link
Contributor Author

cederom commented May 12, 2021

By the way - if we are not interested in this PEMicro - should that block use of pyOCD?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant