4 years, 5 months ago.

Solving TransferError with LPC1768 on Mbed Studio

I've been attempting to launch a debugging session on Mbed Studio for the LPC1768 over the past several days. Regardless of reinstalling Mbed Studio, the CMSIS-DAP serial drivers, or changing the program on the mbed all attempts to launch a debug session have failed with a TransferError shortly after flashing the chip. Below is a relevant excerpt from the logs showing the issue.

As far as I'm aware, the LPC1768 is official supported for debugging by Mbed Studio, so I'm having trouble diagnosing the root cause of the issue. The problem appears on multiple machines across different versions of Windows and different serial drivers, so I don't believe the cause is there. There's a similar issue noted in the pyOCD backlog, but a solution doesn't exist there either. Please let me know if there is something I'm missing.

Log File:

[2019-10-01T12:03:07.729] [INFO] root/mbs-debug - Creating debug session... [] [2019-10-01T12:03:07.940] [DEBUG] root/process - Starting raw process: C:\Users\blah\AppData\Local\Programs\Mbed Studio\resources\app\node_modules\@mbed\mbs-debug-pyocd\download\cmsis-debug\project\lib\index.js, with args: , with options: {"stdio":["pipe","pipe",2,"ipc"]} [] [2019-10-01T12:03:07.944] [INFO] root/mbs-core - Updating CoreMbedApplicationState with updateType: DEBUG_SESSION, update: true [] [2019-10-01T12:03:07.945] [INFO] root/mbs-core - Determining program buttons status: {"BUILD":{"type":"BUILD","typeString":"BUILD","isDisabled":true,"tooltip":"Debug in progress"},"DEBUG":{"type":"DEBUG","typeString":"DEBUG","isDisabled":true,"tooltip":"Debug in progress"},"RUN":{"type":"RUN","typeString":"RUN","isDisabled":true,"tooltip":"Debug in progress"}} [] [2019-10-01T12:03:07.945] [INFO] root/mbs-debug - Activating panel for debug... [] [2019-10-01T12:03:07.945] [INFO] root/mbs-debug - Debug started [] [2019-10-01T12:03:07.957] [WARN] MbedStudio - Widget was activated, but did not accept focus: debug [] [2019-10-01T12:03:08.145] [INFO] root/mbs-debug - console: Selected port 50001 for debugging [] [2019-10-01T12:03:08.147] [DEBUG] MbedStudio - telemetry/progress [ { percent: 0, message: 'Starting Debugger' } ] [2019-10-01T12:03:17.471] [INFO] root/mbs-debug - stdout: 0005898:INFO:board:Target type is lpc1768 [] [2019-10-01T12:03:17.530] [INFO] root/mbs-debug - stdout: 0005958:INFO:dap:DP IDR = 0x2ba01477 (v1 rev2) [] [2019-10-01T12:03:17.550] [INFO] root/mbs-debug - stdout: 0005978:INFO:ap:AP#0 IDR = 0x24770011 (AHB-AP var1 rev2) [] [2019-10-01T12:03:17.583] [INFO] root/mbs-debug - stdout: 0006010:INFO:rom_table:AP#0 ROM table #0 @ 0xe00ff000 (designer=000 part=000) [] [2019-10-01T12:03:17.602] [INFO] root/mbs-debug - stdout: 0006029:INFO:rom_table:[0]<e000e000:SCS-M3 class=14 designer=43b part=000> [] [2019-10-01T12:03:17.614] [INFO] root/mbs-debug - stdout: 0006042:INFO:rom_table:[1]<e0001000:DWT class=14 designer=43b part=002> [] [2019-10-01T12:03:17.627] [INFO] root/mbs-debug - stdout: 0006055:INFO:rom_table:[2]<e0002000:FPB class=14 designer=43b part=003> [] [2019-10-01T12:03:17.643] [INFO] root/mbs-debug - stdout: 0006069:INFO:rom_table:[3]<e0000000:ITM class=14 designer=43b part=001> [] [2019-10-01T12:03:17.653] [INFO] root/mbs-debug - stdout: 0006080:INFO:rom_table:[4]<e0040000:TPIU-M3 class=9 designer=43b part=923 devtype=11 archid=0000 devid=0:0:ca1> [] [2019-10-01T12:03:17.666] [INFO] root/mbs-debug - stdout: 0006092:INFO:rom_table:[5]<e0041000:ETM-M3 class=9 designer=43b part=924 devtype=13 archid=0000 devid=0:0:0> [] [2019-10-01T12:03:17.685] [INFO] root/mbs-debug - stdout: 0006112:INFO:cortex_m:CPU core #0 is Cortex-M3 r2p0 [] [2019-10-01T12:03:17.705] [INFO] root/mbs-debug - stdout: 0006132:INFO:dwt:4 hardware watchpoints [] [2019-10-01T12:03:17.716] [INFO] root/mbs-debug - stdout: 0006141:INFO:fpb:6 hardware breakpoints, 4 literal comparators [] [2019-10-01T12:03:17.752] [INFO] root/mbs-debug - stdout: 0006177:INFO:server:Semihost server started on port 4444 [] [2019-10-01T12:03:17.752] [INFO] root/mbs-debug - stdout: 0006178:INFO:gdbserver:GDB server started on port 50001 [] [2019-10-01T12:03:18.616] [INFO] root/mbs-debug - stdout: Reading symbols from c:\Users\blah\Mbed Programs\Cylon_LED_display\BUILD\LPC1768\ARMC6\Cylon_LED_display.elf... [] [2019-10-01T12:03:18.626] [INFO] root/mbs-debug - stdout: done. [] [2019-10-01T12:03:18.657] [INFO] root/mbs-debug - stdout: 0007085:INFO:gdbserver:One client connected! [] [2019-10-01T12:03:18.742] [INFO] root/mbs-debug - stdout: 0x00002e80 in core_util_critical_section_enter () [] [2019-10-01T12:03:18.743] [INFO] root/mbs-debug - stdout: 0007171:INFO:gdbserver:Attempting to load Argon [] [2019-10-01T12:03:18.745] [INFO] root/mbs-debug - stdout: 0007174:INFO:gdbserver:Attempting to load RTX5 [] [2019-10-01T12:03:18.747] [INFO] root/mbs-debug - stdout: 0007175:INFO:gdbserver:Attempting to load Zephyr [] [2019-10-01T12:03:18.749] [INFO] root/mbs-debug - stdout: 0007177:INFO:gdbserver:Attempting to load FreeRTOS [] [2019-10-01T12:03:18.782] [INFO] root/mbs-debug - console: Attached to debugger on port 50001 [] [2019-10-01T12:03:18.782] [DEBUG] MbedStudio - telemetry/progress [ { percent: 0, message: 'Loading Image' } ] [2019-10-01T12:03:19.346] [DEBUG] MbedStudio - telemetry/progress [ { percent: 3, message: 'Loading Image' } ] [2019-10-01T12:03:19.605] [DEBUG] MbedStudio - telemetry/progress [ { percent: 8, message: 'Loading Image' } ] [2019-10-01T12:03:19.731] [DEBUG] MbedStudio - telemetry/progress [ { percent: 13, message: 'Loading Image' } ] [2019-10-01T12:03:19.857] [DEBUG] MbedStudio - telemetry/progress [ { percent: 15, message: 'Loading Image' } ] [2019-10-01T12:03:19.983] [DEBUG] MbedStudio - telemetry/progress [ { percent: 20, message: 'Loading Image' } ] [2019-10-01T12:03:20.109] [DEBUG] MbedStudio - telemetry/progress [ { percent: 25, message: 'Loading Image' } ] [2019-10-01T12:03:20.234] [DEBUG] MbedStudio - telemetry/progress [ { percent: 28, message: 'Loading Image' } ] [2019-10-01T12:03:20.358] [DEBUG] MbedStudio - telemetry/progress [ { percent: 33, message: 'Loading Image' } ] [2019-10-01T12:03:20.484] [DEBUG] MbedStudio - telemetry/progress [ { percent: 38, message: 'Loading Image' } ] [2019-10-01T12:03:20.610] [DEBUG] MbedStudio - telemetry/progress [ { percent: 40, message: 'Loading Image' } ] [2019-10-01T12:03:20.735] [DEBUG] MbedStudio - telemetry/progress [ { percent: 45, message: 'Loading Image' } ] [2019-10-01T12:03:20.861] [DEBUG] MbedStudio - telemetry/progress [ { percent: 50, message: 'Loading Image' } ] [2019-10-01T12:03:20.987] [DEBUG] MbedStudio - telemetry/progress [ { percent: 53, message: 'Loading Image' } ] [2019-10-01T12:03:21.113] [DEBUG] MbedStudio - telemetry/progress [ { percent: 58, message: 'Loading Image' } ] [2019-10-01T12:03:21.239] [DEBUG] MbedStudio - telemetry/progress [ { percent: 63, message: 'Loading Image' } ] [2019-10-01T12:03:21.364] [DEBUG] MbedStudio - telemetry/progress [ { percent: 65, message: 'Loading Image' } ] [2019-10-01T12:03:21.490] [DEBUG] MbedStudio - telemetry/progress [ { percent: 70, message: 'Loading Image' } ] [2019-10-01T12:03:21.616] [DEBUG] MbedStudio - telemetry/progress [ { percent: 75, message: 'Loading Image' } ] [2019-10-01T12:03:21.742] [DEBUG] MbedStudio - telemetry/progress [ { percent: 78, message: 'Loading Image' } ] [2019-10-01T12:03:21.866] [DEBUG] MbedStudio - telemetry/progress [ { percent: 83, message: 'Loading Image' } ] [2019-10-01T12:03:21.990] [DEBUG] MbedStudio - telemetry/progress [ { percent: 88, message: 'Loading Image' } ] [2019-10-01T12:03:22.116] [DEBUG] MbedStudio - telemetry/progress [ { percent: 90, message: 'Loading Image' } ] [2019-10-01T12:03:22.242] [DEBUG] MbedStudio - telemetry/progress [ { percent: 95, message: 'Loading Image' } ] [2019-10-01T12:03:22.280] [DEBUG] MbedStudio - telemetry/progress [ { percent: 100, message: 'Loading Image' } ] [2019-10-01T12:03:22.328] [INFO] root/mbs-debug - stdout: 0010755:INFO:loader:Erased chip, programmed 23552 bytes (23 pages), skipped 1024 bytes (1 page) at 6.87 kB/s [] [2019-10-01T12:03:22.449] [DEBUG] MbedStudio - telemetry/progress [ { percent: 100, message: 'Loading Image' } ] [2019-10-01T12:03:22.626] [INFO] root/mbs-debug - console: Image loaded: c:\Users\blah\Mbed Programs\Cylon_LED_display\BUILD\LPC1768\ARMC6\Cylon_LED_display.elf [] [2019-10-01T12:03:22.735] [INFO] root/mbs-debug - stdout: Note: automatically using hardware breakpoints for read-only addresses. [] [2019-10-01T12:03:22.884] [INFO] root/mbs-debug - stdout: 0011188:ERROR:gdbserver:Unhandled exception in handle_message: Traceback (most recent call last): File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py", line 549, in handle_message reply = handler(msg[msgStart:]) File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py", line 776, in v_command return self.v_cont(cmd) File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py", line 827, in v_cont return self.resume(None) File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py", line 700, in resume self.target.resume() File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\coresight\cortex_m.py", line 958, in resume self.flush() File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\core\target.py", line 142, in flush self.session.probe.flush() File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\probe\cmsis_dap_probe.py", line 239, in flush six.raise_from(self._convert_exception(exc), exc) File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\six.py", line 737, in raise_from raise value TransferError [] [2019-10-01T12:03:22.926] [INFO] root/mbs-debug - stdout: 0011316:ERROR:gdbserver:Unhandled exception in handle_message: Traceback (most recent call last): File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py", line 547, in handle_message reply = handler() File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\gdbserver.py", line 982, in get_registers return self.create_rsp_packet(self.target_facade.get_register_context()) File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\gdbserver\context_facade.py", line 69, in get_register_context vals = self._context.read_core_registers_raw(reg_num_list) File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\debug\cache.py", line 531, in read_core_registers_raw return self._regcache.read_core_registers_raw(reg_list) File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\debug\cache.py", line 133, in read_core_registers_raw self._check_cache() File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\debug\cache.py", line 110, in _check_cache if self._core.is_running(): File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\coresight\cortex_m.py", line 943, in is_running return self.get_state() == Target.TARGET_RUNNING File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\coresight\cortex_m.py", line 920, in get_state dhcsr = self.read_memory(CortexM.DHCSR) File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\coresight\cortex_m.py", line 605, in read_memory result = self.ap.read_memory(addr, transfer_size, now) File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\coresight\ap.py", line 564, in _read_memory result = read_mem_cb() File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\coresight\ap.py", line 546, in read_mem_cb res = result_cb() File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\coresight\dap.py", line 276, in read_ap_cb result = result_cb() File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\probe\cmsis_dap_probe.py", line 307, in read_ap_result_callback six.raise_from(self._convert_exception(error), error) File "c:\Users\blah\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\six.py", line 737, in raise_from raise value TransferError []

1 Answer

4 years, 4 months ago.

Hi Jered,

This is caused by LPC1768 device firmware, however there is no solution or good workaround for it currently, you can refer to the detail here.

https://github.com/mbedmicro/pyOCD/issues/725

Regards, Desmond