{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/2536","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/2536/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/2536/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/2536/events","html_url":"https://github.com/esp8266/Arduino/issues/2536","id":177661975,"number":2536,"title":"Serial.flush() not flushing correctly at 160Mhz?","user":{"login":"themindfactory","id":8609129,"avatar_url":"https://avatars.githubusercontent.com/u/8609129?v=3","gravatar_id":"","url":"https://api.github.com/users/themindfactory","html_url":"https://github.com/themindfactory","followers_url":"https://api.github.com/users/themindfactory/followers","following_url":"https://api.github.com/users/themindfactory/following{/other_user}","gists_url":"https://api.github.com/users/themindfactory/gists{/gist_id}","starred_url":"https://api.github.com/users/themindfactory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/themindfactory/subscriptions","organizations_url":"https://api.github.com/users/themindfactory/orgs","repos_url":"https://api.github.com/users/themindfactory/repos","events_url":"https://api.github.com/users/themindfactory/events{/privacy}","received_events_url":"https://api.github.com/users/themindfactory/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-18T16:40:52Z","updated_at":"2016-09-19T03:54:39Z","closed_at":null,"body":"\r\n### Hardware\r\nHardware:\t\tESP-12E\r\nCore Version:      \t2.3.0\r\n\r\n### Description\r\n\r\nWhen I run a sketch at 80Mhz all is OK 160Mhz brings in new issues.\r\n\r\nI send out about 3000 bytes of data to serial with:\r\n\r\n```\r\nptr = s;\r\nwhile (*ptr) {\r\n   Serial.write(*ptr++);\r\n   // just in case its very long\r\n   yield();\r\n}\r\n\r\n```\r\n\r\nthen I do with no delay\r\n\r\n```\r\nSerial.flush();\r\n//delay(10);\r\nSerial.swap();\r\n\r\n```\r\n\r\nI end up with an odd character on the serial port 0xEA when I expected a 0x0A (I guess we call it the default serial port on pins 1 and 3)\r\n\r\nif I add a delay(10) after the flush all is OK.... its like the flush does not get to complete.\r\n\r\nRichardS\r\n\r\n### Settings in IDE\r\n\r\nModule:  \t\t\tGeneric ESP8266 Module\r\nFlash Size: \t\t4MB/1MB\r\nCPU Frequency:\t160Mhz\r\nFlash Mode:\t\tdio\r\nFlash Frequency:\t40Mhz\r\nUpload Using:\t\tSERIAL\r\nReset Method:\t\tnodemcu\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/247907450","html_url":"https://github.com/esp8266/Arduino/issues/2536#issuecomment-247907450","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/2536","id":247907450,"user":{"login":"stickbreaker","id":2858309,"avatar_url":"https://avatars.githubusercontent.com/u/2858309?v=3","gravatar_id":"","url":"https://api.github.com/users/stickbreaker","html_url":"https://github.com/stickbreaker","followers_url":"https://api.github.com/users/stickbreaker/followers","following_url":"https://api.github.com/users/stickbreaker/following{/other_user}","gists_url":"https://api.github.com/users/stickbreaker/gists{/gist_id}","starred_url":"https://api.github.com/users/stickbreaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stickbreaker/subscriptions","organizations_url":"https://api.github.com/users/stickbreaker/orgs","repos_url":"https://api.github.com/users/stickbreaker/repos","events_url":"https://api.github.com/users/stickbreaker/events{/privacy}","received_events_url":"https://api.github.com/users/stickbreaker/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T03:54:39Z","updated_at":"2016-09-19T03:54:39Z","body":"The flush() call should wait until the uart issues the TXComplete interrupt.  On the AVR ATMega328p this is the TXCn bit of the UCSRnA register. I looked at the code in the HardwareSerial library, but I was not able to understand/decode how to find the equivalent status bit for the ESP.  Is there any documentation available for the ESP UART?\r\nChuck."}}
{"actor":{"display_login":"stickbreaker"}}