Recently, the function printf does not print any data to the console anymore. I did not face this issue before. I’ve read the threads with similar problems on this forum. However, not any solution worked for me. For example, I’ve added a ‘\n’ character at the end of the string, but this didn’t solve the problem.
Any ideas what can fix this problem? Thanks in advance!
I had the same problem with another board and added this code below #include “mbed.h” and it then worked:
// Create a BufferedSerial object to be used by the system
// Check that the USBTX and USBRX are correctly defined in target pinnames files or define yourself
// Insert the baud rate you want to use
static BufferedSerial serial_port(USBTX, USBRX, 115200);
FileHandle *mbed::mbed_override_console(int fd)
{
return &serial_port;
}
The STDIO_UART_TX/RX can be also remapped in the mbed_app.json, but the defaults work for the USB VCOM. Unless you have modified the solder jumpers on the Nucleo, the VCOM can be disconnected.
Yeah, I had the same problem. The ST default is 9600,8,N,1 and the mbed studio defaults are 115200,8,N,1 - just change the baud rate drop down for your board’s serial terminal to 9600 and it works fine.