Boards

BoardDescription
Air Quality WingAir Quality WingFeatherwing for Air Quality Monitoring
nRF9160 FeathernRF9160 FeatherFeather using nRF9160 to connect via LTE CAT M1 or CAT NB1.
Sparkfun Thing Plus nRF9160Sparkfun Thing Plus nRF9160Thing Plus using nRF9160 to connect via LTE CAT M1 or CAT NB1.

Introduction to the nRF9160 Feather

The nRF9160 Feather by Jared Wolff (aka Circuit Dojo LLC) is an electronics development board. It features a Nordic Semiconductor nRF9160-SICA part. This part is capable of both CAT M1 LTE and NB-IoT for communication with the outside world. It's compatible primarily with Zephyr via the nRF Connect SDK. Other toolchains and languages coming soon to a Github repository near you.

Air Quality Wing Board

Glamour Shots

nRF9160 Feather with OSHWA nRf9160 Feather Trimmed nRf9160 Feather Back

Overview

Diagram

This board can be powered several ways. The most popular way to power Feather boards is by using the USB port. This board is no exception. It works well across both USB and LiPoly batteries.

The board is designed from the ground up to be power efficient at the most used power state: standby. That's right, if you're developing something that's battery powered, your most used state will usually be standby mode. As of this writing the estimated current draw in this state should be about 2µA. That's approximately 8.5 years on a 150mAH cell!

Speaking of power, this board also has a fully fledged DC/DC Buck Boost. That whether your input voltage is 5.5 or 2.8V you'll get a nice stable 3.3V at the output.

This board also sports some external flash for storing your application data. Use it with the built in support for LittleFS in Zephyr. Or, use one of your choice! What ever tickles your fancy.

Finally, but not least, the nRF9160. I've been watching this part very carefully since the CEO had it locked in a mysterious black case years back. It's here and it's real and the module is half the price of other modules. I won't bore you with all the technical details. (Technical details get you excited? Go here.) Needless to say, it's awesome.

Logos

I'll be launching in collaboration with the awesome folks at Hackster.io and GroupGets. We're all very excited to bring these boards to you!

If you want real-time updates, sign up here and i'll stay in touch. I can't wait to share more with you!

Specifications and Requirements

Specs photo

