Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Gurux DLMS MeterStudio
  3. Gurux DLMS MeterStudio
  4. Build
  5. NRF9160
By Gurux Documentation , 30 November, 2026
Gurux DLMS MeterStudio

Use this quick start for Nordic nRF9160 DK / PCA10090. MeterStudio generates a standalone secure Cortex-M33 application. It is not a Zephyr, TF-M or MCUboot project: do not substitute west build for its generated build script.

1. Download the local compiler and headers

Install Arm GNU Toolchain, choosing arm-none-eabi. Obtain nrfx v3.14.0 and CMSIS5 v5.9.0:

git clone --branch v3.14.0 --depth 1 https://github.com/NordicSemiconductor/nrfx.git C:/SDKs/nrfx
git clone --branch 5.9.0 --depth 1 https://github.com/ARM-software/CMSIS_5.git C:/SDKs/CMSIS_5

Check C:/SDKs/nrfx/mdk/nrf9160.h and C:/SDKs/CMSIS_5/CMSIS/Core/Include/core_cm33.h. The CMSIS include option points to the directory containing that header, not the CMSIS repository root.

2. Build locally first

Extract the generated project and open Windows PowerShell in its root directory:

.\build.ps1 -NrfxPath C:/SDKs/nrfx -CmsisInclude C:/SDKs/CMSIS_5/CMSIS/Core/Include -GccBin C:/Tools/ArmGNU/bin

Substitute the installed paths. The script also reads NRFX_PATH, CMSIS_INCLUDE and ARM_GCC_BIN environment variables. Successful output is build/meter.elf, meter.hex, meter.bin and meter.map.

If there is no local compiler, continue with Docker; keep the nrfx and CMSIS headers.

3. Docker fallback: download and build

Prepare the Arm Docker image. Its PowerShell/compiler aliases allow the generated script to run without a host compiler.

From the extracted project directory, in Windows PowerShell:

$projectDir = (Get-Location).Path
$nrfxSdk = (Resolve-Path C:/SDKs/nrfx).Path
$cmsisHeaders = (Resolve-Path C:/SDKs/CMSIS_5/CMSIS/Core/Include).Path
docker run --rm -v "${projectDir}:/project" -v "${nrfxSdk}:/nrfx:ro" -v "${cmsisHeaders}:/cmsis:ro" meterstudio-arm:local -File ./build.ps1 -NrfxPath /nrfx -CmsisInclude /cmsis -GccBin /opt/arm/bin

For native Linux:

docker run --rm -v "$PWD:/project" -v /opt/sdks/nrfx:/nrfx:ro -v /opt/sdks/CMSIS_5/CMSIS/Core/Include:/cmsis:ro meterstudio-arm:local -File ./build.ps1 -NrfxPath /nrfx -CmsisInclude /cmsis -GccBin /opt/arm/bin

The resulting build/meter.hex is on the host. This uses nrfx directly; the presence of Nordic tooling does not turn the project into an nRF Connect SDK application.

4. Prepare the programming tool and board

Install current nRF Util, then its device command:

nrfutil install device
nrfutil device --version
nrfutil device list

Install the matching SEGGER J-Link release and USB drivers required by the selected device-command version; use Nordic's current prerequisite table. Do not use the legacy Python pip install nrfutil package as a replacement for this tool.

Connect the DK's debug USB, select nRF91 on the debug selector, and retain the factory nRF52840 board-controller firmware. Copy the serial number for the intended DK from device list.

5. Flash after a local or Docker build

On Windows, from the project directory:

.\flash.ps1 -ProbeSerial YOUR_JLINK_SERIAL -NrfutilPath C:/Tools/nrfutil/nrfutil.exe

This works after a Docker compilation without installing a Windows compiler. The script uses ERASE_RANGES_TOUCHED_BY_FIRMWARE, verifies readback and resets the nRF9160. It does not program the modem or nRF52840. Do not use recover or mass erase for an ordinary update.

Entire flash step inside Docker on native Linux

Nordic provides a separate toolchain image with nRF Util/device and J-Link. Use it here for programming the already-built HEX. This example uses an available versioned tag:

docker pull ghcr.io/nrfconnect/sdk-nrf-toolchain:v3.2.2
docker run --rm -it --privileged -v /dev:/dev -v /run/udev:/run/udev:ro -v "$PWD:/project" -w /project ghcr.io/nrfconnect/sdk-nrf-toolchain:v3.2.2 bash

Read and accept the vendor's J-Link licence when prompted if you agree. This vendor USB procedure grants the container broad device access; use it on your development machine. Inside the container:

nrfutil device --version
nrfutil device list
nrfutil device program --serial-number YOUR_JLINK_SERIAL --firmware build/meter.hex --options 'chip_erase_mode=ERASE_RANGES_TOUCHED_BY_FIRMWARE,verify=VERIFY_READ,reset=RESET_SYSTEM'
exit

Use the serial for the intended nRF91 DK only. On Windows Docker Desktop, use the host flash script unless USB/IP has been set up separately. A Windows COM-port name alone does not expose the debug probe to the container.

6. Connect and update later

Select VCOM0 in Director, assert DTR, and use default HDLC 9600, 8N1, no hardware flow control. The DK exposes several COM ports; port numbers vary. Firmware uses UARTE0 TX P0.29 / RX P0.28.

This target supports General/Minimum Data/Register/Clock with None/Low, not LTE/GNSS, HLS/GMAC or DLMS Image Transfer. Low credentials need provisioning or explicit inclusion in the generated image.

For later updates, rebuild the application and repeat the same flash command. Preserve 0x000FC000–0x000FFFFF, the final 16 KiB settings region. Firmware uses the preceding 1008 KiB. Generation and cross-compilation do not establish physical HDLC/persistence operation; verify those on your actual DK.

Return to Build.

  • Log in or register to post comments
  • Create new account
  • Reset your password

Book navigation

  • Standard
  • Target
  • Referencing
  • Transport
  • Associations
  • Passwords
  • Security
  • Objects
  • Validation
  • ZIP
  • Build
    • ESP32-S3
    • STM32L433RC
    • EFR32MG13P
    • nRF9160
    • LPCXpresso54608
    • MKM35Z512VLL7
    • R5F10NMLDFB
    • Windows / Visual Studio
    • Linux / Makefile

Hire Us!

Latest Releases

  • Mon, 11/30/2026 - 14:21
    gurux.dlms.c 9.0.2611.3001
  • Thu, 11/26/2026 - 15:24
    gurux.dlms.c 9.0.2611.2601
  • Thu, 11/19/2026 - 10:57
    Gurux.DLMS.Python 1.0.204
  • Thu, 11/19/2026 - 10:12
    gurux.dlms.c 9.0.2611.1901
  • Tue, 10/13/2026 - 12:00
    gurux.dlms.java 4.0.97

New forum topics

  • Landis E650 meter reading over DLMS
  • class_id = 40, version = 2, pushsetup Unparsed data frame
  • GXObisValueItem entries without MaskSize appear to be interpreted as bit flags
  • CheckedListBox incorrectly selects GXObisValueItem Value=0 for non-zero values
  • UIValueType=TextBox is rendered as CheckedListBox when Values are defined
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin