Getting started
Before getting started, make sure you have a proper nRF Connect SDK development environment. Follow the official Getting started guide.
There are two options for setting up the project, depending on your preferred development environment:
Using nRF Connect for VS Code (recommended)
Using the command line
Initialization
This section represents alternative approaches for initializing the workspace.
To install the nRF Connect SDK and its toolchain using nRF Connect for VS Code, follow extension documentation or Installing nRF Connect SDK and VS Code exercise on Nordic Developer Academy.
Open the nRF Connect extension in Visual Studio Code by clicking its icon in the Activity Bar.
Click Create New Application.
Select the Browse nRF Connect SDK add-on Index option.
Search for the Serial Modem application and create the project.
Assume you have an existing nRF Connect SDK workspace in the ncs folder.
Navigate to the workspace folder:
cd ncs
Clone Serial Modem repository:
git clone https://github.com/nrfconnect/ncs-serial-modem.git
Set manifest path to the Serial Modem:
west config manifest.path ncs-serial-modem
Update the nRF Connect SDK modules:
west update
Depending on the current state of your nRF Connect SDK modules, this may take several minutes as it fetches all nRF Connect SDK modules according to the requirements of the Serial Modem.
Complete the following steps for initialization:
To initialize the workspace:
west init -m https://github.com/nrfconnect/ncs-serial-modem --mr main ncs
Navigate to the workspace folder:
cd ncs
Update the nRF Connect SDK modules:
west update
This may take several minutes as it fetches all nRF Connect SDK modules according to the requirements of the Serial Modem.
Building and running
Before building and running the application, you need to connect the development kit to your PC using a USB cable and power on the development kit. Complete the following steps for building and running:
Complete the steps in the How to build an application section in the extension documentation to build the application.
You can also specify the additional configuration variables (Kconfig, DTC overlays, and extra Kconfig options) while setting up a build configuration during building the application. See Providing CMake options for more information on setting the additional configuration variables.
Open the nRF Connect extension in Visual Studio Code by clicking its icon in the Activity Bar.
In the extension’s Actions View, click on Flash.
The application is now built and flashed to the device. You can open a serial terminal to use the application. The default baud rate is 115200.
From the workspace folder, navigate to the
ncs-serial-modemfolder:cd ncs-serial-modem/app
To build the application, run the following command:
west build -p -b nrf9151dk/nrf9151/ns
To build the application with nRF91M1 configuration, run the following command, which utilizes the configuration from the
app/sample.yamlfile:west build -b nrf9151dk/nrf9151/ns -p -T ./serial_modem.nrf91m1
To build the application with Kconfig, DTC overlays, and extra Kconfig options, the following command gives an example of how they are passed as build arguments:
west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE="overlay-ppp.conf;overlay-cmux.conf" -DEXTRA_DTC_OVERLAY_FILE="overlay-external-mcu.overlay" -DCONFIG_SM_LOG_LEVEL_DBG=y
To program the application, run the following command:
west flash
The application is now built and flashed to the device. You can open a serial terminal to use the application. The default baud rate is 115200.
Note
When building the Serial Modem application, the manifest path must point to the ncs-serial-modem folder.
Otherwise linking will fail as drivers and libraries from Serial Modem will not be found.
To check your current manifest path, run the following command anywhere in your workspace:
west config manifest.path
To set the manifest path for Serial Modem, run the following command:
west config manifest.path ncs-serial-modem