zephyr/snippets/ram-console
Hou Zhiqiang fd584b4727 snippets: add ram-console snippet support
The ram-console snippet disabled UART console and enabled the
RAM console with the option link the RAM console buffer to a
dedicate section in a new added memory-region.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2024-06-12 17:09:24 -05:00
..
boards
README.rst
ram-console.conf
snippet.yml

README.rst

.. _snippet-ram-console:

RAM Console Snippet (ram-console)
#################################

.. code-block:: console

   west build -S ram-console [...]

Overview
********

This snippet redirects console output to a RAM buffer. The RAM console
buffer is a global array located in RAM region by default, whose address
is unknown before building. The RAM console driver also supports using
a dedicated section for the RAM console buffer with prefined address.

How to enable RAM console buffer section
****************************************

Add board dts overlay to this snippet to add property ``zephyr,ram-console``
in the chosen node and memory-region node with compatible string
:dtcompatible:`zephyr,memory-region` as the following:

.. code-block:: DTS

    / {
        chosen {
            zephyr,ram-console = &snippet_ram_console;
        };

       snippet_ram_console: memory@93d00000 {
            compatible = "zephyr,memory-region";
            reg = <0x93d00000 DT_SIZE_K(4)>;
            zephyr,memory-region = "RAM_CONSOLE";
       };
    };