doc: connectivity: networking: Update CMake linker info to CoAP server

Add missing entry to the documentation to also support CMake linker
generator with CoAP services.
Update hard coded value with linker script defined value.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
Pieter De Gendt 2024-10-02 08:41:23 +02:00 committed by Fabio Baltieri
parent cbe0abfd00
commit 79f063e81b
1 changed files with 7 additions and 1 deletions

View File

@ -34,15 +34,21 @@ prefixed with ``coap_resource_`` and added to a linker file:
#include <zephyr/linker/iterable_sections.h>
ITERABLE_SECTION_RAM(coap_resource_my_service, 4)
ITERABLE_SECTION_RAM(coap_resource_my_service, Z_LINK_ITERABLE_SUBALIGN)
Add this linker file to your application using CMake:
.. code-block:: cmake
:caption: ``CMakeLists.txt``
# Support LD linker template
zephyr_linker_sources(DATA_SECTIONS sections-ram.ld)
# Support CMake linker generator
zephyr_iterable_section(NAME coap_resource_my_service
GROUP DATA_REGION ${XIP_ALIGN_WITH_INPUT}
SUBALIGN ${CONFIG_LINKER_ITERABLE_SUBALIGN})
You can now define your service as part of the application:
.. code-block:: c