From c0e1ecd31098fd964988ddd22960e127148c58a4 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Thu, 17 Oct 2024 12:42:16 +0800 Subject: [PATCH] docs(size): mention disabling console output to reduce binary size --- docs/en/api-guides/performance/size.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/en/api-guides/performance/size.rst b/docs/en/api-guides/performance/size.rst index f88f8a38bc..65aa9504df 100644 --- a/docs/en/api-guides/performance/size.rst +++ b/docs/en/api-guides/performance/size.rst @@ -255,6 +255,23 @@ VFS * Enabling :ref:`CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH` can reduce the IRAM usage and binary size by placing the entirety of the heap functionalities in flash memory. :CONFIG_ESP_ROM_HAS_HEAP_TLSF: * Enabling :ref:`CONFIG_HEAP_TLSF_USE_ROM_IMPL` can reduce the IRAM usage and binary size by linking in the TLSF library of ROM implementation. + +.. only:: SOC_USB_SERIAL_JTAG_SUPPORTED + + Console + @@@@@@@@ + + For targets that support USB-Serial-JTAG, both the USB-Serial-JTAG and UART console output are enabled by default. If you only need one console, you can reduce the binary size and RAM usage by doing the following: + + 1. Disable the secondary console by setting :ref:`CONFIG_ESP_CONSOLE_SECONDARY` to ``CONFIG_ESP_CONSOLE_SECONDARY_NONE``. + 2. Set :ref:`CONFIG_ESP_CONSOLE_UART` to use one of the following: + + * ``UART`` reduces the binary size by around 2.5 KB. + * ``USB-Serial-JTAG`` reduces the binary size by around 10 KB and DRAM usage by around 1.5 KB. + + Please note that these size reductions assume the UART/USB-Serial-JTAG driver code is not pulled into the app, if you already use these drivers for other purposes then the savings will be smaller. + + Bootloader Size ---------------