Can't print floats

Hello,

I'm trying to print a float using my Thingy91 and Segger EDU Mini. 

It prints my printk statements (but not the values), but printf is completely ignored. Trying to use printk just outputs the value as *float*.

Code:

    float f1 = 1.23f;

    char buffer[4];
    snprintf(buffer, sizeof(buffer), "%f", f1);

    printk("START PRINT\n");
    printk("printk: %f\n", f1);
    printk("printk2: %f\n", buffer);
    printf("printf: %f\n", f1);
    printk("END PRINT\n");
Outputs:
START PRINT
printk: *float*
printk2: *float*
END PRINT
I've found an old post that might point to a issue with the RTT, but it did not get resolved.
Parents Reply Children
Related