Technical Details

  • Nordic nRF9160*
    • Microcontroller
      • ARM Cortex M33
      • 1MB Flash
      • 256kB RAM
      • ARM® TrustZone®
      • ARM® Cryptocell 310
      • Up to 4x SPI, I2C and UART with Easy DMA
      • I2S w/ EasyDMA
      • 4x PWM with EasyDMA
      • 12bit SADC with EasyDMA
      • 2x RTC
      • PPI (Programmable peripheral interconnect) interface
    • Radio
      • Transceiver and baseband
      • 3GPP LTE release 13 Category M1 and NB1 compliant
      • 3GPP release 14 NB2 compliant
      • GPS receiver (GPS L1 C/A supported) - Active antenna only.
      • RF Transceiver for global coverage supporting bands:
        • Cat-M1: B1, B2, B3, B4, B5, B8, B12, B13, B14, B17, B18, B19, B20, B25, B26, B28, B66
        • Cat-NB1/NB2: B1, B2, B3, B4, B5, B8, B12, B13, B17, B18, B20, B25, B26, B28, B66
      • Supports 4FF Nano SIM
  • Micro USB connection for USB-to-Serial and DFU
  • Pre-programmed MCUBoot bootloader
  • External NOR Flash by Winbond
    • 2MB 4MB of space (Upgraded for all boards as of August 2, 2020!)
    • Max bus speed of 133MHz
    • Standard SPI
  • Power supply
    • 3.3V Buck/Boost up to 0.9A of current draw
    • Operating range 2.8 to 5.5V
    • External LiPoly battery connection (JST SPH type)
    • LiPoly set to 300mA with indication
  • Programmer
    • Capable of interfacing with Jlink and CMSIS-DAP based programmers
    • Use with a Tag Connect TC2030-CTX-NL over Serial Wire Debug (SWD)
  • Low Power RTC on board for time keeping and as a low power wakeup source.
  • User I/O
    • Standard feather form factor GPIOs (0.1" pitch)
    • 2x buttons (1 Reset, 1 General Purpose)
    • 1x Blue LED connected to D7
  • Antenna connections:
    • 1x U.FL for LTE with matching network
    • 1x U.FL for active GPS antennas
  • Feather form factor
    • 50.8mm x 22.86mm (2" x 0.9")

* nRF9160 tech specs provided from the nRF9160 Product Specification

Block Diagram

Electrical

Here are the elctrical specifications for the nRF9160 Feather. Most of the specifications here are based on the nRF9160 Product Specification. You can get the latest version of the nRF9160 Product Specification here. All previous versions can be found here.

Board Supply

  • Output voltage: 3.3V ± 0.3V
  • Max output current: 800mA
  • Off current w/ Low Power RTC: < 3µA

Pin Ratings (MD/A0-A5/D0-D8/TX/RX/CIPO/COPI/SCK/RST)

  • Max input voltage: 3.6V

Enable Pin

  • Max input voltage: 8V¹

¹Enable pin is active low.

External Power Supply

The nRF9160 Feather can be powered via battery or USB. See below for the specifics for each power source

USB Requirements

  • Operating range: 5V ± 0.2V
  • Current requirements: >500mA

Battery Requirements

  • Battery type: LiPoly
  • Operating range: 2.8-5.5V
  • Current/power rating: Able to support at least 2W of power
  • Battery capacity: > 300mAH²
  • Charging current: 294mA ± 10%

²Batteries below this capacity are not recommended nor supported.

GPS Antenna

GPS Antenna

The U.FL port on the nRf9160 Feather is to be used with an active GPS antenna only.

  • Antenna supply voltage: 3.3V ± 0.3V
  • Antenna current rating: 15mA

The port works with most U.FL based active antenna parts. The nRF9160 Feather has been tested and verified with the following parts:

Part NumberManufacturererDatasheetNotes
ACTPAT182-01-IPInventek SystemsLinkOffered as an addon

Cellular Antenna

The nRF9160 Feather has been tested with these approved antennas. They're chosen specifically to match the FCC requirements as indicated here.

Part NumberManufacturererDatasheetNotes
FH2B4MH1F2F0100Unictron TechnologiesLinkIncluded
ANT-LTE-RPC-UFLLinxLinkGPS/GNSS, Rigid

Only tested antennas are supported. If you choose to use a different one, proceed at your own risk!

Getting Started

Start here

🚨Read this first🚨

There are some important things about the nRF9160 Feather before you get started:

  1. The nRF9160 Feater shouldn't be used with a battery less than 300mAH. More information in the specs section.
  2. If you need to debug your nRF9160 Feather, it requires an external programmer. More information on that in the Requirements for external programming section.
  3. Looking for help? Check out the support forum: https://community.jaredwolff.com

What's included

nRF9160 Feather

  • 1x nRF9160 Feather board
  • 1x set of male headers (16 pin and 12 pin)
  • 1x wide-band LTE antenna
  • 1x getting started card
  • 1x IoT SIM

SDK and Development Environment Setup

Instructions below are based on using Microsoft's Visual Studio Code as your workspace. While you may choose a different editor, most of the steps remain the same.

Getting Started Sections

SDK Setup (Mac OS)

This page is all about getting your Mac compiling code for the nRF9160 Feather. Run into trouble during the process? Post your questions on the community forum.

Installing IDE

  1. Install or use the code editor of your choice. I personally use Microsoft Visual Studio Code. The download link is here
  2. If you decide to use Visual Studio Code, make sure you install the C/C++ and Cortex-Debug extentions using the built in extension marketplace.

Installing SDK

Before we start, if you already have NCS installed, you can skip to Step 8. Let's begin!

Installing the latest SDK is a snap and only takes a few steps. Let's walk through them here:

  1. If you haven't already make sure you install Xcode Command Line tools. Without it you may run into issues compiling later on. Run the following in CLI:

    xcode-select --install
    
  2. Download and install nRF Connect For Desktop

    Download page for nRF Connect For Desktop

  3. Copy the app to your Applications folder

    Installer

  4. Open up the app and install the Toolchain Manager

    Toolchain Manager install

  5. Then open it up.

    Open Toolchain Manager

  6. Scroll to the bottom and click Install package from other source

    Other source install

  7. Then paste this url into the box and click ok.

    http://developer.nordicsemi.com/.pc-tools/toolchain/ncs-toolchain-v1.5.0-20210225-607a0e0-minimal.dmg
    

    Insert into box

  8. The download and install will take a few minutes. Hang out, take a walk, sing a song and come back later.

  9. Finally, once installed you'll have a dropdown that you can access. Click on it and then the Open Terminal option. Open terminal

  10. To get the nRF9160 Feather examples we'll update /opt/nordic/ncs/v1.5.0/nrf/west.yml. First in the remotes section add:

 - name: circuitdojo
   url-base: https://github.com/circuitdojo
  1. Then in the projects section add at the bottom:

    - name: nfed
      repo-path: nrf9160-feather-examples-and-drivers
      revision: v1.5.x
      path: nfed
      remote: circuitdojo
    

    Here's the diff for the file afterwards:

    diff --git a/west.yml b/west.yml
    index 2065ad3f..de8ea812 100644
    --- a/west.yml
    +++ b/west.yml
    @@ -33,6 +33,8 @@ manifest:
           url-base: https://github.com/nanopb
         - name: alexa
           url-base: https://github.com/alexa
    +    - name: circuitdojo
    +      url-base: https://github.com/circuitdojo
     
       # If not otherwise specified, the projects below should be obtained
       # from the ncs remote.
    @@ -124,6 +126,13 @@ manifest:
           path: modules/alexa-embedded
           revision: face92d8c62184832793f518bb1f19379538c5c1
           remote: alexa
    +    - name: nfed
    +      repo-path: nrf9160-feather-examples-and-drivers
    +      revision: v1.5.x
    +      path: nfed
    +      remote: circuitdojo
    +    - name: pyrinas
    +      path: pyrinas
     
       # West-related configuration for the nrf repository.
       self:
    
    
  2. Then run west update in your freshly created terminal session. This will fetch the nRF9160 Feather examples.

Installing newtmgr

  1. If you'r on a newer version of OSX you'll need to install the drivers.

  2. For loading code to your nRF9160 Feather, you'll need to download and copy a custom version of newtmgr. Open a terminal window and run:

    cd ~/Downloads
    wget "https://docs.jaredwolff.com/files/newtmgr/darwin/newtmgr.zip"
    unzip newtmgr.zip
    mv newtmgr /opt/nordic/ncs/v1.5.0/toolchain/bin
    rm newtmgr.zip
    
  3. Then you'll need to add your serial profile to make it easier to download/update your device:

    newtmgr conn add serial type=serial connstring='dev=/dev/tty.SLAB_USBtoUART,baud=1000000'
    

    If you have multiple Silicon Labs CP2102 connected to your machine your serial port may be named differently. I recommend you unplug all devices that could be named tty.SLAB_USBtoUART to ensure you're targeting the correct device during programming.

For more info in using newtmgr checkout the programming section of this documentation.

Migrating from previous instructions

Follow the same steps as above. Except for Step 9. Then copy your nfed directory from your old setup to the new SDK folder. It will be in /opt/nordic/ncs/v1.5.0/. You'll want to checkout the latest using git pull && git checkout v1.5.x.

Testing it

Now you can get to playing around with some of the nRF9160 Feather example code! Remember you'll always have to open a terminal using the Toolchain Manager to build code!

You can quickly test if your SDK is set up correctly by checking out the blinky example.

SDK Setup (Windows)

This page is all about getting your Windows machine compiling code for the nRF9160 Feather. Run into trouble during the process? Post your questions on the community forum.

IDE Setup

  1. Install or use the code editor of your choice. I personally use Microsoft Visual Studio Code. The download link is here
  2. If you decide to use Visual Studio Code, make sure you install the C/C++ and Cortex-Debug extentions using the built in extension marketplace. Extensions installed

SDK Install

Before we start, if you already have NCS installed, you can skip to Step 8. Let's begin!

  1. Download and install nRF Connect For Desktop

    Download page for nRF Connect For Desktop

  2. Once downloaded, run the installer.

    nRF Connect Install

  3. Open up the app and install the Toolchain Manager

    Toolchain Manager install

  4. Then open it up after installing.

  5. Scroll to the bottom and click Install package from other source

    Other source install

  6. Then paste this url into the box and click ok.

    http://developer.nordicsemi.com/.pc-tools/toolchain/ncs-toolchain-v1.5.0-20210225-607a0e0-minimal.zip
    

    Insert into box

  7. The download and install will take a few minutes. Hang out, take a walk, sing a song and come back later.

  8. Finally, once installed you'll have a dropdown that youc an access. Click on it and then the Open Bash or Open Command Prompt option. (I prefer bash since I use *nix a lot) Open terminal

  9. To get the nRF9160 Feather examples we'll update C:\Users\<your username>\ncs\v1.5.0\nrf\west.yml. First in the remotes section add:

     - name: circuitdojo
       url-base: https://github.com/circuitdojo
    
  10. Then in the projects section add at the bottom:

    - name: nfed
      repo-path: nrf9160-feather-examples-and-drivers
      revision: v1.5.x
      path: nfed
      remote: circuitdojo
    

    Here's the diff for the file afterwards:

    diff --git a/west.yml b/west.yml
    index 2065ad3f..de8ea812 100644
    --- a/west.yml
    +++ b/west.yml
    @@ -33,6 +33,8 @@ manifest:
           url-base: https://github.com/nanopb
         - name: alexa
           url-base: https://github.com/alexa
    +    - name: circuitdojo
    +      url-base: https://github.com/circuitdojo
     
       # If not otherwise specified, the projects below should be obtained
       # from the ncs remote.
    @@ -124,6 +126,13 @@ manifest:
           path: modules/alexa-embedded
           revision: face92d8c62184832793f518bb1f19379538c5c1
           remote: alexa
    +    - name: nfed
    +      repo-path: nrf9160-feather-examples-and-drivers
    +      revision: v1.5.x
    +      path: nfed
    +      remote: circuitdojo
    +    - name: pyrinas
    +      path: pyrinas
     
       # West-related configuration for the nrf repository.
       self:
    
    
  11. Then run west update in your freshly created bash/command prompt session. This will fetch the nRF9160 Feather examples.

newtmgr

  1. For loading code to your nRF9160 Feather, you'll need to download and copy a custom version of newtmgr.
  2. Extract it and move it into your toolchain/bin/ directory. This will likely be: C:\Users\<your username>\ncs\v1.5.0\toolchain\bin
  3. Then, you'll need to add your serial profile to make it easier to download/update your device:
    newtmgr conn add serial type=serial connstring="dev=COM5,baud=1000000"
    
    Make sure that the COM port matches the one attached to the nRF9160 Feather. An easy way to check is to remove and add the device to see which COM port shows up in device manager.
  4. Having trouble? You may need to install the Silabs VCP driver.. Download and install the CP210x VCP Windows option.

For more info in using newtmgr checkout the programming section of this documentation.

Migrating from previous instructions

Follow the same steps as above. Except for Step 9. Then copy your nfed directory from your old setup to the new SDK folder. It will be in /opt/nordic/ncs/v1.5.0/. You'll want to checkout the latest using git pull && git checkout v1.5.x.

Testing it

You can quickly test if your SDK is set up correctly by checking out the blinky example. Make sure that you've closed and re-opened all terminals and Visual Studio Code so the environment is correct. Otherwise you may have issues compiling or flashing code.

SDK Setup (Linux - Ubuntu)

This page is all about getting your Linux machine compiling code for the nRF9160 Feather. Run into trouble during the process? Post your questions on the community forum.

Installing IDE

  1. Install or use the code editor of your choice. I personally use Microsoft Visual Studio Code. You can download directly from the Ubuntu Software Install utility. Ubuntu software install
  2. If you decide to use Visual Studio Code, make sure you install the C/C++ and Cortex-Debug extentions using the built in extension marketplace.

Installing SDK

  1. Install dependencies using apt-get

    sudo apt install --no-install-recommends git cmake ninja-build gperf \
    ccache dfu-util device-tree-compiler wget \
    python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
    make gcc gcc-multilib g++-multilib libsdl2-dev
    
  2. Check your cmake version:

    cmake --version
    

    If it's older than 3.13.3, you'll have to install a newer version using the instructions here.

  3. Install west. West is the most important utility for using nRF Connect SDK & Zephyr. You'll become quite familliar with very soon.

    pip3 install --user -U west
    
  4. Then make sure that ~/.local/bin is added to your path:

    echo 'export PATH=~/.local/bin:"$PATH"' >> ~/.bashrc
    source ~/.bashrc
    
  5. Now create a folder on your machine and call it nfed (short for nRF9160 Feather Examples and Drivers). Open a terminal to this folder and initialize nRF Connect SDK using west:

    cd ~
    mkdir nfed
    cd nfed
    west init -m https://github.com/circuitdojo/nrf9160-feather-examples-and-drivers --mr v1.5.x
    
  6. Once your nRF Connect SDK compontents are downloaded, you'll need to fetch the remaining SDK:

    west update
    

    You'll see a bunch of output go by as west downloads dependencies using Git.

    Here's what your nfed folder should look like:

    ❯ tree -L 1
    .
    ├── bootloader
    ├── build
    ├── latest
    ├── mbedtls
    ├── modules
    ├── nrf
    ├── nrf9160-feather
    ├── nrfxlib
    ├── test
    ├── tools
    └── zephyr
    
  7. Installing the remaining SDK requirements using pip3:

    pip3 install --user -r zephyr/scripts/requirements.txt
    pip3 install --user -r nrf/scripts/requirements.txt
    pip3 install --user -r bootloader/mcuboot/scripts/requirements.txt
    

    Note: there may be an error during the first pip3 install you can safely ignore them.

The ARM Embedded Toolchain

  1. First download the latest Zephyr SDK installer:
    cd ~
    wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.11.4/zephyr-sdk-0.11.4-setup.run
    
  2. Then run it:
    chmod +x zephyr-sdk-0.11.4-setup.run
    ./zephyr-sdk-0.11.4-setup.run -- -d ~/zephyr-sdk-0.11.4
    
  3. Finally install the udev rules which allows you to flash boards using a programmer.
    sudo cp ~/zephyr-sdk-0.11.4/sysroots/x86_64-pokysdk-linux/usr/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d
    sudo udevadm control --reload
    

newtmgr

  1. For loading code to your nRF9160 Feather, you'll need to download and copy a custom version of newtmgr to a folder in your PATH.

    cd ~/Downloads
    wget "https://docs.jaredwolff.com/files/newtmgr/linux/newtmgr.zip"
    unzip newtmgr.zip
    mv newtmgr ~/.local/bin
    rm newtmgr.zip
    

    If you're not sure, ~/.local/bin is always a good spot for these types of binaries.

  2. Then you'll need to add your serial profile to make it easier to download/update your device:

    newtmgr conn add serial type=serial connstring='dev=/dev/ttyUSB0,baud=1000000'
    newtmgr -c serial reset
    

    If you have multiple Silicon Labs CP2102 connected to your machine your serial port may be named differently. I recommend you unplug all devices that could be named ttyUSB0 to ensure you're targeting the correct device during programming.

    Note if you get a Error: open /dev/ttyUSB0: permission denied error. You'll have to fix permissions for the serial device for all users. Here are the steps:

    Open this .rules file in vi (or your editor of choice)

    sudo vi /etc/udev/rules.d/50-myusb.rules
    

    Then within the editor hit i, paste this:

    KERNEL=="ttyUSB[0-9]*",MODE="0666"
    KERNEL=="ttyACM[0-9]*",MODE="0666"
    

    Hit the esc button and then type :wq!.

For more info in using newtmgr checkout the programming section of this documentation.

Testing it

You can quickly test if your SDK is set up correctly by checking out the blinky example.

Compiling an Application

Prerequisites/SDK Setup

If you haven't already, make sure you've set up the SDK:

Side note One of the engineers at Nordic configured a Docker Image you can also use to build your code. I'll be adding a section on this when I get a chance to test it!

Board Defintion Files

Currently the 1.2 and 1.3 branchs of the nRF Connect SDK does not have support for the nRF9160 Feather built in. You'll need to download and copy the appropriate board defintion files from the downloads page. If you're using the latest nRF SDK those defintions should be included.

To install, unzip the contents of the board defintions to ncs/zephyr/boards/arm/ It should create a folder called circuitdojo_feather_nrf9160. Congrats your board files are installed! You should be able to use the circuitdojo_feather_nrf9160ns target for your Zephyr builds!

Here are the direct downloads:

Note: if you're using the v1.2.x branch of nRF Connect SDK, make sure you're using the v1.2.x definitions. Same for the v1.3.x definitions.

Example

As long as you have all the requirements from the guide above, compiling for the nRF9160 Feather should be as simple as running the following:

west build -b circuitdojo_feather_nrf9160ns

If you would like to "clean" your project before building add the -p parameter.

west build -b circuitdojo_feather_nrf9160ns -p

Note: having trouble building? Make sure you check out the troubleshooting page.

The output assets are placed in the build/zephyr folder. If you're programming from scratch, you'll want the merged.hex. If you're using newtmgr then you'll want the app_update.bin. More info on different programming methods in the programming and debugging section using newtmgr and an external programmer.

For subsequent builds you don't need -b circuitdojo_feather_nrf9160ns if you're not using the -p param.

west build

west uses the last board that was indicated for the re-build.

Here's an example compile output from the blinky sample:

$ west build -b circuitdojo_feather_nrf9160ns
[0/1] Re-running CMake...
Including boilerplate (Zephyr base (cached)): /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/cmake/app/boilerplate.cmake
-- Application: /Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client
-- Zephyr version: 2.3.99 (/Users/jaredwolff/Git/nrf-connect/ncs/zephyr)
-- Found west: /usr/local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
-- Board: circuitdojo_feather_nrf9160ns
-- Found dtc: /usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/Users/jaredwolff/gcc-arm-none-eabi-9-2019-q4-major)
-- Found BOARD.dts: /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160ns.dts
circuitdojo_feather_nrf9160ns.dts.pre.tmp:358.32-362.5: Warning (simple_bus_reg): /soc/cryptocell-sw: missing or empty reg/ranges property
circuitdojo_feather_nrf9160ns.dts.pre.tmp:57.42-69.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@40000000/kmu@39000)
circuitdojo_feather_nrf9160ns.dts.pre.tmp:306.19-312.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@40000000/power@5000)
-- Generated zephyr.dts: /Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/zephyr/include/generated/devicetree_unfixed.h
Parsing /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/Kconfig
Loaded configuration '/Users/jaredwolff/Git/nrf-connect/ncs/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160ns_defconfig'
Merged configuration '/Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/prj.conf'
Configuration saved to '/Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/zephyr/.config'
Kconfig header saved to '/Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/zephyr/include/generated/autoconf.h'
-- Cache files will be written to: /Users/jaredwolff/Library/Caches/zephyr
Changed board to secure circuitdojo_feather_nrf9160 (NOT NS)

