PlatformIO Mbed print function not work

PlatformIO Mbed print function not work

I am developing Nordic chip and using Mbed OS.
PlatformIO is working well apart from the printf function.

does anyone have the issue for print log?

I don’t know about the mbed framework but your post should contain more information.
What platform/OS are you on and what exactly isn’t working? Is there an error or does the log (which log? are you writing to a file or to a terminal/COM-port) simple not show what you are passing to it using the printf function?

1 Like

this might help
https://os.mbed.com/docs/mbed-os/v5.14/tutorials/debugging-using-printf-statements.html

#include "mbed.h"

// define the Serial object
Serial pc(USBTX, USBRX);

DigitalOut led1(LED1);

int main() {
    while (true) {
        led1 = !led1;

        // Print something over the serial connection
        pc.printf("Blink! LED is now %d\r\n", led1.read());

        wait(0.5);
    }
}

I think there is no regular printf, that is supported, as where is that exactly to print the output to? There is no terminal running on a microcontroller and there is no standard output, I suppose.

1 Like