Arm Mbed and Pelion Device Management support forum

Nucleo F303k8: Baudrate of uart1 and uart2 wouldn't change

Hi

Now I’m trying Nucleo F303k8 board with mbed but there is an issue.

I setup the pin assign and baudrate of uart1 and uart2.
I checked the waveform of the output signals, but the baudrate is too slow about 2bps.
Even if I don’t setup the baudrate, the speed is still 2bps .
*I think the default baudrate is 9600bps.

I have surveyed this issue but cannot find the cause yet.

If anyone know about this issue, please tell me know how to dissolve it.

I tried the code described below.

#include "mbed.h"
    //setup
    Serial ser1(PA_9, NC, 115200);
    Serial ser2(PB_3, NC, 115200);
    
int main() {
    char wrData[2] = {'A', 'A'};

    while(1) {
        ser1.putc(wrData[0]);
        ser2.putc(wrData[1]);
    }
}

I also tried the below code.

#include "mbed.h"
    //setup
    Serial ser1(PA_9, NC);
    Serial ser2(PB_3, NC);
    
int main() {
    ser1.baud(115200);
    ser2.baud(115200);
    
    char wrData[2] = {'A', 'A'};

    while(1) {
        ser1.putc(wrData[0]);
        ser2.putc(wrData[1]);
    }
}

I found the cause.
PB_3 of Nucleo F303K8 is connected to 3V3.

I changed Serial ser2(PB_3, NC) to Serial ser2(PA_2, NC); and dissolved this issue.