-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Getting back the old Serial handling? #2037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The old software implementation is a software as your code . |
You may try placing older HardwareSerial class into the latest core. No guarantees that it will work without issues though. A few places in the code now assume that Serial functions are reentrant, and it is safe to call them from any task. This is not true with the older HardwareSerial, so some things (like debugging output from certain libraries) may cause unexpected behavior. |
is there an interrupt for when the buffer is empty then you could fill it when it's empty :) |
Okay thanks! I've tried to just replace HardwareSerial.h, HardwareSerial.cpp and cbuf.h in the latest core with the files from 2.0.0.. It seems to work fine :) |
I get an exception though. I have a HOST microcontroller that sends data chunks of 1024bytes over the serial to the ESP, for it to send through a WiFi socket. Sometimes it works (the whole file is 25kb), but every other time it throws the following stack trace:
Could this have anything to do with the fact that I've replaced the HardwareSerial? |
Could you please look up what code is at |
|
The code which gets called from ISR has to be marked with So the fix would be to add |
I ended up preceding every function in HardwareSerial.cpp with ICACHE_RAM_ATTR, and it actually did the job!! PERFECT! thanks for that. Though, I just discovered that it only works when the wifi mode is
I've tried to use the ICACHE_RAM_ATTR macro here as well:
But I get a compiler error:
Any ideas? :) |
In connection with: esp8266#2237 esp8266#2037 esp8266#1683
@JonasWestAlro is this issue still valid with latest git? |
We're now using the HW FIFO + a SW buffer in the latest UART code, a significant improvement on the original SW-only handling. |
Hi all,
We've upgraded the esp arduino library from 2.0.0 to 2.2.0 recently, only to realize that the UART buffer handling has been changed from SW buffers to HW buffers. Resulting in a RX-buffer limit on 128bytes (because it's hardware buffers). Well, we need at least 2048bytes, so we basicly need the old Serial / UART handling again? Can we change the Serial libraries back to the old version, and keep the ESP updated code?
(Yes, we've tried to empty the hardware buffer fast as possible but it is not fast enough - it takes around 8ms to fill up the HW buffer, and we have some tasks taking up to 10-12ms)
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: