Summary of Contents for sparkfun nRF9160 Thing Plus
Page 1
Keep it on at all times for high availability scenarios. Power it via the 5V pin or insert a USB C cable to keep things going. Want to persist data? The nRF9160 Thing Plus has a 4MB external flash for storing data while offline. Using external flash with a filesystem like LitteFS and you’ll have a project to recon with! SparkFun Thing Plus - nRF9160 ...
To follow along with this tutorial, you will need the following materials. You may not need everything though depending on what you have. Add it to your cart, read through the guide, and adjust the cart as necessary. nRF9160 Thing Plus Hookup Guide Wish List SparkFun Wish List (2) Reversible USB A to C Cable - 0.8m...
Serial Peripheral Interface (SPI) SPI is commonly used to connect microcontrollers to An introduction to I2C, one of the main embedded peripherals such as sensors, shift registers, and SD communications protocols in use today. cards. Bluetooth Basics Three Quick Tips About Using U.FL An overview of the Bluetooth wireless technology.
Page 4
Power The nRF9160 Thing Plus has an operating range of 2.8V to 5.5V and can be powered several ways. The most popular way to power Thing Plus boards is by using the USB C port on the bottom of the board. Alternatively, the board can be powered by a LiPo battery plugged into the 2 pin JST connector on the left side.
Page 5
JTAG If you choose to use an external programmer, the JTAG pins highlighted here will allow you to connect. We recommend the nRF5340DK or, for non-commercial use, we recommend the J-Link EDU Mini Programmer.
Page 6
Sim Card In order to use the LTE functionality, you'll need to activate and insert the included Hologram Sim Card. Head over to Hologram's Start Page and follow the instructions to activate your card. In this tutorial, we are using the most basic license, which is free (up to a point).
Page 7
Qwiic Connector Our Qwiic Ecosystem makes using qwiic sensors pretty much plug and play. Use this port to attach your sensor of choice!
Page 8
Buttons In order to upload code to the nRF9160 Thing Plus, you'll need to put the board in Bootloader mode. To do so, do the following: Press the Mode button (MD) While holding down the Mode button, press and release the Reset (RST) button.
Antenna Connections There are two antenna connectors - one U.FL for the LTE with matching network, one U.FL for active GPS antennas (active only). The connectors are labelled on the back of the board to help you remember which is which. Antenna supply voltage: 3.3V ±...
Page 10
Jumpers There are two jumpers on the board. JMP1 is used to disable the accelerometer interrupt on Pin 2. By default, the interrupt is push/pull and is always enabled. To disable, cut the trace. JMP2 is used to disable PS_EN's connection to the power supply, which allows you to use PS_EN as a GPIO pin. You can turn this functionality to "Always on"...
Page 11
Board Dimensions The nRF9160 Thing Plus measures 2.10 inches by 0.9 inches.
Page 12
SDK Setup - Windows This page is all about getting your Windows machine compiling code for the nRF9160 Thing Plus. Run into trouble during the process? Post your questions on the community forum. IDE Setup Install or use the code editor of your choice. I personally use Microsoft Visual Studio Code. The download link is here, or you can download by clicking the button below.
Page 13
Connect For Desktop is the utility that you can use to manipulate your nRF9160 Thing Plus. Download and install nRF Connect For Desktop. DOWNLOAD NRF CONNECT FOR DESKTOP Once downloaded, run the installer: Open up the app and install the Toolchain Manager:...
Page 14
Once installed you'll have a dropdown that you can access. Click on it and then the Open Bash or Open Command Prompt option. (I prefer bash since I use *nix a lot) To get the nRF9160 Thing Plus examples we'll update C:\Users\<your username>\ncs\v1.4.1\nrf\west.yml. First in the remotes section add: name: circuitdojo url-base: https://github.com/circuitdojo...
Page 15
In order to easily work with newtmgr you'll need to make a one-time connection profile. Make sure that the COM port matches the one attached to the nRF9160 Thing Plus. An easy way to check is to remove and add the device to see which COM port shows up in device manager.
Page 16
Copy the app to your Applications folder Open up the app and install the Toolchain Manager Then open it up. Scroll to the bottom and click Install package from other source:...
Page 17
Then in the projects section add at the bottom: name: nfed repo-path: nrf9160-feather-examples-and-drivers revision: v1.4.x path: nfed remote: circuitdojo Then run west update in your freshly created terminal session. This will fetch the nRF9160 Thing Plus examples. Installing newtmgr...
Page 18
If you're on a newer version of OSX you'll need to install the drivers. USB TO UART BRIDGE VCP DRIVERS For loading code to your nRF9160 Thing Plus, 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"...
Page 19
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 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. Install west.
Page 20
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.r ules /etc/udev/rules.d sudo udevadm control --reload Installing newtmgr For loading code to your nRF9160 Thing Plus, you'll need to download and copy a custom version of newtmgr to a folder in your PATH.
Hit the esc button and then type :wq!. For more info in using newtmgr checkout the programming section of CircuitDojo's documentation. Programming and Debugging There are currently two ways of programming the nRF9160 Thing Plus. You can use the built-in bootloader or use an external programmer. Bootloader Currently the nRF9160 Thing Plus uses the MCUBoot bootloader which comes standard with the nRF Connect SDK.
Page 22
The nRF9160 Thing Plus does not respond to newtmgr commands unless it's in DFU mode. (See the above to get it into DFU mode.) External Programming and Debugging You can also use external programmers with the nRF9160 Thing Plus. Here are the current supported external programmers: nRF5340-DK nRF9160-DK ...
Page 23
Close/restart VSCode and your Command Prompt Run jlink.exe and make sure it opens. Mac: First run nRF-Command-Line-Tools_10_9_0_OSX.pkg Once that install is done, run JLink_MacOSX_V680a.pkg 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:...
Page 24
-r In the above, I'm: Doing a pristine build of my application with the nRF9160 Thing Plus as the target. Then flashing using the nrfjprog runner option. This is preferred for all J-Link boards. Resetting the board using nrfjprog -r. As of this writing, west does not reset the board after programming.
Page 25
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 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...
Page 26
Click on the image for a closer view Then run your app as normal. You should see the Trace size go up little by little as connections are made, etc. Click on the image for a closer view 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.
Page 27
If you don't have one already, create a .vscode folder in the root of your project. Create a file called launch.json. This is where we'll set up the configuration for debugging. Here's a real example of a config I was using to debug a project in OSX:...
Page 28
// 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/dreamstars/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"...
Page 29
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. In prj.conf you'll also want to enable the CONFIG_DEBUG option. This disables compiler optimizations which make the debug process hairy and/or impossible.
Page 30
You can use the popup menu on the right to control traversal through your code. Compiling an Application Prerequisites/SDK Setup If you haven't already, make sure you've set up the SDK: Windows Mac OS Linux General Build Commands Generally speaking, as long as you have all the requirements from the guide above, compiling for the nRF9160 Thing Plus should be as simple as running the following: west build -b circuitdojo_feather_nrf9160ns If you would like to "clean"...
Page 31
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 can be found in the Programming and Debugging section.
Page 32
The transfer process is limited to 1M BAUD. In most cases it takes about 8 seconds to transfer application code. Reminder: The nRF9160 Thing Plus does not respond to newtmgr commands unless it's in DFU mode. Example - AT Client Sample ...
Page 33
-c serial reset Reminder: The nRF9160 Thing Plus does not respond to newtmgr commands unless it's in DFU mode. LTE Link Monitor The best way to debug anything cellular-related is to use the LTE Link Monitor. To install: (for OSX folks) If you haven't already, install the Si2102 USB-to-Serial drivers.
Page 34
Your purchase of the Sparkfun nRF9160 Thing Plus should have included a SIM card for use with LTE applications. In this instance, we have the Hologram SIM card: Hologram eUICC SIM Card CEL-17117 $4.95 In order to use the SIM card, you'll need to activate it. Go to Hologram's Start Page and follow the instructions. In this tutorial, we are using the most basic license, which is free (up to a point).
Page 35
With Automatic requests turned on and the nRF9160 Thing Plus 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 Thing Plus. Additionally, your nRF9160 Thing Plus will attempt to connect to the closest compatible tower possible.
Page 36
During factory test, your nRF9160 Thing Plus is added to nRF Connect for Cloud for your immediate use. The boards are registered with an nRF cloud key of 7753 (SPKF). You'll use this, along with your nRF9160 Thing Plus, SIM and antenna to connect to the nRF Connect for Cloud and get GPS readings.
Page 37
Every nRF9160 Thing Plus has a device ID generated based on the IMEI. Your full device ID will look something like: thing-plus-<IMEI> where <IMEI> is the IMEI tied to your specific device. You'll need this in a moment. Above you should have compiled and programmed your device with the nrf_cloud_agps sample. Power up and confirm that the device can connect to the cloud.
Page 38
Enter the Device ID and the PIN. Once you press Add Device, nRF Connect for Cloud should notify you that your device has been added. Navigate to Devices and click on the device you're working with! That's it! Your device screen will adapt to whatever example code that you're using. Troubleshooting...
Debug Serial Usage The nRF9160 Thing Plus 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.
Page 40
SPARKFUN TECHNICAL ASSISTANCE PAGE If you don't find what you need there, the SparkFun Forums are a great place to find and ask for help. If this is your first visit, you'll need to create a Forum Account to search product forums and post questions.
Page 41
Understanding the BC127 Bluetooth Module SparkFun Inventor's Kit for Edison Experiment Guide SparkFun has two boards using the BC127; here's Learn how to harness the power of the Intel® Edison what you need to know to use them. using JavaScript to post data to the cloud, control electronics from smartphones, and host web pages that interact with circuits.
Need help?
Do you have a question about the nRF9160 Thing Plus and is the answer not in the manual?
Questions and answers