)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"An implementation of the firmware for an SWD programmer that uses this"},{"line_number":13,"context_line":"cmsis_dap_tcp protocol can be found at the link below."},{"line_number":14,"context_line":"https://github.com/bkuschak/cmsis_dap_tcp_esp32"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Using this cmsis_dap_tcp backend with the firmware above, flashing a"},{"line_number":17,"context_line":"64KB image to an STM32 completes in about 8 seconds."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"4b18d143_307ab1bd","line":14,"updated":"2025-06-22 12:57:06.000000000","message":"Also the project Zephyr provides a CMSIS-DAP firmware as example, and it is easily portable among several MCU.\nIt could be proposed to Zephyr community to extend their example to provide TCP support, either as WiFi and/or ethernet server.\nBoth Zephyr and the EXP32 project on github are under Apache 2.0 license.","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":true,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"An implementation of the firmware for an SWD programmer that uses this"},{"line_number":13,"context_line":"cmsis_dap_tcp protocol can be found at the link below."},{"line_number":14,"context_line":"https://github.com/bkuschak/cmsis_dap_tcp_esp32"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Using this cmsis_dap_tcp backend with the firmware above, flashing a"},{"line_number":17,"context_line":"64KB image to an STM32 completes in about 8 seconds."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"b0a6f865_24d611b2","line":14,"in_reply_to":"4b18d143_307ab1bd","updated":"2025-06-24 06:39:54.000000000","message":"Ack. Can we handle that separately from the approval of this CL?","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"0949cb3fa9dec73ac4c94bf8a16ce359fe29a2e8","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"An implementation of the firmware for an SWD programmer that uses this"},{"line_number":13,"context_line":"cmsis_dap_tcp protocol can be found at the link below."},{"line_number":14,"context_line":"https://github.com/bkuschak/cmsis_dap_tcp_esp32"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Using this cmsis_dap_tcp backend with the firmware above, flashing a"},{"line_number":17,"context_line":"64KB image to an STM32 completes in about 8 seconds."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"c6a584d7_a8596cff","line":14,"in_reply_to":"b0a6f865_24d611b2","updated":"2025-06-25 10:21:21.000000000","message":"Sure, it was just a suggestion, not an obligation.","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"08d3c97a_647aa132","updated":"2025-06-22 12:57:06.000000000","message":"Nice, thanks.\nI have few comments below","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"a33441fa5d7cb058968188744beab77bb0af1e1c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"be1f1c45_f66a8e25","updated":"2025-06-22 09:57:57.000000000","message":"This CL is a replacement for the previous attempt at https://review.openocd.org/c/openocd/+/8941","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"37ae07d5_cf3bf87e","updated":"2025-06-24 06:39:54.000000000","message":"Thanks for the review! A few comments below.","commit_id":"d794aef11c2016efd6f4a1dbf0ef2e31f30b828c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"9d2ca60adb29a5196e0e79cf7b2ac3afcabcd55c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"2e37c0c8_3e75813b","updated":"2025-07-02 21:26:13.000000000","message":"Thanks. Still one minor issue in the documentation.\nTomas, any further point from your side?","commit_id":"6990019a56e980b75be07d0e759dc92e140b5e49"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"32d19ad8a758d60301ca3606c4a3d1ebf136527a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"a36d8eab_ebb536d3","in_reply_to":"2e37c0c8_3e75813b","updated":"2025-07-03 07:16:02.000000000","message":"I wish to give it a try. Unfortunately the ESP fw dependency on Adruino is a little bit disgusting for me.\n\nYou proposed using Zephyr for fw. It sounds good, the compatibility is broad.\nUnfortunately my experience with moving from nRF native SDK to Zephyr suggests that Zephyr makes some performance fine tuning more complicated.\n\nI noticed in Brian\u0027s github the fw uses ESP gpio routines and direct I/O for sake of performance so it not a \"compatible\" Arduino sketch. In that light I thing that porting it to native ESP32 IDF would be the easiest and also allows to tune the performance. 8 kB/sec is a big improvement in comparison to remote bitbang but still rather poor for nowadays big flash devices.","commit_id":"6990019a56e980b75be07d0e759dc92e140b5e49"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"8fb2cf98ae0888d09f5a9ad583387fad32ecedf3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"54e123e2_b1fda27c","in_reply_to":"a36d8eab_ebb536d3","updated":"2025-07-04 07:25:36.000000000","message":"The Arduino code is provided as an example. Feel free to port it to whatever environment you like. See my other comment regarding the higher performance seen with a 512KB flash device.","commit_id":"6990019a56e980b75be07d0e759dc92e140b5e49"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f8cc6281c70687683beb20a583bde59e7a8c8927","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":9,"id":"64cfea6e_aa735c55","updated":"2025-07-04 08:21:55.000000000","message":"Debug logs of not recovering after error:\n```\nDebug: 28 18522 command.c:86 script_debug(): command - mdw 0x56780000\nDebug: 29 18529 cmsis_dap.c:957 cmsis_dap_swd_read_process(): SWD ack not OK @ 3 FAULT\nDebug: 30 18543 cmsis_dap.c:1269 cmsis_dap_swd_switch_seq(): JTAG-to-DORMANT\nDebug: 31 18576 cmsis_dap.c:1284 cmsis_dap_swd_switch_seq(): DORMANT-to-SWD\nDebug: 32 18593 cmsis_dap.c:957 cmsis_dap_swd_read_process(): SWD ack not OK @ 0 JUNK\nDebug: 33 18609 cmsis_dap.c:1264 cmsis_dap_swd_switch_seq(): JTAG-to-SWD\nDebug: 34 18626 cmsis_dap.c:957 cmsis_dap_swd_read_process(): SWD ack not OK @ 0 JUNK\n...\nError: 53 19038 adi_v5_swd.c:381 swd_connect_single(): Error connecting DP: cannot read IDR\nError: 54 19038 arm_adi_v5.c:685 mem_ap_read(): Failed to read memory and, additionally, failed to find out where\nDebug: 55 19038 command.c:457 exec_command(): Command \u0027mdw\u0027 failed with error code -401\nUser : 56 19038 command.c:530 command_run_line():\nDebug: 57 19046 cmsis_dap.c:957 cmsis_dap_swd_read_process(): SWD ack not OK @ 0 JUNK\nDebug: 58 19046 target.c:1784 target_call_event_callbacks(): target event 0 (gdb-halt) for core kx.cpu\nError: 59 19046 target.c:3008 handle_target(): [kx.cpu] Polling failed, trying to reexamine\nDebug: 60 19046 target.c:684 target_examine_one(): [kx.cpu] Examination started\nDebug: 61 19046 target.c:1784 target_call_event_callbacks(): target event 19 (examine-start) for core kx.cpu\nDebug: 62 19058 cmsis_dap.c:1264 cmsis_dap_swd_switch_seq(): JTAG-to-SWD\nDebug: 63 19078 cmsis_dap.c:957 cmsis_dap_swd_read_process(): SWD ack not OK @ 0 JUNK\nDebug: 64 19098 cmsis_dap.c:1269 cmsis_dap_swd_switch_seq(): JTAG-to-DORMANT\nDebug: 65 19127 cmsis_dap.c:1284 cmsis_dap_swd_switch_seq(): DORMANT-to-SWD\nDebug: 66 19145 cmsis_dap.c:957 cmsis_dap_swd_read_process(): SWD ack not OK @ 0 JUNK\n...\nError: 87 19550 adi_v5_swd.c:381 swd_connect_single(): Error connecting DP: cannot read IDR\nError: 88 19550 target.c:690 target_examine_one(): [kx.cpu] Examination failed\nDebug: 89 19550 target.c:691 target_examine_one(): [kx.cpu] examine() returned error code -400\nDebug: 90 19550 target.c:1784 target_call_event_callbacks(): target event 20 (examine-fail) for core kx.cpu\n```\n\nFor comparison the same SWD FAUL on USB bulk based CMSIS-DAP:\n```\nDebug: 25 9881 command.c:86 script_debug(): command - mdw 0x56780000\nDebug: 26 9882 cmsis_dap.c:957 cmsis_dap_swd_read_process(): SWD ack not OK @ 3 FAULT\nDebug: 27 9882 cmsis_dap.c:1264 cmsis_dap_swd_switch_seq(): JTAG-to-SWD\nInfo : 28 9884 adi_v5_swd.c:385 swd_connect_single(): SWD DPIDR 0x2ba01477\nDebug: 29 9884 arm_adi_v5.c:783 dap_dp_init(): kx.dap\nDebug: 30 9884 arm_adi_v5.c:816 dap_dp_init(): DAP: wait CDBGPWRUPACK\nDebug: 31 9884 arm_adi_v5.h:682 dap_dp_poll_register(): DAP: poll 4, mask 0x20000000, value 0x20000000\nDebug: 32 9885 arm_adi_v5.c:824 dap_dp_init(): DAP: wait CSYSPWRUPACK\nDebug: 33 9885 arm_adi_v5.h:682 dap_dp_poll_register(): DAP: poll 4, mask 0x80000000, value 0x80000000\nDebug: 34 9885 cmsis_dap.c:861 cmsis_dap_swd_write_from_queue(): refusing to enable sticky overrun detection\nError: 35 9887 arm_adi_v5.c:681 mem_ap_read(): Failed to read memory at 0x56780004\nDebug: 36 9887 command.c:457 exec_command(): Command \u0027mdw\u0027 failed with error code -401\n```","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"2d23bf265ac2f2faace712caa67a80b8bafeac2b","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":9,"id":"5df584e2_64b94a7c","updated":"2025-07-04 08:04:43.000000000","message":"I finally tested.\n\nI used ESP32 for the adapter - I think the dual core gives more performance than WiFi 6 protocols of ESP32-C6.\nI compiled by platformio which uses older ESP-IDF version (I simply avoid all IDE-only sw including Arduino).\nThe first bad surprise was that GPIO structures\nhttps://github.com/bkuschak/cmsis_dap_tcp_esp32/blob/main/DAP_config.h#L454\nhttps://github.com/bkuschak/cmsis_dap_tcp_esp32/blob/main/DAP_config.h#L462\nare not compatible even between ESP32-C6 and ESP32-C3, and much different in ESP32.\nIMO using `gpio_ll_set_level()` `gpio_ll_get_level()` etc... with some compiler optimisation would lead to the same machine code and solves the incompatibility.\n\nThe first tests showed lot of corrupted data. The usual trick adding a resistor to SWDIO wire helped. Decreasing pad drive strength to the lowest value may help (if it\u0027s not the default). What is worse, **CMSIS-DAP protocol loosing sync after an error**. This might be caused by porting to dual core ESP32. Anyway it\u0027s very important the adapter handles errors properly.\n\nThe performance is definitely not as bad as in your first test. Loading file to RAM\n(performance does not depend on used flash algorithm and flash programming speed)\n```\n\u003e load_image rand_64k.bin 0x20000000\n65536 bytes written at address 0x20000000\ndownloaded 65536 bytes in 0.398727s (160.511 KiB/s)\n```\nBut dumping from RAM always failed until I set `cmsis-dap quirk 1` - it means that the adapter cannot work with pipelined CMSIS-DAP packets.\nWith `cmsis-dap quirk 1` I managed to measure both directions:\n```\n\u003e load_image rand_64k.bin 0x20000000\n65536 bytes written at address 0x20000000\ndownloaded 65536 bytes in 0.660997s (96.823 KiB/s)\n\u003e dump_image /dev/null 0x20000000 0x10000\ndumped 65536 bytes in 0.769758s (83.143 KiB/s)\n```\n\nAlso it\u0027s visible that setting `adapter speed` does not work.\n```\n\u003e adapter speed 100\nadapter speed: 100 kHz\n\u003e load_image rand_64k.bin 0x20000000\n65536 bytes written at address 0x20000000\ndownloaded 65536 bytes in 0.663691s (96.430 KiB/s)\n\u003e adapter speed 10000\nadapter speed: 10000 kHz\n\u003e load_image rand_64k.bin 0x20000000\n65536 bytes written at address 0x20000000\ndownloaded 65536 bytes in 0.666398s (96.039 KiB/s)\n```\nFYI the theoretical maximum of throughput @ 100 kHz is 8.6 KiB/s.","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"dc75373c8674579e709f3a30f2bf0ed5c2a32e23","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"b361afc2_2482a295","updated":"2025-07-03 09:33:54.000000000","message":"Thanks. I\u0027ve nothing more to add on this.\nClearly the performance is quite low, but also my limited experience on USBIP is not good. The issue is the round-trip-time of USB funnel in the round-trip-time of TCP.  \nMerge pending for few weeks waiting for any further review/feedback.","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"88991ce07565050dee5927f66cff96284b6a3201","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":9,"id":"838fe116_7ff9cf6b","in_reply_to":"21a63dfb_03979bbc","updated":"2025-08-08 12:14:28.000000000","message":"\u003e In the case of a FAULT response from the target, the CMSIS-DAP code that flushes the buffer is using a short timeout of 10 msec.\n\nGood catch! I thought that it must be some problem with flushing buffered data but didn\u0027t dig deeper. The timeout is really unsuitable for TCP transport, feel free to propose a change to the base code `cmsis_dap.c` or add some code to `cmsis_dap_tcp_cancel_all()`\n\nI\u0027m about leaving for vacation. I tested just the latest version very shortly and confirm that the error recovery works as expected. The transfer speed are on par with the previous version:\n```\n\u003e cmsis-dap quirk 0\nadapter speed: 5000 kHz\n\u003e load_image /home/vanekt/a/rand_64k.bin 0x20000000\n65536 bytes written at address 0x20000000\ndownloaded 65536 bytes in 0.431214s (148.418 KiB/s)\n\u003e dump_image /dev/null 0x20000000 0x10000\ndumped 65536 bytes in 0.514671s (124.351 KiB/s)\n```\n\n\u003e if needed, using the new parameter ```cmsis-dap tcp min_timeout```.\n\nIn theory the timeout should be as long as TCP/IP time-to-live. I agree that configurable timeout is better as we may use much shorter time in a local WiFi.\n\nI also noticed the new `esp-idf` branch on your fw github. Nice surprise!\nI was inpatient and compiled and flashed it. It connects but fails very early in CMSIS-DAP handshake. Let me know when it is ready to test!\n\nThanks for good work!!","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"78ca5c91d90f35d3c47035f2f4e260389f4d6c53","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":9,"id":"d1ec67f6_0ad67866","in_reply_to":"5df584e2_64b94a7c","updated":"2025-07-06 05:23:42.000000000","message":"Thank you for testing this Tomas. \n\nI was able to reproduce the problem with load_image and dump_image. The code was not properly handing a short read from the socket. This bug should now be fixed in the latest patchset. Please try again. It works for me repeatedly, with cmsis-dap quirk 0 and 1.\n\n```\n\u003e cmsis-dap quirk 0                      \nCMSIS-DAP quirk workarounds disabled\n\u003e load_image ./random_96kb.bin 0x20000000\n98304 bytes written at address 0x20000000\ndownloaded 98304 bytes in 1.183031s (81.147 KiB/s)\n\u003e dump_image /dev/null 0x20000000 0x18000\ndumped 98304 bytes in 1.341064s (71.585 KiB/s)\n```\n\n```\n\u003e cmsis-dap quirk 1                      \nCMSIS-DAP quirk workarounds enabled\n\u003e load_image ./random_96kb.bin 0x20000000\n98304 bytes written at address 0x20000000\ndownloaded 98304 bytes in 1.585624s (60.544 KiB/s)\n\u003e dump_image /dev/null 0x20000000 0x18000\ndumped 98304 bytes in 1.626495s (59.023 KiB/s)\n```\n\nI also see the problem with adapter clock rate not changing. I will look into this. I don\u0027t currently have access to my lab bench so I\u0027m unable to probe the signals directly, but I\u0027ll see what I can do.","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"78ca5c91d90f35d3c47035f2f4e260389f4d6c53","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":9,"id":"95b1c504_7bc02080","in_reply_to":"64cfea6e_aa735c55","updated":"2025-07-06 05:23:42.000000000","message":"I\u0027ve not been able to repro this, but I will continue to try. Let me know if you still see it with the latest code.","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"abfe3127fa973422e5640cc2049e2b497f7323db","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"a0029621_88e7c2d4","in_reply_to":"6b5c7a36_3290564d","updated":"2025-08-19 16:15:53.000000000","message":"And even better performance with `CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1\u003dy`","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"7940e3680840a36386db25865b7f5ed07df80a64","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":9,"id":"21a63dfb_03979bbc","in_reply_to":"75e27b60_eee01207","updated":"2025-08-07 12:57:17.000000000","message":"Tomas,\nSorry it has taken me a while to get back to this. I think I\u0027ve fixed the problem with recovery failing after reading non-existent memory.  \n\nIn the case of a FAULT response from the target, the CMSIS-DAP code that flushes the buffer is using a short timeout of 10 msec. If a TCP response packet takes longer to arrive, it doesn\u0027t get flushed and leads to a loss of sync. I\u0027m now enforcing a lower bound on the minimum timeout, which can be adjusted, if needed, using the new parameter ```cmsis-dap tcp min_timeout```.\n\nThe failures observed with ```cmsis-dap quirk 1``` were fixed by making some changes to the firmware. The way I was controlling the direction of the SWDIO pin was incorrect. Quirk mode triggers a DAP_disconnect followed by DAP_connect after getting a FAULT response. This was exposing a problem with the way SWDIO was configured, and the subsequent IDR register read would fail. Please grab the latest firmware code and give it a try.\n\nRepeatedly sending these commands works for me now:\n\n```\n\u003e poll off\n\u003e cmsis-dap quirk 0                      \nCMSIS-DAP quirk workarounds disabled\n\u003e mdw 0x56780000 1024\nSWD DPIDR 0x2ba01477\nFailed to read memory at 0x56780004\n\n\u003e mdw 0x56780000 1024\nSWD DPIDR 0x2ba01477\nFailed to read memory at 0x56780004\n\n... repeat...\n```\n\n```\n\u003e cmsis-dap quirk 1  \nCMSIS-DAP quirk workarounds enabled\n\u003e mdw 0x56780000 1024\nSWD DPIDR 0x2ba01477\nFailed to read memory at 0x56780004\n\n\u003e mdw 0x56780000 1024\nSWD DPIDR 0x2ba01477\nFailed to read memory at 0x56780004\n\n... repeat...\n```\n\nMy transfer rate is a little lower. Maybe it\u0027s due to the firmware change, or maybe due to the fact that I\u0027m on a different WiFi network now, which is slower. Let me know if you see lower transfer rates with the new firmware.\n\n```\n\u003e cmsis-dap quirk 0  \nCMSIS-DAP quirk workarounds disabled\n\u003e dump_image /dev/null 0x20000000 0x18000\ndumped 98304 bytes in 1.695930s (56.606 KiB/s)\n\u003e load_image ./random_96kb.bin 0x20000000\n98304 bytes written at address 0x20000000\ndownloaded 98304 bytes in 1.330775s (72.138 KiB/s)\n```\n\n```\n\u003e cmsis-dap quirk 1                      \nCMSIS-DAP quirk workarounds enabled\n\u003e dump_image /dev/null 0x20000000 0x18000\ndumped 98304 bytes in 2.404143s (39.931 KiB/s)\n\u003e load_image ./random_96kb.bin 0x20000000\n98304 bytes written at address 0x20000000\ndownloaded 98304 bytes in 2.408666s (39.856 KiB/s)\n```\n\nI\u0027m still traveling without access to an oscilloscope so I\u0027m unable to verify the hardware signals directly. I will defer the clock frequency related firmware changes until I\u0027m back in the lab. I agree the actual clock rate (positive or negative half-cycles) should not go above the configured value.","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"a3d7767269a38cfecadfcb105a3480e5ee9f0539","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"8cbbf34c_1ed4d1d3","in_reply_to":"838fe116_7ff9cf6b","updated":"2025-08-08 15:31:44.000000000","message":"Thanks Tomas. The ```esp-idf``` [branch](https://github.com/bkuschak/cmsis_dap_tcp_esp32/tree/esp-idf) is a work in progress. I got an ESP32-S3 board and added support for it. I updated the README with new build instructions. It seems to be working for me on both C6 and S3. See the ```main/DAP_config.h``` file for the pinout for S3 which is different from C6 (just based on what was convenient for me at the time). \n\nYou might have caught me in the middle of making some changes. Give it another try now if you like. If you\u0027re seeing it hang immediately after the connection is made, double check that your sdkconfig contains ```CONFIG_LWIP_SO_RCVBUF\u003dy```.\n\nI\u0027m seeing similar numbers with S3:\n\n```                          \n\u003e load_image ./random_96kb.bin 0x20000000\n98304 bytes written at address 0x20000000\ndownloaded 98304 bytes in 0.489488s (196.123 KiB/s)\n\n\u003e dump_image /dev/null 0x20000000 0x18000\ndumped 98304 bytes in 0.832846s (115.267 KiB/s)\n```\n\nI agree that the timeout handling could be improved and I\u0027d like to defer that to another CL. \n\nI\u0027m going to mark this as resolved. Feel free to reopen if needed. \n\nEnjoy your vacation!","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"2947c1f5ac3136f7ecfbfd0067a18d1284963701","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"6b5c7a36_3290564d","in_reply_to":"8cbbf34c_1ed4d1d3","updated":"2025-08-19 15:41:35.000000000","message":"Re-tried https://github.com/bkuschak/cmsis_dap_tcp_esp32/tree/main branch with ESP-IDF 5.4.2 and a custom ESP32 board.\n```\nidf.py set-target esp32\nidf.py menuconfig\n```\nand set SWD pins, `CONFIG_LWIP_SO_RCVBUF\u003dy`, `CPU_FREQ_240`, `CONFIG_COMPILER_OPTIMIZATION_PERF\u003dy` and `CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE\u003dy`\n\nWorks and performs very nicely:\n```\n\u003e load_image /home/vanekt/a/rand_64k.bin 0x20000000\n65536 bytes written at address 0x20000000\ndownloaded 65536 bytes in 0.292060s (219.133 KiB/s)\n\u003e dump_image /dev/null 0x20000000 0x10000\ndumped 65536 bytes in 0.346366s (184.776 KiB/s)\n```","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"1ffc8b4b43721dd9ffc5c0e15db873e9df1b4cc8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"5c626f4a_80f021df","in_reply_to":"95b1c504_7bc02080","updated":"2025-07-30 10:46:42.000000000","message":"Single error recovery seems gone in the latest version","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"b3645d7e1b3391f20209d829e3c8fbff119a42ed","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"2d07e903_508b09d0","in_reply_to":"a0029621_88e7c2d4","updated":"2025-08-21 08:12:56.000000000","message":"Thanks Tomas! That looks good.","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"8fb2cf98ae0888d09f5a9ad583387fad32ecedf3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"4b458378_a991b6ed","in_reply_to":"b361afc2_2482a295","updated":"2025-07-04 07:25:36.000000000","message":"Regarding performance, here\u0027s another data point.\n\nFor a 512KB image flashed onto STM32F401RE in SWD mode using the ESP32-C6, the overall performance was 38 KB/sec. It took 13.4 seconds to erase, program, and verify (with 4 to 8 seconds of that time used for flash erasure).\n\nOscilloscope measurements showed SWCLK to be 1.0 MHz.","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"1ffc8b4b43721dd9ffc5c0e15db873e9df1b4cc8","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":9,"id":"75e27b60_eee01207","in_reply_to":"cbea5892_f0fa42ea","updated":"2025-07-30 10:46:42.000000000","message":"Brian,\nthis version really works better!\n\nThanks for using `gpio_ll` calls, now the adapter fw compiles for ESP32 as well.\n\n`gpio_ll_set_drive_capability()` helped and no resistor is needed in SWDIO circuit.\nMaybe GPIO_DRIVE_CAP_0 is too weak for clocks - normally it works, however when I connected logic analyser I had to set GPIO_DRIVE_CAP_1 for GPIO_SWCLK_TCK.\n\nSpeed setting somehow works, but have to be calibrated properly with a fast sampling logic analyser. I tested the adapter fw on ESP32, not C6, so not surprisingly the speed differs. Anyway for the serious work we should guaranty that real clk frequency never exceeds `adapter speed`, in other words no clk pulse is shorter than half clock period - we should not rely on average timing!\nOn ESP32 the shortest pulse in fast mode was 49ns (~10MHz) and for `adapter speed 1000` the shortest pulse 148ns corresponds to ~3.3MHz.\nThis depends only on the adapter fw configuration, so it\u0027s no blocker of this patch.\n\nAlso `cmsis-dap quirk` not needed now.\nFYI speeds in fast mode @ ESP32 are quite good:\n```\n\u003e load_image rand_64k.bin 0x20000000\n65536 bytes written at address 0x20000000\ndownloaded 65536 bytes in 0.443037s (144.457 KiB/s)\n\n\u003e dump_image /dev/null 0x20000000 0x10000\ndumped 65536 bytes in 0.474598s (134.851 KiB/s)\n```\n\nUnfortunately there is still some problem in protocol syncing after error.\nIt does not go out of sync after a single error however the communication broke after reading a block of non-existent memory:\n```\n\u003e mdw 0x56780000\nSWD DPIDR 0x2ba01477\nFailed to read memory at 0x56780004\n \n\u003e mdw 0x56780000 1024\nSWD DPIDR 0x2ba01477\nFailed to read memory at 0x56780004\n \n\u003e mdw 0x56780000 1024\nCMSIS-DAP command mismatch. Sent 0x12 received 0x6\nCMSIS-DAP command mismatch. Sent 0x11 received 0x12\nCMSIS-DAP command CMD_DAP_SWJ_CLOCK failed.\nCMSIS-DAP command mismatch. Expected 0x5 received 0x11\nCMSIS-DAP command mismatch. Sent 0x12 received 0x5\nCMSIS-DAP command mismatch. Expected 0x5 received 0x12\nCMSIS-DAP command mismatch. Sent 0x12 received 0x5\nCMSIS-DAP command mismatch. Sent 0x11 received 0x12\nCMSIS-DAP command CMD_DAP_SWJ_CLOCK failed.\nCMSIS-DAP command mismatch. Expected 0x5 received 0x11\nCMSIS-DAP command mismatch. Sent 0x12 received 0x5\nCMSIS-DAP command mismatch. Expected 0x5 received 0x12\nCMSIS-DAP command mismatch. Sent 0x12 received 0x5\nCMSIS-DAP command mismatch. Sent 0x11 received 0x12\n...\nError connecting DP: cannot read IDR\n[kx.cpu] Examination failed\nCMSIS-DAP transfer count mismatch: expected 3, got 1\nMDM: failed to read ID register\n[kx.cpu] Examination failed, GDB will be halted. Polling again in 100ms\nCMSIS-DAP command mismatch. Sent 0x12 received 0x5\nSWD DPIDR 0x2ba01477\n[kx.cpu] Polling failed, trying to reexamine\n[kx.cpu] Cortex-M4 r0p1 processor detected\n[kx.cpu] target has 6 breakpoints, 4 watchpoints\nMDM: Chip is unsecured. Continuing.\n[kx.cpu] Examination succeed\n```\n\nAnd with `cmsis-dap quirk 1` the recovery is not possible at all:\n```\n\u003e mdw 0x56780000 1024\nError connecting DP: cannot read IDR\nFailed to read memory and, additionally, failed to find out where\n \n[kx.cpu] Polling failed, trying to reexamine\nError connecting DP: cannot read IDR\n[kx.cpu] Examination failed\nMDM: failed to read ID register\n[kx.cpu] Examination failed, GDB will be halted. Polling again in 100ms\nError connecting DP: cannot read IDR\n...\n```","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"248f7d59deaa2cff0e214c5c75c66d62ab7d6cff","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":9,"id":"cbea5892_f0fa42ea","in_reply_to":"d1ec67f6_0ad67866","updated":"2025-07-06 09:24:09.000000000","message":"I pushed a commit to the cmsis_dap_tcp_esp32 repo that fixes the \u0027adapter speed\u0027 problem.  I\u0027m traveling and don\u0027t have a scope to verify the SWCLK signal. I grabbed timestamps before and after the SWD transaction to estimate the clock rate. It looks roughly correct. The HW/SW is limited to about 1.15 MHz max in the \u0027fast\u0027 case.\n\n```\nadapter_speed   appx clockrate\n5000            1155.1\n2000            1155.1\n1200            1155.1\n1000            882.5\n500             461.8\n200             188.5\n100             96.0\n50              48.1\n20              19.4\n10              9.7\n5               4.9\n2               1.9\n1               1.0\n```\n\n```\n\u003e adapter speed 2000                     \nadapter speed: 2000 kHz\n\u003e dump_image /dev/null 0x20000000 0x18000\ndumped 98304 bytes in 1.394637s (68.835 KiB/s)\n\u003e dump_image /dev/null 0x20000000 0x18000\ndumped 98304 bytes in 1.402091s (68.469 KiB/s)\n\n\u003e adapter speed 1200                     \nadapter speed: 1200 kHz\n\u003e dump_image /dev/null 0x20000000 0x18000\ndumped 98304 bytes in 1.388461s (69.141 KiB/s)\n\n\u003e adapter speed 1000                     \nadapter speed: 1000 kHz\n\u003e dump_image /dev/null 0x20000000 0x18000\ndumped 98304 bytes in 1.728140s (55.551 KiB/s)\n\u003e dump_image /dev/null 0x20000000 0x18000\ndumped 98304 bytes in 1.728650s (55.535 KiB/s)\n\n\u003e adapter speed 100                      \nadapter speed: 100 kHz\n\u003e dump_image /dev/null 0x20000000 0x18000\ndumped 98304 bytes in 12.069776s (7.954 KiB/s)\n\n\u003e adapter speed 10                       \nadapter speed: 10 kHz\n\u003e dump_image /dev/null 0x20000000 0x18000\ndumped 98304 bytes in 115.583870s (0.831 KiB/s)\n```","commit_id":"d91d79d7e248f4380c31ca061d55a3d90a63d7a6"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"62ac0a8a4bb82d2d08c23a97067ea5339a2af7d2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"69cc5c63_2f0d771e","updated":"2025-08-12 13:21:47.000000000","message":"Sorry for the multiple patchsets.. I was tired when I did this.","commit_id":"36b58ef691ff0b6fcb0d980d12496cdd1cfb01d9"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"e4a81d3d00c391a7acfc23ae738ecad44905cfde","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"4372e381_5faa795b","updated":"2025-08-18 06:28:32.000000000","message":"Thanks Brian! I will also try to test the patch on hardware.","commit_id":"36b58ef691ff0b6fcb0d980d12496cdd1cfb01d9"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"fef049cecced113a3b5a9ff54b5df756d82a2763","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"6e78507b_b78ba8aa","in_reply_to":"0c109fdd_3fb28f05","updated":"2025-08-21 17:18:21.000000000","message":"Nice, thanks a lot! Can confirm that it works smooth on an ESP32 Pico.","commit_id":"36b58ef691ff0b6fcb0d980d12496cdd1cfb01d9"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"3d2e197806da9d0e64b4195701d4e356bde86e79","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"d8d57d4d_cc6299e9","in_reply_to":"4372e381_5faa795b","updated":"2025-08-18 07:46:11.000000000","message":"Sounds good. Let me know if you\u0027re using a device other than S3 or C6.","commit_id":"36b58ef691ff0b6fcb0d980d12496cdd1cfb01d9"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"baaaab74ab62a567c19bc0ee133463f22f6e35bb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"0c109fdd_3fb28f05","in_reply_to":"6ebf8ef4_433c3fc9","updated":"2025-08-21 16:41:13.000000000","message":"Probably the same problem I faced. Try Brian\u0027s advice\n\u003e If you\u0027re seeing it hang immediately after the connection is made, double check that your sdkconfig contains `CONFIG_LWIP_SO_RCVBUF\u003dy`.","commit_id":"36b58ef691ff0b6fcb0d980d12496cdd1cfb01d9"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"1420a6870d4a9ae049f0cc095c32d8ca4ba314a3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"6ebf8ef4_433c3fc9","in_reply_to":"d8d57d4d_cc6299e9","updated":"2025-08-21 16:37:02.000000000","message":"I tried your patch with an ESP32 Pico and unfortunately it does not work :-(\n\nI get the following device response (`idf.py monitor`):\n\n```\nI (946) wifi:AP\u0027s beacon interval \u003d 102400 us, DTIM period \u003d 2\nI (1926) esp_netif_handlers: sta ip: 10.42.0.147, mask: 255.255.255.0, gw: 10.42.0.1\nIP address: 10.42.0.147\nI (1926) wifi:Set ps type: 0, coexist: 0\n\ncmsis_dap_tcp server listening on port 4441.\nClient connected.\nI (130426) wifi:\u003cba-add\u003eidx:0 (ifx:0, 50:2f:9b:12:58:40), tid:0, ssn:15, winSize:64\n```\n\nAnd OpenOCD:\n\n```\nInfo : Listening on port 6666 for tcl connections\nInfo : Listening on port 4444 for telnet connections\nInfo : CMSIS-DAP: Connecting to 10.42.0.147:4441 using TCP backend\nError: CMSIS-DAP command CMD_INFO failed.\n```\n\nAny idea?\n\n(This should not block the patch from begin merged as Tomas already verified it on hardware.)","commit_id":"36b58ef691ff0b6fcb0d980d12496cdd1cfb01d9"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"cf550400d54be5e50e9b606186876d328a6bdb35","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":18,"id":"0a932a27_87eaebfb","updated":"2025-08-20 13:34:32.000000000","message":"Some comment on the documentation.\nCan you please check them?","commit_id":"e9d32cd4e173f127eff17e0f13ffcc873c55e579"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"dd1feb569cad8ce160e34afc8636e97ccaa46ad4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"8f91e466_a36f6623","updated":"2025-08-21 08:37:20.000000000","message":"Thanks","commit_id":"6c0747435132f608e27828a4bf769582afac2378"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"eaaed8960d18dc5390fafb6185f9593d75a937a6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"b5d09daf_d29d2d02","updated":"2025-08-25 07:43:48.000000000","message":"Thanks for the approvals! Do you need anything else from me? I\u0027m in the attention set, but I don\u0027t have permission to submit.","commit_id":"6c0747435132f608e27828a4bf769582afac2378"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"60a8bf09b66d77e3857eb6c564aa3886dca171a7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"b304f9b8_9a809d2f","in_reply_to":"779dd8bb_b6ff2eb9","updated":"2025-08-25 08:14:46.000000000","message":"OK, sounds good.","commit_id":"6c0747435132f608e27828a4bf769582afac2378"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"ff9f57f88c28b546fcddbaa643b2de3b8dde2842","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"779dd8bb_b6ff2eb9","in_reply_to":"b5d09daf_d29d2d02","updated":"2025-08-25 07:52:20.000000000","message":"We will wait few more days, in case of any further review or comment. Then we will merge it.","commit_id":"6c0747435132f608e27828a4bf769582afac2378"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"0acec3e47510a0a1fda3644a76a33669043e5ead","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":21,"id":"3b8297aa_52cabefe","updated":"2025-09-08 16:44:18.000000000","message":"Brian,\nI noticed minor memory leaks. We want to keep OpenOCD leak-free\nand https://openocd.org/doc/doxygen/html/patchguide.html recommends valgrind tests. Please fix the leaks in a new patch and run under valgrind.\nThanks","commit_id":"fcff4b712c53a6169f0f96dd63f0adb1b12a1789"},{"author":{"_account_id":1002436,"name":"IRON ALEKS","email":"8ironaleks8@gmail.com","username":"ironaleks"},"change_message_id":"947c8dcb559b8d7e62b7f31d49dec83703c5de38","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":21,"id":"647f5e15_609d2eb5","updated":"2025-09-12 21:17:07.000000000","message":"There is an issue on windows with the peeking behaviour https://sourceforge.net/p/openocd/tickets/457/","commit_id":"fcff4b712c53a6169f0f96dd63f0adb1b12a1789"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"ccf9934adbed1dacb60106594cec9e9aad2cb3fc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":21,"id":"f708268f_dc525da9","in_reply_to":"3b8297aa_52cabefe","updated":"2025-09-25 14:07:17.000000000","message":"Ack. Work in progress. Not ready for review yet: https://review.openocd.org/c/openocd/+/9147","commit_id":"fcff4b712c53a6169f0f96dd63f0adb1b12a1789"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"c75a9936b464702cf6ac0b48aea28972235ffbe7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":21,"id":"09a87b69_539db581","in_reply_to":"647f5e15_609d2eb5","updated":"2025-09-25 14:32:06.000000000","message":"Resolved in https://review.openocd.org/c/openocd/+/9136","commit_id":"fcff4b712c53a6169f0f96dd63f0adb1b12a1789"}],"configure.ac":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":209,"context_line":"m4_define([CMSIS_DAP_TCP_ADAPTER],"},{"line_number":210,"context_line":"\t[[[cmsis_dap_tcp], [CMSIS-DAP v2 compliant dongle (TCP)], [CMSIS_DAP_TCP]]])"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"# The word \u0027Adapter\u0027 in \"Dummy Adapter\" below must begin with a capital letter"},{"line_number":213,"context_line":"# because there is an M4 macro called \u0027adapter\u0027."},{"line_number":214,"context_line":"m4_define([DUMMY_ADAPTER],"},{"line_number":215,"context_line":"\t[[[dummy], [Dummy Adapter], [DUMMY]]])"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"dee197bc_c8f4a6ca","line":212,"updated":"2025-06-22 12:57:06.000000000","message":"This line is going to be erased by pending commit\nhttps://review.openocd.org/c/8972\nso after merge 8972 this will conflict.\nWhen you push it in gerrit again, please move your change few lines above or below so there will be no more conflict for merge.\nLook also at pending\nhttps://review.openocd.org/c/8971\nto prevent a new conflict.","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":false,"context_lines":[{"line_number":209,"context_line":"m4_define([CMSIS_DAP_TCP_ADAPTER],"},{"line_number":210,"context_line":"\t[[[cmsis_dap_tcp], [CMSIS-DAP v2 compliant dongle (TCP)], [CMSIS_DAP_TCP]]])"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"# The word \u0027Adapter\u0027 in \"Dummy Adapter\" below must begin with a capital letter"},{"line_number":213,"context_line":"# because there is an M4 macro called \u0027adapter\u0027."},{"line_number":214,"context_line":"m4_define([DUMMY_ADAPTER],"},{"line_number":215,"context_line":"\t[[[dummy], [Dummy Adapter], [DUMMY]]])"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"4cdd8419_f7c67f99","line":212,"in_reply_to":"dee197bc_c8f4a6ca","updated":"2025-06-24 06:39:54.000000000","message":"Done","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":711,"context_line":"AM_CONDITIONAL([HLADAPTER_STLINK], [test \"x$enable_stlink\" !\u003d \"xno\"])"},{"line_number":712,"context_line":"AM_CONDITIONAL([HLADAPTER_ICDI], [test \"x$enable_ti_icdi\" !\u003d \"xno\"])"},{"line_number":713,"context_line":"AM_CONDITIONAL([HLADAPTER_NULINK], [test \"x$enable_nulink\" !\u003d \"xno\"])"},{"line_number":714,"context_line":""},{"line_number":715,"context_line":"AS_IF([test \"x$enable_jlink\" !\u003d \"xno\"], ["},{"line_number":716,"context_line":"  AS_IF([test \"x$use_internal_libjaylink\" \u003d \"xyes\"], ["},{"line_number":717,"context_line":"    AS_IF([test -f \"$srcdir/src/jtag/drivers/libjaylink/configure.ac\"], ["}],"source_content_type":"application/octet-stream","patch_set":5,"id":"edad41d8_ea5ef0d1","line":714,"updated":"2025-06-22 12:57:06.000000000","message":"For the discussion in `Makefile.am`, here add\n\n```\nAM_CONDITIONAL([CMSIS_DAP_CORE],\n   [test \"x$enable_cmsis_dap\" !\u003d \"xno\" -o \"x$enable_cmsis_dap_v2\" !\u003d \"xno\" -o \"x$enable_cmsis_dap_tcp\" !\u003d \"xno\"]\n)\n```","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":false,"context_lines":[{"line_number":711,"context_line":"AM_CONDITIONAL([HLADAPTER_STLINK], [test \"x$enable_stlink\" !\u003d \"xno\"])"},{"line_number":712,"context_line":"AM_CONDITIONAL([HLADAPTER_ICDI], [test \"x$enable_ti_icdi\" !\u003d \"xno\"])"},{"line_number":713,"context_line":"AM_CONDITIONAL([HLADAPTER_NULINK], [test \"x$enable_nulink\" !\u003d \"xno\"])"},{"line_number":714,"context_line":""},{"line_number":715,"context_line":"AS_IF([test \"x$enable_jlink\" !\u003d \"xno\"], ["},{"line_number":716,"context_line":"  AS_IF([test \"x$use_internal_libjaylink\" \u003d \"xyes\"], ["},{"line_number":717,"context_line":"    AS_IF([test -f \"$srcdir/src/jtag/drivers/libjaylink/configure.ac\"], ["}],"source_content_type":"application/octet-stream","patch_set":5,"id":"8e7c663f_503b38a7","line":714,"in_reply_to":"edad41d8_ea5ef0d1","updated":"2025-06-24 06:39:54.000000000","message":"Done","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"}],"doc/openocd.texi":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":2562,"context_line":"@end example"},{"line_number":2563,"context_line":"@end deffn"},{"line_number":2564,"context_line":""},{"line_number":2565,"context_line":"@deffn {Config Command} {cmsis-dap backend} [@option{auto}|@option{usb_bulk}|@option{hid}]"},{"line_number":2566,"context_line":"Specifies how to communicate with the adapter:"},{"line_number":2567,"context_line":""},{"line_number":2568,"context_line":"@itemize @minus"}],"source_content_type":"text/x-texinfo","patch_set":5,"id":"90d6bc06_454a3c0d","line":2565,"updated":"2025-06-22 12:57:06.000000000","message":"Please document here the new option.\nThe new commands for tcp transport are also missing","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":false,"context_lines":[{"line_number":2562,"context_line":"@end example"},{"line_number":2563,"context_line":"@end deffn"},{"line_number":2564,"context_line":""},{"line_number":2565,"context_line":"@deffn {Config Command} {cmsis-dap backend} [@option{auto}|@option{usb_bulk}|@option{hid}]"},{"line_number":2566,"context_line":"Specifies how to communicate with the adapter:"},{"line_number":2567,"context_line":""},{"line_number":2568,"context_line":"@itemize @minus"}],"source_content_type":"text/x-texinfo","patch_set":5,"id":"1b3607b7_8ce7a381","line":2565,"in_reply_to":"90d6bc06_454a3c0d","updated":"2025-06-24 06:39:54.000000000","message":"Done","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"9d2ca60adb29a5196e0e79cf7b2ac3afcabcd55c","unresolved":true,"context_lines":[{"line_number":2580,"context_line":"interface string or for user class interface."},{"line_number":2581,"context_line":"@end deffn"},{"line_number":2582,"context_line":""},{"line_number":2583,"context_line":"@deffn {Config Command} {cmsis-dap tcp host} [hostname]"},{"line_number":2584,"context_line":"Specifies the @var{hostname} or IP address of the remote programmer. For use"},{"line_number":2585,"context_line":"with \u0027tcp\u0027 backend only."},{"line_number":2586,"context_line":"@end deffn"}],"source_content_type":"text/x-texinfo","patch_set":7,"id":"3f2a7814_3351f8a2","line":2583,"updated":"2025-07-02 21:26:13.000000000","message":"I missed this.\nThe parameter `hostname` is mandatory to this command.\nBut the square brackets around means that it\u0027s optional.\nPlease drop the square brackets\n`@deffn {Config Command} {cmsis-dap tcp host} hostname`\nalso for the command `cmsis-dap tcp port` below.","commit_id":"6990019a56e980b75be07d0e759dc92e140b5e49"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"23417c9ac57fd83a836f89d5da381ab15dc3fc5c","unresolved":false,"context_lines":[{"line_number":2580,"context_line":"interface string or for user class interface."},{"line_number":2581,"context_line":"@end deffn"},{"line_number":2582,"context_line":""},{"line_number":2583,"context_line":"@deffn {Config Command} {cmsis-dap tcp host} [hostname]"},{"line_number":2584,"context_line":"Specifies the @var{hostname} or IP address of the remote programmer. For use"},{"line_number":2585,"context_line":"with \u0027tcp\u0027 backend only."},{"line_number":2586,"context_line":"@end deffn"}],"source_content_type":"text/x-texinfo","patch_set":7,"id":"8b599edd_7abd40ff","line":2583,"in_reply_to":"3f2a7814_3351f8a2","updated":"2025-07-03 00:29:25.000000000","message":"Done","commit_id":"6990019a56e980b75be07d0e759dc92e140b5e49"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"9396a248699a2515198fe4fcfdd789cc6e138d8c","unresolved":true,"context_lines":[{"line_number":2595,"context_line":"commands. For use with \u0027tcp\u0027 backend only."},{"line_number":2596,"context_line":"@end deffn"},{"line_number":2597,"context_line":""},{"line_number":2598,"context_line":"@deffn {Config Command} {cmsis-dap tcp min_timeout} milliseconds"},{"line_number":2599,"context_line":"Overrides the default minimum timeout in @var{milliseconds} to wait for TCP"},{"line_number":2600,"context_line":"response packets from the remote programmer. The user may want to use a larger"},{"line_number":2601,"context_line":"value on slower networks, to avoid getting command mismatch errors. For use"}],"source_content_type":"text/x-texinfo","patch_set":14,"id":"333b2137_4360cde4","line":2598,"range":{"start_line":2598,"start_character":39,"end_line":2598,"end_character":50},"updated":"2025-08-12 11:02:35.000000000","message":"Please rename to `timeout`, there is no such thing as `max_timeout`.\nSame for the text below: `Overrides the default timeout in ...`.\nMaybe mention what the default timeout is?","commit_id":"6e4fef90a09c700ad49bccc222440da8534c89dc"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"62ac0a8a4bb82d2d08c23a97067ea5339a2af7d2","unresolved":false,"context_lines":[{"line_number":2595,"context_line":"commands. For use with \u0027tcp\u0027 backend only."},{"line_number":2596,"context_line":"@end deffn"},{"line_number":2597,"context_line":""},{"line_number":2598,"context_line":"@deffn {Config Command} {cmsis-dap tcp min_timeout} milliseconds"},{"line_number":2599,"context_line":"Overrides the default minimum timeout in @var{milliseconds} to wait for TCP"},{"line_number":2600,"context_line":"response packets from the remote programmer. The user may want to use a larger"},{"line_number":2601,"context_line":"value on slower networks, to avoid getting command mismatch errors. For use"}],"source_content_type":"text/x-texinfo","patch_set":14,"id":"a3aa75b0_15de315b","line":2598,"range":{"start_line":2598,"start_character":39,"end_line":2598,"end_character":50},"in_reply_to":"333b2137_4360cde4","updated":"2025-08-12 13:21:47.000000000","message":"Hi Marc, thanks for the review. I partially disagree with you on this. \n\nThe timeout is passed as a parameter to ```cmsis_dap_tcp_backend.read()```. The caller determines the length of the timeout. The timeout is different depending on where it is called from. This new option ```min_timeout``` doesn\u0027t set the timeout. It sets a lower bound on the timeout. It is the minimum value that the timeout will be for this backend, hence ```min_timeout```.\n\nI updated the documentation to try to be more clear about this, and added the default value for ```min_timeout```.","commit_id":"6e4fef90a09c700ad49bccc222440da8534c89dc"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"1420a6870d4a9ae049f0cc095c32d8ca4ba314a3","unresolved":false,"context_lines":[{"line_number":2595,"context_line":"commands. For use with \u0027tcp\u0027 backend only."},{"line_number":2596,"context_line":"@end deffn"},{"line_number":2597,"context_line":""},{"line_number":2598,"context_line":"@deffn {Config Command} {cmsis-dap tcp min_timeout} milliseconds"},{"line_number":2599,"context_line":"Overrides the default minimum timeout in @var{milliseconds} to wait for TCP"},{"line_number":2600,"context_line":"response packets from the remote programmer. The user may want to use a larger"},{"line_number":2601,"context_line":"value on slower networks, to avoid getting command mismatch errors. For use"}],"source_content_type":"text/x-texinfo","patch_set":14,"id":"f699e7a1_810f5115","line":2598,"range":{"start_line":2598,"start_character":39,"end_line":2598,"end_character":50},"in_reply_to":"a3aa75b0_15de315b","updated":"2025-08-21 16:37:02.000000000","message":"Sorry, overlooked your comment. I see your point, the documentation is clear now - thanks! I don\u0027t think the command name needs to reflect this implementation detail but I don\u0027t have a very strong opinion here.","commit_id":"6e4fef90a09c700ad49bccc222440da8534c89dc"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"cf550400d54be5e50e9b606186876d328a6bdb35","unresolved":true,"context_lines":[{"line_number":2571,"context_line":"Specifies how to communicate with the adapter:"},{"line_number":2572,"context_line":""},{"line_number":2573,"context_line":"@itemize @minus"},{"line_number":2574,"context_line":"@item @option{hid} Use HID generic reports - CMSIS-DAP v1"},{"line_number":2575,"context_line":"@item @option{usb_bulk} Use USB bulk - CMSIS-DAP v2"},{"line_number":2576,"context_line":"@item @option{tcp} Use TCP/IP instead of USB - CMSIS-DAP v2"},{"line_number":2577,"context_line":"@item @option{auto} First try USB bulk CMSIS-DAP v2, if not found try HID CMSIS-DAP v1."}],"source_content_type":"text/x-texinfo","patch_set":18,"id":"5c5c3967_25108250","line":2574,"updated":"2025-08-20 13:34:32.000000000","message":"Now that we have TCP, should we change the text here as `Use USB HID generic ...` ?","commit_id":"e9d32cd4e173f127eff17e0f13ffcc873c55e579"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"b3645d7e1b3391f20209d829e3c8fbff119a42ed","unresolved":false,"context_lines":[{"line_number":2571,"context_line":"Specifies how to communicate with the adapter:"},{"line_number":2572,"context_line":""},{"line_number":2573,"context_line":"@itemize @minus"},{"line_number":2574,"context_line":"@item @option{hid} Use HID generic reports - CMSIS-DAP v1"},{"line_number":2575,"context_line":"@item @option{usb_bulk} Use USB bulk - CMSIS-DAP v2"},{"line_number":2576,"context_line":"@item @option{tcp} Use TCP/IP instead of USB - CMSIS-DAP v2"},{"line_number":2577,"context_line":"@item @option{auto} First try USB bulk CMSIS-DAP v2, if not found try HID CMSIS-DAP v1."}],"source_content_type":"text/x-texinfo","patch_set":18,"id":"ae8e36b6_e32cecd0","line":2574,"in_reply_to":"5c5c3967_25108250","updated":"2025-08-21 08:12:56.000000000","message":"Done","commit_id":"e9d32cd4e173f127eff17e0f13ffcc873c55e579"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"cf550400d54be5e50e9b606186876d328a6bdb35","unresolved":true,"context_lines":[{"line_number":2573,"context_line":"@itemize @minus"},{"line_number":2574,"context_line":"@item @option{hid} Use HID generic reports - CMSIS-DAP v1"},{"line_number":2575,"context_line":"@item @option{usb_bulk} Use USB bulk - CMSIS-DAP v2"},{"line_number":2576,"context_line":"@item @option{tcp} Use TCP/IP instead of USB - CMSIS-DAP v2"},{"line_number":2577,"context_line":"@item @option{auto} First try USB bulk CMSIS-DAP v2, if not found try HID CMSIS-DAP v1."},{"line_number":2578,"context_line":"This is the default if @command{cmsis-dap backend} is not specified."},{"line_number":2579,"context_line":"@end itemize"}],"source_content_type":"text/x-texinfo","patch_set":18,"id":"2941530b_a302a446","line":2576,"updated":"2025-08-20 13:34:32.000000000","message":"I thought the delta v1 vs v2 was only about USB HID vs bulk.\nIs there any other difference to justify that TCP/IP is v2 too?","commit_id":"e9d32cd4e173f127eff17e0f13ffcc873c55e579"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"b3645d7e1b3391f20209d829e3c8fbff119a42ed","unresolved":false,"context_lines":[{"line_number":2573,"context_line":"@itemize @minus"},{"line_number":2574,"context_line":"@item @option{hid} Use HID generic reports - CMSIS-DAP v1"},{"line_number":2575,"context_line":"@item @option{usb_bulk} Use USB bulk - CMSIS-DAP v2"},{"line_number":2576,"context_line":"@item @option{tcp} Use TCP/IP instead of USB - CMSIS-DAP v2"},{"line_number":2577,"context_line":"@item @option{auto} First try USB bulk CMSIS-DAP v2, if not found try HID CMSIS-DAP v1."},{"line_number":2578,"context_line":"This is the default if @command{cmsis-dap backend} is not specified."},{"line_number":2579,"context_line":"@end itemize"}],"source_content_type":"text/x-texinfo","patch_set":18,"id":"38123283_55fbd324","line":2576,"in_reply_to":"2941530b_a302a446","updated":"2025-08-21 08:12:56.000000000","message":"Not sure how to classify it. https://arm-software.github.io/CMSIS_5/DAP/html/dap_revisionHistory.html\n\nThis code is mostly derived from cmsis_dap_usb_hid.c. The remote-side code is based on what was the latest at the time, CMSIS-DAP V2.1.2. This code is not limited to 1 msec polling like HID, so speed-wise it would seem more similar to v2.\n\nFor now I\u0027ve removed the reference to v2 for TCP. Feel free to reopen this.","commit_id":"e9d32cd4e173f127eff17e0f13ffcc873c55e579"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"cf550400d54be5e50e9b606186876d328a6bdb35","unresolved":true,"context_lines":[{"line_number":2574,"context_line":"@item @option{hid} Use HID generic reports - CMSIS-DAP v1"},{"line_number":2575,"context_line":"@item @option{usb_bulk} Use USB bulk - CMSIS-DAP v2"},{"line_number":2576,"context_line":"@item @option{tcp} Use TCP/IP instead of USB - CMSIS-DAP v2"},{"line_number":2577,"context_line":"@item @option{auto} First try USB bulk CMSIS-DAP v2, if not found try HID CMSIS-DAP v1."},{"line_number":2578,"context_line":"This is the default if @command{cmsis-dap backend} is not specified."},{"line_number":2579,"context_line":"@end itemize"},{"line_number":2580,"context_line":"@end deffn"}],"source_content_type":"text/x-texinfo","patch_set":18,"id":"ab93a08d_036fd3b6","line":2577,"updated":"2025-08-20 13:34:32.000000000","message":"I think `auto` checks TCP too as the last one, correct?","commit_id":"e9d32cd4e173f127eff17e0f13ffcc873c55e579"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"b3645d7e1b3391f20209d829e3c8fbff119a42ed","unresolved":false,"context_lines":[{"line_number":2574,"context_line":"@item @option{hid} Use HID generic reports - CMSIS-DAP v1"},{"line_number":2575,"context_line":"@item @option{usb_bulk} Use USB bulk - CMSIS-DAP v2"},{"line_number":2576,"context_line":"@item @option{tcp} Use TCP/IP instead of USB - CMSIS-DAP v2"},{"line_number":2577,"context_line":"@item @option{auto} First try USB bulk CMSIS-DAP v2, if not found try HID CMSIS-DAP v1."},{"line_number":2578,"context_line":"This is the default if @command{cmsis-dap backend} is not specified."},{"line_number":2579,"context_line":"@end itemize"},{"line_number":2580,"context_line":"@end deffn"}],"source_content_type":"text/x-texinfo","patch_set":18,"id":"c3cb4e8f_57011c7e","line":2577,"in_reply_to":"ab93a08d_036fd3b6","updated":"2025-08-21 08:12:56.000000000","message":"Correct. Updated the text.","commit_id":"e9d32cd4e173f127eff17e0f13ffcc873c55e579"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"da05e374249548ffd3ce5b81fb0d30322ef1cb87","unresolved":true,"context_lines":[{"line_number":2575,"context_line":"@item @option{usb_bulk} Use USB bulk - CMSIS-DAP v2"},{"line_number":2576,"context_line":"@item @option{tcp} Use TCP/IP instead of USB"},{"line_number":2577,"context_line":"@item @option{auto} First try USB bulk CMSIS-DAP v2, if not found try USB HID"},{"line_number":2578,"context_line":"CMSIS-DAP v1, if not found try TCP. This is the default if"},{"line_number":2579,"context_line":"@command{cmsis-dap backend} is not specified."},{"line_number":2580,"context_line":"@end itemize"},{"line_number":2581,"context_line":"@end deffn"}],"source_content_type":"text/x-texinfo","patch_set":19,"id":"43e200e4_fb39f874","line":2578,"range":{"start_line":2578,"start_character":27,"end_line":2578,"end_character":34},"updated":"2025-08-21 07:37:42.000000000","message":"Might be worth to mention that TCP gets used only if `cmsis-dap tcp host` is configured (IIRC)","commit_id":"6a3dc9aac71679b34a2e3a099ea9081cc47cb473"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"b3645d7e1b3391f20209d829e3c8fbff119a42ed","unresolved":false,"context_lines":[{"line_number":2575,"context_line":"@item @option{usb_bulk} Use USB bulk - CMSIS-DAP v2"},{"line_number":2576,"context_line":"@item @option{tcp} Use TCP/IP instead of USB"},{"line_number":2577,"context_line":"@item @option{auto} First try USB bulk CMSIS-DAP v2, if not found try USB HID"},{"line_number":2578,"context_line":"CMSIS-DAP v1, if not found try TCP. This is the default if"},{"line_number":2579,"context_line":"@command{cmsis-dap backend} is not specified."},{"line_number":2580,"context_line":"@end itemize"},{"line_number":2581,"context_line":"@end deffn"}],"source_content_type":"text/x-texinfo","patch_set":19,"id":"cf409300_ec2addb0","line":2578,"range":{"start_line":2578,"start_character":27,"end_line":2578,"end_character":34},"in_reply_to":"43e200e4_fb39f874","updated":"2025-08-21 08:12:56.000000000","message":"Done","commit_id":"6a3dc9aac71679b34a2e3a099ea9081cc47cb473"}],"src/helper/replacements.h":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":225,"context_line":"#endif"},{"line_number":226,"context_line":"}"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"static inline int socket_timeout(int fd, unsigned long timeout_msec)"},{"line_number":229,"context_line":"{"},{"line_number":230,"context_line":"#ifdef _WIN32"},{"line_number":231,"context_line":"\tDWORD timeout \u003d timeout_msec;"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"5d8fdc49_825d649c","line":228,"updated":"2025-06-22 12:57:06.000000000","message":"This is only for receive timeout. It is possible to set also SO_SNDTIMEO.\nIf you only need to set SO_RCVTIMEO, then rename this function accordingly.\nIf you want to set both SO_RCVTIMEO and SO_SNDTIMEO, then the name is OK (or rename timeout as timeouts?), but the code is missing a piece.","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":false,"context_lines":[{"line_number":225,"context_line":"#endif"},{"line_number":226,"context_line":"}"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"static inline int socket_timeout(int fd, unsigned long timeout_msec)"},{"line_number":229,"context_line":"{"},{"line_number":230,"context_line":"#ifdef _WIN32"},{"line_number":231,"context_line":"\tDWORD timeout \u003d timeout_msec;"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"17c7c73f_c4508003","line":228,"in_reply_to":"5d8fdc49_825d649c","updated":"2025-06-24 06:39:54.000000000","message":"Done","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"}],"src/jtag/drivers/Makefile.am":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":200,"context_line":"endif"},{"line_number":201,"context_line":"if CMSIS_DAP_TCP"},{"line_number":202,"context_line":"DRIVERFILES +\u003d %D%/cmsis_dap_tcp.c"},{"line_number":203,"context_line":"DRIVERFILES +\u003d %D%/cmsis_dap.c"},{"line_number":204,"context_line":"endif"},{"line_number":205,"context_line":"if IMX_GPIO"},{"line_number":206,"context_line":"DRIVERFILES +\u003d %D%/imx_gpio.c"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"a3197688_b4f7e850","line":203,"updated":"2025-06-22 12:57:06.000000000","message":"No, if both CMSIS_DAP_HID and CMSIS_DAP_TCP are enabled, you get the last file added twice.\nSince `if` in `Makefile.am` can only test one variable\nhttps://www.gnu.org/software/automake/manual/html_node/Usage-of-Conditionals.html\nthe best is to add a new variable in `configure.ac` (see my proposal there) and here:\n```\nif CMSIS_DAP_CORE\nDRIVERFILES +\u003d %D%/cmsis_dap.c\nendif\nif CMSIS_DAP_HID\nDRIVERFILES +\u003d %D%/cmsis_dap_usb_hid.c\nendif\nif CMSIS_DAP_USB\nDRIVERFILES +\u003d %D%/cmsis_dap_usb_bulk.c\nendif\nif CMSIS_DAP_TCP\nDRIVERFILES +\u003d %D%/cmsis_dap_tcp.c\nendif\n```","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":false,"context_lines":[{"line_number":200,"context_line":"endif"},{"line_number":201,"context_line":"if CMSIS_DAP_TCP"},{"line_number":202,"context_line":"DRIVERFILES +\u003d %D%/cmsis_dap_tcp.c"},{"line_number":203,"context_line":"DRIVERFILES +\u003d %D%/cmsis_dap.c"},{"line_number":204,"context_line":"endif"},{"line_number":205,"context_line":"if IMX_GPIO"},{"line_number":206,"context_line":"DRIVERFILES +\u003d %D%/imx_gpio.c"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"1856614c_42792015","line":203,"in_reply_to":"a3197688_b4f7e850","updated":"2025-06-24 06:39:54.000000000","message":"Done","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"}],"src/jtag/drivers/cmsis_dap.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"14a5f2dd8f471ca343478d7e2aaa3ff38e7c62e8","unresolved":true,"context_lines":[{"line_number":286,"context_line":"\t\t\tLOG_ERROR(\"Requested CMSIS-DAP backend is disabled by configure\");"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"\t} else {"},{"line_number":289,"context_line":"\t\t/* Try all backends */"},{"line_number":290,"context_line":"\t\tfor (unsigned int i \u003d 0; i \u003c ARRAY_SIZE(cmsis_dap_backends); i++) {"},{"line_number":291,"context_line":"\t\t\tbackend \u003d cmsis_dap_backends[i];"},{"line_number":292,"context_line":"\t\t\tif (!backend-\u003eopen)"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"23d7d638_a409a79e","line":289,"updated":"2025-06-23 10:04:55.000000000","message":"IMO we should not try the TCP backend if no backend specified or in auto mode.\nThe errors printed:\n```\nInfo : CMSIS-DAP: Connecting to localhost:CMSIS_DAP_TCP_PORT using TCP backend\nError: CMSIS-DAP: getaddrinfo: Servname not supported for ai_socktype\n```\nmight be quite misleading for an user who just forget to connect his USB based CMSIS-DAP adapter and has no idea about the TCP protocol alternative.","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":false,"context_lines":[{"line_number":286,"context_line":"\t\t\tLOG_ERROR(\"Requested CMSIS-DAP backend is disabled by configure\");"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"\t} else {"},{"line_number":289,"context_line":"\t\t/* Try all backends */"},{"line_number":290,"context_line":"\t\tfor (unsigned int i \u003d 0; i \u003c ARRAY_SIZE(cmsis_dap_backends); i++) {"},{"line_number":291,"context_line":"\t\t\tbackend \u003d cmsis_dap_backends[i];"},{"line_number":292,"context_line":"\t\t\tif (!backend-\u003eopen)"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"6c060428_f1c863ee","line":289,"in_reply_to":"23d7d638_a409a79e","updated":"2025-06-24 06:39:54.000000000","message":"Good point, thanks. I changed cmsis_dap_tcp_open() to skip the open if the user has not provided a hostname. It should should no longer print these messages.","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"}],"src/jtag/drivers/cmsis_dap_tcp.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":59,"context_line":"#define CMSIS_DAP_PACKET_SIZE\t1024\t\t// Max payload size not including"},{"line_number":60,"context_line":"\t\t\t\t\t\t\t\t\t\t\t// header."},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"// CMSIS-DAP requests are variable length. With CMSIS-DAP over USB, the"},{"line_number":63,"context_line":"// transfer sizes are preserved by the USB stack. However, TCP/IP is stream"},{"line_number":64,"context_line":"// oriented so we perform our own packetization to preserve the boundaries"},{"line_number":65,"context_line":"// between each request. This short header is prepended to each CMSIS-DAP"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"a3d501fd_b669ca61","line":62,"updated":"2025-06-22 12:57:06.000000000","message":"per coding style, multi-line comments should use:\n```\n/*\n * comment line 1\n * comment line 2\n */\n```","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":false,"context_lines":[{"line_number":59,"context_line":"#define CMSIS_DAP_PACKET_SIZE\t1024\t\t// Max payload size not including"},{"line_number":60,"context_line":"\t\t\t\t\t\t\t\t\t\t\t// header."},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"// CMSIS-DAP requests are variable length. With CMSIS-DAP over USB, the"},{"line_number":63,"context_line":"// transfer sizes are preserved by the USB stack. However, TCP/IP is stream"},{"line_number":64,"context_line":"// oriented so we perform our own packetization to preserve the boundaries"},{"line_number":65,"context_line":"// between each request. This short header is prepended to each CMSIS-DAP"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"94709ed9_7ecf9a0a","line":62,"in_reply_to":"a3d501fd_b669ca61","updated":"2025-06-24 06:39:54.000000000","message":"Done","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":87,"context_line":"\t\tpids[], const char *serial)"},{"line_number":88,"context_line":"{"},{"line_number":89,"context_line":"\t// Ignore vids, pids, serial. We use host and port subcommands instead."},{"line_number":90,"context_line":"\t(void)vids;"},{"line_number":91,"context_line":"\t(void)pids;"},{"line_number":92,"context_line":"\t(void)serial;"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"60a64e0c_0b7229b2","line":90,"updated":"2025-06-22 12:57:06.000000000","message":"Instead of using these cast to void, declare the function as:\n```\nstatic int cmsis_dap_tcp_open(struct cmsis_dap *dap,\n        uint16_t vids[] __attribute__((unused)),\n        uint16_t pids[] __attribute__((unused)),\n        const char *serial __attribute__((unused)))\n```\n\nSimilar for `cmsis_dap_tcp_write()`","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":false,"context_lines":[{"line_number":87,"context_line":"\t\tpids[], const char *serial)"},{"line_number":88,"context_line":"{"},{"line_number":89,"context_line":"\t// Ignore vids, pids, serial. We use host and port subcommands instead."},{"line_number":90,"context_line":"\t(void)vids;"},{"line_number":91,"context_line":"\t(void)pids;"},{"line_number":92,"context_line":"\t(void)serial;"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":5,"id":"55b9925e_6b15c595","line":90,"in_reply_to":"60a64e0c_0b7229b2","updated":"2025-06-24 06:39:54.000000000","message":"Done","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":158,"context_line":"\tint retval \u003d cmsis_dap_tcp_alloc(dap, CMSIS_DAP_PACKET_SIZE);"},{"line_number":159,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":160,"context_line":"\t\tcmsis_dap_tcp_close(dap);"},{"line_number":161,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":162,"context_line":"\t}"},{"line_number":163,"context_line":"\treturn ERROR_OK;"},{"line_number":164,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"12a5ea69_140db19f","line":161,"updated":"2025-06-22 12:57:06.000000000","message":"`return retval;`","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":false,"context_lines":[{"line_number":158,"context_line":"\tint retval \u003d cmsis_dap_tcp_alloc(dap, CMSIS_DAP_PACKET_SIZE);"},{"line_number":159,"context_line":"\tif (retval !\u003d ERROR_OK) {"},{"line_number":160,"context_line":"\t\tcmsis_dap_tcp_close(dap);"},{"line_number":161,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":162,"context_line":"\t}"},{"line_number":163,"context_line":"\treturn ERROR_OK;"},{"line_number":164,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"131dbf56_ce252e05","line":161,"in_reply_to":"12a5ea69_140db19f","updated":"2025-06-24 06:39:54.000000000","message":"Done","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":187,"context_line":"\t\tsocket_block(dap-\u003ebdata-\u003esockfd);"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"\t// Read the header first to find the length, then read the rest."},{"line_number":190,"context_line":"\tstruct cmsis_dap_tcp_packet_hdr *header \u003d (void *)dap-\u003epacket_buffer;"},{"line_number":191,"context_line":"\tint retval \u003d read_socket(dap-\u003ebdata-\u003esockfd, dap-\u003epacket_buffer,"},{"line_number":192,"context_line":"\t\t\tsizeof(*header));"},{"line_number":193,"context_line":"\tLOG_DEBUG_IO(\"Reading header returned %d\", retval);"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"eb3ae6ac_21cf5fae","line":190,"updated":"2025-06-22 12:57:06.000000000","message":"You cannot trust that every compiler will keep the elements in the struct at the same offset required by the protocol.\nIt\u0027s safer if you manually copy between the buffer and the host struct (or individual variables).\n\n```\n#define HEADER_SIGN_OFF 0\n#define HEADER_LEN_OFF  sizeof(uint32_t)\n#define HEADER_TYPE_OFF (sizeof(uint32_t) + sizeof(uint16_t))\n#define HEADER_RES_OFF  (sizeof(uint32_t) + sizeof(uint16_t) + sizeof(uint8_t))\n#define HEADER_SIZE     (sizeof(uint32_t) + sizeof(uint16_t) + 2 * sizeof(uint8_t))\n\nint retval \u003d read_socket(dap-\u003ebdata-\u003esockfd, dap-\u003epacket_buffer, HEADER_SIZE);\n... error handling ...;\nuint32_t hdr_signature  \u003d le_to_h_u32(dap-\u003epacket_buffer + HEADER_SIGN_OFF);\nuint16_t hdr_length     \u003d le_to_h_u16(dap-\u003epacket_buffer + HEADER_LEN_OFF);\nuint8_t hdr_packet_type \u003d dap-\u003epacket_buffer[HEADER_TYPE_OFF];\nuint8_t hdr_reserved    \u003d dap-\u003epacket_buffer[HEADER_RES_OFF];\n```","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"6b2c21cb602eef4fa4124657d2cf5b98a4f8a8bb","unresolved":false,"context_lines":[{"line_number":187,"context_line":"\t\tsocket_block(dap-\u003ebdata-\u003esockfd);"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"\t// Read the header first to find the length, then read the rest."},{"line_number":190,"context_line":"\tstruct cmsis_dap_tcp_packet_hdr *header \u003d (void *)dap-\u003epacket_buffer;"},{"line_number":191,"context_line":"\tint retval \u003d read_socket(dap-\u003ebdata-\u003esockfd, dap-\u003epacket_buffer,"},{"line_number":192,"context_line":"\t\t\tsizeof(*header));"},{"line_number":193,"context_line":"\tLOG_DEBUG_IO(\"Reading header returned %d\", retval);"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"075f83bd_90ca80cc","line":190,"in_reply_to":"0689181c_3434150f","updated":"2025-06-29 06:21:45.000000000","message":"Done","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"0949cb3fa9dec73ac4c94bf8a16ce359fe29a2e8","unresolved":true,"context_lines":[{"line_number":187,"context_line":"\t\tsocket_block(dap-\u003ebdata-\u003esockfd);"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"\t// Read the header first to find the length, then read the rest."},{"line_number":190,"context_line":"\tstruct cmsis_dap_tcp_packet_hdr *header \u003d (void *)dap-\u003epacket_buffer;"},{"line_number":191,"context_line":"\tint retval \u003d read_socket(dap-\u003ebdata-\u003esockfd, dap-\u003epacket_buffer,"},{"line_number":192,"context_line":"\t\t\tsizeof(*header));"},{"line_number":193,"context_line":"\tLOG_DEBUG_IO(\"Reading header returned %d\", retval);"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"0689181c_3434150f","line":190,"in_reply_to":"9b6ff100_59fcf598","updated":"2025-06-25 10:21:21.000000000","message":"In this specific case, on the specific layout of this struct, packet attribute should work fine.\nBut in a generic case, e.g. swapping 2 values in the struct:\n```\nstruct __attribute__((packed)) cmsis_dap_tcp_packet_hdr {\n\tuint32_t signature;\n\tuint8_t packet_type;\n\tuint16_t length;\n\tuint8_t reserved;\n};\n```\ndifferent compiler will behave differently. X86 accent to have `length` not aligned 16 bits, other compiler will add a padding.\nSo, in general, I don\u0027t want to use the packet attribute.\n\nFor readability, you could add a function to convert the uin8_t array from `read_socket()` to the host struct, but I still prefer using the offsets in the array instead of cast to packet struct.\n\nAlso, I don\u0027t like reading a struct in one endianness and overwrite the same struct after change the endianness.\nI want to introduce in OpenOCD the tool `sparse` from Linux kernel to check about endianness, so the field in the struct will become:\n```\nstruct __attribute__((packed)) cmsis_dap_tcp_packet_hdr {\n\t_le32 signature;\n\t_le16 length;\n\tuint8_t packet_type;\n\tuint8_t reserved;\n};\n```\nthe conversion function will have prototype\n`uint32_t le_to_h_u32(_le32 v);`\nand you would not be able to assign\n`header-\u003esignature \u003d le_to_h_u32(header-\u003esignature);`","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":true,"context_lines":[{"line_number":187,"context_line":"\t\tsocket_block(dap-\u003ebdata-\u003esockfd);"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"\t// Read the header first to find the length, then read the rest."},{"line_number":190,"context_line":"\tstruct cmsis_dap_tcp_packet_hdr *header \u003d (void *)dap-\u003epacket_buffer;"},{"line_number":191,"context_line":"\tint retval \u003d read_socket(dap-\u003ebdata-\u003esockfd, dap-\u003epacket_buffer,"},{"line_number":192,"context_line":"\t\t\tsizeof(*header));"},{"line_number":193,"context_line":"\tLOG_DEBUG_IO(\"Reading header returned %d\", retval);"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"9b6ff100_59fcf598","line":190,"in_reply_to":"eb3ae6ac_21cf5fae","updated":"2025-06-24 06:39:54.000000000","message":"How about changing the struct definition to: ```struct __attribute__((packed)) cmsis_dap_tcp_packet_hdr```","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":305,"context_line":""},{"line_number":306,"context_line":"COMMAND_HANDLER(cmsis_dap_handle_tcp_dap_port)"},{"line_number":307,"context_line":"{"},{"line_number":308,"context_line":"\tif (CMD_ARGC \u003d\u003d 1)"},{"line_number":309,"context_line":"\t\tcmsis_dap_tcp_dap_port \u003d strdup(CMD_ARGV[0]);"},{"line_number":310,"context_line":"\telse"},{"line_number":311,"context_line":"\t\tLOG_ERROR(\"CMSIS-DAP: expected exactly one argument to \""},{"line_number":312,"context_line":"\t\t\t\t\"cmsis-dap tcp dap_port \u003cport_number\u003e\");"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"\treturn ERROR_OK;"},{"line_number":315,"context_line":"}"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"COMMAND_HANDLER(cmsis_dap_handle_tcp_host)"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"3b0eb8e6_82cce5fc","line":314,"range":{"start_line":308,"start_character":1,"end_line":314,"end_character":17},"updated":"2025-06-22 12:57:06.000000000","message":"Rewrite this and, similarly also next command, as:\n```\nif (CMD_ARGC !\u003d 1)\n  return ERROR_COMMAND_SYNTAX_ERROR;\n  \nfree(cmsis_dap_tcp_dap_port);\ncmsis_dap_tcp_dap_port \u003d strdup(CMD_ARGV[0]);\nif (!cmsis_dap_tcp_dap_port) {\n  LOG_ERROR(\"Out of memory\");\n  return ERROR_FAIL;\n}\n\nreturn ERROR_OK;\n```\n\nThis prevents a memory leak if the command is called twice and reports memory error.\nThe magic error `ERROR_COMMAND_SYNTAX_ERROR` provides to output the syntax message.","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":false,"context_lines":[{"line_number":305,"context_line":""},{"line_number":306,"context_line":"COMMAND_HANDLER(cmsis_dap_handle_tcp_dap_port)"},{"line_number":307,"context_line":"{"},{"line_number":308,"context_line":"\tif (CMD_ARGC \u003d\u003d 1)"},{"line_number":309,"context_line":"\t\tcmsis_dap_tcp_dap_port \u003d strdup(CMD_ARGV[0]);"},{"line_number":310,"context_line":"\telse"},{"line_number":311,"context_line":"\t\tLOG_ERROR(\"CMSIS-DAP: expected exactly one argument to \""},{"line_number":312,"context_line":"\t\t\t\t\"cmsis-dap tcp dap_port \u003cport_number\u003e\");"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"\treturn ERROR_OK;"},{"line_number":315,"context_line":"}"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"COMMAND_HANDLER(cmsis_dap_handle_tcp_host)"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"b397c942_11b1f165","line":314,"range":{"start_line":308,"start_character":1,"end_line":314,"end_character":17},"in_reply_to":"3b0eb8e6_82cce5fc","updated":"2025-06-24 06:39:54.000000000","message":"Done","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":334,"context_line":"\t\t.usage \u003d \"\u003chost_name\u003e\","},{"line_number":335,"context_line":"\t},"},{"line_number":336,"context_line":"\t{"},{"line_number":337,"context_line":"\t\t.name \u003d \"dap_port\","},{"line_number":338,"context_line":"\t\t.handler \u003d \u0026cmsis_dap_handle_tcp_dap_port,"},{"line_number":339,"context_line":"\t\t.mode \u003d COMMAND_CONFIG,"},{"line_number":340,"context_line":"\t\t.help \u003d \"set the port number to use for DAP (for TCP backend only)\","}],"source_content_type":"text/x-csrc","patch_set":5,"id":"f17b361a_cbc7637b","line":337,"updated":"2025-06-22 12:57:06.000000000","message":"use \"port\", already used by other drivers like remote_bitbang","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"0949cb3fa9dec73ac4c94bf8a16ce359fe29a2e8","unresolved":true,"context_lines":[{"line_number":334,"context_line":"\t\t.usage \u003d \"\u003chost_name\u003e\","},{"line_number":335,"context_line":"\t},"},{"line_number":336,"context_line":"\t{"},{"line_number":337,"context_line":"\t\t.name \u003d \"dap_port\","},{"line_number":338,"context_line":"\t\t.handler \u003d \u0026cmsis_dap_handle_tcp_dap_port,"},{"line_number":339,"context_line":"\t\t.mode \u003d COMMAND_CONFIG,"},{"line_number":340,"context_line":"\t\t.help \u003d \"set the port number to use for DAP (for TCP backend only)\","}],"source_content_type":"text/x-csrc","patch_set":5,"id":"6a07cab3_2203999a","line":337,"in_reply_to":"2137e78d_969cb680","updated":"2025-06-25 10:21:21.000000000","message":"We have few drivers that require to connect to `host:port` or local UNIX socket.\nI want to introduce the generic commands:\n`adapter socket /path/to/unix/socket`\n`adapter socket [host]:port`\nor similar.\nTo deprecate the old commands it could be simpler having the name `port` used, but that\u0027s not mandatory. If you prefer, keep it as is today.\n\nBut what you plan to do with `swo_port` in OpenOCD?\nOpenOCD configures the SWO port of the target to output the traces on one pin and nothing else. User has to connect the pin to the UART of the host or to a UART-to-USB adapter to dump the trace, but the dump is not done by OpenOCD.\nIn your case, the TCP adapter CMSIS-DAP is probably working as UART-to-TCP adapter on the SWO pin. You would need another tool (socat, telnet or nc) to connect to the swo_port. OpenOCD will probably have to send some command to the CMSIS-DAP to configure the UART speed, but should not connect to swo_port.","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"6b2c21cb602eef4fa4124657d2cf5b98a4f8a8bb","unresolved":false,"context_lines":[{"line_number":334,"context_line":"\t\t.usage \u003d \"\u003chost_name\u003e\","},{"line_number":335,"context_line":"\t},"},{"line_number":336,"context_line":"\t{"},{"line_number":337,"context_line":"\t\t.name \u003d \"dap_port\","},{"line_number":338,"context_line":"\t\t.handler \u003d \u0026cmsis_dap_handle_tcp_dap_port,"},{"line_number":339,"context_line":"\t\t.mode \u003d COMMAND_CONFIG,"},{"line_number":340,"context_line":"\t\t.help \u003d \"set the port number to use for DAP (for TCP backend only)\","}],"source_content_type":"text/x-csrc","patch_set":5,"id":"6799b2e3_edab28d8","line":337,"in_reply_to":"6a07cab3_2203999a","updated":"2025-06-29 06:21:45.000000000","message":"Changed it to \u0027port\u0027.  Deferring the SWO work until later.","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":true,"context_lines":[{"line_number":334,"context_line":"\t\t.usage \u003d \"\u003chost_name\u003e\","},{"line_number":335,"context_line":"\t},"},{"line_number":336,"context_line":"\t{"},{"line_number":337,"context_line":"\t\t.name \u003d \"dap_port\","},{"line_number":338,"context_line":"\t\t.handler \u003d \u0026cmsis_dap_handle_tcp_dap_port,"},{"line_number":339,"context_line":"\t\t.mode \u003d COMMAND_CONFIG,"},{"line_number":340,"context_line":"\t\t.help \u003d \"set the port number to use for DAP (for TCP backend only)\","}],"source_content_type":"text/x-csrc","patch_set":5,"id":"2137e78d_969cb680","line":337,"in_reply_to":"f17b361a_cbc7637b","updated":"2025-06-24 06:39:54.000000000","message":"The intention is that SWO trace might be added in the future using a different port, hence I would call them dap_port and swo_port.  If you don\u0027t like that, I will rename it \u0027port\u0027.","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"ea137bfb88e783990e237e78192aaa7f369cb9e0","unresolved":true,"context_lines":[{"line_number":14,"context_line":" *\t   mike brown \u003cmike@theshedworks.org.uk\u003e\t\t\t\t\t\t\t   *"},{"line_number":15,"context_line":" *\t   Spencer Oliver \u003cspen@spen-soft.co.uk\u003e\t\t\t\t\t\t\t   *"},{"line_number":16,"context_line":" *\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   *"},{"line_number":17,"context_line":" *\t Example usage:\t\t\t\t\t\t\t\t\t\t\t\t\t\t   *"},{"line_number":18,"context_line":" *\t   adapter driver cmsis-dap\t\t\t\t\t\t\t\t\t\t\t   *"},{"line_number":19,"context_line":" *\t   cmsis-dap backend tcp\t\t\t\t\t\t\t\t\t\t\t   *"},{"line_number":20,"context_line":" *\t   cmsis-dap tcp host 192.168.1.4\t\t\t\t\t\t\t\t\t   *"}],"source_content_type":"text/x-csrc","patch_set":14,"id":"4fc05636_67ce0322","line":17,"updated":"2025-08-12 11:51:53.000000000","message":"Please move the example usage in the documentation.","commit_id":"6e4fef90a09c700ad49bccc222440da8534c89dc"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"62ac0a8a4bb82d2d08c23a97067ea5339a2af7d2","unresolved":false,"context_lines":[{"line_number":14,"context_line":" *\t   mike brown \u003cmike@theshedworks.org.uk\u003e\t\t\t\t\t\t\t   *"},{"line_number":15,"context_line":" *\t   Spencer Oliver \u003cspen@spen-soft.co.uk\u003e\t\t\t\t\t\t\t   *"},{"line_number":16,"context_line":" *\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   *"},{"line_number":17,"context_line":" *\t Example usage:\t\t\t\t\t\t\t\t\t\t\t\t\t\t   *"},{"line_number":18,"context_line":" *\t   adapter driver cmsis-dap\t\t\t\t\t\t\t\t\t\t\t   *"},{"line_number":19,"context_line":" *\t   cmsis-dap backend tcp\t\t\t\t\t\t\t\t\t\t\t   *"},{"line_number":20,"context_line":" *\t   cmsis-dap tcp host 192.168.1.4\t\t\t\t\t\t\t\t\t   *"}],"source_content_type":"text/x-csrc","patch_set":14,"id":"9694b070_54a30f88","line":17,"in_reply_to":"4fc05636_67ce0322","updated":"2025-08-12 13:21:47.000000000","message":"Done. Updated doc/openocd.texi.","commit_id":"6e4fef90a09c700ad49bccc222440da8534c89dc"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"0acec3e47510a0a1fda3644a76a33669043e5ead","unresolved":true,"context_lines":[{"line_number":368,"context_line":"\tif (cmsis_dap_tcp_port !\u003d cmsis_dap_tcp_port_default)"},{"line_number":369,"context_line":"\t\tfree(cmsis_dap_tcp_port);"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"\tcmsis_dap_tcp_port \u003d strdup(CMD_ARGV[0]);"},{"line_number":372,"context_line":"\tif (!cmsis_dap_tcp_port) {"},{"line_number":373,"context_line":"\t\tLOG_ERROR(\"CMSIS-DAP: out of memory\");"},{"line_number":374,"context_line":"\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":21,"id":"ac935d36_fba02c51","line":371,"range":{"start_line":371,"start_character":22,"end_line":371,"end_character":41},"updated":"2025-09-08 16:44:18.000000000","message":"The allocated mem is not freed at exit","commit_id":"fcff4b712c53a6169f0f96dd63f0adb1b12a1789"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"ccf9934adbed1dacb60106594cec9e9aad2cb3fc","unresolved":false,"context_lines":[{"line_number":368,"context_line":"\tif (cmsis_dap_tcp_port !\u003d cmsis_dap_tcp_port_default)"},{"line_number":369,"context_line":"\t\tfree(cmsis_dap_tcp_port);"},{"line_number":370,"context_line":""},{"line_number":371,"context_line":"\tcmsis_dap_tcp_port \u003d strdup(CMD_ARGV[0]);"},{"line_number":372,"context_line":"\tif (!cmsis_dap_tcp_port) {"},{"line_number":373,"context_line":"\t\tLOG_ERROR(\"CMSIS-DAP: out of memory\");"},{"line_number":374,"context_line":"\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":21,"id":"8c2a574f_713cc523","line":371,"range":{"start_line":371,"start_character":22,"end_line":371,"end_character":41},"in_reply_to":"ac935d36_fba02c51","updated":"2025-09-25 14:07:17.000000000","message":"Ack","commit_id":"fcff4b712c53a6169f0f96dd63f0adb1b12a1789"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"0acec3e47510a0a1fda3644a76a33669043e5ead","unresolved":true,"context_lines":[{"line_number":382,"context_line":"\t\treturn ERROR_COMMAND_SYNTAX_ERROR;"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"\tfree(cmsis_dap_tcp_host);"},{"line_number":385,"context_line":"\tcmsis_dap_tcp_host \u003d strdup(CMD_ARGV[0]);"},{"line_number":386,"context_line":"\tif (!cmsis_dap_tcp_host) {"},{"line_number":387,"context_line":"\t\tLOG_ERROR(\"CMSIS-DAP: out of memory\");"},{"line_number":388,"context_line":"\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":21,"id":"052ad3b9_1f467aca","line":385,"range":{"start_line":385,"start_character":22,"end_line":385,"end_character":28},"updated":"2025-09-08 16:44:18.000000000","message":"As above","commit_id":"fcff4b712c53a6169f0f96dd63f0adb1b12a1789"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"ccf9934adbed1dacb60106594cec9e9aad2cb3fc","unresolved":false,"context_lines":[{"line_number":382,"context_line":"\t\treturn ERROR_COMMAND_SYNTAX_ERROR;"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":"\tfree(cmsis_dap_tcp_host);"},{"line_number":385,"context_line":"\tcmsis_dap_tcp_host \u003d strdup(CMD_ARGV[0]);"},{"line_number":386,"context_line":"\tif (!cmsis_dap_tcp_host) {"},{"line_number":387,"context_line":"\t\tLOG_ERROR(\"CMSIS-DAP: out of memory\");"},{"line_number":388,"context_line":"\t\treturn ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":21,"id":"8a7b6a2f_739aa64a","line":385,"range":{"start_line":385,"start_character":22,"end_line":385,"end_character":28},"in_reply_to":"052ad3b9_1f467aca","updated":"2025-09-25 14:07:17.000000000","message":"Ack","commit_id":"fcff4b712c53a6169f0f96dd63f0adb1b12a1789"}],"tcl/interface/cmsis-dap-tcp.cfg":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f3830ae7e98f23e5f76827525f99bcbc5b436f2d","unresolved":true,"context_lines":[{"line_number":9,"context_line":"adapter driver cmsis-dap"},{"line_number":10,"context_line":"cmsis-dap backend tcp"},{"line_number":11,"context_line":"cmsis-dap tcp host 192.168.1.4"},{"line_number":12,"context_line":"cmsis-dap tcp dap_port 4441"}],"source_content_type":"text/x-ttcn-cfg","patch_set":5,"id":"2657db2f_1487857a","line":12,"updated":"2025-06-22 12:57:06.000000000","message":"following my proposal, this would become\n`cmsis-dap tcp port 4441`","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"458e3954e66751efb33a9d6a8765372eb6c567ba","unresolved":true,"context_lines":[{"line_number":9,"context_line":"adapter driver cmsis-dap"},{"line_number":10,"context_line":"cmsis-dap backend tcp"},{"line_number":11,"context_line":"cmsis-dap tcp host 192.168.1.4"},{"line_number":12,"context_line":"cmsis-dap tcp dap_port 4441"}],"source_content_type":"text/x-ttcn-cfg","patch_set":5,"id":"60d8f0d6_f0b3e7ad","line":12,"in_reply_to":"2657db2f_1487857a","updated":"2025-06-24 06:39:54.000000000","message":"See my comment above about dap_port and swo_port.","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"6b2c21cb602eef4fa4124657d2cf5b98a4f8a8bb","unresolved":false,"context_lines":[{"line_number":9,"context_line":"adapter driver cmsis-dap"},{"line_number":10,"context_line":"cmsis-dap backend tcp"},{"line_number":11,"context_line":"cmsis-dap tcp host 192.168.1.4"},{"line_number":12,"context_line":"cmsis-dap tcp dap_port 4441"}],"source_content_type":"text/x-ttcn-cfg","patch_set":5,"id":"5cc5429d_9b9821f2","line":12,"in_reply_to":"60d8f0d6_f0b3e7ad","updated":"2025-06-29 06:21:45.000000000","message":"Done","commit_id":"3c2fd86dd47d5286303642c83290f28222ec9172"},{"author":{"_account_id":1000853,"name":"Marc Schink","display_name":"Marc Schink","email":"dev@zapb.de","username":"zapb"},"change_message_id":"e4a81d3d00c391a7acfc23ae738ecad44905cfde","unresolved":true,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"adapter driver cmsis-dap"},{"line_number":10,"context_line":"cmsis-dap backend tcp"},{"line_number":11,"context_line":"cmsis-dap tcp host 192.168.1.4"},{"line_number":12,"context_line":"cmsis-dap tcp port 4441"}],"source_content_type":"text/x-ttcn-cfg","patch_set":17,"id":"4595842c_2cbdc635","line":11,"updated":"2025-08-18 06:28:32.000000000","message":"I don\u0027t think it makes sense to have a fixed host here.\nWe can also remove the port because it\u0027s the default anyway, no?","commit_id":"36b58ef691ff0b6fcb0d980d12496cdd1cfb01d9"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"3d2e197806da9d0e64b4195701d4e356bde86e79","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"adapter driver cmsis-dap"},{"line_number":10,"context_line":"cmsis-dap backend tcp"},{"line_number":11,"context_line":"cmsis-dap tcp host 192.168.1.4"},{"line_number":12,"context_line":"cmsis-dap tcp port 4441"}],"source_content_type":"text/x-ttcn-cfg","patch_set":17,"id":"9336c221_4281a0f1","line":11,"in_reply_to":"4595842c_2cbdc635","updated":"2025-08-18 07:46:11.000000000","message":"Good point. I wanted to include these as examples, similar to what is done in other .cfg files. I commented these two lines and added some descriptive text.","commit_id":"36b58ef691ff0b6fcb0d980d12496cdd1cfb01d9"}]}
