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

LPC4088 QSB 'No ACK received' #1124

Open
tux19 opened this issue Mar 27, 2021 · 1 comment
Open

LPC4088 QSB 'No ACK received' #1124

tux19 opened this issue Mar 27, 2021 · 1 comment

Comments

@tux19
Copy link

tux19 commented Mar 27, 2021

I want to use platformio to develop the LPC4088. It has an onboard CMSIS-DAP debug probe. I was unable to debug with platformio. Not sure what the root cause was, I opened a thread at platformio. I was able to narrow the issues down to pyOCD.

As mentioned here only older versions of pyOCD are able to successfully debug these LPC chips. I tried pyOCD 0.8.0 successfully, but it is really akward/hacky to use python2 for some tasks whereas the rest of platformio has to run with python3.

Is there a way to get pyOCD to support the LPC17xx/LPC40xx family with on board probes again?

I am happy to help, but I am unsure how/where to start.

Below the log output from my debug attempt with pyOCD 1.29

❯ python .\pyocd-gdbserver.py -t lpc4088
0000506:WARNING:gdb_server:pyocd-gdbserver is deprecated; please use the new combined pyocd tool.
Waiting for a debug probe to be connected...
0009486:INFO:board:Target type is lpc4088
0009539:INFO:dap:DP IDR = 0x2ba01477 (v1 rev2)
0009597:INFO:ap:AHB-AP#0 IDR = 0x24770011 (AHB-AP var1 rev2)
0009654:INFO:rom_table:AHB-AP#0 Class 0x1 ROM table #0 @ 0xe00ff000 (designer=43b part=4c4)
0009663:INFO:rom_table:[0]<e000e000:SCS-M4 class=14 designer=43b part=00c>
0009668:INFO:rom_table:[1]<e0001000:DWT class=14 designer=43b part=002>
0009674:INFO:rom_table:[2]<e0002000:FPB class=14 designer=43b part=003>
0009680:INFO:rom_table:[3]<e0000000:ITM class=14 designer=43b part=001>
0009686:INFO:rom_table:[4]<e0040000:TPIU-M4 class=9 designer=43b part=9a1 devtype=11 archid=0000 devid=ca1:0:0>
0009692:INFO:rom_table:[5]<e0041000:ETM-M4 class=9 designer=43b part=925 devtype=13 archid=0000 devid=0:0:0>
0009695:INFO:cortex_m:CPU core #0 is Cortex-M4 r0p1
0009705:INFO:cortex_m:FPU present: FPv4-SP-D16-M
0009710:INFO:dwt:4 hardware watchpoints
0009714:INFO:fpb:6 hardware breakpoints, 4 literal comparators
0009737:INFO:server:Semihost server started on port 4444 (core 0)
0009748:INFO:gdbserver:GDB server started on port 3333 (core 0)
0275145:INFO:gdbserver:Client connected to port 3333!
0275186:INFO:gdbserver:Attempting to load argon
0275187:INFO:gdbserver:Attempting to load freertos
0275187:INFO:gdbserver:Attempting to load rtx5
0275187:INFO:gdbserver:Attempting to load zephyr
[====================] 100%
0285430:INFO:loader:Erased 4096 bytes (1 sector), programmed 4096 bytes (8 pages), skipped 159744 bytes (312 pages) at 15.66 kB/s
0286813:ERROR:gdbserver:Unhandled exception in handle_message: No ACK received
Traceback (most recent call last):
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\cmsis_dap_probe.py", line 238, in flush
    self._link.flush()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\utility\concurrency.py", line 28, in _locking
    return func(self, *args, **kwargs)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 672, in flush
    self._read_packet()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\utility\concurrency.py", line 28, in _locking
    return func(self, *args, **kwargs)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 932, in _read_packet
    decoded_data = cmd.decode_data(raw_data)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 452, in decode_data
    data = self._decode_transfer_data(data)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 359, in _decode_transfer_data
    self._check_response(data[2])
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 342, in _check_response
    raise DAPAccessIntf.TransferError("No ACK received")