=== child image spm -  begin ===
Including boilerplate (Zephyr base (cached)): /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/cmake/app/boilerplate.cmake
-- Application: /Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/spm
-- Zephyr version: 2.3.99 (/Users/jaredwolff/Git/nrf-connect/ncs/zephyr)
-- Found west: /usr/local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
-- Board: circuitdojo_feather_nrf9160
-- Found dtc: /usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/Users/jaredwolff/gcc-arm-none-eabi-9-2019-q4-major)
-- Found BOARD.dts: /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160.dts
circuitdojo_feather_nrf9160.dts.pre.tmp:57.42-69.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@50000000/kmu@39000)
circuitdojo_feather_nrf9160.dts.pre.tmp:306.19-312.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@50000000/power@5000)
-- Generated zephyr.dts: /Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/spm/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/spm/zephyr/include/generated/devicetree_unfixed.h
Parsing /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/Kconfig
Loaded configuration '/Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/spm/zephyr/.config'
No change to configuration in '/Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/spm/zephyr/.config'
No change to Kconfig header in '/Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/spm/zephyr/include/generated/autoconf.h'
-- Cache files will be written to: /Users/jaredwolff/Library/Caches/zephyr
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/spm
=== child image spm -  end ===

Changed board to secure circuitdojo_feather_nrf9160 (NOT NS)

