Skip to content

Arduino Ring Buffer is not suitable for serial interface #154

@hn

Description

@hn

Libretiny uses the Arduino Ring Buffer for serial port i/o. However, the implementation is not interrupt-safe and there are no plans to change this.

This causes hard to debug problems with serial i/o. One pain point is that the Arduino Ring buffer is very error prone when used in such a situation (it uses a redundant way to store its state). And if it breaks, it will never be good again (no self-healing). You have to (in most cases) reboot the device or restart the component in question.

As far as I can (quickly) see the ESP8266 and ESP32 serial port components do not use the Arduino Ring Buffer, but implement some own 'magic' for the buffer.

I suggest replacing the Arduino Ring Buffer within the serial component with a better option (at least it should not break permanently).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions