The sprintf function cannot handle float type

The sprintf function seems unable to handle float types, and this issue has been troubling me for quite some time. I would greatly appreciate any guidance or solutions. Thank you in advance!


and

Duplicate of

1 Like


it still doesn’t work.:face_with_head_bandage:

That’s weird. Can you edit your hardfloat.py to add "-u_printf_float" in the LINKFLAGS? Then clean and reupload.

Import("env")

for e in [env, DefaultEnvironment()]:
    e.Append(
        CCFLAGS=[
            "-mfloat-abi=hard",
            "-mfpu=fpv4-sp-d16"
        ],
        LINKFLAGS=[
            "-mfloat-abi=hard",
            "-mfpu=fpv4-sp-d16",
            "-u_printf_float"
        ]
    )
1 Like

It worked! Thank you! :kissing_heart::kissing_heart: It really will help me a lot!