=== child image mcuboot -  begin ===
Including boilerplate (Zephyr base (cached)): /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/cmake/app/boilerplate.cmake
-- Application: /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr
-- Zephyr version: 2.3.99 (/Users/jaredwolff/Git/nrf-connect/ncs/zephyr)
-- Found west: /usr/local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
-- Board: circuitdojo_feather_nrf9160
-- Found dtc: /usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/Users/jaredwolff/gcc-arm-none-eabi-9-2019-q4-major)
-- Found BOARD.dts: /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160.dts
-- Found devicetree overlay: /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Found devicetree overlay: /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Found devicetree overlay: /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Found devicetree overlay: /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Found devicetree overlay: /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/dts.overlay
circuitdojo_feather_nrf9160.dts.pre.tmp:57.42-69.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@50000000/kmu@39000)
circuitdojo_feather_nrf9160.dts.pre.tmp:306.19-312.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@50000000/power@5000)
-- Generated zephyr.dts: /Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/mcuboot/zephyr/include/generated/devicetree_unfixed.h
Parsing /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/Kconfig
Loaded configuration '/Users/jaredwolff/Git/nrf-connect/ncs/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_defconfig'
Merged configuration '/Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/prj.conf'
Merged configuration '/Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/boards/circuitdojo_feather_nrf9160.conf'
Configuration saved to '/Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/mcuboot/zephyr/.config'
Kconfig header saved to '/Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/mcuboot/zephyr/include/generated/autoconf.h'
-- Cache files will be written to: /Users/jaredwolff/Library/Caches/zephyr
MCUBoot bootloader key file: /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/root-rsa-2048.pem
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build/mcuboot
=== child image mcuboot -  end ===

CMake Warning at /Users/jaredwolff/Git/nrf-connect/ncs/nrf/cmake/mcuboot.cmake:115 (message):


        ---------------------------------------------------------
        --- WARNING: Using default MCUBoot key, it should not ---
        --- be used for production.                           ---
        ---------------------------------------------------------


Call Stack (most recent call first):
  /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/zephyr/CMakeLists.txt:1 (include)


CMake Warning at /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/CMakeLists.txt:1379 (message):
  __ASSERT() statements are globally ENABLED


-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build
[0/180] Performing build step for 'spm_subimage'
[151/155] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       32256 B        48 KB     65.62%
            SRAM:        5488 B        64 KB      8.37%
        IDT_LIST:          40 B         2 KB      1.95%
[155/155] Linking C executable zephyr/zephyr.elf
[2/176] Performing build step for 'mcuboot_subimage'
[248/253] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       42500 B        48 KB     86.47%
            SRAM:       26800 B        64 KB     40.89%
        IDT_LIST:          72 B         2 KB      3.52%
[253/253] Linking C executable zephyr/zephyr.elf
[163/176] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       76868 B     441856 B     17.40%
            SRAM:       36928 B       128 KB     28.17%
        IDT_LIST:         120 B         2 KB      5.86%
[174/174] Generating zephyr/merged.hex
MacBook-Pro:at_client jaredwolff$ newtmgr -c serial image upload build/zephyr/app_update.bin
MacBook-Pro:at_client jaredwolff$ cd ../../..
MacBook-Pro:nrf jaredwolff$ cd ..
MacBook-Pro:ncs jaredwolff$ cd zephyr/samples/basic/blinky
MacBook-Pro:blinky jaredwolff$ code prj.conf
MacBook-Pro:blinky jaredwolff$ west build -b circuitdojo_feather_nrf9160ns
[0/16] Performing build step for 'spm_subimage'
ninja: no work to do.
[1/9] Performing build step for 'mcuboot_subimage'
[0/1] Re-running CMake...
Including boilerplate (Zephyr base (cached)): /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/cmake/app/boilerplate.cmake
-- Application: /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr
-- Zephyr version: 2.3.99 (/Users/jaredwolff/Git/nrf-connect/ncs/zephyr)
-- Found west: /usr/local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
-- Board: circuitdojo_feather_nrf9160
-- Found dtc: /usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/Users/jaredwolff/gcc-arm-none-eabi-9-2019-q4-major)
-- Found BOARD.dts: /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160.dts
-- Found devicetree overlay: /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Found devicetree overlay: /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Found devicetree overlay: /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/dts.overlay
circuitdojo_feather_nrf9160.dts.pre.tmp:57.42-69.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@50000000/kmu@39000)
circuitdojo_feather_nrf9160.dts.pre.tmp:306.19-312.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@50000000/power@5000)
-- Generated zephyr.dts: /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/samples/basic/blinky/build/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/samples/basic/blinky/build/mcuboot/zephyr/include/generated/devicetree_unfixed.h
Parsing /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/Kconfig
Loaded configuration '/Users/jaredwolff/Git/nrf-connect/ncs/zephyr/boards/arm/circuitdojo_feather_nrf9160/circuitdojo_feather_nrf9160_defconfig'
Merged configuration '/Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/prj.conf'
Merged configuration '/Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/boot/zephyr/boards/circuitdojo_feather_nrf9160.conf'
Configuration saved to '/Users/jaredwolff/Git/nrf-connect/ncs/zephyr/samples/basic/blinky/build/mcuboot/zephyr/.config'
Kconfig header saved to '/Users/jaredwolff/Git/nrf-connect/ncs/zephyr/samples/basic/blinky/build/mcuboot/zephyr/include/generated/autoconf.h'
-- Cache files will be written to: /Users/jaredwolff/Library/Caches/zephyr
MCUBoot bootloader key file: /Users/jaredwolff/Git/nrf-connect/ncs/bootloader/mcuboot/root-rsa-2048.pem
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jaredwolff/Git/nrf-connect/ncs/zephyr/samples/basic/blinky/build/mcuboot
[247/252] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       42528 B        48 KB     86.52%
            SRAM:       26800 B        64 KB     40.89%
        IDT_LIST:          72 B         2 KB      3.52%
