Thanks for the hints. As it turns out, disabling all other VSCode extensions helped to get the debugger to start. It seems that the preDebug task simply died. I will investigate what extension caused it later.
It starts the debugging process successfully, but dies at a later stage after uploading the firmware and the reset of the MCU.
This is the normal output:
Preparing firmware for debugging...
Processing lpc4088 (platform: nxplpc; board: lpc4088; framework: mbed)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/nxplpc/lpc4088.html
PLATFORM: NXP LPC (7.0.0+sha.241dc20) > Embedded Artists LPC4088 QuickStart Board
HARDWARE: LPC4088 120MHz, 96KB RAM, 512KB Flash
DEBUG: Current (cmsis-dap) On-board (cmsis-dap) External (jlink)
PACKAGES:
- framework-mbed 6.51506.201227 (5.15.6)
- toolchain-gccarmnoneeabi 1.90201.191206 (9.2.1)
Collecting mbed sources...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 4 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
Checking size .pio/build/lpc4088/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 3.4% (used 3349 bytes from 98304 bytes)
Flash: [= ] 6.9% (used 36288 bytes from 524288 bytes)
========================= [SUCCESS] Took 1.12 seconds =========================
undefined0000311:WARNING:gdb_server:pyocd-gdbserver is deprecated; please use the new combined pyocd tool.
0000728:INFO:board:Target type is lpc4088
0000768:INFO:dap:DP IDR = 0x2ba01477 (v1 rev2)
0000785:INFO:ap:AHB-AP#0 IDR = 0x24770011 (AHB-AP var1 rev2)
0000904:INFO:rom_table:AHB-AP#0 Class 0x1 ROM table #0 @ 0xe00ff000 (designer=43b part=4c4)
0000912:INFO:rom_table:[0]<e000e000:SCS-M4 class=14 designer=43b part=00c>
0000917:INFO:rom_table:[1]<e0001000:DWT class=14 designer=43b part=002>
0000922:INFO:rom_table:[2]<e0002000:FPB class=14 designer=43b part=003>
0000927:INFO:rom_table:[3]<e0000000:ITM class=14 designer=43b part=001>
0000932:INFO:rom_table:[4]<e0040000:TPIU-M4 class=9 designer=43b part=9a1 devtype=11 archid=0000 devid=ca1:0:0>
0000937:INFO:rom_table:[5]<e0041000:ETM-M4 class=9 designer=43b part=925 devtype=13 archid=0000 devid=0:0:0>
0000939:INFO:cortex_m:CPU core #0 is Cortex-M4 r0p1
0000947:INFO:cortex_m:FPU present: FPv4-SP-D16-M
0000951:INFO:dwt:4 hardware watchpoints
0000954:INFO:fpb:6 hardware breakpoints, 4 literal comparators
0000970:INFO:server:Semihost server started on port 4444 (core 0)
0000974:INFO:gdbserver:GDB server started on port 3333 (core 0)
Reading symbols from ~/Documents/PlatformIO/Projects/testtest/.pio/build/lpc4088/firmware.elf...
PlatformIO Unified Debugger -> http://bit.ly/pio-debug
PlatformIO: debug_tool = cmsis-dap
PlatformIO: Initializing remote target...
0001493:INFO:gdbserver:Client connected to port 3333!
main () at src/main.cpp:7
7 {
0001530:INFO:gdbserver:Attempting to load argon
0001530:INFO:gdbserver:Attempting to load freertos
0001531:INFO:gdbserver:Attempting to load rtx5
0001531:INFO:gdbserver:Attempting to load zephyr
Error: unrecognized command 'init'
Loading section .text, size 0x82e0 lma 0x0
Loading section .ARM.exidx, size 0x8 lma 0x82e0
Loading section .data, size 0xad8 lma 0x82e8
Loading section .heap, size 0xe200 lma 0x9000
[---|---|---|---|---|---|---|---|---|----]
[========================================]
0007887:INFO:loader:Erased 4096 bytes (1 sector), programmed 4096 bytes (8 pages), skipped 94208 bytes (184 pages) at 15.16 kB/s
Start address 0x1858, load size 94144
Transfer rate: 14 KB/sec, 1845 bytes/write.
Resetting target with halt
Successfully halted device on reset
Temporary breakpoint 1 at 0x1e90: file src/main.cpp, line 7.
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = tbreak main`
PlatformIO: More configuration options -> http://bit.ly/pio-debug
Note: automatically using hardware breakpoints for read-only addresses.
0009225:ERROR:gdbserver:Unhandled exception in handle_message: No ACK received
Traceback (most recent call last):
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/probe/cmsis_dap_probe.py", line 238, in flush
self._link.flush()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/utility/concurrency.py", line 28, in _locking
return func(self, *args, **kwargs)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 672, in flush
self._read_packet()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/utility/concurrency.py", line 28, in _locking
return func(self, *args, **kwargs)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 932, in _read_packet
decoded_data = cmd.decode_data(raw_data)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 452, in decode_data
data = self._decode_transfer_data(data)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 359, in _decode_transfer_data
self._check_response(data[2])
File "~/.platformio/packages/tool-pyocd/site-packages/py38/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 "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/gdbserver/gdbserver.py", line 427, in handle_message
reply = handler(msg[msgStart:])
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/gdbserver/gdbserver.py", line 675, in v_command
return self.v_cont(cmd)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/gdbserver/gdbserver.py", line 726, in v_cont
return self.resume(None)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/gdbserver/gdbserver.py", line 580, in resume
self.target.resume()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/coresight/cortex_m.py", line 877, in resume
self.flush()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/core/target.py", line 233, in flush
self.session.probe.flush()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/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
warning: Remote failure reply: E01
0009228:ERROR:gdbserver:Unhandled exception in handle_message: No ACK received
Traceback (most recent call last):
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/probe/cmsis_dap_probe.py", line 286, in read_ap_result_callback
return result()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 847, in read_reg_cb
res = transfer.get_result()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 144, in get_result
self.daplink.flush()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/utility/concurrency.py", line 28, in _locking
return func(self, *args, **kwargs)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 672, in flush
self._read_packet()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/utility/concurrency.py", line 28, in _locking
return func(self, *args, **kwargs)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 932, in _read_packet
decoded_data = cmd.decode_data(raw_data)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 452, in decode_data
data = self._decode_transfer_data(data)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 359, in _decode_transfer_data
self._check_response(data[2])
File "~/.platformio/packages/tool-pyocd/site-packages/py38/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 "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/gdbserver/gdbserver.py", line 425, in handle_message
reply = handler()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/gdbserver/gdbserver.py", line 873, in get_registers
return self.create_rsp_packet(self.target_facade.get_register_context())
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/gdbserver/context_facade.py", line 101, in get_register_context
vals = self._context.read_core_registers_raw(self._full_reg_num_list)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/debug/cache.py", line 48, in read_core_registers_raw
return self._regcache.read_core_registers_raw(reg_list)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/cache/register.py", line 96, in read_core_registers_raw
if self._check_cache():
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/cache/register.py", line 77, in _check_cache
if self._core.is_running():
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/coresight/cortex_m.py", line 861, in is_running
return self.get_state() == Target.State.RUNNING
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/coresight/cortex_m.py", line 830, in get_state
dhcsr = self.read_memory(CortexM.DHCSR)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/coresight/cortex_m.py", line 435, in read_memory
result = self.ap.read_memory(addr, transfer_size, now)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/utility/concurrency.py", line 28, in _locking
return func(self, *args, **kwargs)
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/coresight/ap.py", line 993, in _read_memory
result = read_mem_cb()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/coresight/ap.py", line 972, in read_mem_cb
res = result_cb()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/pyocd/coresight/dap.py", line 717, in read_ap_cb
result = result_cb()
File "~/.platformio/packages/tool-pyocd/site-packages/py38/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
Could not read registers; remote failure reply 'E01'
A full log with dev debug output can be found here: LPC4088 pyOCD Debug Output · GitHub
I’ve read about debug problems with pyOCD and LPC1768, and tried downgrading to pyOCD, but that did not help. It looks to me as if the board is in a power saving mode and does not respond to the debugger anymore.
Did you hit similar problems before?
I would love to get away from MCUXpresso to develop on the LPC4088.
Best regards,
Christian