5 years, 3 months ago.

UART serial issues with Nucleo-F411RE

Hi guys, I am testing the UART serial port in my Nucleo-F411RE with the following code:

UART

#include "mbed.h"

//------------------------------------
// Hyperterminal configuration
// 9600 bauds, 8-bit data, no parity
//------------------------------------

Serial pc(USBTX, USBRX);

int main()
{
    pc.baud(115200);
    
    while(1)
    {
        pc.printf("Hello\n");
        pc.printf("world\n");
    }
}

The code works fine until it stops working(the UART transmission stops) after a few minutes. Could anyone tell me what the issue might be here?

Thanks!

1 Answer

5 years, 3 months ago.

Hello, Freddy

I guess the issue here is on the PC side rather than with the mbed board. Try to give the Hyperterminal more time to display the messages received. For example by modifying your program as follows:

#include "mbed.h"

Serial pc(USBTX, USBRX);

int main()
{
    pc.baud(115200);
    
    while(1)
    {
        pc.printf("Hello\n");
        pc.printf("world\n");
        wait(0.1);  // let the Hyperterminal show the messages
    }
}

You can also verify whether it's a trasmission or reception issue by launching the Hyperterminal only after the program has been running for a few minutes.

Hi Zoltan, This doesn't seem to solve the problem. If I am using the normal serial port, it works without stopping. Here is the code which works:

#include "mbed.h"

//------------------------------------
// Hyperterminal configuration
// 9600 bauds, 8-bit data, no parity
//------------------------------------

Serial uart(PA_9, PA_10);

int main()
{
    uart.baud(9600);
    
    while(1)
    {
        uart.printf("Hello\n");
        uart.printf("world\n");
    }
}

If I am using the native USB serial, the problem occurs.

posted by Freddy Phil 18 Jan 2019