[252/252] Linking C executable zephyr/zephyr.elf
[7/7] Generating zephyr/merged.hex

Common errors and warnings

  1. CMake complains about your MCUBoot key

    CMake Warning at /Users/jaredwolff/Git/nrf-connect/ncs/nrf/cmake/mcuboot.cmake:115 (message):
    
    
            ---------------------------------------------------------
            --- WARNING: Using default MCUBoot key, it should not ---
            --- be used for production.                           ---
            ---------------------------------------------------------
    

    The default nRF9160 Feather bootloader uses the default MCUBoot key. If you're working on a secure application, be sure to change this key.

Programming and Debugging

There are currently two ways of programming the nRF9160 Feather. You can use the built-in bootloader or use an external programmer.

Bootloader use

Currently the nRF9160 Feather uses the MCUBoot bootloader which comes standard with the nRF Connect SDK. It is the recommended way to load new firmware onto your nRF9160 Feather.

In order to utilize the bootloader, you'll ned to install newtmgr (AKA mcumgr). Here's how below:

IMPORTANT: updates above ~192kB will not work with the current version of the bootloader. Examples like the asset_tracker require a programmer.

Binary Download

Download one of the binary files below. (Install script coming soon...)

Then place that file in your $PATH. On Linux and OSX that location will be /usr/local/bin. On Windows you can place the file in a location of your choice. Then, you'll have to update your $PATH. If you're unfamailiar with the process check out this guide.

Setting your connection configuration (one time only)

In order to easily work with newtmgr you'll need to make a one-time connection profile.

For Mac OS

newtmgr conn add serial type=serial connstring='dev=/dev/tty.SLAB_USBtoUART,baud=1000000'

Having trouble? You may have to install the drivers.

For Linux

sudo newtmgr conn add serial type=serial connstring="dev=/dev/ttyUSB0,baud=1000000"

Depending on your system, the serial port may show up differently. Replace /dev/ttyUSB0 with the serial port name. Also, sudo is required for Linux to access the serial port properly.

For Windows

newtmgr conn add serial type=serial connstring="dev=COM3,baud=1000000"

In all three cases above you've created a connection called serial. We'll be using that when issuing commands to the nRF9160 Feather.

Using newtmgr

Pre-check: MCUBoot needs to be enabled in your project before you can use it! Make sure that you have CONFIG_BOOTLOADER_MCUBOOT=y in your prj.conf

  1. Put your nRF9160 Feather into DFU mode.
    1. Hold the MODE button
    2. Then tap the RST button while holding mode
    3. Hold the MODE button until the Blue LED illuminates
  2. Building your application if you haven't already with west build. It will create a folder called build. The file we care about is build/zephyr/app_update.bin
  3. Load the file using newtmgr
    1. Load the binary file using: newtmgr -c serial image upload build/zephyr/app_update.bin
    2. Reset your board using newtmgr -c serial reset or hit the RST button. Full process below:

Note:

  1. The transfer process is limited to 1M BAUD. In most cases it takes about 8 seconds to transfer application code.
  2. The nRF9160 Feather does not respond to newtmgr commands unless it's in DFU mode. (See step 1 above to get it into DFU mode.)

Requirements for external programming and debugging

You can also use external programmers with the nRF9160 Feather. Here are the current supported external programmers:

  1. nRF5340-DK
  2. nRF9160-DK

Note: Most commercial J-Link programmers *should* work with the nRF9160 Feather. In particular the J-Link EDU Mini is a great choice if you're building non-commercial products. (Supports Cortex M33 processors. Untested at this time.)

🚨Important: the nRF52 and nRF51 based development kits do not work with the nRF9160 Feather!

👉Additionally, you'll also need a Tag-Connect cable. The nRF9160 Feather was designed to use the TC2030-CTX-NL. For more information check out Tag-Connect's product page.

Installing programmer software

In this next section, I'll be focusing on using the nRF5340-DK as the programmer of choice. These steps should not be different from other J-Link supported boards.

  1. Download your version of the nRF Command Line Tools

Windows

  1. Then, run the .exe that was downloaded. It will do all the heavy lifting for you.
  2. Run nrfjprog in a cmd window to make sure your install is working.
  3. You may also have to add JLink.exe to your path. It's the exact same proceedure as adding newtmgr except the path you're adding is C:\Program Files (x86)\SEGGER\JLink Paths updated for Windows for JLink
  4. Close/restart VSCode and your Command Prompt
  5. Run jlink.exe and make sure it opens.
    > jlink.exe
    SEGGER J-Link Commander V6.86f (Compiled Oct 23 2020 18:01:48)
    DLL version V6.86f, compiled Oct 23 2020 18:00:13
    
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link OB-K22-NordicSemi compiled Jan 21 2020 17:33:01
    Hardware version: V1.00
    S/N: 960083363
    License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    VTref=3.300V
    
    
    Type "connect" to establish a target connection, '?' for help
    J-Link>
    

Mac

  1. First run nRF-Command-Line-Tools_10_9_0_OSX.pkg
  2. Once that install is done, run JLink_MacOSX_V680a.pkg
  3. Open a fresh terminal window and run nrfjprog and jlinkexe to make sure your install is complete.

Setting up the nRF5340-DK

Here are a couple of close up shots of how to connect the nRF5340-DK:

nrf53-dk-connected

nRF9160 Feather w/ USB

nRF9160 Feather w/ Tag Connect

nRF9160 Feather w/ Tag Connect Connected

I highly recommend you jump SB47 on your nRF5340-DK with some solder. This forces the debugger to think an external devices is permanently connected. If you're only doing external debugging, this is very useful.

nRF5340-DK jumper highlighted

After hooking things up, It's time to do a quick smoke test. Running nrfjprog -r in a terminal should show this result:

$ nrfjprog -r
Applying system reset.
Run.

Success!

Note: these pictures are with an early version of the nRF9160 Feather. The procedure is the same. The orientation of the Tag-Connect though is horizontal not vertical as seen in the pictures.

Securing the Bootloader

In order to deliver secure over the air updates we need to generate our own signing key. Here's the (simplified) process:

  • Change directories to /opt/nordic/ncs/v1.x.x/bootloader/mcuboot
  • Run the image generation script:
scripts/imgtool.py keygen -k your-key-rsa-2048.pem -t rsa-2048
  • Create a mcuboot.conf file in your app with the included contents:
CONFIG_BOOT_SIGNATURE_TYPE_RSA=y
CONFIG_BOOT_SIGNATURE_KEY_FILE="your-key-rsa-2048.pem"
  • In CMakeLists.txt add the following lines:
# MCUboot related
list(APPEND mcuboot_OVERLAY_CONFIG
  "${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf"
  )

Then start a pristine build using west:

west build -b circuitdojo_feather_nrf9160ns -p

A pristine build  should happen before releasing that way the version data is up to date in the app_update.binIt's critical not to lose your-key-rsa-2048.pem as it's the key for (secure) OTA updates to succeed.

Programming with the nRF5340-DK

Programming with the nRF5340-DK is straight forward in Zephyr using west. Here's what it looks like:

west build -b circuitdojo_feather_nrf9160ns -p
west flash --runner nrfjprog
nrfjprog -r

In the above, i'm:

  1. Doing a pristine build of my application with the nRF9160 Feather as the target.
  2. Then flashing using the nrfjprog runner option. This is preferred for all J-Link boards.
  3. Resetting the board using nrfjprog -r. As of this writing, west does not reset the board after programming.

Getting a modem trace

Sometimes, you may be requested to get a modem trace of your device. This section will focus on helping you get one for your nRF9160 Feather.

