zephyrproject-rtos / eclipse-plugin

Zephyr Eclipse Plugin
Eclipse Public License 2.0
16 stars 18 forks source link

pyOCD failed to load "zephyr.elf" #16

Open zakariae87 opened 4 years ago

zakariae87 commented 4 years ago

Im trying to debug with pyocd and im getting this error

0/1] Debugging nrf52_blenano2 -- west debugserver: using runner pyocd -- runners.pyocd: pyOCD GDB server running on port 3333 0000515:INFO:board:Target type is nrf52 0000710:INFO:dap:DP IDR = 0x2ba01477 (v1 rev2) 0000797:INFO:ap:AP#0 IDR = 0x24770011 (AHB-AP var1 rev2) 0000874:INFO:ap:AP#1 IDR = 0x02880000 (proprietary) 0000879:INFO:target_nRF52:NRF52832 not in secure state 0000898:INFO:rom_table:AP#0 ROM table #0 @ 0xe00ff000 (designer=244 part=006) 0000910:INFO:rom_table:[0] 0000920:INFO:rom_table:[1] 0000929:INFO:rom_table:[2] 0000939:INFO:rom_table:[3] 0000950:INFO:rom_table:[4] 0000958:INFO:rom_table:[5] 0000964:INFO:cortex_m:CPU core #0 is Cortex-M4 r0p1 0000987:INFO:cortex_m:FPU present: FPv4-SP 0000996:INFO:dwt:4 hardware watchpoints 0001003:INFO:fpb:6 hardware breakpoints, 4 literal comparators 0001087:CRITICAL:main:uncaught exception: [Errno 98] Address already in use Traceback (most recent call last): File "/home/zephyr/.local/lib/python3.6/site-packages/pyocd/main.py", line 344, in run self._COMMANDSself._args.cmd File "/home/zephyr/.local/lib/python3.6/site-packages/pyocd/main.py", line 579, in do_gdbserver server_listening_callback=self.server_listening) File "/home/zephyr/.local/lib/python3.6/site-packages/pyocd/gdbserver/gdbserver.py", line 151, in init self.abstract_socket.init() File "/home/zephyr/.local/lib/python3.6/site-packages/pyocd/utility/sockets.py", line 33, in init self.listener.bind((self.host, self.port)) OSError: [Errno 98] Address already in use ERROR: command exited with status 1: pyocd gdbserver -p 3333 -T 4444 -t nrf52 FAILED: zephyr/cmake/flash/CMakeFiles/debugserver cd /home/zephyr/eclipse-workspace/SmartEggLite/build && /snap/cmake/252/bin/cmake -E env /home/zephyr/.local/bin/west debugserver --skip-rebuild ninja: build stopped: subcommand failed.

dcpleung commented 4 years ago

It is possible that a previous instance of pyocd was still running, occupying those ports. Or pyocd did not exit cleanly so the OS has a TIME_WAIT on those sockets. Did you perform a debugging session just before this happened? Maybe that debugging session was still in progress?

zakariae87 commented 4 years ago

Im using DAPlink(USB) . this is my first debug , antyhing done before and i get always the same error. Can you provide with daplink config ? is there something in debug to set in order to get debug session work fine ?

dcpleung commented 4 years ago

I have never used DAPlink and don't have one to try. Could you try running west debug in command line? If it is still an issue there, it might be caused by the underlying cmake/west mechanisms and we can file a bug at the main Zephyr repo.

zakariae87 commented 4 years ago

My Daplink is always at "/dev/ttyACM0" and when i open terminal view on eclipse, it tell me that port is closed. I verify if the port is realy closed and it's seem to be ok and any process have been attached to it. I think you should make bug on zephyr repos to correct this . i have always the same error