Skip to content
Permalink
Browse files

boards: arm: Add support for nRF51 Dongle (PCA10031)

This commit adds support for the nrf51_pca10031 board.

Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
  • Loading branch information...
stig-bjorlykke authored and ioannisg committed Jun 13, 2018
1 parent 284bc9d commit 0ca1aaa7be0ab2249db467e61b793bea2cc60733
@@ -0,0 +1,9 @@
# Kconfig - nRF51 PCA10031 board configuration
#
# Copyright (c) 2018 Nordic Semiconductor ASA.
#
# SPDX-License-Identifier: Apache-2.0

config BOARD_NRF51_PCA10031
bool "nRF51 PCA10031"
depends on SOC_NRF51822_QFAC
@@ -0,0 +1,22 @@
# Kconfig - nRF51 PCA10031 board configuration
#
# Copyright (c) 2018 Nordic Semiconductor ASA.
#
# SPDX-License-Identifier: Apache-2.0

if BOARD_NRF51_PCA10031

config BOARD
default "nrf51_pca10031"

if ADC

config ADC_0
default y

endif # ADC

config BT_CTLR
default BT

endif # BOARD_NRF51_PCA10031
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

board_runner_args(nrfjprog "--nrf-family=NRF51")
board_runner_args(jlink "--device=nrf51" "--speed=4000")
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
Binary file not shown.
@@ -0,0 +1,145 @@
.. _nrf51_pca10031:

nRF51-PCA10031
##############

Overview
********

The nRF51 Dongle (PCA10031) hardware provides support for the Nordic
Semiconductor nRF51822 ARM Cortex-M0 CPU and the following devices:

* :abbr:`ADC (Analog to Digital Converter)`
* CLOCK
* FLASH
* :abbr:`GPIO (General Purpose Input Output)`
* :abbr:`I2C (Inter-Integrated Circuit)`
* :abbr:`NVIC (Nested Vectored Interrupt Controller)`
* RADIO (Bluetooth Low Energy)
* :abbr:`RTC (nRF RTC System Clock)`
* Segger RTT (RTT Console)
* :abbr:`SPI (Serial Peripheral Interface)`
* :abbr:`UART (Universal asynchronous receiver-transmitter)`
* :abbr:`WDT (Watchdog Timer)`

.. figure:: img/nrf51_pca10031.jpg
:width: 442px
:align: center
:alt: nRF51 PCA10031 Dongle

nRF51 PCA10031 Dongle (Credit: Nordic Semi)

More information about the board can be found at the
`nRF51 Dongle website`_. The `Nordic Semiconductor Infocenter`_
contains the processor's information and the datasheet.

Hardware
********

nRF51 Dongle has two external oscillators. The frequency of
the slow clock is 32.768 kHz. The frequency of the main clock
is 16 MHz.

Supported Features
==================

The nrf51_pca10031 board configuration supports the following nRF51
hardware features:

+-----------+------------+----------------------+
| Interface | Controller | Driver/Component |
+===========+============+======================+
| ADC | on-chip | adc |
+-----------+------------+----------------------+
| CLOCK | on-chip | clock_control |
+-----------+------------+----------------------+
| FLASH | on-chip | flash |
+-----------+------------+----------------------+
| GPIO | on-chip | gpio |
+-----------+------------+----------------------+
| I2C(M) | on-chip | i2c |
+-----------+------------+----------------------+
| NVIC | on-chip | arch/arm |
+-----------+------------+----------------------+
| RADIO | on-chip | Bluetooth |
+-----------+------------+----------------------+
| RTC | on-chip | system clock |
+-----------+------------+----------------------+
| RTT | Segger | console |
+-----------+------------+----------------------+
| SPI(M/S) | on-chip | spi |
+-----------+------------+----------------------+
| UART | on-chip | serial |
+-----------+------------+----------------------+
| WDT | on-chip | watchdog |
+-----------+------------+----------------------+