In order to get a modem trace, the TX and RX pins on your board need to be free. You'll also need a UART to USB adapter of some type. I used an FTDI one that has each of the lines broken out.

  1. First, set your prj.conf to include the following lines:

    # Enable modem trace
    CONFIG_BSD_LIBRARY_TRACE_ENABLED=y
    
    
    # AT host library
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_AT_HOST_LIBRARY=y
    

    Note: version v1.5.x and newer uses this flag to enable modem tracing: CONFIG_NRF_MODEM_LIB_TRACE_ENABLED=y

  2. Then, create a folder in your project/sample called boards and add a new file called circuitdojo_feather_nrf9160ns.overlay We'll want to enable the UART1 interface on pins 23 and 24 like below:

    /*
    * Copyright (c) 2020 Circuit Dojo LLC
    *
    * SPDX-License-Identifier: Apache-2.0
    */
    
    &uart1 {
    status = "okay";
    current-speed = <115200>;
    tx-pin = <24>;
    rx-pin = <23>;
    };
    
  3. Connect your USB to UART adatper. I've used clips from my logic analyzer to hold the wires in place. Connect the yellow wire to the TX on the board. Connect the orange wire to the RX on the board.

    img/programming-and-debugging/Screen_Shot_2020-09-16_at_4.42.58_PM.png

  4. Then, inside LTE link monitor enable the process with:

    AT%XMODEMTRACE=1,2
    AT+CFUN=0
    

    This will perpetually save and keep modem traces on.

    Note: this step is no longer necessary.

  5. Then open the serial port in the modem trace App and click start.

    img/programming-and-debugging/Screen_Shot_2020-09-16_at_4.47.06_PM.png

  6. Then run your app as normal. You should see the Trace size go up little by little as connections are made, etc.

    img/programming-and-debugging/Screen_Shot_2020-09-16_at_5.12.48_PM.png

  7. Then grab the file according to the log output. For example: Tracefile created: /Users/jaredwolff/Library/Application Support/nrfconnect/pc-nrfconnect-tracecollector/trace-2020-09-16T20-47-19.741Z.bin

    For more information, check out Nordic's original article on the subject.

Debugging in Visual Code

Debugging your application is possible with Visual Code. You will need a J-Link programmer and a Tag Connect (TC2030-CTX-NL) cable for this process. Programmers include the nRF9160 DK, nRF532 DK, J-Link EDU (if your project is non-profit) and the standard commercial J-Link programmers.

Here's the process:

  1. Download and install your version of the nRF Command Line Tools

  2. Install the C/C++ Extension and the Cortex-Debug extensions. They're both very handy in development and debugging of Zephyr based projects. C/C++ Extension Cortex M Debug Extension

  3. If you don't have one already, create a .vscode folder in the root of your project. .vscode Fodler

  4. Create a file called launch.json. This is where we'll set up the configuration for debugging.

  5. Here's a real example of a config I was using to debug a project in OSX:

    {
      // Use IntelliSense to learn about possible attributes.
      // Hover to view descriptions of existing attributes.
      // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
      "version": "0.2.0",
      "configurations": [
        {
          "name": "Cortex Debug",
          "cwd": "${workspaceRoot}",
          "executable": "${workspaceRoot}/pyrinas/applications/application/build/zephyr/zephyr.elf",
          "request": "launch",
          "type": "cortex-debug",
          "servertype": "jlink",
          "device": "nrf9160_xxAA",
          "interface": "swd",
          "armToolchainPath": "/Users/jaredwolff/gcc-arm-none-eabi-9-2019-q4-major/bin"
        }
      ]
    }
    

    For folks on Windows you'll have to modify appropriately:

    {
     // Use IntelliSense to learn about possible attributes.
     // Hover to view descriptions of existing attributes.
     // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
     "version": "0.2.0",
     "configurations": [
        {
            "name": "Cortex Debug",
            "cwd": "${workspaceRoot}",
            "executable": "${workspaceRoot}\\nrf9160-feather\\samples\\blinky\\build\\zephyr\\zephyr.elf",
            "request": "launch",
            "type": "cortex-debug",
            "servertype": "jlink",
            "device": "nrf9160_xxAA",
            "interface": "swd",
            "armToolchainPath": "C:\\Program Files (x86)\\GNU Tools Arm Embedded\\9 2019-q4-major\\bin"
        }
     ]
    }
    

    Remember that workspaceRoot refers to the folder you have opened in VSCode. This will most likely be C:\Users\<your username>\ncs\v1.5.0\nfed\. (/opt/nordic/ncs/v1.5.0 for Mac) You will have to modify the "executable" entry to match the path of your zephyr.elf file.

  6. Change the executable path and the armToolchainPath to reflect your system. Make sure you point the executable option to the .elf file that gets produced during the compilation process.

  7. Next, go to your projects prj.conf and disable the bootloader by commenting out CONFIG_BOOTLOADER_MCUBOOT=y or changing the y to a n. As of this writing, disabling the bootloader is required as it prevents the debugging process from occuring.

  8. In prj.conf you'll also want to enable the CONFIG_DEBUG option. This disables compiler optimizations which makes the debug process hairy or impossible.

  9. Finally, program your project using west build && west flash

  10. At this point, if you've ever done any debugging in Visual Code, you should be able to follow the final steps to debug your application!

  11. Set some breakpoints in your code by pressing the line number you want. A red dot will appear where the breakpoint is set. Breakpoint

  12. Start debugging by clicking the debug icon on the left. Then click the play button in the top left. Debug menu Debug play button

  13. You can use the popup menu on the right to control traversal through your code. Popup debug control

nRF Connect For Desktop

nRF Connect For Desktop

nRF Connect For Desktop is the utility that you can use to manipulate your nRF9160 Feather. In this section we'll be focusing on two apps that will affect you the most:

  1. LTE Link Monitor
  2. Programmer

You can find the download page for nRF Connect For Desktop here.

Linux usesr: nRF Connect for Desktop is distributed as an appimage. Right click and enable running as an executable. Then you can double click and run as any other app.

Appimage Execute nRF Connect Desktop running on Ubuntu

LTE Link Monitor

The best way to debug anything cellular-related is to use the LTE Link Monitor.

To install:

  1. (for OSX folks) If you haven't already, install the Si2102 USB-to-Serial drivers.
  2. Install nRF Connect For Desktop app
  3. Open it up and in the list of apps find LTE Link Monitor
  4. Click install
  5. Once installed click open and let the fun begin! nRF Connect For Desktop with LTE Link Monitor installed

For more information check out Nordic's Documentation.

Using with LTE Link Monitor

Almost any code example can be used with the AT Host Library. Generally all that is needed is adding these lines to your prj.conf:

# AT host library
CONFIG_AT_HOST_LIBRARY=y
CONFIG_UART_INTERRUPT_DRIVEN=y

Alternatively, for a quick start, simply program the at_client example to your nRF9160 Feather. Then follow these quick steps to get up an running:

  1. Insert your SIM into the nRF9160 Feather.
  2. Attach your LTE antenna.
  3. Plug your nRF9160 Feather into your computer's USB port.
  4. Ensure that Flow Control is turned off, and Auto device/port filter is also unchecked. Flow Control unchecked
  5. Connect to it using the Device dropdown in the top left hand corner of the LTE Link Monitor. Devices dropdown On *nix based systems, the port will show up like /dev/tty.SLAB_USBtoUART. On Windows, you'll have to determine which COM port is associated by using the device manager.
  6. With Automatic requests turned on and the nRF9160 Feather connected, press the AT+CFUN=1 button followed by the AT+CFUN? button. This will cause a few important commands to be automatically sent to your nRF9160 Feather. Additionally, your nRF9160 Feather will attempt to connect to the closest compatible tower possible.
  7. Review the LTE Link Monitor for connection information. LTE Link Monitor connected Yes, the LTE Link Monitor provides some great information. Consider it your go-to tool when debugging cellular or board related issues.

