{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/497","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/497/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/497/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/497/events","html_url":"https://github.com/esp8266/Arduino/issues/497","id":92307116,"number":497,"title":"Error during flashing - FLASH_DOWNLOAD_DATA","user":{"login":"Attil","id":7683532,"avatar_url":"https://avatars.githubusercontent.com/u/7683532?v=3","gravatar_id":"","url":"https://api.github.com/users/Attil","html_url":"https://github.com/Attil","followers_url":"https://api.github.com/users/Attil/followers","following_url":"https://api.github.com/users/Attil/following{/other_user}","gists_url":"https://api.github.com/users/Attil/gists{/gist_id}","starred_url":"https://api.github.com/users/Attil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Attil/subscriptions","organizations_url":"https://api.github.com/users/Attil/orgs","repos_url":"https://api.github.com/users/Attil/repos","events_url":"https://api.github.com/users/Attil/events{/privacy}","received_events_url":"https://api.github.com/users/Attil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/esp8266/Arduino/labels/upload","name":"upload","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-07-01T08:01:55Z","updated_at":"2016-02-26T18:35:53Z","closed_at":null,"body":"Hello,\r\nWhen I'm trying to upload my sketch to arduino, everything works seems to go smoothly, however at the end of the uploading, there is usually an error.\r\n\r\n```\r\nSketch uses 241,952 bytes (55%) of program storage space. Maximum is 434,160 bytes.\r\nGlobal variables use 46,880 bytes (57%) of dynamic memory, leaving 35,040 bytes for local variables. Maximum is 81,920 bytes.\r\nUploading 246096 bytes from /tmp/build1487447564622711308.tmp/ESPdriver.cpp.bin to flash at 0x00000000\r\n............................................................................................................................................................................................................................................warning: espcomm_send_command: didn't receive command response\r\nwarning: espcomm_send_command(FLASH_DOWNLOAD_DATA) failed\r\nwarning: espcomm_send_command: didn't receive command response\r\n```\r\n\r\nAfter this happens, i cannot even attempt to upload sketches, because i immediately get the following error\r\n\r\n```\r\nwarning: espcomm_sync failed\r\nerror: espcomm_open failed\r\n```\r\n\r\nThen i have to unplug USB-to-serial from my PC, plug it again and try uploading, which usually results in getting error during FLASH_DOWNLOAD_DATA again.\r\n\r\nI should add that sometimes, in about 1 per 20 or so tries i can flash, also monitoring Serial, both sending and receiving data works fine. Every time this error happens, it appears at about the same moment (judging by the amount of dots).\r\n\r\nI have tried both Arduino IDE with installed ESP8266 from the Board Manager and compiled one from the git by myself, same error.\r\n\r\nI am using ESP8266-01 and MicroFTX to communicate with PC (http://jim.sh/ftx/). ESP8266 is powered by YwRobot. My OS is Ubuntu 14.04.\r\n\r\nBecause my MicroFTX doesn't support DTR I'm manually resetting and setting GPIO0 low.\r\n\r\nAny suggestions on how could I fix this problem?\r\n\r\nThanks\r\n\r\nAny suggestions?\r\n\r\nEDIT: Using esptool.py, it seems that uploading always stops at 87%. Am I correct that this means the ESP is broken?\r\nEDIT2: However, i managed to flash it using the .bin from arduino esp (not from esptool.py elf2image) and using esptool.py write_flash 0x00000 <the .bin file here>. I am not sure if this is one of the randomly working flashes, but it worked 2 times in a row.\r\nEDIT3: It didnt start working sadly, but I have noticed that the moment of error is persistent among the same binary. So while it was always at 87% before, later it happened at address 0x0003b000 which was 90% and then at 0x00007400 at 90% (it was while writing first file of two into flash). The error from esptool.py is always:\r\n```\r\nTraceback (most recent call last):\r\n  File \"esptool.py\", line 547, in <module>\r\n    esp.flash_block(block, seq)\r\n  File \"esptool.py\", line 204, in flash_block\r\n    struct.pack('<IIII', len(data), seq, 0, 0)+data, ESPROM.checksum(data))[1] != \"\\0\\0\":\r\n  File \"esptool.py\", line 107, in command\r\n    raise Exception('Invalid head of packet')\r\nException: Invalid head of packet\r\n\r\n```\r\n\r\nI have also noticed that almost all sources on the internet use two binary files: 0x00000 and 0x40000 and the file I get from Arduino IDE is 1 binary file .bin, while esptool.py elf2image on the elf generated by IDE generates one file at 0x00000 and one file at 0x01010. Could this be related to the issue?"},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/189416260","html_url":"https://github.com/esp8266/Arduino/issues/497#issuecomment-189416260","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/497","id":189416260,"user":{"login":"dpechman","id":1469348,"avatar_url":"https://avatars.githubusercontent.com/u/1469348?v=3","gravatar_id":"","url":"https://api.github.com/users/dpechman","html_url":"https://github.com/dpechman","followers_url":"https://api.github.com/users/dpechman/followers","following_url":"https://api.github.com/users/dpechman/following{/other_user}","gists_url":"https://api.github.com/users/dpechman/gists{/gist_id}","starred_url":"https://api.github.com/users/dpechman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpechman/subscriptions","organizations_url":"https://api.github.com/users/dpechman/orgs","repos_url":"https://api.github.com/users/dpechman/repos","events_url":"https://api.github.com/users/dpechman/events{/privacy}","received_events_url":"https://api.github.com/users/dpechman/received_events","type":"User","site_admin":false},"created_at":"2016-02-26T18:35:53Z","updated_at":"2016-02-26T18:35:53Z","body":"I fix this issue increasing the current of the 3V3 power supply. the esp8266 requires more current while in programming."}}