Skip to content

Buffered STDIN/STDOUT crashes on RTL8195AM and Ublox ODIN W2 #8081

@SeppoTakalo

Description

@SeppoTakalo

Description

When sending bytes bidirectionally to Uart that handles STDIN/STDOUT the Realtek 8195 seems to crash.
This is basically same issue that was reported in #6358 but requires faster speed than what humans can type.

To reproduce:

mbed new serial-test
cd serial-test
cd mbed-os
git checkout master
cd ..

Then create main.cpp and mbed_app.json as follows:

main.cpp

#include "mbed.h"

int main() {
    printf("Started!\r\n");

    while (true) {
        int c = getchar();
        if (c != EOF) {
            printf("Input: %c\r\n", c);
        } else {
            return 0;
        }
    }
}

mbed_app.json

{
    "target_overrides": {
        "*": {
            "platform.stdio-buffered-serial": true
        }
    }
}

Now compile and run the program.

It first seems to work, if you type in anything. But if you copy&paste some string that is longer that 10 characters, then it crashes.

So for example, paste following to the serial terminal: 0123456789A
Output would be:

Started!
Input: 0
Input: 1
Input: 2
Input: 3
Input: 4
Input: 5
Input: 6
Input: 7

And then it does not respond anymore

Note: If you set stdio-buffered-serial to false it does not crash.

Issue request type

[ ] Question
[ ] Enhancement
[X] Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions