Skip to content

Commit 0ca1aaa

Browse files
stig-bjorlykkeioannisg
authored andcommitted
boards: arm: Add support for nRF51 Dongle (PCA10031)
This commit adds support for the nrf51_pca10031 board. Signed-off-by: Stig Bjørlykke <[email protected]>
1 parent 284bc9d commit 0ca1aaa

File tree

8 files changed

+314
-0
lines changed

8 files changed

+314
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Kconfig - nRF51 PCA10031 board configuration
2+
#
3+
# Copyright (c) 2018 Nordic Semiconductor ASA.
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
config BOARD_NRF51_PCA10031
8+
bool "nRF51 PCA10031"
9+
depends on SOC_NRF51822_QFAC
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Kconfig - nRF51 PCA10031 board configuration
2+
#
3+
# Copyright (c) 2018 Nordic Semiconductor ASA.
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
if BOARD_NRF51_PCA10031
8+
9+
config BOARD
10+
default "nrf51_pca10031"
11+
12+
if ADC
13+
14+
config ADC_0
15+
default y
16+
17+
endif # ADC
18+
19+
config BT_CTLR
20+
default BT
21+
22+
endif # BOARD_NRF51_PCA10031
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
board_runner_args(nrfjprog "--nrf-family=NRF51")
4+
board_runner_args(jlink "--device=nrf51" "--speed=4000")
5+
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
6+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
169 KB
Loading
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
.. _nrf51_pca10031:
2+
3+
nRF51-PCA10031
4+
##############
5+
6+
Overview
7+
********
8+
9+
The nRF51 Dongle (PCA10031) hardware provides support for the Nordic
10+
Semiconductor nRF51822 ARM Cortex-M0 CPU and the following devices:
11+
12+
* :abbr:`ADC (Analog to Digital Converter)`
13+
* CLOCK
14+
* FLASH
15+
* :abbr:`GPIO (General Purpose Input Output)`
16+
* :abbr:`I2C (Inter-Integrated Circuit)`
17+
* :abbr:`NVIC (Nested Vectored Interrupt Controller)`
18+
* RADIO (Bluetooth Low Energy)
19+
* :abbr:`RTC (nRF RTC System Clock)`
20+
* Segger RTT (RTT Console)
21+
* :abbr:`SPI (Serial Peripheral Interface)`
22+
* :abbr:`UART (Universal asynchronous receiver-transmitter)`
23+
* :abbr:`WDT (Watchdog Timer)`
24+
25+
.. figure:: img/nrf51_pca10031.jpg
26+
:width: 442px
27+
:align: center
28+
:alt: nRF51 PCA10031 Dongle
29+
30+
nRF51 PCA10031 Dongle (Credit: Nordic Semi)
31+
32+
More information about the board can be found at the
33+
`nRF51 Dongle website`_. The `Nordic Semiconductor Infocenter`_
34+
contains the processor's information and the datasheet.
35+
36+
Hardware
37+
********
38+
39+
nRF51 Dongle has two external oscillators. The frequency of
40+
the slow clock is 32.768 kHz. The frequency of the main clock
41+
is 16 MHz.
42+
43+
Supported Features
44+
==================
45+
46+
The nrf51_pca10031 board configuration supports the following nRF51
47+
hardware features:
48+
49+
+-----------+------------+----------------------+
50+
| Interface | Controller | Driver/Component |
51+
+===========+============+======================+
52+
| ADC | on-chip | adc |
53+
+-----------+------------+----------------------+
54+
| CLOCK | on-chip | clock_control |
55+
+-----------+------------+----------------------+
56+
| FLASH | on-chip | flash |
57+
+-----------+------------+----------------------+
58+
| GPIO | on-chip | gpio |
59+
+-----------+------------+----------------------+
60+
| I2C(M) | on-chip | i2c |
61+
+-----------+------------+----------------------+
62+
| NVIC | on-chip | arch/arm |
63+
+-----------+------------+----------------------+
64+
| RADIO | on-chip | Bluetooth |
65+
+-----------+------------+----------------------+
66+
| RTC | on-chip | system clock |
67+
+-----------+------------+----------------------+
68+
| RTT | Segger | console |
69+
+-----------+------------+----------------------+
70+
| SPI(M/S) | on-chip | spi |
71+
+-----------+------------+----------------------+
72+
| UART | on-chip | serial |
73+
+-----------+------------+----------------------+
74+
| WDT | on-chip | watchdog |
75+
+-----------+------------+----------------------+
76+
77+
Other hardware features are not supported by the Zephyr kernel.
78+
See `nRF51 Dongle website`_ and `Nordic Semiconductor Infocenter`_
79+
for a complete list of nRF51 Dongle hardware features.
80+
81+
Connections and IOs
82+
===================
83+
84+
LED
85+
---
86+
87+
* LED1 (red) = P0.21
88+
* LED1 (green) = P0.22
89+
* LED1 (blue) = P0.23
90+
91+
Push buttons
92+
------------
93+
94+
* BOOT = SW1 = boot/reset
95+
96+
Programming and Debugging
97+
*************************
98+
99+
Flashing
100+
========
101+
102+
Follow the instructions in the :ref:`nordic_segger` page to install
103+
and configure all the necessary software. Further information can be
104+
found in :ref:`nordic_segger_flashing`. Then build and flash
105+
applications as usual (see :ref:`build_an_application` and
106+
:ref:`application_run` for more details).
107+
108+
Here is an example for the :ref:`hello_world` application.
109+
110+
First, run your favorite terminal program to listen for output.
111+
112+
.. code-block:: console
113+
114+
$ minicom -D <tty_device> -b 115200
115+
116+
Replace :code:`<tty_device>` with the port where the board nRF51 Dongle
117+
can be found. For example, under Linux, :code:`/dev/ttyACM0`.
118+
119+
Then build and flash the application in the usual way.
120+
121+
.. zephyr-app-commands::
122+
:zephyr-app: samples/hello_world
123+
:board: nrf51_pca10031
124+
:goals: build flash
125+
126+
Debugging
127+
=========
128+
129+
Refer to the :ref:`nordic_segger` page to learn about debugging Nordic boards with a
130+
Segger IC.
131+
132+
Testing the LEDs on the nRF51 Dongle
133+
************************************
134+
135+
Build and flash the :ref:`blinky-sample` sample to test that the onboard LED
136+
is working properly with Zephyr.
137+
138+
References
139+
**********
140+
141+
.. target-notes::
142+
143+
.. _nRF51 Dongle website: http://www.nordicsemi.com/eng/Products/nRF51-Dongle
144+
.. _Nordic Semiconductor Infocenter: http://infocenter.nordicsemi.com/
145+
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/*
2+
* Copyright (c) 2018 Nordic Semiconductor ASA.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <nordic/nrf51822_qfac.dtsi>
9+
10+
/ {
11+
model = "Nordic PCA10031 Dev Kit";
12+
compatible = "nordic,pca10031-dk", "nordic,nrf51822-qfac",
13+
"nordic,nrf51822";
14+
15+
chosen {
16+
zephyr,console = &uart0;
17+
zephyr,shell-uart = &uart0;
18+
zephyr,uart-mcumgr = &uart0;
19+
zephyr,bt-mon-uart = &uart0;
20+
zephyr,bt-c2h-uart = &uart0;
21+
zephyr,sram = &sram0;
22+
zephyr,flash = &flash0;
23+
zephyr,code-partition = &slot0_partition;
24+
};
25+
26+
leds {
27+
compatible = "gpio-leds";
28+
led0_red: led_0 {
29+
gpios = <&gpio0 21 GPIO_INT_ACTIVE_LOW>;
30+
label = "Red LED 0";
31+
};
32+
led0_green: led_1 {
33+
gpios = <&gpio0 22 GPIO_INT_ACTIVE_LOW>;
34+
label = "Green LED 0";
35+
};
36+
led0_blue: led_2 {
37+
gpios = <&gpio0 23 GPIO_INT_ACTIVE_LOW>;
38+
label = "Blue LED 0";
39+
};
40+
};
41+
42+
/* These aliases are provided for compatibility with samples */
43+
aliases {
44+
led0 = &led0_red;
45+
led1 = &led0_green;
46+
led2 = &led0_blue;
47+
};
48+
};
49+
50+
&gpiote {
51+
status ="okay";
52+
};
53+
54+
&gpio0 {
55+
status ="okay";
56+
};
57+
58+
&adc {
59+
status ="okay";
60+
};
61+
62+
&uart0 {
63+
current-speed = <115200>;
64+
status = "okay";
65+
tx-pin = <9>;
66+
rx-pin = <11>;
67+
rts-pin = <8>;
68+
cts-pin = <10>;
69+
};
70+
71+
&flash0 {
72+
/*
73+
* For more information, see:
74+
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
75+
*/
76+
partitions {
77+
compatible = "fixed-partitions";
78+
#address-cells = <1>;
79+
#size-cells = <1>;
80+
81+
boot_partition: partition@0 {
82+
label = "mcuboot";
83+
reg = <0x00000000 0x8000>;
84+
};
85+
slot0_partition: partition@8000 {
86+
label = "image-0";
87+
reg = <0x00008000 0x1a000>;
88+
};
89+
slot1_partition: partition@22000 {
90+
label = "image-1";
91+
reg = <0x00022000 0x1a000>;
92+
};
93+
scratch_partition: partition@3c000 {
94+
label = "image-scratch";
95+
reg = <0x0003c000 0x2000>;
96+
};
97+
storage_partition: partition@3e000 {
98+
label = "storage";
99+
reg = <0x0003e000 0x00002000>;
100+
};
101+
};
102+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
identifier: nrf51_pca10031
2+
name: nRF51-PCA10031
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
- xtools
9+
ram: 32
10+
supported:
11+
- ble
12+
- nvs
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_ARM=y
4+
CONFIG_SOC_FAMILY_NRF=y
5+
CONFIG_SOC_SERIES_NRF51X=y
6+
CONFIG_SOC_NRF51822_QFAC=y
7+
CONFIG_BOARD_NRF51_PCA10031=y
8+
9+
# enable GPIO
10+
CONFIG_GPIO=y
11+
12+
# enable uart driver
13+
CONFIG_SERIAL=y
14+
CONFIG_UART_0_NRF_UART=y
15+
16+
# enable console
17+
CONFIG_CONSOLE=y
18+
CONFIG_UART_CONSOLE=y

0 commit comments

Comments
 (0)