{"action":"created","comment":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/comments/177555224","pull_request_review_id":107447467,"id":177555224,"diff_hunk":"@@ -0,0 +1,53 @@\n+# Copyright (c) 2018 Roman Tataurov <diytronic@yandex.ru>\n+#\n+# SPDX-License-Identifier: Apache-2.0\n+\n+'''Runner for flashing with Black Magick Probe.'''\n+\n+# https://github.com/blacksphere/blackmagic/wiki\n+\n+import sys\n+\n+from .core import ZephyrBinaryRunner, RunnerCaps\n+\n+class BlackMagickRunner(ZephyrBinaryRunner):\n+    '''Runner front-end for Black Magick probe.'''\n+\n+    def __init__(self, gdb, kernel_elf, gdb_port, debug=False):\n+        super(BlackMagickRunner, self).__init__(debug=debug)\n+        self.gdb = gdb\n+        self.kernel_elf = kernel_elf\n+        self.gdb_port = gdb_port\n+\n+    @classmethod\n+    def name(cls):\n+        return 'blackmagick'\n+\n+    @classmethod\n+    def capabilities(cls):\n+        return RunnerCaps(commands={'flash'})\n+\n+    @classmethod\n+    def do_add_parser(cls, parser):\n+        parser.add_argument('--gdb_port', default='/dev/ttyACM0',","path":"scripts/support/runner/blackmagick.py","position":32,"original_position":32,"commit_id":"4aa320b9f2bfb3f6b97f8d18d5bdb488dbf9571b","original_commit_id":"4aa320b9f2bfb3f6b97f8d18d5bdb488dbf9571b","user":{"login":"mbolivar","id":35088,"avatar_url":"https://avatars3.githubusercontent.com/u/35088?v=4","gravatar_id":"","url":"https://api.github.com/users/mbolivar","html_url":"https://github.com/mbolivar","followers_url":"https://api.github.com/users/mbolivar/followers","following_url":"https://api.github.com/users/mbolivar/following{/other_user}","gists_url":"https://api.github.com/users/mbolivar/gists{/gist_id}","starred_url":"https://api.github.com/users/mbolivar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbolivar/subscriptions","organizations_url":"https://api.github.com/users/mbolivar/orgs","repos_url":"https://api.github.com/users/mbolivar/repos","events_url":"https://api.github.com/users/mbolivar/events{/privacy}","received_events_url":"https://api.github.com/users/mbolivar/received_events","type":"User","site_admin":false},"body":"Can you rename this to something like --gdb-serial (with dash instead of _)? The --gdb-port argument is used elsewhere to mean a network port.","created_at":"2018-03-27T20:06:25Z","updated_at":"2018-03-27T20:08:05Z","html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6829#discussion_r177555224","pull_request_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/6829","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/comments/177555224"},"html":{"href":"https://github.com/zephyrproject-rtos/zephyr/pull/6829#discussion_r177555224"},"pull_request":{"href":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/6829"}}},"pull_request":{"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/6829","id":177850048,"html_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6829","diff_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6829.diff","patch_url":"https://github.com/zephyrproject-rtos/zephyr/pull/6829.patch","issue_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6829","number":6829,"state":"open","locked":false,"title":"Black Magick probe runner","user":{"login":"diytronic","id":36968072,"avatar_url":"https://avatars2.githubusercontent.com/u/36968072?v=4","gravatar_id":"","url":"https://api.github.com/users/diytronic","html_url":"https://github.com/diytronic","followers_url":"https://api.github.com/users/diytronic/followers","following_url":"https://api.github.com/users/diytronic/following{/other_user}","gists_url":"https://api.github.com/users/diytronic/gists{/gist_id}","starred_url":"https://api.github.com/users/diytronic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diytronic/subscriptions","organizations_url":"https://api.github.com/users/diytronic/orgs","repos_url":"https://api.github.com/users/diytronic/repos","events_url":"https://api.github.com/users/diytronic/events{/privacy}","received_events_url":"https://api.github.com/users/diytronic/received_events","type":"User","site_admin":false},"body":"Hello!\r\n\r\nLet me introduce code to support Black Magick Probe - in-application debugging tool for embedded microprocessors. More details is here https://github.com/blacksphere/blackmagic/wiki \r\n\r\nI am using it with some of my projects so decided to add runner for it. Now realized only [flashing]( https://github.com/blacksphere/blackmagic/wiki/GDB-Automation), but its possible and planned to add [debugging](https://github.com/blacksphere/blackmagic/wiki/Useful-GDB-commands) feature as well.  \r\n\r\nIn case of nothing plugged in it looks like this\r\n\r\n```\r\n$  ninja flash\r\n[1/70] Generating always_rebuild\r\nBuilding for board stm32_blue_pill\r\n[1/2] Flashing stm32_blue_pill\r\n/dev/ttyACM0: Device or resource busy.\r\n\"monitor\" command not supported by this target.\r\nDon't know how to attach.  Try \"help target\".\r\nYou can't do that when your target is `None'\r\nThe program is not being run.\r\n``` \r\n\r\nIn case of success flashing \r\n\r\n```\r\n$ ninja flash\r\n[1/70] Generating always_rebuild\r\nBuilding for board stm32_blue_pill\r\n[1/2] Flashing stm32_blue_pill\r\nRemote debugging using /dev/ttyACM0\r\nTarget voltage: unknown\r\nAvailable Targets:\r\nNo. Att Driver\r\n 1      STM32F1 medium density\r\nAttaching to Remote target\r\n0x4f480588 in ?? ()\r\nLoading section text, size 0x30e6 lma 0x8000000\r\nLoading section devconfig, size 0x90 lma 0x80030e8\r\nLoading section rodata, size 0x5fc lma 0x8003178\r\nLoading section datas, size 0x20 lma 0x8003774\r\nLoading section initlevel, size 0x90 lma 0x8003794\r\nStart address 0x8001c1c, load size 14370\r\nTransfer rate: 11 KB/sec, 798 bytes/write.\r\n```\r\n\r\nJust kind of proofs it really work :) ","created_at":"2018-03-27T20:04:22Z","updated_at":"2018-03-27T20:08:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7cd1ace5a74c6ce7d9674db0940a213d72e0395e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/6829/commits","review_comments_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/6829/comments","review_comment_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6829/comments","statuses_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/statuses/4aa320b9f2bfb3f6b97f8d18d5bdb488dbf9571b","head":{"label":"diytronic:black_magick_runner","ref":"black_magick_runner","sha":"4aa320b9f2bfb3f6b97f8d18d5bdb488dbf9571b","user":{"login":"diytronic","id":36968072,"avatar_url":"https://avatars2.githubusercontent.com/u/36968072?v=4","gravatar_id":"","url":"https://api.github.com/users/diytronic","html_url":"https://github.com/diytronic","followers_url":"https://api.github.com/users/diytronic/followers","following_url":"https://api.github.com/users/diytronic/following{/other_user}","gists_url":"https://api.github.com/users/diytronic/gists{/gist_id}","starred_url":"https://api.github.com/users/diytronic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diytronic/subscriptions","organizations_url":"https://api.github.com/users/diytronic/orgs","repos_url":"https://api.github.com/users/diytronic/repos","events_url":"https://api.github.com/users/diytronic/events{/privacy}","received_events_url":"https://api.github.com/users/diytronic/received_events","type":"User","site_admin":false},"repo":{"id":123479267,"name":"zephyr","full_name":"diytronic/zephyr","owner":{"login":"diytronic","id":36968072,"avatar_url":"https://avatars2.githubusercontent.com/u/36968072?v=4","gravatar_id":"","url":"https://api.github.com/users/diytronic","html_url":"https://github.com/diytronic","followers_url":"https://api.github.com/users/diytronic/followers","following_url":"https://api.github.com/users/diytronic/following{/other_user}","gists_url":"https://api.github.com/users/diytronic/gists{/gist_id}","starred_url":"https://api.github.com/users/diytronic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diytronic/subscriptions","organizations_url":"https://api.github.com/users/diytronic/orgs","repos_url":"https://api.github.com/users/diytronic/repos","events_url":"https://api.github.com/users/diytronic/events{/privacy}","received_events_url":"https://api.github.com/users/diytronic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/diytronic/zephyr","description":"Primary GIT Repository for the Zephyr Project","fork":true,"url":"https://api.github.com/repos/diytronic/zephyr","forks_url":"https://api.github.com/repos/diytronic/zephyr/forks","keys_url":"https://api.github.com/repos/diytronic/zephyr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diytronic/zephyr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diytronic/zephyr/teams","hooks_url":"https://api.github.com/repos/diytronic/zephyr/hooks","issue_events_url":"https://api.github.com/repos/diytronic/zephyr/issues/events{/number}","events_url":"https://api.github.com/repos/diytronic/zephyr/events","assignees_url":"https://api.github.com/repos/diytronic/zephyr/assignees{/user}","branches_url":"https://api.github.com/repos/diytronic/zephyr/branches{/branch}","tags_url":"https://api.github.com/repos/diytronic/zephyr/tags","blobs_url":"https://api.github.com/repos/diytronic/zephyr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diytronic/zephyr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diytronic/zephyr/git/refs{/sha}","trees_url":"https://api.github.com/repos/diytronic/zephyr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diytronic/zephyr/statuses/{sha}","languages_url":"https://api.github.com/repos/diytronic/zephyr/languages","stargazers_url":"https://api.github.com/repos/diytronic/zephyr/stargazers","contributors_url":"https://api.github.com/repos/diytronic/zephyr/contributors","subscribers_url":"https://api.github.com/repos/diytronic/zephyr/subscribers","subscription_url":"https://api.github.com/repos/diytronic/zephyr/subscription","commits_url":"https://api.github.com/repos/diytronic/zephyr/commits{/sha}","git_commits_url":"https://api.github.com/repos/diytronic/zephyr/git/commits{/sha}","comments_url":"https://api.github.com/repos/diytronic/zephyr/comments{/number}","issue_comment_url":"https://api.github.com/repos/diytronic/zephyr/issues/comments{/number}","contents_url":"https://api.github.com/repos/diytronic/zephyr/contents/{+path}","compare_url":"https://api.github.com/repos/diytronic/zephyr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diytronic/zephyr/merges","archive_url":"https://api.github.com/repos/diytronic/zephyr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diytronic/zephyr/downloads","issues_url":"https://api.github.com/repos/diytronic/zephyr/issues{/number}","pulls_url":"https://api.github.com/repos/diytronic/zephyr/pulls{/number}","milestones_url":"https://api.github.com/repos/diytronic/zephyr/milestones{/number}","notifications_url":"https://api.github.com/repos/diytronic/zephyr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diytronic/zephyr/labels{/name}","releases_url":"https://api.github.com/repos/diytronic/zephyr/releases{/id}","deployments_url":"https://api.github.com/repos/diytronic/zephyr/deployments","created_at":"2018-03-01T18:59:03Z","updated_at":"2018-03-01T18:59:40Z","pushed_at":"2018-03-27T19:58:14Z","git_url":"git://github.com/diytronic/zephyr.git","ssh_url":"git@github.com:diytronic/zephyr.git","clone_url":"https://github.com/diytronic/zephyr.git","svn_url":"https://github.com/diytronic/zephyr","homepage":"http://zephyrproject.org/doc","size":103048,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zephyrproject-rtos:master","ref":"master","sha":"f947439fa15971b3406aace8585fde7834043c25","user":{"login":"zephyrproject-rtos","id":19595895,"avatar_url":"https://avatars2.githubusercontent.com/u/19595895?v=4","gravatar_id":"","url":"https://api.github.com/users/zephyrproject-rtos","html_url":"https://github.com/zephyrproject-rtos","followers_url":"https://api.github.com/users/zephyrproject-rtos/followers","following_url":"https://api.github.com/users/zephyrproject-rtos/following{/other_user}","gists_url":"https://api.github.com/users/zephyrproject-rtos/gists{/gist_id}","starred_url":"https://api.github.com/users/zephyrproject-rtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zephyrproject-rtos/subscriptions","organizations_url":"https://api.github.com/users/zephyrproject-rtos/orgs","repos_url":"https://api.github.com/users/zephyrproject-rtos/repos","events_url":"https://api.github.com/users/zephyrproject-rtos/events{/privacy}","received_events_url":"https://api.github.com/users/zephyrproject-rtos/received_events","type":"Organization","site_admin":false},"repo":{"id":59771425,"name":"zephyr","full_name":"zephyrproject-rtos/zephyr","owner":{"login":"zephyrproject-rtos","id":19595895,"avatar_url":"https://avatars2.githubusercontent.com/u/19595895?v=4","gravatar_id":"","url":"https://api.github.com/users/zephyrproject-rtos","html_url":"https://github.com/zephyrproject-rtos","followers_url":"https://api.github.com/users/zephyrproject-rtos/followers","following_url":"https://api.github.com/users/zephyrproject-rtos/following{/other_user}","gists_url":"https://api.github.com/users/zephyrproject-rtos/gists{/gist_id}","starred_url":"https://api.github.com/users/zephyrproject-rtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zephyrproject-rtos/subscriptions","organizations_url":"https://api.github.com/users/zephyrproject-rtos/orgs","repos_url":"https://api.github.com/users/zephyrproject-rtos/repos","events_url":"https://api.github.com/users/zephyrproject-rtos/events{/privacy}","received_events_url":"https://api.github.com/users/zephyrproject-rtos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zephyrproject-rtos/zephyr","description":"Primary GIT Repository for the Zephyr Project","fork":false,"url":"https://api.github.com/repos/zephyrproject-rtos/zephyr","forks_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/forks","keys_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/teams","hooks_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/hooks","issue_events_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/events{/number}","events_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/events","assignees_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/assignees{/user}","branches_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/branches{/branch}","tags_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/tags","blobs_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/git/refs{/sha}","trees_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/statuses/{sha}","languages_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/languages","stargazers_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/stargazers","contributors_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/contributors","subscribers_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/subscribers","subscription_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/subscription","commits_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/commits{/sha}","git_commits_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/git/commits{/sha}","comments_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/comments{/number}","issue_comment_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/comments{/number}","contents_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/contents/{+path}","compare_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/merges","archive_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/downloads","issues_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues{/number}","pulls_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls{/number}","milestones_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/milestones{/number}","notifications_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/labels{/name}","releases_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/releases{/id}","deployments_url":"https://api.github.com/repos/zephyrproject-rtos/zephyr/deployments","created_at":"2016-05-26T17:54:19Z","updated_at":"2018-03-27T14:07:26Z","pushed_at":"2018-03-27T20:04:23Z","git_url":"git://github.com/zephyrproject-rtos/zephyr.git","ssh_url":"git@github.com:zephyrproject-rtos/zephyr.git","clone_url":"https://github.com/zephyrproject-rtos/zephyr.git","svn_url":"https://github.com/zephyrproject-rtos/zephyr","homepage":"https://zephyrproject.org/doc","size":105357,"stargazers_count":727,"watchers_count":727,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":525,"mirror_url":null,"archived":false,"open_issues_count":852,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":525,"open_issues":852,"watchers":727,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/6829"},"html":{"href":"https://github.com/zephyrproject-rtos/zephyr/pull/6829"},"issue":{"href":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6829"},"comments":{"href":"https://api.github.com/repos/zephyrproject-rtos/zephyr/issues/6829/comments"},"review_comments":{"href":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/6829/comments"},"review_comment":{"href":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zephyrproject-rtos/zephyr/pulls/6829/commits"},"statuses":{"href":"https://api.github.com/repos/zephyrproject-rtos/zephyr/statuses/4aa320b9f2bfb3f6b97f8d18d5bdb488dbf9571b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mbolivar"}}