Skip to content

Commit 4bbd91a

Browse files
eivindj-nordicmbolivar-nordic
authored andcommitted
boards: arm: add support for nRF9161DK
Add board support for nRF9161DK. Signed-off-by: Eivind Jølsgard <eivind.jolsgard@nordicsemi.no>
1 parent 2a4373c commit 4bbd91a

17 files changed

+909
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# nRF9161 DK NRF9161 board configuration
2+
3+
# Copyright (c) 2023 Nordic Semiconductor ASA
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if SOC_NRF9161_SICA
7+
8+
config BOARD_NRF9161DK_NRF9161
9+
bool "nRF9161 DK NRF9161"
10+
11+
config BOARD_NRF9161DK_NRF9161_NS
12+
bool "nRF9161 DK NRF9161 non-secure"
13+
14+
endif # SOC_NRF9161_SICA
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# nRF9161 DK NRF9161 board configuration
2+
3+
# Copyright (c) 2023 Nordic Semiconductor ASA
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if BOARD_NRF9161DK_NRF9161 || BOARD_NRF9161DK_NRF9161_NS
7+
8+
config BOARD
9+
default "nrf9161dk_nrf9161"
10+
11+
# For the secure version of the board the firmware is linked at the beginning
12+
# of the flash, or into the code-partition defined in DT if it is intended to
13+
# be loaded by MCUboot. If the secure firmware is to be combined with a non-
14+
# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always
15+
# be restricted to the size of its code partition.
16+
# For the non-secure version of the board, the firmware
17+
# must be linked into the code-partition (non-secure) defined in DT, regardless.
18+
# Apply this configuration below by setting the Kconfig symbols used by
19+
# the linker according to the information extracted from DT partitions.
20+
21+
# Workaround for not being able to have commas in macro arguments
22+
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
23+
24+
config FLASH_LOAD_SIZE
25+
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
26+
depends on BOARD_NRF9161DK_NRF9161 && TRUSTED_EXECUTION_SECURE
27+
28+
if BOARD_NRF9161DK_NRF9161_NS
29+
30+
config FLASH_LOAD_OFFSET
31+
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
32+
33+
config FLASH_LOAD_SIZE
34+
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
35+
36+
endif # BOARD_NRF9161DK_NRF9161_NS
37+
38+
config BT_HCI_VS
39+
default y if BT
40+
41+
config BT_WAIT_NOP
42+
default BT && $(dt_nodelabel_enabled,nrf5340_reset)
43+
44+
config I2C
45+
default $(dt_compat_on_bus,$(DT_COMPAT_NXP_PCAL6408A),i2c)
46+
47+
endif # BOARD_NRF9161DK_NRF9161 || BOARD_NRF9161DK_NRF9161_NS
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
if(CONFIG_BOARD_NRF9161DK_NRF9161_NS)
4+
set(TFM_PUBLIC_KEY_FORMAT "full")
5+
endif()
6+
7+
if(CONFIG_TFM_FLASH_MERGED_BINARY)
8+
set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/tfm_merged.hex")
9+
endif()
10+
11+
# TODO: change to nRF9161_xxAA when such device is available in JLink
12+
board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000")
13+
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
14+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
.. _nrf9161dk_nrf9161:
2+
3+
nRF9161 DK
4+
##########
5+
6+
Overview
7+
********
8+
9+
The nRF9161 DK (PCA10153) is a single-board development kit for evaluation and
10+
development on the nRF9161 SiP for LTE-M and NB-IoT. The nrf9161dk_nrf9161
11+
board configuration provides support for the Nordic Semiconductor nRF9161 ARM
12+
Cortex-M33F CPU with ARMv8-M Security Extension and the following devices:
13+
14+
* :abbr:`ADC (Analog to Digital Converter)`
15+
* CLOCK
16+
* FLASH
17+
* :abbr:`GPIO (General Purpose Input Output)`
18+
* :abbr:`I2C (Inter-Integrated Circuit)`
19+
* :abbr:`MPU (Memory Protection Unit)`
20+
* :abbr:`NVIC (Nested Vectored Interrupt Controller)`
21+
* :abbr:`PWM (Pulse Width Modulation)`
22+
* :abbr:`RTC (nRF RTC System Clock)`
23+
* Segger RTT (RTT Console)
24+
* :abbr:`SPI (Serial Peripheral Interface)`
25+
* :abbr:`UARTE (Universal asynchronous receiver-transmitter with EasyDMA)`
26+
* :abbr:`WDT (Watchdog Timer)`
27+
* :abbr:`IDAU (Implementation Defined Attribution Unit)`
28+
29+
More information about the board can be found at the
30+
`nRF9161 DK website`_. The `Nordic Semiconductor Infocenter`_
31+
contains the processor's information and the datasheet.
32+
33+
34+
Hardware
35+
********
36+
37+
nRF9161 DK has two external oscillators. The frequency of
38+
the slow clock is 32.768 kHz. The frequency of the main clock
39+
is 32 MHz.
40+
41+
Supported Features
42+
==================
43+
44+
The nrf9161dk_nrf9161 board configuration supports the following
45+
hardware features:
46+
47+
+-----------+------------+----------------------+
48+
| Interface | Controller | Driver/Component |
49+
+===========+============+======================+
50+
| ADC | on-chip | adc |
51+
+-----------+------------+----------------------+
52+
| CLOCK | on-chip | clock_control |
53+
+-----------+------------+----------------------+
54+
| FLASH | on-chip | flash |
55+
+-----------+------------+----------------------+
56+
| FLASH | external | spi |
57+
+-----------+------------+----------------------+
58+
| GPIO | on-chip | gpio |
59+
+-----------+------------+----------------------+
60+
| GPIO | external | i2c |
61+
+-----------+------------+----------------------+
62+
| I2C(M) | on-chip | i2c |
63+
+-----------+------------+----------------------+
64+
| MPU | on-chip | arch/arm |
65+
+-----------+------------+----------------------+
66+
| NVIC | on-chip | arch/arm |
67+
+-----------+------------+----------------------+
68+
| PWM | on-chip | pwm |
69+
+-----------+------------+----------------------+
70+
| RTC | on-chip | system clock |
71+
+-----------+------------+----------------------+
72+
| RTT | nRF53 | console |
73+
+-----------+------------+----------------------+
74+
| SPI(M/S) | on-chip | spi |
75+
+-----------+------------+----------------------+
76+
| SPU | on-chip | system protection |
77+
+-----------+------------+----------------------+
78+
| UARTE | on-chip | serial |
79+
+-----------+------------+----------------------+
80+
| WDT | on-chip | watchdog |
81+
+-----------+------------+----------------------+
82+
83+
84+
.. _nrf9161dk_additional_hardware:
85+
86+
Other hardware features have not been enabled yet for this board.
87+
See `nRF9161 DK website`_ and `Nordic Semiconductor Infocenter`_
88+
for a complete list of nRF9161 DK board hardware features.
89+
90+
Connections and IOs
91+
===================
92+
93+
LED
94+
---
95+
96+
* LED1 (green) = P0.0
97+
* LED2 (green) = P0.1
98+
* LED3 (green) = P0.4
99+
* LED4 (green) = P0.5
100+
101+
Push buttons and Switches
102+
-------------------------
103+
104+
* BUTTON1 = P0.8
105+
* BUTTON2 = P0.9
106+
* SWITCH1 = P0.18
107+
* SWITCH2 = P0.19
108+
* BOOT = SW5 = boot/reset
109+
110+
Security components
111+
===================
112+
113+
- Implementation Defined Attribution Unit (`IDAU`_). The IDAU is implemented
114+
with the System Protection Unit and is used to define secure and non-secure
115+
memory maps. By default, all of the memory space (Flash, SRAM, and
116+
peripheral address space) is defined to be secure accessible only.
117+
- Secure boot.
118+
119+
120+
Programming and Debugging
121+
*************************
122+
123+
nrf9161dk_nrf9161 supports the Armv8m Security Extension, and by default boots
124+
in the Secure state.
125+
126+
Building Secure/Non-Secure Zephyr applications with Arm |reg| TrustZone |reg|
127+
=============================================================================
128+
129+
The process requires the following steps:
130+
131+
1. Build the Secure Zephyr application using ``-DBOARD=nrf9161dk_nrf9161`` and
132+
``CONFIG_TRUSTED_EXECUTION_SECURE=y`` in the application project configuration file.
133+
2. Build the Non-Secure Zephyr application using ``-DBOARD=nrf9161dk_nrf9161_ns``.
134+
3. Merge the two binaries together.
135+
136+
When building a Secure/Non-Secure application, the Secure application will
137+
have to set the IDAU (SPU) configuration to allow Non-Secure access to all
138+
CPU resources utilized by the Non-Secure application firmware. SPU
139+
configuration shall take place before jumping to the Non-Secure application.
140+
141+
.. note::
142+
Trusted Firmware-M (TF-M) and building the ``ns`` target is not supported for this board.
143+
144+
Building a Secure only application
145+
==================================
146+
147+
Build the Zephyr app in the usual way (see :ref:`build_an_application`
148+
and :ref:`application_run`), using ``-DBOARD=nrf9161dk_nrf9161``.
149+
150+
Flashing
151+
========
152+
153+
Follow the instructions in the :ref:`nordic_segger` page to install
154+
and configure all the necessary software. Further information can be
155+
found in :ref:`nordic_segger_flashing`. Then build and flash
156+
applications as usual (see :ref:`build_an_application` and
157+
:ref:`application_run` for more details).
158+
159+
Here is an example for the :ref:`hello_world` application.
160+
161+
First, run your favorite terminal program to listen for output.
162+
163+
.. code-block:: console
164+
165+
$ minicom -D <tty_device> -b 115200
166+
167+
Replace :code:`<tty_device>` with the port where the nRF9161 DK
168+
can be found. For example, under Linux, :code:`/dev/ttyACM0`.
169+
170+
Then build and flash the application in the usual way.
171+
172+
.. zephyr-app-commands::
173+
:zephyr-app: samples/hello_world
174+
:board: nrf9161dk_nrf9161
175+
:goals: build flash
176+
177+
Debugging
178+
=========
179+
180+
Refer to the :ref:`nordic_segger` page to learn about debugging Nordic boards with a
181+
Segger IC.
182+
183+
184+
Testing the LEDs and buttons in the nRF9161 DK
185+
**********************************************
186+
187+
There are 2 samples that allow you to test that the buttons (switches) and LEDs on
188+
the board are working properly with Zephyr:
189+
190+
* :ref:`blinky-sample`
191+
* :ref:`button-sample`
192+
193+
You can build and flash the examples to make sure Zephyr is running correctly on
194+
your board. The button and LED definitions can be found in
195+
:zephyr_file:`boards/arm/nrf9161dk_nrf9161/nrf9161dk_nrf9161_common.dtsi`.
196+
197+
References
198+
**********
199+
200+
.. target-notes::
201+
202+
.. _IDAU:
203+
https://developer.arm.com/docs/100690/latest/attribution-units-sau-and-idau
204+
.. _nRF9161 DK website: https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF9161-DK
205+
.. _Nordic Semiconductor Infocenter: https://infocenter.nordicsemi.com
206+
.. _Trusted Firmware M: https://www.trustedfirmware.org/projects/tf-m/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2023 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: GPIO used to reset nRF5340 on nRF9161 DK
5+
6+
compatible: "nordic,nrf9161dk-nrf5340-reset"
7+
8+
include: base.yaml
9+
10+
properties:
11+
status:
12+
required: true
13+
14+
gpios:
15+
type: phandle-array
16+
required: true
17+
description: |
18+
GPIO to use as nRF5340 reset line: output in nRF9161, input in nRF5340.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&pcal6408a {
8+
status = "okay";
9+
};
10+
11+
&button0 {
12+
gpios = <&pcal6408a 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
13+
};
14+
15+
&button1 {
16+
gpios = <&pcal6408a 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
17+
};
18+
19+
&button2 {
20+
gpios = <&pcal6408a 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
21+
};
22+
23+
&button3 {
24+
gpios = <&pcal6408a 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
25+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&pcal6408a {
8+
status = "okay";
9+
};
10+
11+
&led0 {
12+
gpios = <&pcal6408a 4 GPIO_ACTIVE_HIGH>;
13+
};
14+
15+
&led1 {
16+
gpios = <&pcal6408a 5 GPIO_ACTIVE_HIGH>;
17+
};
18+
19+
&led2 {
20+
gpios = <&pcal6408a 6 GPIO_ACTIVE_HIGH>;
21+
};
22+
23+
&led3 {
24+
gpios = <&pcal6408a 7 GPIO_ACTIVE_HIGH>;
25+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <nordic/nrf9161_sica.dtsi>
9+
#include "nrf9161dk_nrf9161_common.dtsi"
10+
11+
/ {
12+
chosen {
13+
zephyr,sram = &sram0_s;
14+
zephyr,flash = &flash0;
15+
zephyr,code-partition = &slot0_partition;
16+
zephyr,sram-secure-partition = &sram0_s;
17+
zephyr,sram-non-secure-partition = &sram0_ns;
18+
};
19+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
identifier: nrf9161dk_nrf9161
2+
name: nRF9161-DK-NRF9161
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- gnuarmemb
7+
- xtools
8+
- zephyr
9+
ram: 88
10+
flash: 1024
11+
supported:
12+
- arduino_gpio
13+
- arduino_i2c
14+
- arduino_serial
15+
- arduino_spi
16+
- gpio
17+
- i2c
18+
- pwm
19+
- spi
20+
- watchdog
21+
- counter

0 commit comments

Comments
 (0)