[riot-notifications] [RIOT-OS/RIOT] cpu/esp32: fix printf for float with newlib-nano (#14004)

Gunar Schorcht notifications at github.com
Sat May 2 17:12:41 CEST 2020

### Contribution description

This PR fixes the problem when using `printf` with `float` and the `newlib-nano-formatted-io` library that was introduced with the new toolchain version.

Using the `printf` function of the `newlib-nano-formated-io` library with `float` requires the definition of a `_printf_float` function in the newlib function stub table `s_stub_table`: https://github.com/RIOT-OS/RIOT/blob/99e8b04921aff99d197e5bc48ca2565b17b0490e/cpu/esp32/syscalls.c#L142-L145 This is the case, if the `CONFIG_NEWLIB_NANO_FORMAT` macro is defined. If this macro is not defined, a `NULL` pointer is tried to be called as function by the `newlib-nano-formated-io` when `printf` is used with `float`.

This PR simply sets `CONFIG_NEWLIB_NANO_FORMAT` macro to fix the problem.

The problem was found while investigating #13984. `tests/pkg_ubasic` seems to be the only test that use `printf` with `float`.

### Testing procedure

Make, flash and test `tests/pkg_ubasic` for any ESP32 board.
make BOARD=esp32-wroom-32 -C tests/pkg_ubasic flash test

### Issues/PRs references

Fixes #13984 
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * cpu/esp32: fix printf for float with newlib-nano

-- File Changes --

    M cpu/esp32/include/sdk_conf.h (2)
    M cpu/esp32/syscalls.c (13)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200502/72339be8/attachment-0001.htm>

More information about the notifications mailing list