The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Issue: NUCLEO-L031K6 : Serial communication issues

code 1 - PC Serial Port:

#include "mbed.h"

Serial pc(SERIAL_TX, SERIAL_RX);
DigitalOut myled(LED1);

int main() {
    while(1) {
        if(pc.readable()) {
            pc.putc(pc.getc());
            myled = !myled;
        }
    }
}

code 2: Serial Device Communication

#include "mbed.h"

Serial uart(PA_9, PA_10);
DigitalOut myled(LED1);

int main() {
    while(1) {
        if(uart.readable()) {
            uart.putc(uart.getc());
            myled = !myled;
        }
    }
}

code 3: Defining Two Devices

#include "mbed.h"

Serial pc(SERIAL_TX, SERIAL_RX);
Serial uart(PA_9, PA_10);
DigitalOut myled(LED1);

int main() {
    while(1) {
        if(pc.readable()) {
            pc.putc(pc.getc());
            myled = !myled;
        }
    }
}

Bug Description

For reference, all 3 codes are working well on NXP-LCP1768.

Revision 121: All 3 codes compile but nothing happens on the board when I try to use the terminal.

Revision 120: Code 1 and code 2 compile and working well. Code 3 compiles but nothing happens on the board when I try to use the terminal.

Conclusion

Revision 121 has a major issue handling any kind of serial communication for the Nucleo board. Revision 120 has an issue that might be related where only defining two different serial communication devices causes the serial communication not to work.