pyocd / pyocd/pyOCD

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

Open
#1,158 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
560
Avg merge
1h 41m
Merged PRs (30d)
3

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pyocd_pemicro/pemicro_probe.py at get_all_connected_probes and compare its exception handling with pypemicro/pemicro.py at get_library_name and list_ports. Reproduce the failure with pyocd list on FreeBSD; done means the unsupported-platform path no longer raises the shown AttributeError and the intended FreeBSD support outcome is established.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.