How to use printf in mbed using STM32F429I-DISC1 and PlatformIO

In PlatformIO, you can directly use printf without any special configuration for the STM32F429-DISC1 discovery board:

#include <mbed.h>

int main() {
  while(1) {
    printf("Hello world\n");
    wait(0.5);
  }
}

This program will print Hello world twice every second. You can watch the output using the PlatformIO Monitor feature.