{"action":"created","comment":{"url":"https://api.github.com/repos/mbedmicro/pyOCD/pulls/comments/32383159","id":32383159,"diff_hunk":"@@ -37,6 +38,22 @@ def word2byte(data):\n         res.append((x >> 24) & 0xff)\n     return res\n \n+## @brief Convert a byte array into a halfword array.\n+def byte2half(data):\n+    byteData = []\n+    for i in data:\n+        byteData.extend([i & 0xff, (i >> 8) & 0xff])\n+    return byteData\n+\n+## @brief Convert a halfword array into a byte array\n+def half2byte(byteData):","path":"pyOCD/utility/conversion.py","position":20,"original_position":20,"commit_id":"5e2c976126ed37d5431038a0b3f55d86c00c3fb9","original_commit_id":"5e2c976126ed37d5431038a0b3f55d86c00c3fb9","user":{"login":"flit","id":3116536,"avatar_url":"https://avatars.githubusercontent.com/u/3116536?v=3","gravatar_id":"","url":"https://api.github.com/users/flit","html_url":"https://github.com/flit","followers_url":"https://api.github.com/users/flit/followers","following_url":"https://api.github.com/users/flit/following{/other_user}","gists_url":"https://api.github.com/users/flit/gists{/gist_id}","starred_url":"https://api.github.com/users/flit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flit/subscriptions","organizations_url":"https://api.github.com/users/flit/orgs","repos_url":"https://api.github.com/users/flit/repos","events_url":"https://api.github.com/users/flit/events{/privacy}","received_events_url":"https://api.github.com/users/flit/received_events","type":"User","site_admin":false},"body":"Ugh, must have been asleep. Fixed this and the one above.","created_at":"2015-06-14T19:14:28Z","updated_at":"2015-06-14T19:14:28Z","html_url":"https://github.com/mbedmicro/pyOCD/pull/157#discussion_r32383159","pull_request_url":"https://api.github.com/repos/mbedmicro/pyOCD/pulls/157","_links":{"self":{"href":"https://api.github.com/repos/mbedmicro/pyOCD/pulls/comments/32383159"},"html":{"href":"https://github.com/mbedmicro/pyOCD/pull/157#discussion_r32383159"},"pull_request":{"href":"https://api.github.com/repos/mbedmicro/pyOCD/pulls/157"}}},"pull_request":{"url":"https://api.github.com/repos/mbedmicro/pyOCD/pulls/157","id":37315270,"html_url":"https://github.com/mbedmicro/pyOCD/pull/157","diff_url":"https://github.com/mbedmicro/pyOCD/pull/157.diff","patch_url":"https://github.com/mbedmicro/pyOCD/pull/157.patch","issue_url":"https://api.github.com/repos/mbedmicro/pyOCD/issues/157","number":157,"state":"open","locked":false,"title":"pyocd-tool and flash-tool improvements","user":{"login":"flit","id":3116536,"avatar_url":"https://avatars.githubusercontent.com/u/3116536?v=3","gravatar_id":"","url":"https://api.github.com/users/flit","html_url":"https://github.com/flit","followers_url":"https://api.github.com/users/flit/followers","following_url":"https://api.github.com/users/flit/following{/other_user}","gists_url":"https://api.github.com/users/flit/gists{/gist_id}","starred_url":"https://api.github.com/users/flit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flit/subscriptions","organizations_url":"https://api.github.com/users/flit/orgs","repos_url":"https://api.github.com/users/flit/repos","events_url":"https://api.github.com/users/flit/events{/privacy}","received_events_url":"https://api.github.com/users/flit/received_events","type":"User","site_admin":false},"body":"Change pyocd-tool to focus on an interactive command mode.\r\n\r\nExample interactive session:\r\n<pre>\r\ncreed@sapo:pyOCD-flit$ pyocd-tool \r\nConnected to K64F [Halted]: 0240020245C50E13B838F3AB\r\n>>> g\r\nSuccessfully resumed device\r\n>>> stat\r\nSecurity:       Unlocked\r\nMDM-AP Control: 0x00000000\r\nMDM-AP Status:  0x0000003b\r\nCore status:    Running\r\n>>> h\r\nSuccessfully halted device\r\n>>> reg\r\n     r0: 0x1fff0414       r6: 0x0000047e      r12: 0xcccccccc \r\n     r1: 0x00000000       r7: 0x77777777       sp: 0x1fff0688 \r\n     r2: 0x0000002f       r8: 0x88888888       lr: 0x00000bf3 \r\n     r3: 0x00000000       r9: 0x99999999       pc: 0x00000446 \r\n     r4: 0x00000000      r10: 0xaaaaaaaa     xpsr: 0x61000000 \r\n     r5: 0x0000044f      r11: 0xbbbbbbbb  primask: 0x00000000 \r\n>>> r4\r\nr4 = 0x00000000 (0)\r\n>>> pc\r\npc = 0x00000446 (1094)\r\n>>> d -c pc 32          \r\npc = 0x00000446\r\n0x00000436:  856a      ldr     r5, [r0, #0x28]\r\n0x00000438:  2e00      movs    r6, r5\r\n0x0000043a:  02e0      b       #0x442\r\n0x0000043c:  491e      subs    r1, r1, #1\r\n0x0000043e:  0c19      adds    r4, r1, r4\r\n0x00000440:  0600      movs    r6, r0\r\n0x00000442:  dff80004  ldr.w   r0, [pc, #0x400]\r\n0x00000446:* c069      ldr     r0, [r0, #0x1c]\r\n0x00000448:  0028      cmp     r0, #0\r\n0x0000044a:  2dd0      beq     #0x4a8\r\n0x0000044c:  dff8f403  ldr.w   r0, [pc, #0x3f4]\r\n0x00000450:  d0f81c80  ldr.w   r8, [r0, #0x1c]\r\n0x00000454:  0027      movs    r7, #0\r\n</pre>\r\n\r\nAlso added a few minor improvements to pyocd-flashtool such as being able to perform chip and sector erases without writing anything, i.e. `pyocd-flashtool -se -a0x40000 -n16` will erase 16 sectors starting at 0x40000. It also can use the file's extension instead of requiring the type to be provided on the command line.","created_at":"2015-06-10T00:46:42Z","updated_at":"2015-06-14T19:14:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b97115f859abdfeb5a53a943108245d47587a02","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mbedmicro/pyOCD/pulls/157/commits","review_comments_url":"https://api.github.com/repos/mbedmicro/pyOCD/pulls/157/comments","review_comment_url":"https://api.github.com/repos/mbedmicro/pyOCD/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mbedmicro/pyOCD/issues/157/comments","statuses_url":"https://api.github.com/repos/mbedmicro/pyOCD/statuses/5e2c976126ed37d5431038a0b3f55d86c00c3fb9","head":{"label":"flit:dev_tools","ref":"dev_tools","sha":"5e2c976126ed37d5431038a0b3f55d86c00c3fb9","user":{"login":"flit","id":3116536,"avatar_url":"https://avatars.githubusercontent.com/u/3116536?v=3","gravatar_id":"","url":"https://api.github.com/users/flit","html_url":"https://github.com/flit","followers_url":"https://api.github.com/users/flit/followers","following_url":"https://api.github.com/users/flit/following{/other_user}","gists_url":"https://api.github.com/users/flit/gists{/gist_id}","starred_url":"https://api.github.com/users/flit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flit/subscriptions","organizations_url":"https://api.github.com/users/flit/orgs","repos_url":"https://api.github.com/users/flit/repos","events_url":"https://api.github.com/users/flit/events{/privacy}","received_events_url":"https://api.github.com/users/flit/received_events","type":"User","site_admin":false},"repo":{"id":14731481,"name":"pyOCD","full_name":"flit/pyOCD","owner":{"login":"flit","id":3116536,"avatar_url":"https://avatars.githubusercontent.com/u/3116536?v=3","gravatar_id":"","url":"https://api.github.com/users/flit","html_url":"https://github.com/flit","followers_url":"https://api.github.com/users/flit/followers","following_url":"https://api.github.com/users/flit/following{/other_user}","gists_url":"https://api.github.com/users/flit/gists{/gist_id}","starred_url":"https://api.github.com/users/flit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flit/subscriptions","organizations_url":"https://api.github.com/users/flit/orgs","repos_url":"https://api.github.com/users/flit/repos","events_url":"https://api.github.com/users/flit/events{/privacy}","received_events_url":"https://api.github.com/users/flit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/flit/pyOCD","description":"Open source python library for programming and debugging ARM Cortex-M microcontrollers using CMSIS-DAP","fork":true,"url":"https://api.github.com/repos/flit/pyOCD","forks_url":"https://api.github.com/repos/flit/pyOCD/forks","keys_url":"https://api.github.com/repos/flit/pyOCD/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flit/pyOCD/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flit/pyOCD/teams","hooks_url":"https://api.github.com/repos/flit/pyOCD/hooks","issue_events_url":"https://api.github.com/repos/flit/pyOCD/issues/events{/number}","events_url":"https://api.github.com/repos/flit/pyOCD/events","assignees_url":"https://api.github.com/repos/flit/pyOCD/assignees{/user}","branches_url":"https://api.github.com/repos/flit/pyOCD/branches{/branch}","tags_url":"https://api.github.com/repos/flit/pyOCD/tags","blobs_url":"https://api.github.com/repos/flit/pyOCD/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flit/pyOCD/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flit/pyOCD/git/refs{/sha}","trees_url":"https://api.github.com/repos/flit/pyOCD/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flit/pyOCD/statuses/{sha}","languages_url":"https://api.github.com/repos/flit/pyOCD/languages","stargazers_url":"https://api.github.com/repos/flit/pyOCD/stargazers","contributors_url":"https://api.github.com/repos/flit/pyOCD/contributors","subscribers_url":"https://api.github.com/repos/flit/pyOCD/subscribers","subscription_url":"https://api.github.com/repos/flit/pyOCD/subscription","commits_url":"https://api.github.com/repos/flit/pyOCD/commits{/sha}","git_commits_url":"https://api.github.com/repos/flit/pyOCD/git/commits{/sha}","comments_url":"https://api.github.com/repos/flit/pyOCD/comments{/number}","issue_comment_url":"https://api.github.com/repos/flit/pyOCD/issues/comments{/number}","contents_url":"https://api.github.com/repos/flit/pyOCD/contents/{+path}","compare_url":"https://api.github.com/repos/flit/pyOCD/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flit/pyOCD/merges","archive_url":"https://api.github.com/repos/flit/pyOCD/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flit/pyOCD/downloads","issues_url":"https://api.github.com/repos/flit/pyOCD/issues{/number}","pulls_url":"https://api.github.com/repos/flit/pyOCD/pulls{/number}","milestones_url":"https://api.github.com/repos/flit/pyOCD/milestones{/number}","notifications_url":"https://api.github.com/repos/flit/pyOCD/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flit/pyOCD/labels{/name}","releases_url":"https://api.github.com/repos/flit/pyOCD/releases{/id}","created_at":"2013-11-26T22:48:46Z","updated_at":"2014-07-23T15:16:30Z","pushed_at":"2015-06-13T21:04:49Z","git_url":"git://github.com/flit/pyOCD.git","ssh_url":"git@github.com:flit/pyOCD.git","clone_url":"https://github.com/flit/pyOCD.git","svn_url":"https://github.com/flit/pyOCD","homepage":null,"size":1214,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mbedmicro:master","ref":"master","sha":"1ad87e08060db6f2ded9bc66f645651d94ff9a30","user":{"login":"mbedmicro","id":3626466,"avatar_url":"https://avatars.githubusercontent.com/u/3626466?v=3","gravatar_id":"","url":"https://api.github.com/users/mbedmicro","html_url":"https://github.com/mbedmicro","followers_url":"https://api.github.com/users/mbedmicro/followers","following_url":"https://api.github.com/users/mbedmicro/following{/other_user}","gists_url":"https://api.github.com/users/mbedmicro/gists{/gist_id}","starred_url":"https://api.github.com/users/mbedmicro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbedmicro/subscriptions","organizations_url":"https://api.github.com/users/mbedmicro/orgs","repos_url":"https://api.github.com/users/mbedmicro/repos","events_url":"https://api.github.com/users/mbedmicro/events{/privacy}","received_events_url":"https://api.github.com/users/mbedmicro/received_events","type":"Organization","site_admin":false},"repo":{"id":13862423,"name":"pyOCD","full_name":"mbedmicro/pyOCD","owner":{"login":"mbedmicro","id":3626466,"avatar_url":"https://avatars.githubusercontent.com/u/3626466?v=3","gravatar_id":"","url":"https://api.github.com/users/mbedmicro","html_url":"https://github.com/mbedmicro","followers_url":"https://api.github.com/users/mbedmicro/followers","following_url":"https://api.github.com/users/mbedmicro/following{/other_user}","gists_url":"https://api.github.com/users/mbedmicro/gists{/gist_id}","starred_url":"https://api.github.com/users/mbedmicro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbedmicro/subscriptions","organizations_url":"https://api.github.com/users/mbedmicro/orgs","repos_url":"https://api.github.com/users/mbedmicro/repos","events_url":"https://api.github.com/users/mbedmicro/events{/privacy}","received_events_url":"https://api.github.com/users/mbedmicro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mbedmicro/pyOCD","description":"Open source python library for programming and debugging ARM Cortex-M microcontrollers using CMSIS-DAP","fork":false,"url":"https://api.github.com/repos/mbedmicro/pyOCD","forks_url":"https://api.github.com/repos/mbedmicro/pyOCD/forks","keys_url":"https://api.github.com/repos/mbedmicro/pyOCD/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mbedmicro/pyOCD/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mbedmicro/pyOCD/teams","hooks_url":"https://api.github.com/repos/mbedmicro/pyOCD/hooks","issue_events_url":"https://api.github.com/repos/mbedmicro/pyOCD/issues/events{/number}","events_url":"https://api.github.com/repos/mbedmicro/pyOCD/events","assignees_url":"https://api.github.com/repos/mbedmicro/pyOCD/assignees{/user}","branches_url":"https://api.github.com/repos/mbedmicro/pyOCD/branches{/branch}","tags_url":"https://api.github.com/repos/mbedmicro/pyOCD/tags","blobs_url":"https://api.github.com/repos/mbedmicro/pyOCD/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mbedmicro/pyOCD/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mbedmicro/pyOCD/git/refs{/sha}","trees_url":"https://api.github.com/repos/mbedmicro/pyOCD/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mbedmicro/pyOCD/statuses/{sha}","languages_url":"https://api.github.com/repos/mbedmicro/pyOCD/languages","stargazers_url":"https://api.github.com/repos/mbedmicro/pyOCD/stargazers","contributors_url":"https://api.github.com/repos/mbedmicro/pyOCD/contributors","subscribers_url":"https://api.github.com/repos/mbedmicro/pyOCD/subscribers","subscription_url":"https://api.github.com/repos/mbedmicro/pyOCD/subscription","commits_url":"https://api.github.com/repos/mbedmicro/pyOCD/commits{/sha}","git_commits_url":"https://api.github.com/repos/mbedmicro/pyOCD/git/commits{/sha}","comments_url":"https://api.github.com/repos/mbedmicro/pyOCD/comments{/number}","issue_comment_url":"https://api.github.com/repos/mbedmicro/pyOCD/issues/comments{/number}","contents_url":"https://api.github.com/repos/mbedmicro/pyOCD/contents/{+path}","compare_url":"https://api.github.com/repos/mbedmicro/pyOCD/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mbedmicro/pyOCD/merges","archive_url":"https://api.github.com/repos/mbedmicro/pyOCD/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mbedmicro/pyOCD/downloads","issues_url":"https://api.github.com/repos/mbedmicro/pyOCD/issues{/number}","pulls_url":"https://api.github.com/repos/mbedmicro/pyOCD/pulls{/number}","milestones_url":"https://api.github.com/repos/mbedmicro/pyOCD/milestones{/number}","notifications_url":"https://api.github.com/repos/mbedmicro/pyOCD/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mbedmicro/pyOCD/labels{/name}","releases_url":"https://api.github.com/repos/mbedmicro/pyOCD/releases{/id}","created_at":"2013-10-25T14:10:05Z","updated_at":"2015-06-10T01:47:38Z","pushed_at":"2015-06-12T07:28:54Z","git_url":"git://github.com/mbedmicro/pyOCD.git","ssh_url":"git@github.com:mbedmicro/pyOCD.git","clone_url":"https://github.com/mbedmicro/pyOCD.git","svn_url":"https://github.com/mbedmicro/pyOCD","homepage":null,"size":1625,"stargazers_count":67,"watchers_count":67,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":20,"forks":63,"open_issues":20,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mbedmicro/pyOCD/pulls/157"},"html":{"href":"https://github.com/mbedmicro/pyOCD/pull/157"},"issue":{"href":"https://api.github.com/repos/mbedmicro/pyOCD/issues/157"},"comments":{"href":"https://api.github.com/repos/mbedmicro/pyOCD/issues/157/comments"},"review_comments":{"href":"https://api.github.com/repos/mbedmicro/pyOCD/pulls/157/comments"},"review_comment":{"href":"https://api.github.com/repos/mbedmicro/pyOCD/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mbedmicro/pyOCD/pulls/157/commits"},"statuses":{"href":"https://api.github.com/repos/mbedmicro/pyOCD/statuses/5e2c976126ed37d5431038a0b3f55d86c00c3fb9"}}}}