)]}'
{"id":"openocd~master~Ide856b11d006ca01381c7c57e4118eadeb50fc65","project":"openocd","branch":"master","attention_set":{},"removed_from_attention_set":{"1002195":{"account":{"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"},"last_update":"2026-09-16 19:47:02.000000000","reason":"Change was submitted"},"1000021":{"account":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"last_update":"2026-09-16 19:47:02.000000000","reason":"Change was submitted"},"1000687":{"account":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"last_update":"2026-09-07 19:57:53.000000000","reason":"\u003cGERRIT_ACCOUNT_1000687\u003e replied on the change","reason_account":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"}},"1002556":{"account":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"last_update":"2026-09-16 19:47:02.000000000","reason":"Change was submitted"}},"hashtags":[],"change_id":"Ide856b11d006ca01381c7c57e4118eadeb50fc65","subject":"drivers/ch347: support SRST in SWD mode","status":"MERGED","created":"2026-08-11 03:54:25.000000000","updated":"2026-09-16 19:47:02.000000000","submitted":"2026-09-16 19:47:02.000000000","submitter":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"total_comment_count":21,"unresolved_comment_count":1,"has_review_started":true,"submission_id":"9700","meta_rev_id":"6d12757266efe82d6e0e8028b8e269cfac981715","_number":9700,"owner":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"actions":{},"labels":{"Verified":{"approved":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"all":[{"value":0,"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"},{"value":0,"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},{"tag":"autogenerated:gerrit:merged","value":1,"date":"2026-09-16 19:47:02.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}],"values":{"-1":"Fails"," 0":"No score","+1":"Verified"},"description":"","default_value":0},"Code-Review":{"approved":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"all":[{"tag":"autogenerated:gerrit:merged","value":1,"date":"2026-09-16 19:47:02.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"},{"tag":"autogenerated:gerrit:merged","value":2,"date":"2026-09-16 19:47:02.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},{"value":0,"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}],"values":{"-2":"This shall not be merged","-1":"I would prefer this is not merged as is"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me, approved"},"description":"","default_value":0}},"removable_reviewers":[{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"}],"reviewers":{"REVIEWER":[{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},{"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"}],"CC":[{"_account_id":1002563,"name":"lynch","display_name":"lynch","email":"lynch.wy@gmail.com","username":"lynchwy"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2026-08-11 03:54:38.000000000","updated_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"reviewer":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"state":"CC"},{"updated":"2026-08-11 04:11:28.000000000","updated_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"reviewer":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"state":"REVIEWER"},{"updated":"2026-08-12 19:22:46.000000000","updated_by":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"reviewer":{"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"},"state":"REVIEWER"},{"updated":"2026-08-12 19:22:46.000000000","updated_by":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"reviewer":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"state":"REVIEWER"},{"updated":"2026-08-12 19:22:46.000000000","updated_by":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"reviewer":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"state":"REVIEWER"},{"updated":"2026-08-31 11:11:55.000000000","updated_by":{"_account_id":1002563,"name":"lynch","display_name":"lynch","email":"lynch.wy@gmail.com","username":"lynchwy"},"reviewer":{"_account_id":1002563,"name":"lynch","display_name":"lynch","email":"lynch.wy@gmail.com","username":"lynchwy"},"state":"CC"}],"messages":[{"id":"7bbad29a3c4fe45df5b252b09ebccc12d1538534","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"real_author":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"date":"2026-08-11 03:54:25.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"b4553c32bc6a532c831df92eb8cfe7366f0b90a5","tag":"autogenerated:jenkins-gerrit-trigger","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2026-08-11 04:11:28.000000000","message":"Patch Set 1: Verified+1\n\nBuild Successful \n\nhttps://build.openocd.org/job/openocd-gerrit/23737/ : SUCCESS\n\nhttps://build.openocd.org/job/openocd-gerrit-build/22830/ : SUCCESS","accounts_in_message":[],"_revision_number":1},{"id":"d63df5150aa577362e85ec05a435ad8bb30c6a57","author":{"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"},"real_author":{"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"},"date":"2026-08-24 19:24:12.000000000","message":"Patch Set 1:\n\n(3 comments)","accounts_in_message":[],"_revision_number":1},{"id":"bd49d0e3ace14e0e56d2de26fc5e9cf6ade2db7a","author":{"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"},"real_author":{"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"},"date":"2026-08-24 19:49:14.000000000","message":"Patch Set 1:\n\n(1 comment)","accounts_in_message":[],"_revision_number":1},{"id":"b011d750f3ce71a73c58685cd0485a39528b0892","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"real_author":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"date":"2026-08-30 10:57:27.000000000","message":"Uploaded patch set 2.\n\nOutdated Votes:\n* Verified+1 (copy condition: \"changekind:NO_CHANGE\")\n","accounts_in_message":[],"_revision_number":2},{"id":"e5e5c317e0ea30de52b7e111d6c9b02d3b5eade7","tag":"autogenerated:jenkins-gerrit-trigger","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2026-08-30 11:14:30.000000000","message":"Patch Set 2: Verified+1\n\nBuild Successful \n\nhttps://build.openocd.org/job/openocd-gerrit/23952/ : SUCCESS\n\nhttps://build.openocd.org/job/openocd-gerrit-build/23036/ : SUCCESS","accounts_in_message":[],"_revision_number":2},{"id":"fe90228e1c1a4bf48375aa7a4d6488f4f7cfcfa2","author":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"real_author":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"date":"2026-08-30 11:32:35.000000000","message":"Patch Set 2:\n\n(3 comments)\n\nPatch set 2 addresses both inline comments:\n\n- ch347_gpio_cmd() takes an unsigned int and checks the range.\n- ch347_configure_srst_gpio() refuses a GPIO already used as the\n  activity LED, for the default pin as well as an explicit one.\n- The commit message now records both chips.\n\nTested on a CH347T in mode 3 and on a CH347F, both with an S32K118 whose\nRESET_b is wired to the TRST pin:\n\n- SWD: \u0027reset halt\u0027 5/5, \u0027reset run\u0027 leaves the target running.\n- Sweeping all eight GPIO\u0027s against the MDM-AP SYSRES bit shows that\n  only the default GPIO reaches the reset line: GPIO5 on the CH347T,\n  GPIO3 on the CH347F.\n- \u0027adapter gpio srst 5\u0027 works; \u0027adapter gpio srst 0\u0027 is rejected at\n  config time and SRST stays disabled.\n- \u0027adapter gpio led 5\u0027 now disables SRST instead of sharing the pin.\n- JTAG still reads the IDCODE 0x0993001d, TRST works and asserting SRST\n  is still refused.","accounts_in_message":[],"_revision_number":2},{"id":"04c1f9d87f2cda05b034cfc6e25580bcc4aceea6","author":{"_account_id":1002563,"name":"lynch","display_name":"lynch","email":"lynch.wy@gmail.com","username":"lynchwy"},"real_author":{"_account_id":1002563,"name":"lynch","display_name":"lynch","email":"lynch.wy@gmail.com","username":"lynchwy"},"date":"2026-08-31 11:11:55.000000000","message":"Patch Set 2:\n\n(1 comment)","accounts_in_message":[],"_revision_number":2},{"id":"2768b8bb469869694ef3f0bafb308527301bf4e4","author":{"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"},"real_author":{"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"},"date":"2026-08-31 19:57:58.000000000","message":"Patch Set 2: Code-Review+1\n\n(1 comment)","accounts_in_message":[],"_revision_number":2},{"id":"4ce7dd7d4eb19e699e223c5bed16e8483acd38d7","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2026-09-01 09:54:35.000000000","message":"Patch Set 2:\n\n(1 comment)","accounts_in_message":[],"_revision_number":2},{"id":"93f1b29ddaacc73c20360db641f7a72f31296c28","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2026-09-01 11:28:18.000000000","message":"Patch Set 2:\n\n(1 comment)","accounts_in_message":[],"_revision_number":2},{"id":"973b7ed8757ff9ed55a5c02971914bf6e0e69b7d","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2026-09-01 14:36:02.000000000","message":"Patch Set 2:\n\n(1 comment)","accounts_in_message":[],"_revision_number":2},{"id":"872f5ea2467ecee7408691102400c9d81277002a","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"real_author":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"date":"2026-09-01 17:43:24.000000000","message":"Uploaded patch set 3.\n\nOutdated Votes:\n* Code-Review+1 (copy condition: \"changekind:NO_CHANGE OR is:MIN\")\n* Verified+1 (copy condition: \"changekind:NO_CHANGE\")\n","accounts_in_message":[],"_revision_number":3},{"id":"401747b922812b329677d25620ef9dd12f87d6eb","author":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"real_author":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"date":"2026-09-01 17:52:22.000000000","message":"Patch Set 3:\n\n(3 comments)\n\nPatch set 3 adds the open drain drive mode for SRST that Tomas asked for.\n\n- ch347_reset() honours adapter_config.gpios[ADAPTER_GPIO_IDX_SRST].drive\n  through a new ch347_gpio_drive_value() helper. Open drain, which is the\n  default for SRST, releases the pin instead of driving the inactive\n  level.\n- GPIO_SET_INPUT moved into this change, because it is now first used\n  here rather than in the follow up \u0027ch347 gpio\u0027 change.\n- Documented that the reset line needs a pull-up in open drain mode, and\n  that \u0027reset_config srst_push_pull\u0027 selects the previous behaviour.\n- The commit message records the new behaviour and the extra testing.\n\nRetested on a CH347T in mode 3 with an S32K118: \u0027reset halt\u0027 5/5 and\n\u0027reset run\u0027 leaves the target running in both drive modes, the readback\nof the GPIO command confirms the pin is released on deassert in open\ndrain mode and driven high in push-pull mode, the guards for an unusable\nGPIO and for a collision with the activity LED still fire, and JTAG still\nreads the IDCODE 0x0993001d with TRST working and SRST refused.\n\nTomas, I answered your question about the GPIO mask inline. Short\nversion: the mask is unchanged from the original driver, I measured what\neach GPIO does on my CH347T, and I would rather revisit the mask itself\nin a separate change.\n\nMatthias, your Code-Review+1 was on patch set 2; the only change since\nthen is the drive mode handling.\n\ninit_state and exit_state are left for follow up changes.","accounts_in_message":[],"_revision_number":3},{"id":"a2db21796499d2157bb83425e0c504de086a465d","tag":"autogenerated:jenkins-gerrit-trigger","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2026-09-01 18:01:45.000000000","message":"Patch Set 3: Verified+1\n\nBuild Successful \n\nhttps://build.openocd.org/job/openocd-gerrit/23996/ : SUCCESS\n\nhttps://build.openocd.org/job/openocd-gerrit-build/23078/ : SUCCESS","accounts_in_message":[],"_revision_number":3},{"id":"dbb4c0dee9adeaadb78b57d07bdf900a17a1d692","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2026-09-01 20:09:51.000000000","message":"Patch Set 3: Code-Review+1\n\n(2 comments)","accounts_in_message":[],"_revision_number":3},{"id":"65d7a08878534ba03c6813c0126c571304c9ef2f","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2026-09-01 20:23:54.000000000","message":"Patch Set 3:\n\n(1 comment)","accounts_in_message":[],"_revision_number":3},{"id":"1df7f499aae79a91e1792001a2e2d5577142f912","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2026-09-07 13:35:29.000000000","message":"Patch Set 3:\n\n(1 comment)","accounts_in_message":[],"_revision_number":3},{"id":"b18af969acb1c01d596523c889c4d705979ea95b","author":{"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"},"real_author":{"_account_id":1002195,"name":"Matthias Jentsch","display_name":"EasyDevKits","email":"info@easydevkits.com","username":"EasyDevKits"},"date":"2026-09-07 19:42:00.000000000","message":"Patch Set 3: Code-Review+1\n\n(1 comment)","accounts_in_message":[],"_revision_number":3},{"id":"555af0dec35dea9d4d1c8b9e4d5f5ef2a4421adc","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2026-09-07 19:57:53.000000000","message":"Patch Set 3: Code-Review+2\n\n(1 comment)","accounts_in_message":[],"_revision_number":3},{"id":"6d12757266efe82d6e0e8028b8e269cfac981715","tag":"autogenerated:gerrit:merged","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2026-09-16 19:47:02.000000000","message":"Change has been successfully cherry-picked as a6df9b87d55b1c1641259a97693f3da0f230f151","accounts_in_message":[],"_revision_number":4}],"current_revision":"a6df9b87d55b1c1641259a97693f3da0f230f151","revisions":{"a6df9b87d55b1c1641259a97693f3da0f230f151":{"kind":"REWORK","_number":4,"created":"2026-09-16 19:47:02.000000000","uploader":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"ref":"refs/changes/00/9700/4","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/00/9700/4","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/4 \u0026\u0026 git checkout -b change-9700 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/4 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/4 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/4 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/00/9700/4","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/4 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"1f3f5831d25f58dbeed8de4ad6627c75e774bd2c","subject":"jtag/drivers/cmsis_dap: fix possible buffer overflow"}],"author":{"name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","date":"2026-08-10 18:55:22.000000000","tz":180},"committer":{"name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","date":"2026-09-16 19:47:02.000000000","tz":0},"subject":"drivers/ch347: support SRST in SWD mode","message":"drivers/ch347: support SRST in SWD mode\n\nIn SWD mode the TRST pin is not needed as a JTAG signal, so it can be\ndriven through the GPIO command (0xCC) to provide SRST. The GPIO command\nis a \"single\" command that is flushed on its own, so it works while the\nchip is in SWD mode.\n\nTRST is Pin9 on both chips, but has a different GPIO number: GPIO5 on the\nCH347T and GPIO3 on the CH347F. Use that pin by default and allow to\nselect another one with \u0027adapter gpio srst\u0027. Refuse a GPIO that is already\ntaken by the activity LED, because the LED activity would toggle the reset\nline.\n\nHonour the drive mode that \u0027reset_config\u0027 keeps in the GPIO configuration.\nSRST defaults to open drain, which the chip cannot do by itself, so\nemulate it by switching the pin to an input instead of driving it to the\ninactive level. The reset line then needs a pull-up; \u0027reset_config\nsrst_push_pull\u0027 selects the previous behaviour of driving both levels.\n\nDon\u0027t verify the readback of the GPIO command for SRST. Bit 6 of the\nresponse is the measured pin level, not the state of the output latch, so\nit legitimately differs from the requested level while the target drives\nthe reset line itself, e.g. during a watchdog reset loop.\n\nThe mask of the usable GPIO\u0027s was determined on the CH347T and does not\nhold for the CH347F, where the GPIO\u0027s share their pins with the interface\nsignals: GPIO4 to GPIO7 are TCK, TDO, TDI and TMS, and TCK and TMS are\nalso SWDCLK and SWDIO. Selecting one of them would break the running\ntransport, so use a separate mask per chip variant. This also applies to\n\u0027adapter gpio led\u0027.\n\nTested on a CH347T in mode 3 and on a CH347F, both with an S32K118 whose\nRESET_b is wired to the TRST pin. Over SWD \u0027reset halt\u0027 works reliably on\nboth chips, driving the default GPIO: GPIO5 on the CH347T and GPIO3 on the\nCH347F. A sweep of all GPIO\u0027s confirmed that no other GPIO reaches the\nreset line. Both drive modes were checked against the readback of the\nGPIO command: deasserting SRST leaves the pin an input in open drain mode\nand drives it high in push-pull mode, and the target leaves reset in both\ncases. JTAG is unaffected, the scan chain interrogation still reads the\nIDCODE, TRST still works and asserting SRST is still refused.\n\nChange-Id: Ide856b11d006ca01381c7c57e4118eadeb50fc65\nSigned-off-by: Paulius Zaleckas \u003cpaulius.zaleckas@gmail.com\u003e\nReviewed-on: https://review.openocd.org/c/openocd/+/9700\nTested-by: jenkins\nReviewed-by: Matthias Jentsch \u003cinfo@easydevkits.com\u003e\nReviewed-by: Tomas Vanek \u003ctomas.vanek.oocd@gmail.com\u003e\n"}},"ec7c06bf5f6d9378ca467977ab2c2f10b7dcd484":{"kind":"REWORK","_number":2,"created":"2026-08-30 10:57:27.000000000","uploader":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"ref":"refs/changes/00/9700/2","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/00/9700/2","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/2 \u0026\u0026 git checkout -b change-9700 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/00/9700/2","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/2 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"da3920b0a52dc2d394afb222c688dac7e57acc1b","subject":"target/riscv: add hart index bounds checking"}],"author":{"name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","date":"2026-08-10 18:55:22.000000000","tz":180},"committer":{"name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","date":"2026-08-25 10:35:51.000000000","tz":180},"subject":"drivers/ch347: support SRST in SWD mode","message":"drivers/ch347: support SRST in SWD mode\n\nIn SWD mode the TRST pin is not needed as a JTAG signal, so it can be\ndriven through the GPIO command (0xCC) to provide SRST. The GPIO command\nis a \"single\" command that is flushed on its own, so it works while the\nchip is in SWD mode.\n\nTRST is Pin9 on both chips, but has a different GPIO number: GPIO5 on the\nCH347T and GPIO3 on the CH347F. Use that pin by default and allow to\nselect another one with \u0027adapter gpio srst\u0027. Refuse a GPIO that is already\ntaken by the activity LED, because the LED activity would toggle the reset\nline.\n\nDon\u0027t verify the readback of the GPIO command for SRST. Bit 6 of the\nresponse is the measured pin level, not the state of the output latch, so\nit legitimately differs from the requested level while the target drives\nthe reset line itself, e.g. during a watchdog reset loop.\n\nThe mask of the usable GPIO\u0027s was determined on the CH347T and does not\nhold for the CH347F, where the GPIO\u0027s share their pins with the interface\nsignals: GPIO4 to GPIO7 are TCK, TDO, TDI and TMS, and TCK and TMS are\nalso SWDCLK and SWDIO. Selecting one of them would break the running\ntransport, so use a separate mask per chip variant. This also applies to\n\u0027adapter gpio led\u0027.\n\nTested on a CH347T in mode 3 and on a CH347F, both with an S32K118 whose\nRESET_b is wired to the TRST pin. Over SWD \u0027reset halt\u0027 works reliably on\nboth chips, driving the default GPIO: GPIO5 on the CH347T and GPIO3 on the\nCH347F. A sweep of all GPIO\u0027s confirmed that no other GPIO reaches the\nreset line. JTAG is unaffected, the scan chain interrogation still reads\nthe IDCODE, TRST still works and asserting SRST is still refused.\n\nChange-Id: Ide856b11d006ca01381c7c57e4118eadeb50fc65\nSigned-off-by: Paulius Zaleckas \u003cpaulius.zaleckas@gmail.com\u003e\n"}},"864445c384142663fa12d45d9195d69cfbd9d1a9":{"kind":"REWORK","_number":3,"created":"2026-09-01 17:43:24.000000000","uploader":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"ref":"refs/changes/00/9700/3","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/00/9700/3","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/3 \u0026\u0026 git checkout -b change-9700 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/3 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/3 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/3 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/00/9700/3","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/3 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"da3920b0a52dc2d394afb222c688dac7e57acc1b","subject":"target/riscv: add hart index bounds checking"}],"author":{"name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","date":"2026-08-10 18:55:22.000000000","tz":180},"committer":{"name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","date":"2026-09-01 12:03:08.000000000","tz":180},"subject":"drivers/ch347: support SRST in SWD mode","message":"drivers/ch347: support SRST in SWD mode\n\nIn SWD mode the TRST pin is not needed as a JTAG signal, so it can be\ndriven through the GPIO command (0xCC) to provide SRST. The GPIO command\nis a \"single\" command that is flushed on its own, so it works while the\nchip is in SWD mode.\n\nTRST is Pin9 on both chips, but has a different GPIO number: GPIO5 on the\nCH347T and GPIO3 on the CH347F. Use that pin by default and allow to\nselect another one with \u0027adapter gpio srst\u0027. Refuse a GPIO that is already\ntaken by the activity LED, because the LED activity would toggle the reset\nline.\n\nHonour the drive mode that \u0027reset_config\u0027 keeps in the GPIO configuration.\nSRST defaults to open drain, which the chip cannot do by itself, so\nemulate it by switching the pin to an input instead of driving it to the\ninactive level. The reset line then needs a pull-up; \u0027reset_config\nsrst_push_pull\u0027 selects the previous behaviour of driving both levels.\n\nDon\u0027t verify the readback of the GPIO command for SRST. Bit 6 of the\nresponse is the measured pin level, not the state of the output latch, so\nit legitimately differs from the requested level while the target drives\nthe reset line itself, e.g. during a watchdog reset loop.\n\nThe mask of the usable GPIO\u0027s was determined on the CH347T and does not\nhold for the CH347F, where the GPIO\u0027s share their pins with the interface\nsignals: GPIO4 to GPIO7 are TCK, TDO, TDI and TMS, and TCK and TMS are\nalso SWDCLK and SWDIO. Selecting one of them would break the running\ntransport, so use a separate mask per chip variant. This also applies to\n\u0027adapter gpio led\u0027.\n\nTested on a CH347T in mode 3 and on a CH347F, both with an S32K118 whose\nRESET_b is wired to the TRST pin. Over SWD \u0027reset halt\u0027 works reliably on\nboth chips, driving the default GPIO: GPIO5 on the CH347T and GPIO3 on the\nCH347F. A sweep of all GPIO\u0027s confirmed that no other GPIO reaches the\nreset line. Both drive modes were checked against the readback of the\nGPIO command: deasserting SRST leaves the pin an input in open drain mode\nand drives it high in push-pull mode, and the target leaves reset in both\ncases. JTAG is unaffected, the scan chain interrogation still reads the\nIDCODE, TRST still works and asserting SRST is still refused.\n\nChange-Id: Ide856b11d006ca01381c7c57e4118eadeb50fc65\nSigned-off-by: Paulius Zaleckas \u003cpaulius.zaleckas@gmail.com\u003e\n"}},"5cc7c72e9ac7dff8e34b890fc0f8a44ecd5c2ada":{"kind":"REWORK","_number":1,"created":"2026-08-11 03:54:25.000000000","uploader":{"_account_id":1002556,"name":"Paulius Zaleckas","display_name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","username":"pauliusz"},"ref":"refs/changes/00/9700/1","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/00/9700/1","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/1 \u0026\u0026 git checkout -b change-9700 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/00/9700/1","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/00/9700/1 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"da3920b0a52dc2d394afb222c688dac7e57acc1b","subject":"target/riscv: add hart index bounds checking"}],"author":{"name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","date":"2026-08-10 18:55:22.000000000","tz":180},"committer":{"name":"Paulius Zaleckas","email":"paulius.zaleckas@gmail.com","date":"2026-08-10 19:33:35.000000000","tz":180},"subject":"drivers/ch347: support SRST in SWD mode","message":"drivers/ch347: support SRST in SWD mode\n\nIn SWD mode the TRST pin is not needed as a JTAG signal, so it can be\ndriven through the GPIO command (0xCC) to provide SRST. The GPIO command\nis a \"single\" command that is flushed on its own, so it works while the\nchip is in SWD mode.\n\nTRST is Pin9 on both chips, but has a different GPIO number: GPIO5 on the\nCH347T and GPIO3 on the CH347F. Use that pin by default and allow to\nselect another one with \u0027adapter gpio srst\u0027.\n\nDon\u0027t verify the readback of the GPIO command for SRST. Bit 6 of the\nresponse is the measured pin level, not the state of the output latch, so\nit legitimately differs from the requested level while the target drives\nthe reset line itself, e.g. during a watchdog reset loop.\n\nThe mask of the usable GPIO\u0027s was determined on the CH347T and does not\nhold for the CH347F, where the GPIO\u0027s share their pins with the interface\nsignals: GPIO4 to GPIO7 are TCK, TDO, TDI and TMS, and TCK and TMS are\nalso SWDCLK and SWDIO. Selecting one of them would break the running\ntransport, so use a separate mask per chip variant. This also applies to\n\u0027adapter gpio led\u0027.\n\nTested on a CH347F with an S32K118 whose RESET_b is wired to the TRST pin:\n\u0027reset halt\u0027 over SWD works reliably. JTAG is unaffected, the scan chain\ninterrogation still reads the IDCODE, TRST still works and asserting SRST\nis still refused.\n\nChange-Id: Ide856b11d006ca01381c7c57e4118eadeb50fc65\nSigned-off-by: Paulius Zaleckas \u003cpaulius.zaleckas@gmail.com\u003e\n"}}},"requirements":[],"submit_records":[{"rule_name":"gerrit~DefaultSubmitRule","status":"CLOSED","labels":[{"label":"Verified","status":"OK","applied_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}},{"label":"Code-Review","status":"OK","applied_by":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"}}]}],"submit_requirements":[{"name":"Verified","status":"SATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"label:Verified\u003dMAX -label:Verified\u003dMIN","fulfilled":true,"status":"PASS","passing_atoms":["label:Verified\u003dMAX","-label:Verified\u003dMIN"],"failing_atoms":[]}},{"name":"Code-Review","status":"SATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"label:Code-Review\u003dMAX -label:Code-Review\u003dMIN","fulfilled":true,"status":"PASS","passing_atoms":["label:Code-Review\u003dMAX","-label:Code-Review\u003dMIN"],"failing_atoms":[]}}]}
