|
| 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