{"action":"created","issue":{"url":"https://api.github.com/repos/JelmerT/cc2538-bsl/issues/52","repository_url":"https://api.github.com/repos/JelmerT/cc2538-bsl","labels_url":"https://api.github.com/repos/JelmerT/cc2538-bsl/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/JelmerT/cc2538-bsl/issues/52/comments","events_url":"https://api.github.com/repos/JelmerT/cc2538-bsl/issues/52/events","html_url":"https://github.com/JelmerT/cc2538-bsl/issues/52","id":158505799,"number":52,"title":"Synch response timeout error with some commands","user":{"login":"bthebaudeau","id":5755442,"avatar_url":"https://avatars.githubusercontent.com/u/5755442?v=3","gravatar_id":"","url":"https://api.github.com/users/bthebaudeau","html_url":"https://github.com/bthebaudeau","followers_url":"https://api.github.com/users/bthebaudeau/followers","following_url":"https://api.github.com/users/bthebaudeau/following{/other_user}","gists_url":"https://api.github.com/users/bthebaudeau/gists{/gist_id}","starred_url":"https://api.github.com/users/bthebaudeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bthebaudeau/subscriptions","organizations_url":"https://api.github.com/users/bthebaudeau/orgs","repos_url":"https://api.github.com/users/bthebaudeau/repos","events_url":"https://api.github.com/users/bthebaudeau/events{/privacy}","received_events_url":"https://api.github.com/users/bthebaudeau/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-06-04T13:54:34Z","updated_at":"2016-06-18T15:23:41Z","closed_at":"2016-06-18T15:23:41Z","body":"On Zolertia Zoul Firefly, with cc2538-bsl 4340542:\r\n```\r\n$ ./tools/cc2538-bsl/cc2538-bsl.py -V -b 115200 -e\r\nOpening port /dev/ttyUSB0, baud 115200\r\nConnecting to target...\r\n*** sending synch sequence\r\nTraceback (most recent call last):\r\n  File \"./tools/cc2538-bsl/cc2538-bsl.py\", line 1040, in <module>\r\n    if not cmd.sendSynch():\r\n  File \"./tools/cc2538-bsl/cc2538-bsl.py\", line 369, in sendSynch\r\n    return self._wait_for_ack(\"Synch (0x55 0x55)\", 2)\r\n  File \"./tools/cc2538-bsl/cc2538-bsl.py\", line 253, in _wait_for_ack\r\n    % (info,))\r\nCmdException: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'\r\nERROR: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'\r\n```\r\n```\r\n$ ./tools/cc2538-bsl/cc2538-bsl.py -V -b 115200 -a 0x0 -l 0x20000 -r rom.bin\r\nOpening port /dev/ttyUSB0, baud 115200\r\nConnecting to target...\r\n*** sending synch sequence\r\nTraceback (most recent call last):\r\n  File \"./tools/cc2538-bsl/cc2538-bsl.py\", line 1040, in <module>\r\n    if not cmd.sendSynch():\r\n  File \"./tools/cc2538-bsl/cc2538-bsl.py\", line 369, in sendSynch\r\n    return self._wait_for_ack(\"Synch (0x55 0x55)\", 2)\r\n  File \"./tools/cc2538-bsl/cc2538-bsl.py\", line 253, in _wait_for_ack\r\n    % (info,))\r\nCmdException: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'\r\nERROR: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'\r\n```\r\n\r\nThe common condition to these errors seemed to be the lack of input file to read, which made me test if this was a timing issue with the following patch:\r\n```\r\ndiff --git a/cc2538-bsl.py b/cc2538-bsl.py\r\nindex dd912de..5715d36 100755\r\n--- a/cc2538-bsl.py\r\n+++ b/cc2538-bsl.py\r\n@@ -1035,6 +1035,8 @@ if __name__ == \"__main__\":\r\n             mdebug(5, \"Reading data from %s\" % args[0])\r\n             firmware = FirmwareFile(args[0])\r\n \r\n+        time.sleep(0.1)\r\n+\r\n         mdebug(5, \"Connecting to target...\")\r\n \r\n         if not cmd.sendSynch():\r\n```\r\n\r\nAnd it now works. This is not a clean fix, but only a workaround indicating where to look. That's why I have opened an issue and not a pull request for this."},"comment":{"url":"https://api.github.com/repos/JelmerT/cc2538-bsl/issues/comments/226948071","html_url":"https://github.com/JelmerT/cc2538-bsl/issues/52#issuecomment-226948071","issue_url":"https://api.github.com/repos/JelmerT/cc2538-bsl/issues/52","id":226948071,"user":{"login":"JelmerT","id":873684,"avatar_url":"https://avatars.githubusercontent.com/u/873684?v=3","gravatar_id":"","url":"https://api.github.com/users/JelmerT","html_url":"https://github.com/JelmerT","followers_url":"https://api.github.com/users/JelmerT/followers","following_url":"https://api.github.com/users/JelmerT/following{/other_user}","gists_url":"https://api.github.com/users/JelmerT/gists{/gist_id}","starred_url":"https://api.github.com/users/JelmerT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JelmerT/subscriptions","organizations_url":"https://api.github.com/users/JelmerT/orgs","repos_url":"https://api.github.com/users/JelmerT/repos","events_url":"https://api.github.com/users/JelmerT/events{/privacy}","received_events_url":"https://api.github.com/users/JelmerT/received_events","type":"User","site_admin":false},"created_at":"2016-06-18T15:23:41Z","updated_at":"2016-06-18T15:23:41Z","body":"closed by #53 "}}
{"actor":{"display_login":"JelmerT"}}