Programmer

The programmer is excellent for updating your application firmware. The most important function it provides is updating the modem firmware.

Updating Application Firmware

Another way of programming your application other firmware images is to use the nRF Connect For Desktop Programmer App.

  1. First, you'll need to install it if you haven't already.
  2. Then open it up and select your programmer Port choices
  3. Then add a hex file using the button on the right side. Add a hex file
  4. Click Browse to loook for your file Add a hex file
  5. Browse your Nordic Connect SDK repo for your file. For instance the at_client hex image is: ncs/nrf/samples/nrf9160/at_client/build/zephyr/merged.hex Add a hex file
  6. Hit write to start the writing process. Remember your programmer has to be connected to the nRF910 Feather for this to work! Add a hex file

Handy trick! Since the nRF Connect For Desktop app is web based, you can use (Command) ⌘ + R to refresh the program. (or CTRL + R on Windows/Linux) This is great when the app goes into a weird state or if your serial device/programmer is now showing up.

Updating Modem Firmware

Your modem firmware plays an important role in the nRF9160. The easiest way, as of this writing, to update is to use the Programmer's Update modem function. It's important to note that not all firmware is certified to work on every provider. For a full up-to-date list, check out Nordic's documentation.

Another note: you will need a programmer and Tag Connect cable in order to update the modem firmware.

Here are the instructions for updating your modem firmware:

  1. Download the modem firmware you need.
  2. Next, open up the Programmer in nRF Connect For Desktop. (You may need to open it first)
  3. Then open up a connection to your programmer. (Your programmer should be connected to USB and attached to your nRF9160 Feather) Port choices
  4. Once opened, the program will read the memory contents of your device and display it. Reading non-volatile mem
  5. To update the modem firmware, scroll down to the bottom right and click Update modem Update modem button
  6. Find your modem firmware Find modem firmware
  7. Start the DFU process by clicking Write! Start the process

Then, your device will be updated. This process takes about 45 seconds. You can check if the firmware version using the AT+CGMR AT command. Devices running on Verizon must use modem firmware v1.1.2.

Debug Serial Usage

The nRF9160 Feather comes with an on-board Silicon Labs CP2102 USB-to-UART chip. You can use it with most serial terminal viewers. If you have an older version of Windows you will have to install the driver. The download is located here.

Here's some recommendations for software to communicate with the nRF9160 Feather. No matter what program you use, the standard baud rate for the console is 115200. All other options are standard/default (8 bits, oon-pairty, 1 stop bit).

Multi-Platform

nRF Connect For Desktop - LTE Link Monitor

If you haven't already, make sure you check out the LTE Link Monitor. It's a great multi-purpose tool for using and debugging the nRF9160 Feather.

CoolTerm

CoolTerm

CoolTerm has been my go-to for testing and debugging. Fortunately it's also multi-platform! You can download it by going here: https://www.freeware.the-meiers.org

Mac OSX & Linux

screen

You can use screen to view your debug output. Here's a typical command:

screen /dev/tty.SLAB_USBtoUART 115200

The major drawback of using screen is that it does not save your history. It's better to use other utilities for that purpose.

Note: depending on your system your serial port may be named something different from /dev/tty.SLAB_USBtoUART. You can check your dev folder like this to check which one may be it:

ls -l /dev | grep SLAB

cu

You can also use cu to display your debug output. Here's an example:

sudo cu -l /dev/tty.SLAB_USBtoUART -s 115200

If you notice, it requires super user permissions. (This is the only drawback to it IMHO)

To escape from your session type ~.

Example Code

Examples

Examples

All examples can be found in the nRF9160 Feather Examples and Drivers (nFED) repository. You can install it during the setup process. Here are some links to setting up on different platforms:

All samples are in nfed/samples. They include:

  • accelerometer - for a basic onboard accelerometer demo
  • at_client - for testing connections using LTE Link Monitor
  • battery - for a basic onboard battery measurement demo
  • blinky - for a basic led blink demo
  • bme280 - for an example of using the bme280 on i2c
  • button - for a basic example using the onboard mode button
  • deep_sleep - ultra deep sleep mode demo
  • external_flash - external flash demo
  • external_rtc - using onboard RTC demo
  • gps - basic gps demo
  • sms - basic SMS demo

Most of these examples are based from the nRF Connect SDK (either directly from Nordic or Zephyr)

More examples coming soon!

Building

To build an example, change directories to that example in a terminal that has been opened with nRF Connect Desktop and run:

west build -b circuitdojo_feather_nrf9160ns

Here's an example of output when finished:

west build -b circuitdojo_feather_nrf9160ns

...

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jaredwolff/Git/nrf-connect/ncs/nrf/samples/nrf9160/at_client/build
[0/180] Performing build step for 'spm_subimage'
[151/155] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       32256 B        48 KB     65.62%
            SRAM:        5488 B        64 KB      8.37%
        IDT_LIST:          40 B         2 KB      1.95%
[155/155] Linking C executable zephyr/zephyr.elf
[2/176] Performing build step for 'mcuboot_subimage'
[248/253] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       42500 B        48 KB     86.47%
            SRAM:       26800 B        64 KB     40.89%
        IDT_LIST:          72 B         2 KB      3.52%
[253/253] Linking C executable zephyr/zephyr.elf
[163/176] Linking C executable zephyr/zephyr_prebuilt.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       76868 B     441856 B     17.40%
            SRAM:       36928 B       128 KB     28.17%
        IDT_LIST:         120 B         2 KB      5.86%
[174/174] Generating zephyr/merged.hex

Note: having trouble building? Make sure you check out the troubleshooting page.

Programming can be completed with newtmgr:

newtmgr -c serial image upload build/zephyr/app_update.bin

Note you always want to use the app_update.bin when using newtmgr. These binaries are also used for FOTA and are always located in your_sample/build/zephyr/.

During testing, it's recomended to use the LTE Link Monitor whenever you need to manually test or execute commands.

Compatible Cloud

The nRF9160 Feather is compatible a handful of cloud providers and the list is growing!

Here is a list of a few that may be useful for you:

Hosted

  • Amazon AWS MQTT Broker
  • Azure MQTT Broker
  • Soracom Cloud

Self Hosted

  • Pyrinas Server
  • And more!

Cellular Provider Matrix

Cellular

In order to use a provider below you'll likely have to set the PDP context. This can be done in your project's prj.conf in Zephyr. Here's an example of setting the PDP context to use Hologram.

# Set the PDP context
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_PDP_CMD=y
CONFIG_LTE_PDP_CONTEXT="0,\"IP\",\"hologram\""

Simply replace hologram with a provider specific APN and you'll be good to go.

Some providers also require a username and password. For example, here's what Soracom's looks like:

CONFIG_LTE_PDN_AUTH_CMD=y
CONFIG_LTE_PDN_AUTH="0,\"PAP\",\"sora\",\"sora\""

Side note: in the case of both Hologram an Soracom you do not need the PDP context to transfer data.

Here's a full working list of what plays nicely with the nRF9160 Feather. This list is subject to change at any time.

LTE

Provider NameConnected ToNotesWorkingAPN
HologramSprint/AT&T/T-MobileThe first SIM to get working out of the box. Also supports T-Mobile and Verizon connections. Coverage info.hologram
SoracomAT&TWorking great from Circuit Dojo HQ. More info on coverage here.soracom.io
VerizonVerizonUse Verizon ThingSpace to get starte quickly.
Twilio (Standard Wireles)T-MobileT-Mobile does not support the nRF9160.🔴
Twilio (Super Sim)?Fails to make a full connection. May work with future nRF9160 modem firmware.🔴super
AT&TAT&TUntested.🔶

