-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
printf
binding doesn't work for strings without arguments.
#13
Comments
Mhh that's weird. I think When I call |
I've narrowed it down a bit. The behavior is different on esp32c3 vs esp32s3. Issue was originally opened for esp32c3. So I assume this must be in the esp32c3; it fails to print if the string ends with 1 or more Ex: mbedtls_printf("word-0\n");
mbedtls_printf("word-1\n ");
mbedtls_printf("word-2\n\n");
mbedtls_printf("word-3\t test");
mbedtls_printf("word-4\t");
mbedtls_printf("word-5\n newline");
mbedtls_printf("word-6");
mbedtls_printf("word-7"); Will log:
esp32s3It prints newlines successfully but it doesn't handle formatting correctly. mbedtls_printf(" SHA-%d test #%d: ", 512 - is384 * 128, i + 1); logs
P.S. I wonder now, that we have a considerable amount of binding for C functions, in a few projects, if we should move them to a specific crate for that, (esp-hal-sys, esp-sys, etc.), and then we just have to import the crate, and the definition of those bindings is unified among projects. And no more double definition errors. |
Interesting finding. I guess that should help to track it down. On the Xtensa targets we unfortunately still have the problem with C variadics ( esp-rs/esp-wifi-sys#16 ) so we currently only can print the format string.
Probably something like an "esp-c-compat" crate or similar would make sense. I think there won't be too much functions which are really worth to live there but for those who are it makes sense |
I compiled the Obviously the code above isn't correct, but close enough for me. Now, why |
When enabling the logging in syslog, which printf calls, by enabling the
wifi-logs
feature, calls tombedtls_printf
in the C library are logged as info, except for any of them that don't have arguments.Example:
This will log
This will not log
The text was updated successfully, but these errors were encountered: