Hitchhiker's Guide to Printf in Mbed 6

You cannot expect anyone to fix this is you have not told us the basics. Namely:
What Mbed version are you using?
What board are you using?

Then next time stick to asking the same question in one place on the forum… you’ve asked it in two different places.