The Modem library is the application interface to the nRF9160 modem firmware, which contains a full IP and DTLS/TLS stack as well as GNSS. It provides the standard Socket APIs, to facilitate application development and additional APIs to manage the modem and perform full-modem firmware updates.
The library implements a communication interface between the Application and Modem cores on the nRF9160 via the RPC protocol, using the Inter Processor Communication (IPC) peripheral and a shared region of RAM.
The following figure shows a simplified Modem library architecture:
The Modem library needs to dynamically allocate memory (a heap) for proper functioning. This memory is used to store the internal data structures that are used to manage the communication between the application core and the modem core. This memory is never shared with the modem core and hence, it can be located anywhere in the application core’s RAM instead of the shared memory regions. The library OS abstraction layer defines the following functions to allocate and free up dynamic memory for the library: