You might find my post on how to use I/O streams in Mbed 6 useful: Hitchhiker's Guide to Printf in Mbed 6