6 years, 5 months ago.  This question has been closed. Reason: Off Topic

UART Baud rate switching not working ?

Hi,

Following code not working in any baud rate, I was trying to switch between two baud rate,

Test UART baud switch program

#include "mbed.h"

Serial pc(USBTX, USBRX);
Serial pc1(USBTX, USBRX);

int main() {
        
        pc.baud(115200);
        pc.format(8,SerialBase::None,1);
        pc.printf("115200...\r");
        
        pc1.baud(9600);
        pc1.format(8,SerialBase::None,1);
        pc1.printf("9600...\r");
}