Mbed UART problem

Im trying to get my board to talk to Putty but Im not receiving anything.

Here is the code im using:

#include “mbed.h”

Serial pc(USBTX, USBRX);

int main() {
pc.printf(“Echoes back to the screen anything you type\n”);
while(1) {
pc.putc(pc.getc());
}
}

On putty I’ve set the baud rate to 9600 as that is the default but I still get nothing. Has anyone else faced this issue?

I think this may be your problem:

Adding this to your mbed_app.json file should get it working.

"target.printf_lib": "std",
"platform.stdio-baud-rate": 115200,