Open maclobdell opened 6 years ago
@maclobdell How reproducible is this exception? (I've actually never seen a TransferTimeoutError before!)
I am having the same error, running or debugging a simple project on a mbed LPC 1768 board, using GNU MCU Eclipse. Using pyOCD manually to upload and debug works ok.
No exception when using pyOCD 0.10. It seems to be a problem when using pyOCD version 0.11 or later along with GNU MCU Eclipse.
Thanks for the info, @fepz.
@thegecko @maclobdell My guess is that this is another sleep related issue. The Mbed OS app is causing the device to enter sleep and therefore lose debug connectivity. So when pyOCD tries to read the core state, the transaction hangs and times out.
Please try disabling the call to hal_sleep()
in sleep_manager_sleep_auto()
in platform/mbed_sleep_manager.c
. (You should already be building using the Debug profile.)
@flit, disabling the hal_sleep()
seemed to have little effect:
Selected port 50000 for debugging
0000845:INFO:board:Target type is lpc1768
0000975:INFO:dap:DP IDR = 0x2ba01477 (v1 rev2)
0001042:INFO:ap:AP#0 IDR = 0x24770011 (AHB-AP var1 rev2)
0001145:INFO:rom_table:AP#0 ROM table #0 @ 0xe00ff000 (designer=000 part=000)
0001181:INFO:rom_table:[0]
0001217:INFO:rom_table:[1]
0001265:INFO:rom_table:[2]
0001341:INFO:rom_table:[3]
0001402:INFO:rom_table:[4]
0001470:INFO:rom_table:[5]
0001574:INFO:cortex_m:CPU core #0 is Cortex-M3 r2p0
0001626:INFO:dwt:4 hardware watchpoints
0001633:INFO:fpb:6 hardware breakpoints, 4 literal comparators
0001660:INFO:server:Semihost server started on port 4444
0001660:INFO:gdbserver:GDB server started on port 50000
Reading symbols from /Users/thegecko/Mbed Programs/mbed-os-example-blinky/BUILD/LPC1768/ARMC6/mbed-os-example-blinky.elf...
done.
0001705:INFO:gdbserver:One client connected!
0x00006b40 in sleep_manager_unlock_deep_sleep_internal () at ./mbed-os/platform/mbed_sleep_manager.c:183
183 if (core_util_atomic_decr_u16(&deep_sleep_lock, 1) == 0xFFFF) {
0001777:INFO:gdbserver:Attempting to load Argon
0001779:INFO:gdbserver:Attempting to load RTX5
0001780:INFO:gdbserver:RTX5 loaded successfully
Attached to debugger on port 50000
0007545:INFO:loader:Erased chip, programmed 37888 bytes (37 pages), skipped 3072 bytes (3 pages) at 7.06 kB/s
Image loaded: /Users/thegecko/Mbed Programs/mbed-os-example-blinky/BUILD/LPC1768/ARMC6/mbed-os-example-blinky.elf
Note: automatically using hardware breakpoints for read-only addresses.
0007758:ERROR:gdbserver:Unhandled exception in handle_message:
Traceback (most recent call last):
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/gdbserver/gdbserver.py", line 547, in handle_message
reply = handler()
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/gdbserver/gdbserver.py", line 982, in get_registers
return self.create_rsp_packet(self.target_facade.get_register_context())
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/gdbserver/context_facade.py", line 69, in get_register_context
vals = self._context.read_core_registers_raw(reg_num_list)
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/debug/cache.py", line 531, in read_core_registers_raw
return self._regcache.read_core_registers_raw(reg_list)
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/debug/cache.py", line 133, in read_core_registers_raw
self._check_cache()
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/debug/cache.py", line 110, in _check_cache
if self._core.is_running():
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/coresight/cortex_m.py", line 943, in is_running
return self.get_state() == Target.TARGET_RUNNING
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/coresight/cortex_m.py", line 920, in get_state
dhcsr = self.read_memory(CortexM.DHCSR)
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/coresight/cortex_m.py", line 605, in read_memory
result = self.ap.read_memory(addr, transfer_size, now)
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/coresight/ap.py", line 564, in _read_memory
result = read_mem_cb()
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/coresight/ap.py", line 546, in read_mem_cb
res = result_cb()
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/coresight/dap.py", line 276, in read_ap_cb
result = result_cb()
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/pyocd/probe/cmsis_dap_probe.py", line 307, in read_ap_result_callback
six.raise_from(self._convert_exception(error), error)
File "/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python2.7/site-packages/six.py", line 737, in raise_from
raise value
TransferError
You are running with a different target than @maclobdell. He was using an LPC546xx rather than the LPC1768 you're using. So I think these are separate bugs. Note that different exceptions are raised: TransferError
for LPC1768, but TransferTimeoutError
for LPC56xx.
Created #745 to cover the LPC1768 issue.
@maclobdell What application were you testing with that caused this issue? Can you reproduce it with mbed-os-example-blinky?
While debugging LPC546XX, using pyocd 0.12.0, I get the following error.