pyocd.probe.pydapaccess.dap_access_api.DAPAccessIntf.TransferError: No ACK received

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\gdbserver\gdbserver.py", line 427, in handle_message
    reply = handler(msg[msgStart:])
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\gdbserver\gdbserver.py", line 675, in v_command
    return self.v_cont(cmd)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\gdbserver\gdbserver.py", line 726, in v_cont
    return self.resume(None)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\gdbserver\gdbserver.py", line 580, in resume
    self.target.resume()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\coresight\cortex_m.py", line 877, in resume
    self.flush()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\core\target.py", line 233, in flush
    self.session.probe.flush()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\cmsis_dap_probe.py", line 240, in flush
    six.raise_from(self._convert_exception(exc), exc)
  File "<string>", line 3, in raise_from
pyocd.core.exceptions.TransferError: No ACK received
0286822:ERROR:gdbserver:Unhandled exception in handle_message: No ACK received
Traceback (most recent call last):
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\cmsis_dap_probe.py", line 286, in read_ap_result_callback
    return result()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 847, in read_reg_cb
    res = transfer.get_result()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 144, in get_result
    self.daplink.flush()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\utility\concurrency.py", line 28, in _locking
    return func(self, *args, **kwargs)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 672, in flush
    self._read_packet()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\utility\concurrency.py", line 28, in _locking
    return func(self, *args, **kwargs)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 932, in _read_packet
    decoded_data = cmd.decode_data(raw_data)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 452, in decode_data
    data = self._decode_transfer_data(data)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 359, in _decode_transfer_data
    self._check_response(data[2])
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\pydapaccess\dap_access_cmsis_dap.py", line 342, in _check_response
    raise DAPAccessIntf.TransferError("No ACK received")
pyocd.probe.pydapaccess.dap_access_api.DAPAccessIntf.TransferError: No ACK received

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\gdbserver\gdbserver.py", line 425, in handle_message
    reply = handler()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\gdbserver\gdbserver.py", line 873, in get_registers
    return self.create_rsp_packet(self.target_facade.get_register_context())
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\gdbserver\context_facade.py", line 101, in get_register_context
    vals = self._context.read_core_registers_raw(self._full_reg_num_list)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\debug\cache.py", line 48, in read_core_registers_raw
    return self._regcache.read_core_registers_raw(reg_list)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\cache\register.py", line 96, in read_core_registers_raw
    if self._check_cache():
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\cache\register.py", line 77, in _check_cache
    if self._core.is_running():
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\coresight\cortex_m.py", line 861, in is_running
    return self.get_state() == Target.State.RUNNING
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\coresight\cortex_m.py", line 830, in get_state
    dhcsr = self.read_memory(CortexM.DHCSR)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\coresight\cortex_m.py", line 435, in read_memory
    result = self.ap.read_memory(addr, transfer_size, now)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\utility\concurrency.py", line 28, in _locking
    return func(self, *args, **kwargs)
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\coresight\ap.py", line 993, in _read_memory
    result = read_mem_cb()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\coresight\ap.py", line 972, in read_mem_cb
    res = result_cb()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\coresight\dap.py", line 717, in read_ap_cb
    result = result_cb()
  File "C:\Users\chrigi\.platformio\packages\tool-pyocd\site-packages\py37\pyocd\probe\cmsis_dap_probe.py", line 288, in read_ap_result_callback
    six.raise_from(self._convert_exception(error), error)
  File "<string>", line 3, in raise_from
pyocd.core.exceptions.TransferError: No ACK received
@tux19
Copy link
Author

tux19 commented Jun 16, 2021

Any update on this? Even a hint in what direction to look would help... see related issues:

I plan to look at this in more detail in the next 1-2 months, but since I am not really comfortable with python/virtual envs etc... it might take some effort to get to the point of effective debugging and understanding pyOCD, so any help to get this working is appreciated :)

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