RN42 connection by using BufferedSerial

I am trying to use Nucleo-L4R5ZI to implement the RN42 bluetooth, I only connect its TX and RX with PC10 and PC11 on Nucleo-L4R5ZI and call BufferedSerial to set it.

BufferedSerial rn42(PC_10, PC_11);

int main() {

    // RN42 baud rate
    rn42.set_baud(115200);
    char buf[64];

    while (1) {
        if (rn42.readable()) {
            printf("1");
        }
    }
}

But readable() can’t return TRUE even if I continue to send bytes to RN42, how does the BufferedSerial work?

Hello,

try to add \n, printf usually does not print out until new line.

printf("1\n");

The readable() method return true as soon as one or more bytes is available.

BR, Jan