NB IoT

Provider NameConnected ToNotesWorkingAPN
Twilio (Standard Narrowband)T-MobileT-Mobile does not support the nRF9160.🔴

Emoji usage chart:

EmojiNote
Tested and working
🔶In progress
🔴Tested. Does not work!

💡Side note: unless otherwise noted these are tested along the shoreline of Connecticut. Your mileage may vary so make sure you do your own testing before adopting a provider.

Customer reports

We don't always have the ability to test every single cellular provider. In this section, here are a few providers that customers have reported success with.

Provider NameConnected ToNotesAPN

For the latest information on which providers support the nRF9160 SiP check out Nordic's nRF9160 certification page.

Downloads

Downloads

Hardware Related

TypeDonwload Link
DocumentationLink to Github
HardwareLink to Github
Bill of MaterialsLink to Aligni
3D ModelLink to Github
EnclosureLink to Grabcad

Software Related

TypeDonwload Link
Bootloader (v1)Link
Bootloader (v2)Link
newtmgr CLI (v1)Link
Board Defintions (v1.3.x)link
Board Definitions (v1.2.x)link

License

All hardware related files are available under the CERN v1.2 license. Click here for more details.

All documentation is released under a Creative Commons Share-alike license. Click here for more details.

Any applicable software is released under the Apache 2.0 license. Click here for more details.

Compliance

Compliance

To make things easier for you, the nRF9160 Feather comes pre-tested and ready for integration. All applicable testing will be done to ensure comppliance with FCC and CE EMI/EMC requirements. See each section below for more information.

Open Source Hardware Certification:

OSHW

CE Compliance

Current status: Compliant

FCC Part15 Compliance

Current status: Compliant

ISED (IC) Compliance

Current status: Compliant

Verizon Network Certification

Current status: Certified

FCC Pre-certification and Markings

When designing the nRF9160 Feather into your own projects, there are some marking requirements. Per the instructions from Nordic, you must have this written on your product somewhere:

  • Contains FCC ID: 2ANPO00NRF9160
  • Contains IC: 24529-NRF9160

Additionally, the nRF9160 Feather must be used at a minimum of 20 cm (7.87 inches) from the body at all times. This means the nRF9160 Feather should not worn on the body without sufficent isolation.

Country of Origin

  • Assembled in the USA 🇺🇸
  • Circuit boards fabricated in Taiwan 🇹🇼

Verizon operation

The nRF9160 Feather is officially on Verizon! If you've been chomping at the bit to get running on their newtwork, here's your chance!

Requirements

There are some requirements related to the use of Verizon's network. Here are the details:

  1. You must use Modem Firmware v1.1.2. The v1.2.x branch of the modem firmware is not supported (and will never be supported) on Verizon. You can check what version of the Modem Firmware you're running by executing this AT command: %SHORTSWVER. It will print something similar to nrf9160_1.1.2

    If you're not on 1.1.2 make sure you update using the guide here.

  2. For production deployments, you must use the 1.2.x branch of the nRF Connect SDK.

  3. If you've purchased a genuine nRF9160 Feather, your IMEI will already be added to Verizon's network. To get started, create a Verizon ThingSpace account. There you'll be able to create a new line with your nRF9160 Feather's IMEI.

    You can get your IMEI by running the AT+CGSN=1 command. The reply should look someting like this:

    AT+CGSN=1
    +CGSN: "352656100367872"
     OK
    
  4. Finally, any device on Verizon's network must be running the LWM2M Carrier Library. This allows Verizon to update the modem firmware in the event it's necessary. Enabling the LWM2M carrier library is as simple as adding CONFIG_LWM2M_CARRIER=y to your prj.conf.

Troubleshooting

This page has a list of common problems and solutions realated to the nRF9160 Feather.

Compiling Problems

Getting a west.manifest.ManifestImportFailed when building on Mac

Make sure that you've installed Xcode Command Line tools using xcode-select --install

Programming problems

The nRF9160 Feather does nothing after being programmed/flashed.

After being programmed using west flash, you may have to issue an additional nrfjprog -r or hit the RST button on the board. This should start code execution.

GPS Connection issues

Unable to get a fix after waiting a long time. (Using the gps example.

If your nRF9160 Feather is plugged into USB, try a different USB power supply. During the testing of the nRF9160 Feather, I found that certain USB C-to-A adapters injected were not properly grounded. This lead to issues getting a fix or prevented it all together. This especially applied to Apple Macbooks.

"The toolchain is unable to build a dummy C file"

If you're trying to build an example and you're getting an error building your code your should delete the Cmake cache:

rm -rf ~/Library/Caches/zephyr

More info here: https://devzone.nordicsemi.com/f/nordic-q-a/55475/the-toolchain-is-unable-to-build-a-dummy-c-file

Also a post on the forum: https://community.jaredwolff.com/d/51-error-whilst-compiling-blinky/3

Support

The best place for support is the Circuit Dojo support forum. In most cases you'll recieve a response within 1-2 business days. For more information see our Terms of Service.

If you have a question relating to your order please contact support@jaredwolff.com

The nRF9160 Feather is licenced under the CERN Open Hardware Licence v1.2. For more details on warranty and liability click here.

Purchase

The nRF9160 Feather has arrived! It's available at our store here:

Circuit Dojo Logo

It's also available on these great sites:

Digikey

GroupGets Logo

Tindie

Changelog

Hardware

v3 - (March 2021)

  • Fixed SCL/SDA labels
  • Added test points for SIM tests

v2 - (Jan 2021)

Backside of nRF9160 Feather V2

  • Added 3-axis Accelerometer by ST (LIS2DH12TR). Zephyr/nRF Connect SDK includes built-in support for this chip.
  • Added Accelerometer INT1 pin to Pin 2 on the board.
  • Added JMP1 to free up use for Pin 2 (INT1 pin on LIS2DH is push/pull an always on)
  • The power supply enable signal, which originally was inaccessible, is now available next to the TX pin.
  • Added JMP2 to disable PS_EN's connection to the power supply. "Always on" operation by shorting the middle and right pads on JMP2.
  • Updated the bottom side labels thanks to Sparkfun's Buzzard tool. They deserve all the credit there!

Software

NFED (nRF9160 Feather Examples and Drivers) - (Jan 2021)

  • Added accelerometer sample
  • Added bme280 sample

Documentation

Uncommitted

Changed

  • Changed note about compiling app
  • Changed instructions about installing nRF Connect Desktop
  • Fixed typo related to the bootloader-use section of Programming and Debugging
  • Updated bootloader moe instructions
  • Changed link to nRF53DK
  • Fixed various typos
  • Updated instructions for getting modem trace
  • Install insructions updated to 1.5.0
  • Adding entries to agps sample prj.conf

Removed

  • Video for putting device into bootloader mode (outdated)

Added

  • Added a page about compatible cloud infrastructures
  • Added some extra help related to newtgmr

Thanks 🙏

Special thanks to all who have helped make this project successful. Here are a few honorable mentions:

  • Thanks to all the kind folks at Nordic Semiconductor! Eeryone on Devzone to sales to the FAEs in the States have all been very supportive of the project. Thank you, thank you thank you!
  • Many thanks to the Aligni team for making a great product and helping open source projects succeed. You can sign up for you own account here.
  • Thanks to the team at Hologram team! Without you guys no one would have a SIM to connect their nRF9160 Feathers with!
  • Last, by not least, thanks to my main collaborators GroupGets and Hackster. Without them there wouldn't be a nRF9160 Feather to release into the world!