Other hardware features are not supported by the Zephyr kernel.
See `nRF51 Dongle website`_ and `Nordic Semiconductor Infocenter`_
for a complete list of nRF51 Dongle hardware features.

Connections and IOs
===================

LED
---

* LED1 (red) = P0.21
* LED1 (green) = P0.22
* LED1 (blue) = P0.23

Push buttons
------------

* BOOT = SW1 = boot/reset

Programming and Debugging
*************************

Flashing
========

Follow the instructions in the :ref:`nordic_segger` page to install
and configure all the necessary software. Further information can be
found in :ref:`nordic_segger_flashing`. Then build and flash
applications as usual (see :ref:`build_an_application` and
:ref:`application_run` for more details).

Here is an example for the :ref:`hello_world` application.

First, run your favorite terminal program to listen for output.

.. code-block:: console

$ minicom -D <tty_device> -b 115200

Replace :code:`<tty_device>` with the port where the board nRF51 Dongle
can be found. For example, under Linux, :code:`/dev/ttyACM0`.

Then build and flash the application in the usual way.

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: nrf51_pca10031
:goals: build flash

Debugging
=========

Refer to the :ref:`nordic_segger` page to learn about debugging Nordic boards with a
Segger IC.

Testing the LEDs on the nRF51 Dongle
************************************

Build and flash the :ref:`blinky-sample` sample to test that the onboard LED
is working properly with Zephyr.

References
**********

.. target-notes::

.. _nRF51 Dongle website: http://www.nordicsemi.com/eng/Products/nRF51-Dongle
.. _Nordic Semiconductor Infocenter: http://infocenter.nordicsemi.com/

@@ -0,0 +1,102 @@
/*
* Copyright (c) 2018 Nordic Semiconductor ASA.
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <nordic/nrf51822_qfac.dtsi>

/ {
model = "Nordic PCA10031 Dev Kit";
compatible = "nordic,pca10031-dk", "nordic,nrf51822-qfac",
"nordic,nrf51822";

chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
};

leds {
compatible = "gpio-leds";
led0_red: led_0 {
gpios = <&gpio0 21 GPIO_INT_ACTIVE_LOW>;
label = "Red LED 0";
};
led0_green: led_1 {
gpios = <&gpio0 22 GPIO_INT_ACTIVE_LOW>;
label = "Green LED 0";
};
led0_blue: led_2 {
gpios = <&gpio0 23 GPIO_INT_ACTIVE_LOW>;
label = "Blue LED 0";
};
};

/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0_red;
led1 = &led0_green;
led2 = &led0_blue;
};
};

&gpiote {
status ="okay";
};

&gpio0 {
status ="okay";
};

&adc {
status ="okay";
};

&uart0 {
current-speed = <115200>;
status = "okay";
tx-pin = <9>;
rx-pin = <11>;
rts-pin = <8>;
cts-pin = <10>;
};

&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x8000>;
};
slot0_partition: partition@8000 {
label = "image-0";
reg = <0x00008000 0x1a000>;
};
slot1_partition: partition@22000 {
label = "image-1";
reg = <0x00022000 0x1a000>;
};
scratch_partition: partition@3c000 {
label = "image-scratch";
reg = <0x0003c000 0x2000>;
};
storage_partition: partition@3e000 {
label = "storage";
reg = <0x0003e000 0x00002000>;
};
};
};
@@ -0,0 +1,12 @@
identifier: nrf51_pca10031
name: nRF51-PCA10031
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 32
supported:
- ble
- nvs
@@ -0,0 +1,18 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_ARM=y
CONFIG_SOC_FAMILY_NRF=y
CONFIG_SOC_SERIES_NRF51X=y
CONFIG_SOC_NRF51822_QFAC=y
CONFIG_BOARD_NRF51_PCA10031=y

# enable GPIO
CONFIG_GPIO=y

# enable uart driver
CONFIG_SERIAL=y
CONFIG_UART_0_NRF_UART=y

# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

0 comments on commit 0ca1aaa

Please sign in to comment.
You can’t perform that action at this time.