1Nordic nRF9160 2============== 3 4The nRF9160 development kit (DK) is a single-board development kit for 5the evaluation and development on the Nordic nRF9160 SiP for LTE-M and NB-IoT. 6 7The nRF9160 SoC features a full-featured Arm® Cortex®-M33F core with DSP 8instructions, FPU, and ARMv8-M Security Extension, running at up to 64 MHz. 9 10Documentation 11------------- 12 13The following links provide useful information about the nRF9160 14 15nRF9160 DK website: 16 https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF9160-DK 17 18Nordic Semiconductor Infocenter: https://infocenter.nordicsemi.com 19 20 21Building TF-M on nRF9160 22------------------------ 23 24To build an S and NS application image for the nRF9160 run the 25following commands: 26 27.. code-block:: bash 28 29 cmake -S <TF-M base folder> -B build_spe \ 30 -DTFM_PLATFORM=nordic_nrf/nrf9160dk_nrf9160 \ 31 -DTFM_TOOLCHAIN_FILE=../toolchain_GNUARM.cmake \ 32 cmake --build build_spe -- install 33 34 cmake -S <Application base folder> -B build_app \ 35 -DCONFIG_SPE_PATH<Absolute path to TF-M base folder>/build_spe/api_ns 36 -DTFM_TOOLCHAIN_FILE=cmake/toolchain_ns_GNUARM.cmake 37 cmake --build 38 39.. note:: 40 Currently, applications can only be built using GCC (GNU ARM Embedded 41 toolchain). 42 43.. note:: 44 For BL2 (MCUBoot) logging output to be available, the project needs to be 45 built with Debug configuration (CMAKE_BUILD_TYPE=Debug). 46 47Flashing and debugging with Nordic nRF Segger J-Link 48----------------------------------------------------- 49 50nRF9160 DK is equipped with a Debug IC (Atmel ATSAM3U2C) which provides the 51following functionality: 52 53* Segger J-Link firmware and desktop tools 54* SWD debug for the nRF9160 IC 55* Mass Storage device for drag-and-drop image flashing 56* USB CDC ACM Serial Port bridged to the nRFx UART peripheral 57* Segger RTT Console 58* Segger Ozone Debugger 59 60To install the J-Link Software and documentation pack, follow the steps below: 61 62#. Download the appropriate package from the `J-Link Software and documentation pack`_ website 63#. Depending on your platform, install the package or run the installer 64#. When connecting a J-Link-enabled board such as an nRF9160 DK, a 65 drive corresponding to a USB Mass Storage device as well as a serial port should come up 66 67nRFx Command-Line Tools Installation 68************************************* 69 70The nRF Command-line Tools allow you to control your nRF9160 device from the command line, 71including resetting it, erasing or programming the flash memory and more. 72 73To install them, visit `nRF Command-Line Tools`_ and select your operating 74system. 75 76After installing, make sure that ``nrfjprog`` is somewhere in your executable path 77to be able to invoke it from anywhere. 78 79BL2, S, and NS application images can be flashed into nRF9160 separately or may be merged 80together into a single binary. 81 82Flashing the nRF9160 DK 83*********************** 84 85To program the flash with a compiled TF-M image (i.e. S, NS or both) after having 86followed the instructions to install the Segger J-Link Software and the nRFx 87Command-Line Tools, follow the steps below: 88 89Generate Intel hex files from the output binary (bin) files as follows: 90 91.. code-block:: console 92 93 srec_cat build_app/tfm_s_ns_signed.bin -binary --offset 0x10000 \ 94 -o build_app/tfm_s_ns_signed.hex -intel 95 96* Connect the micro-USB cable to the nRF9160 DK and to your computer 97* Erase the flash memory in the nRF9160 IC: 98 99.. code-block:: console 100 101 nrfjprog --eraseall -f nrf91 102 103* (Optionally) Erase the flash memory and reset flash protection and disable 104 the read back protection mechanism if enabled. 105 106.. code-block:: console 107 108 nrfjprog --recover -f nrf91 109 110* Flash the BL2 and TF-M image binaries from the sample folder of your choice: 111 112.. code-block:: console 113 114 nrfjprog --program build_spe/bin/bl2.hex -f nrf91 --sectorerase 115 nrfjprog --program build_app/tfm_s_ns_signed.hex -f nrf91 --sectorerase 116 117* Reset and start TF-M: 118 119.. code-block:: console 120 121 nrfjprog --reset -f nrf91 122 123Secure UART Console on nRF9160 DK 124********************************** 125 126SECURE_UART1 is enabled by default when building TF-M on nRF9160 DK, so the secure firmware console output 127is available via USART1. 128 129Non-Secure console output is available via USART0. 130 131.. note:: 132 By default USART0 and USART1 outputs are routed to separate serial ports. 133 134.. _nRF Command-Line Tools: https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Command-Line-Tools 135 136.. _J-Link Software and documentation pack: https://www.segger.com/jlink-software.html 137 138-------------- 139 140*Copyright (c) 2020, Arm Limited. All rights reserved.* 141*Copyright (c) 2020, Nordic Semiconductor. All rights reserved.* 142