- Introduction
- Getting Started
- Integrate FreeRTOS Cellular Interface with MCU platforms
- Adding support for new cellular modems
- Building Unit Tests
- Generating documentation
- Contributing
The FreeRTOS Cellular Interface exposes the capability of a few popular cellular modems through a uniform API. Currently, this repository contains libraries for these three cellular modems.
The current version of the FreeRTOS Cellular Interface encapsulates the TCP stack offered by those cellular modems. They all implement the same uniform Cellular Library API. That API hides the complexity of AT commands, and exposes a socket-like interface to C programmers.
Even though applications can choose to use the FreeRTOS Cellular Interface API directly, the API is not designed for such a purpose. In a typical FreeRTOS system, applications use high level libraries, such as the coreMQTT library and the coreHTTP library, to communicate with other end points. Those high level libraries use an abstract interface, the Transport Interface, to send and receive data. A Transport Interface can be implemented on top of the FreeRTOS Cellular Interface.
Most cellular modems implement more or less the AT commands defined by the 3GPP TS v27.007 standard. This project provides an implementation of such standard AT commands in a reusable common component. The three Cellular libraries in this project all take advantage of that common code. The library for each modem only implements the vendor-specific AT commands, then exposes the complete Cellular API.
The common component that implements the 3GPP TS v27.007 standard has been written in compliance of the following code quality criteria:
- GNU Complexity scores are not over 8.
- MISRA coding standard. Any deviations from the MISRA C:2012 guidelines are documented in source code comments marked by "
coverity
".
To clone using HTTPS:
git clone https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface.git
Using SSH:
git clone [email protected]/FreeRTOS/FreeRTOS-Cellular-Interface.git
At the root of this repository are these folders:
- source : reusable common code that implements the standard AT commands defined by 3GPP TS v27.007.
- modules : vendor-specific code that implements non-3GPP AT commands for each cellular modem.
- docs : documentations.
- test : unit test and cbmc.
- tools : tools for Coverity static analysis and CMock.
The FreeRTOS Cellular Interface runs on MCUs. It uses an abstracted interface - the Comm Interface, to communicate with cellular modems. A Comm Interface must be implemented as well on the MCU platform. The most common implementations of the Comm Interface are over UART hardware, but it can be implemented over other physical interfaces such as SPI as well. The documentation of the Comm Interface is found within the Cellular API References. These are example implementations of the Comm Interface:
- FreeRTOS windows simulator comm interface
- FreeRTOS Common IO UART comm interface
- STM32 L475 discovery board comm interface
- Sierra Sensor Hub board comm interface
The FreeRTOS Cellular Interface uses kernel APIs for task synchronization and memory management.
FreeRTOS Cellular Interface now supports AT commands, TCP offloaded Cellular abstraction Layer. In order to add support for a new cellular modem, the developer can use the common component that has already implemented the 3GPP standard AT commands.
In order to port the common component:
- Implement the cellular modem porting interface defined in cellular_common_portable.h (Document).
- Implement the subset of Cellular Library APIs that use vendor-specific (non-3GPP) AT commands. The APIs to be implemented are the ones not marked with an "o" in this table.
- Implement Cellular Library callback functions that handle vendor-specific (non-3GPP) Unsolicited Result Code (URC). The URC handlers to be implemented are the ones not marked with an "o" in this table.
The Cellular common APIs document provides detail information required in each steps. It is recommended that you start by cloning the implementation of one of the existing modems, then make modifications where your modem's vendor-specific (non-3GPP) AT commands are different.
Current Example Implementations:
By default, the submodules in this repository are configured with update=none
in .gitmodules to avoid increasing clone time and disk space usage of other repositories (like amazon-freertos that submodules this repository).
To build unit tests, the submodule dependency of CMock is required. Use the following command to clone the submodule:
git submodule update --checkout --init --recursive test/unit-test/CMock
- For building the unit tests, CMake 3.13.0 or later and a C90 compiler.
- For running unit tests, Ruby 2.0.0 or later is additionally required for the CMock test framework (that we use).
- For running the coverage target, gcov and lcov are additionally required.
-
Go to the root directory of this repository. (Make sure that the CMock submodule is cloned as described above.)
-
Run the cmake command:
cmake -S test -B build
-
Run this command to build the library and unit tests:
make -C build all
-
The generated test executables will be present in
build/bin/tests
folder. -
Run
cd build && ctest
to execute all tests and view the test run summary.
To learn more about CBMC and proofs specifically, review the training material here.
The test/cbmc/proofs
directory contains CBMC proofs.
In order to run these proofs you will need to install CBMC and other tools by following the instructions here.
Please refer to the demos of the Cellular Interface library here using FreeRTOS on the Windows simulator platform. These can be used as reference examples for the library API.
The Doxygen references were created using Doxygen version 1.9.2. To generate the Doxygen pages, please run the following command from the root of this repository:
doxygen docs/doxygen/config.doxyfile
See CONTRIBUTING.md for information on contributing.