Re: Debugging with Eclipse and PyOCD: Uncaught Exception in pyocd.exe

Bolivar, Marti

Hi, responses inline.

"Weber, Dominik via"
<> writes:

Hello there,

I'm new to Zephyr and having some trouble with debugging my application with PyOCD and Eclipse. I'm running a multithreaded application on a nRF52840 DK. I flash and want to debug the application via the onboard debugger on the DK. I followed the steps described in the tutorial: in the section "Eclipse Debugging".

I use:

* Zephyr 2.3 Build 99

* Segger J-Link OB-SAM3U128-V2-NordicSemi

* Eclipse 2019-09

* Python 3.8.3

* West 0.7.2

* C compiler GNU 9.2.1

All Python dependencies for Zephyr are satisfied.
Does this mean you installed the latest pyocd? The zephyr
requirements-run-test.txt file from which pyocd comes just says:


The version of this tool is likely what is at issue.

When I try to debug the application via pyocd.exe or pyocd-gdbserver.exe I get the following error:

0001289:CRITICAL:__main__:uncaught exception: 'JLinkProbe' object has no attribute '_lock'
Traceback (most recent call last):
File "c:\python38\lib\site-packages\pyocd\", line 362, in run
File "c:\python38\lib\site-packages\pyocd\", line 680, in do_gdbserver
with session:
File "c:\python38\lib\site-packages\pyocd\core\", line 302, in __enter__
File "c:\python38\lib\site-packages\pyocd\core\", line 420, in open
File "c:\python38\lib\site-packages\pyocd\board\", line 85, in init
File "c:\python38\lib\site-packages\pyocd\core\", line 160, in init
File "c:\python38\lib\site-packages\pyocd\utility\", line 213, in invoke
File "c:\python38\lib\site-packages\pyocd\utility\", line 208, in invoke
resultSequence = call()
File "c:\python38\lib\site-packages\pyocd\coresight\", line 359, in power_up_debug
File "c:\python38\lib\site-packages\pyocd\coresight\", line 348, in write_reg
self.write_dp(addr, data)
File "c:\python38\lib\site-packages\pyocd\coresight\", line 528, in write_dp
did_lock = self._set_dpbanksel(addr, True)
File "c:\python38\lib\site-packages\pyocd\coresight\", line 480, in _set_dpbanksel
File "c:\python38\lib\site-packages\pyocd\coresight\", line 252, in lock
File "c:\python38\lib\site-packages\pyocd\probe\", line 173, in lock
AttributeError: 'JLinkProbe' object has no attribute '_lock'

Is this a bug in the python scripts or is the debugger not supported?
This error is coming from pyocd itself. Since it's an AttributeError it
looks like there's probably a bug in the tool. Knowing the exact version
is the next step. I would try manually installing the 0.24.0 version
given in the requirements file if the latest release is buggy here.

I don't understand if "When I try to debug the application via pyocd.exe
or pyocd-gdbserver.exe" means you are using 'west debug' or 'west
debugserver', but if so, you can run in verbose mode to see the pyocd
commands under the hood:

west -v debug

Example output:

$ west -v debug
-- west debug: using runner pyocd
-- runners.pyocd: pyOCD GDB server running on port 3333
runners.pyocd: pyocd gdbserver -p 3333 -T 4444 -t nrf52840 -f 4000000
runners.pyocd: /home/mbolivar/bin/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb /home/mbolivar/zp/zephyr/build/zephyr/zephyr.elf -ex 'target remote :3333' -ex 'monitor halt' -ex 'monitor reset' -ex load


Thanks for your help!

Best Regards,

Join to automatically receive all group messages.