Skip to content

Commit e832411

Browse files
lucasvdpnordicjm
authored andcommitted
doc: libraries: modem: nrf_modem_lib: Add devicetree guide
Add devicetree integration documentation for the modem library. Signed-off-by: Lucas van der Ploeg <lucas.vanderploeg@nordicsemi.no>
1 parent 0795734 commit e832411

2 files changed

Lines changed: 58 additions & 1 deletion

File tree

doc/nrf/libraries/modem/nrf_modem_lib/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Modem library integration layer
44
###############################
55

66
The Modem library integration layer handles the integration of the Modem library into |NCS|.
7-
The integration layer is constituted by the library wrapper and functionalities like socket offloading, OS abstraction, memory reservation by the Partition manager, handling modem traces, and diagnostics.
7+
The integration layer is constituted by the library wrapper and functionalities like socket offloading, OS abstraction, memory reservation by the Partition manager or devicetree, handling modem traces, and diagnostics.
88

99
.. toctree::
1010
:maxdepth: 1
@@ -14,6 +14,7 @@ The integration layer is constituted by the library wrapper and functionalities
1414
nrf_modem_lib_wrapper
1515
nrf_modem_lib_socket_offloading
1616
nrf_modem_lib_os_abstraction
17+
nrf_modem_lib_dt_integration
1718
nrf_modem_lib_pm_integration
1819
nrf_modem_lib_lte_net_if
1920
nrf_modem_lib_trace
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
.. _devicetree_integration:
2+
3+
Devicetree integration
4+
######################
5+
6+
The :ref:`nrfxlib:nrf_modem`, which runs on the application core, shares a region of RAM memory with the modem core.
7+
During the initialization, the Modem library accepts the boundaries of this region of RAM and configures the communication with the modem core accordingly.
8+
9+
However, it is the responsibility of the application to reserve that RAM during linking so that this memory area is not used for other purposes and remains dedicated for use by the Modem library.
10+
11+
The size and location of the shared memory can be defined in devicetree by creating the following RAM sections:
12+
13+
* ``sram0_ns_modem``:
14+
15+
This section contains all the subsections needed for communicating with the modem.
16+
You must place it in a specific area of RAM depending on the device (see the :ref:`following table <modem_shmem_variations>`).
17+
18+
* ``cpuapp_cpucell_ipc_shm_ctrl``:
19+
20+
This section is used for control messages.
21+
It has a minimum size depending on the modem firmware (see the :ref:`following table <modem_shmem_variations>`).
22+
23+
* ``cpuapp_cpucell_ipc_shm_heap``:
24+
25+
This section is used for data sent from the Modem library to the modem.
26+
The heap implementation used has an overhead of up to 128 bytes.
27+
Adjust the size of this region so it is 128 bytes larger than the largest allocation you expect to happen in your application (such as the longest AT command or the largest payload passed to :c:func:`nrf_send`).
28+
29+
* ``cpucell_cpuapp_ipc_shm_heap``:
30+
31+
This section is used for data sent from the modem to the Modem library.
32+
33+
* ``cpucell_cpuapp_ipc_shm_trace``:
34+
35+
This section is used for modem tracing.
36+
It is optional and only needs to be added when modem tracing is enabled.
37+
38+
* ``sram0_ns_app``:
39+
40+
This section is used as the application memory.
41+
The size of this section will be assigned to ``CONFIG_SRAM_SIZE`` in kB, so this section must be 1024-byte aligned.
42+
43+
.. _modem_shmem_variations:
44+
45+
.. table:: Control region size and shared memory location
46+
47+
+---------------+--------------+-----------------------+---------------------+------------------------+
48+
| Device series | Variant | Firmware | Control region size | Shared memory location |
49+
+---------------+--------------+-----------------------+---------------------+------------------------+
50+
| nRF91 | DECT NR+ | * mfw_nr+_nrf91x1 | 1832 bytes | first 128 kB of RAM |
51+
| | | * mfw_nr+-phy_nrf91x1 | | |
52+
| +--------------+-----------------------+---------------------+ |
53+
| | Cellular | * mfw_nrf9160 | 1256 bytes | |
54+
| | | * mfw_nrf91x1 | | |
55+
| | | * mfw_nrf9151-ntn | | |
56+
+---------------+--------------+-----------------------+---------------------+------------------------+

0 commit comments

Comments
 (0)