I'm using openocd 0.10.0-4 (as shipped with Ubuntu Linux 18.04), with the configuration file board/xmc4500-relax.cfg on a desktop PC in order to download the FLASH memory of the processor on an Infineon XMC4500 Relax Lite development board with the commands
reset halt dump_image filename.bin 0x08000000 0x100000
On some USB ports of some PCs (tested with two different XMC4500 Relax Lite boards and two different USB cables), this frequently results in LIBUSB_ERROR_PIPE and JAYLINK_ERR error messages such as
$ openocd -f board/xmc4500-relax.cfg Open On-Chip Debugger 0.10.0 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html cortex_m reset_config sysresetreq adapter speed: 1000 kHz Info : No device selected, using first device. Info : J-Link Lite-XMC4000 Rev.1 compiled Apr 2 2015 18:25:20 Info : Hardware version: 1.00 Info : VTarget = 3.300 V Info : clock speed 1000 kHz Info : SWD DPIDR 0x2ba01477 Info : xmc4500.cpu: hardware has 6 breakpoints, 4 watchpoints Info : accepting 'tcl' connection on tcp/6666 target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08000200 msp: 0x10000800 target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08000200 msp: 0x10000800 Info : dropped 'tcl' connection Info : accepting 'tcl' connection on tcp/6666 Error: Failed to receive data from device: LIBUSB_ERROR_PIPE. Error: transport_read() failed: unspecified error. Error: jaylink_swd_io() failed: JAYLINK_ERR. Warn : Last read operation left 1730 bytes. Warn : Sending data to device timed out, retrying.
Reducing the interface clock frequency with the command
adapter_khz 800
appears to fix the problem. The “adapter_khz 1000” default in the config file therefore appears to be slightly too high for reliable operation.
From my experiments with two XMC4500 Relax Lite boards and two different USB ports on the same PC (Intel DQ77MK motherboard), it appears that the choice of USB port is significant: values less than about 950 kHz worked on one USB port, and values less than about 850 kHz on another USB port of the same PC.
With debug level 3, I get the following output read the first error message:
Debug: 4494 5208 jlink.c:2065 jlink_swd_run_queue(): Executing 2 queued transactions. Debug: 4495 5208 jlink.c:530 jaylink_log_handler(): Starting write / read operation (length = 32 / 15 bytes). Debug: 4496 5208 jlink.c:530 jaylink_log_handler(): Wrote 4 bytes into buffer. Debug: 4497 5208 jlink.c:530 jaylink_log_handler(): Wrote 14 bytes into buffer. Debug: 4498 5208 jlink.c:530 jaylink_log_handler(): Buffer filled up with 14 bytes. Debug: 4499 5208 jlink.c:530 jaylink_log_handler(): Sent 32 bytes to device. Debug: 4500 5209 jlink.c:530 jaylink_log_handler(): Received 14 bytes from device. Debug: 4501 5209 jlink.c:530 jaylink_log_handler(): Read 14 bytes from buffer. Debug: 4502 5209 jlink.c:530 jaylink_log_handler(): Received 1 bytes from device. Debug: 4503 5209 jlink.c:530 jaylink_log_handler(): Read 1 bytes from buffer. Debug: 4504 5209 target.c:2091 target_read_buffer(): reading buffer of 4096 byte at 0x08027000 Debug: 4505 5209 jlink.c:2065 jlink_swd_run_queue(): Executing 256 queued transactions. Debug: 4506 5209 jlink.c:530 jaylink_log_handler(): Starting write / read operation (length = 3462 / 1730 bytes). Debug: 4507 5209 jlink.c:530 jaylink_log_handler(): Wrote 4 bytes into buffer. Debug: 4508 5209 jlink.c:530 jaylink_log_handler(): Wrote 1729 bytes into buffer. Debug: 4509 5209 jlink.c:530 jaylink_log_handler(): Buffer filled up with 315 bytes. Debug: 4510 5214 jlink.c:530 jaylink_log_handler(): Sent 2048 bytes to device. Debug: 4511 5217 jlink.c:530 jaylink_log_handler(): Sent 1414 bytes to device. Warn : 4512 6220 jlink.c:530 jaylink_log_handler(): Receiving data from device timed out, retrying. Debug: 4513 6220 jlink.c:530 jaylink_log_handler(): Read 1664 bytes from buffer. Warn : 4514 7224 jlink.c:530 jaylink_log_handler(): Receiving data from device timed out, retrying. Warn : 4515 8227 jlink.c:530 jaylink_log_handler(): Receiving data from device timed out, retrying. Error: 4516 8227 jlink.c:530 jaylink_log_handler(): Receiving data from device timed out. Error: 4517 8227 jlink.c:530 jaylink_log_handler(): transport_read() failed: timeout occurred. Error: 4518 8227 jlink.c:2081 jlink_swd_run_queue(): jaylink_swd_io() failed: JAYLINK_ERR_TIMEOUT. Debug: 4519 8227 jlink.c:2065 jlink_swd_run_queue(): Executing 256 queued transactions. Debug: 4520 8227 jlink.c:530 jaylink_log_handler(): Starting write / read operation (length = 3462 / 1730 bytes). Warn : 4521 8227 jlink.c:530 jaylink_log_handler(): Last read operation left 66 bytes. Debug: 4522 8227 jlink.c:530 jaylink_log_handler(): Wrote 4 bytes into buffer. Debug: 4523 8227 jlink.c:530 jaylink_log_handler(): Wrote 1729 bytes into buffer. Debug: 4524 8227 jlink.c:530 jaylink_log_handler(): Buffer filled up with 315 bytes. Warn : 4525 9231 jlink.c:530 jaylink_log_handler(): Sending data to device timed out, retrying. Debug: 4526 9231 jlink.c:530 jaylink_log_handler(): Sent 0 bytes to device. Error: 4527 10198 jlink.c:530 jaylink_log_handler(): Failed to send data to device: LIBUSB_ERROR_PIPE. Error: 4528 10198 jlink.c:530 jaylink_log_handler(): transport_write() failed: unspecified error. Error: 4529 10198 jlink.c:2081 jlink_swd_run_queue(): jaylink_swd_io() failed: JAYLINK_ERR. Debug: 4530 10198 jlink.c:2065 jlink_swd_run_queue(): Executing 256 queued transactions. Debug: 4531 10198 jlink.c:530 jaylink_log_handler(): Starting write / read operation (length = 3462 / 1730 bytes). Warn : 4532 10198 jlink.c:530 jaylink_log_handler(): Last read operation left 1730 bytes. Debug: 4533 10198 jlink.c:530 jaylink_log_handler(): Wrote 4 bytes into buffer. Debug: 4534 10198 jlink.c:530 jaylink_log_handler(): Wrote 1729 bytes into buffer. Debug: 4535 10198 jlink.c:530 jaylink_log_handler(): Buffer filled up with 315 bytes. Error: 4536 10198 jlink.c:530 jaylink_log_handler(): Failed to send data to device: LIBUSB_ERROR_PIPE. Error: 4537 10198 jlink.c:530 jaylink_log_handler(): transport_write() failed: unspecified error. Error: 4538 10198 jlink.c:2081 jlink_swd_run_queue(): jaylink_swd_io() failed: JAYLINK_ERR.
Suggested patch: either replace in target/xmc4xxx.cfg the final line
adapter_khz 1000
with a lower value such as
adapter_khz 800
or make it configurable and set it to 800 in board/xmc4500-relax.cfg.
Hi Markus,
Mainline OpenOCD works fine for me:
https://acassis.wordpress.com/2018/01/08/running-nuttx-on-infineon-xmc4500-relax/
Maybe it is some issue on your board or new version. No idea...
BR,
Alan
On Saturday, October 26, 2019, Markus Kuhn via OpenOCD-devel openocd-devel@lists.sourceforge.net wrote:
Related
Tickets: #253