mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 02:30:52 +03:00
Merge branch 'docs/picolibc-is-default_v6.0' into 'release/v6.0'
docs: update picolibc as default C library, remove experimental references (v6.0) See merge request espressif/esp-idf!46549
This commit is contained in:
@@ -5,10 +5,10 @@ C Support
|
||||
|
||||
ESP-IDF is primarily written in C and provides C APIs. ESP-IDF can use one of the following C Standard Library implementations:
|
||||
|
||||
- `Newlib <https://sourceware.org/newlib/>`_ (default)
|
||||
- `Picolibc <https://keithp.com/picolibc/>`_ (enabled with :ref:`CONFIG_LIBC_PICOLIBC<CONFIG_LIBC_PICOLIBC>` Kconfig option)
|
||||
- `Picolibc <https://keithp.com/picolibc/>`_ (default)
|
||||
- `Newlib <https://sourceware.org/newlib/>`_ (enabled with :ref:`CONFIG_LIBC_NEWLIB<CONFIG_LIBC_NEWLIB>` Kconfig option)
|
||||
|
||||
The Newlib version is specified in :component_file:`esp_libc/sbom.yml`.
|
||||
The Picolibc version is specified in :component_file:`esp_libc/sbom_picolibc.yml` and the Newlib version in :component_file:`esp_libc/sbom_newlibc.yml`.
|
||||
|
||||
In general, all C features supported by the compiler (currently GCC) can be used in ESP-IDF, unless otherwise noted in :ref:`unsupported_c_features` below.
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ Reducing Stack Sizes
|
||||
|
||||
- Avoid stack heavy functions. String formatting functions (like ``printf()``) are particularly heavy users of the stack, so any task which does not ever call these can usually have its stack size reduced.
|
||||
|
||||
- Using experimental :ref:`picolibc-instead-of-newlib` reduces the stack usage of ``printf()`` calls significantly.
|
||||
- Using :ref:`picolibc-instead-of-newlib` reduces the stack usage of ``printf()`` calls significantly.
|
||||
- Enabling :ref:`newlib-nano-formatting` reduces the stack usage of any task that calls ``printf()`` or other C string formatting functions.
|
||||
|
||||
- Avoid allocating large variables on the stack. In C, any large structures or arrays allocated as an automatic variable (i.e., default scope of a C declaration) uses space on the stack. To minimize the sizes of these, allocate them statically and/or see if you can save memory by dynamically allocating them from the heap only when they are needed.
|
||||
|
||||
@@ -158,12 +158,10 @@ lwIP IPv4
|
||||
Picolibc instead of Newlib
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
By default, ESP-IDF uses the Newlib C library, and it also has experimental support for the Picolibc C library.
|
||||
By default, ESP-IDF uses the Picolibc C library. Newlib is also supported and can be selected with :ref:`CONFIG_LIBC_NEWLIB<CONFIG_LIBC_NEWLIB>`.
|
||||
|
||||
Picolibc C library provides smaller ``printf`` family functions and can reduce the binary size by up to 30 KB, depending on your application.
|
||||
|
||||
To switch to linking against the Picolibc C library, please enable the configuration options :ref:`CONFIG_IDF_EXPERIMENTAL_FEATURES` and :ref:`CONFIG_LIBC_PICOLIBC<CONFIG_LIBC_PICOLIBC>`.
|
||||
|
||||
.. _newlib-nano-formatting:
|
||||
|
||||
Newlib Nano Formatting
|
||||
|
||||
Reference in New Issue
Block a user