I plan to port the FreeRTOS Cellular Library to my project.
I should support the modems Cat-M1 and Cat-1.
Q1: Is there support for two modes? I see, there official out of box support to Cat-M1 only?
Q2: Possible create 2 instances? My requirements to work in parallel with 2 modems (each modem on different UART peripheral, for example UART1 and UART2). For instance, I’ll take 2 modems, that already supported (Quectel BG96)?
Thank you for your interest in the cellular library.
Q1: Is there support for two modes? I see, there official out of box support to Cat-M1 only?
Currently, the FreeRTOS Cellular Interface only provides reference modem ports for Cat-M1/NB-IoT modems (e.g., Quectel BG96, Sierra HL7802, u-blox Sara R4). There is no official Cat-1 modem port available.
Additionally, some power-saving features such as eDRX and PSM are specific to Cat-M1/NB-IoT and are not supported by Cat-1 modems.
If you need Cat-1 support, you will need to create your own cellular module port. Since most LTE modems use standard 3GPP AT commands, porting a Cat-1 modem should be feasible.
Q2: Possible create 2 instances? My requirements to work in parallel with 2 modems (each modem on different UART peripheral, for example UART1 and UART2). For instance, I’ll take 2 modems, that already supported (Quectel BG96)?
The library was originally designed for single modem use. Some modifications are required to support multiple cellular contexts:
CELLULAR_CONTEXT_MAX – This is currently set to 1 in cellular_common.c. You can move this definition to cellular_config_defaults.h and override it in your cellular_config.h.
CELLULAR_CONFIG_STATIC_SOCKET_CONTEXT_ALLOCATION – Static socket allocation does not work with multiple cellular contexts because it uses a single global socket pool. You will need to set this to 0 to use dynamic allocation instead.
cellular_config.h – This file is used to configure the cellular library for a specific modem, and only one cellular_config.h is supported. If you are using two different modem types, you will need to merge their configurations into a single file, which may require some adaptation.
Static Cellular Module Context – Some module-specific ports contain static variables that may cause conflicts when running multiple instances. For example, the BG96 port uses a static module context to store modem state. If you want to enable two BG96 modems, you will need to modify the port to allocate a separate context for each instance.
Separate Comm Interface per Modem – Each modem requires its own communication interface implementation. You must provide separate comm interface callbacks (open, close, send, recv) for each UART peripheral (e.g., UART1 for modem 1, UART2 for modem 2).
We do not have direct experience enabling two cellular modems on a single board. If you encounter any issues, please feel free to post here and we will be happy to discuss and help troubleshoot.
Does the library able to support multiple tasks and if it thread safety? I mean, create a few tasks, each task is responsible to process data (read, write) from specific socket (TCP or UDP connection).
The Cellular library ensures thread safety between the internal pktio thread and the thread calling the cellular interface API. However, the application must ensure that only one thread calls the cellular interface API at a time.
If you need multiple tasks handling different sockets, the application must implement its own synchronization mechanism to ensure only one task accesses the cellular API at a time.
More explanation about multiple modem support:
Supporting multiple instances of the same cellular modem is possible, as each instance can share the same module implementation with separate contexts.
However, supporting multiple instances of different cellular modems would require architectural changes, since the current API binds directly to a single cellular module implementation.
Edit: Removed “significant” as I am not certain of the exact effort required.