Skip to content

Commit

Permalink
boards: arm: Add board definition for Adafruit Feather nRF52840 Express
Browse files Browse the repository at this point in the history
Add support for adafruit_feather_nrf52840 board.

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
  • Loading branch information
tsvehagen authored and hakehuang committed Apr 30, 2020
1 parent e5135d6 commit 41b883d
Show file tree
Hide file tree
Showing 10 changed files with 392 additions and 7 deletions.
10 changes: 10 additions & 0 deletions boards/arm/adafruit_feather_nrf52840/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Adafruit Feather nRF52840 Express board configuration

# Copyright (c) 2020 Tobias Svehagen
# SPDX-License-Identifier: Apache-2.0

config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default y
depends on BOARD_ADAFRUIT_FEATHER_NRF52840
8 changes: 8 additions & 0 deletions boards/arm/adafruit_feather_nrf52840/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Adafruit Feather nRF52840 Express board configuration

# Copyright (c) 2020 Tobias Svehagen
# SPDX-License-Identifier: Apache-2.0

config BOARD_ADAFRUIT_FEATHER_NRF52840
bool "Adafruit Feather nRF52840 Express"
depends on SOC_NRF52840_QIAA
40 changes: 40 additions & 0 deletions boards/arm/adafruit_feather_nrf52840/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Adafruit Feather nRF52840 Express board configuration

# Copyright (c) 2020 Tobias Svehagen
# SPDX-License-Identifier: Apache-2.0

if BOARD_ADAFRUIT_FEATHER_NRF52840

config BOARD
default "adafruit_feather_nrf52840"

config ADC_0
default y
depends on ADC

config I2C_0
default y
depends on I2C

config SPI_1
default y
depends on SPI

if USB

config USB_NRFX
default y

config USB_DEVICE_STACK
default y

endif # USB

config IEEE802154_NRF5
default y
depends on IEEE802154

config BT_CTLR
default BT

endif # BOARD_ADAFRUIT_FEATHER_NRF52840
133 changes: 133 additions & 0 deletions boards/arm/adafruit_feather_nrf52840/adafruit_feather_nrf52840.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
* Copyright (c) 2020 Tobias Svehagen
*
* SPDX-License-Identifier: Apache-2.0
*/

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

/ {
model = "Adafruit Feather nRF52840 Express";
compatible = "nordic,nrf52840-qiaa", "nordic,nrf52840";

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: led_0 {
gpios = <&gpio1 15 0>;
label = "Red LED";
};
led1: led_1 {
gpios = <&gpio1 10 0>;
label = "Blue LED";
};
};

buttons {
compatible = "gpio-keys";
button0: button_0 {
gpios = <&gpio1 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "Push button switch";
};
};

/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
led1 = &led1;
sw0 = &button0;
};
};

&adc {
status = "okay";
};

&gpiote {
status = "okay";
};

&gpio0 {
status = "okay";
};

&gpio1 {
status = "okay";
};

&uart0 {
compatible = "nordic,nrf-uart";
current-speed = <115200>;
status = "okay";
tx-pin = <25>;
rx-pin = <24>;
};

&i2c0 {
status = "okay";
sda-pin = <12>;
scl-pin = <11>;
};

&spi1 {
status = "okay";
sck-pin = <14>;
mosi-pin = <13>;
miso-pin = <15>;
};

&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 = <0x000000000 0x0000C000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x000067000>;
};
slot1_partition: partition@73000 {
label = "image-1";
reg = <0x00073000 0x000067000>;
};
scratch_partition: partition@da000 {
label = "image-scratch";
reg = <0x000da000 0x0001e000>;
};

/*
* The flash starting at 0x000f8000 and ending at
* 0x000fffff is reserved for use by the application.
*/

/* Storage partition will be used by FCB/NFFS/NVS if enabled. */
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 0x00008000>;
};
};
};

&usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
identifier: adafruit_feather_nrf52840
name: Adafruit Feather nRF52840 Express
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- adc
- usb_device
- usb_cdc
- ble
- ieee802154
- watchdog
- counter
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_ADAFRUIT_FEATHER_NRF52840=y

# Enable MPU
CONFIG_ARM_MPU=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

# additional board options
CONFIG_GPIO_AS_PINRESET=y
8 changes: 8 additions & 0 deletions boards/arm/adafruit_feather_nrf52840/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: Apache-2.0

board_runner_args(jlink "--device=nrf52" "--speed=4000")
board_runner_args(pyocd "--target=nrf52" "--frequency=4000000")
board_runner_args(blackmagicprobe "--gdb-serial=/dev/ttyBmpGdb")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
147 changes: 147 additions & 0 deletions boards/arm/adafruit_feather_nrf52840/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
.. _adafruit_feather_nrf52840:

Adafruit Feather nRF52840 Express
#################################

Overview
********

The Adafruit Feather nRF52840 provides support for the Nordic Semiconductor
nRF52840 ARM Cortex-M4F 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:`MPU (Memory Protection Unit)`
* :abbr:`NVIC (Nested Vectored Interrupt Controller)`
* :abbr:`PWM (Pulse Width Modulation)`
* RADIO (Bluetooth Low Energy and 802.15.4)
* :abbr:`RTC (nRF RTC System Clock)`
* Segger RTT (RTT Console)
* :abbr:`SPI (Serial Peripheral Interface)`
* :abbr:`UART (Universal asynchronous receiver-transmitter)`
* :abbr:`USB (Universal Serial Bus)`
* :abbr:`WDT (Watchdog Timer)`

.. figure:: img/adafruit_feather_nrf52840.jpg
:width: 640px
:align: center
:alt: Adafruit Feather nRF52840 Express

Hardware
********

- nRF52840 ARM Cortex-M4F processor at 64 MHz
- 1 MB flash memory and 256 KB of SRAM
- Battery connector and charger for 3.7 V lithium polymer batteries
- Charging indicator LED
- 2 User LEDs
- 1 NeoPixel LED
- Reset button
- SWD connector

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

The Adafruit Feather nRF52840 board configuration supports the
following hardware features:

+-----------+------------+----------------------+
| Interface | Controller | Driver/Component |
+===========+============+======================+
| ADC | on-chip | adc |
+-----------+------------+----------------------+
| CLOCK | on-chip | clock_control |
+-----------+------------+----------------------+
| FLASH | on-chip | flash |
+-----------+------------+----------------------+
| GPIO | on-chip | gpio |
+-----------+------------+----------------------+
| I2C | on-chip | i2c |
+-----------+------------+----------------------+
| MPU | on-chip | arch/arm |
+-----------+------------+----------------------+
| NVIC | on-chip | arch/arm |
+-----------+------------+----------------------+
| PWM | on-chip | pwm |
+-----------+------------+----------------------+
| RADIO | on-chip | Bluetooth, |
| | | ieee802154 |
+-----------+------------+----------------------+
| RTC | on-chip | system clock |
+-----------+------------+----------------------+
| SPI | on-chip | spi |
+-----------+------------+----------------------+
| UART | on-chip | serial |
+-----------+------------+----------------------+
| USB | on-chip | usb |
+-----------+------------+----------------------+
| WDT | on-chip | watchdog |
+-----------+------------+----------------------+

Other hardware features are not supported by the Zephyr kernel.

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

The `Adafruit Feather nRF52840 Express Learn site`_ has detailed
information about the board including `pinouts`_ and the `schematic`_.

LED
---

* LED0 (red) = P1.15
* LED1 (blue) = P1.10

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

* SWITCH = P1.02
* RESET = P0.18

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

Applications for the ``adafruit_feather_nrf52840`` board configuration
can be built and flashed in the usual way (see :ref:`build_an_application`
and :ref:`application_run` for more details).

Flashing
========

Flashing Zephyr onto the ``adafruit_feather_nrf52480`` board requires
an external programmer. The programmer is attached to the SWD header.

Build the Zephyr kernel and the :ref:`blinky-sample` sample application.

.. zephyr-app-commands::
:zephyr-app: samples/blinky
:board: adafruit_feather_nrf52840
:goals: build
:compact:

Flash the image.

.. zephyr-app-commands::
:zephyr-app: samples/blinky
:board: adafruit_feather_nrf52840
:goals: flash
:compact:

You should see the the red LED blink.

References
**********

.. target-notes::

.. _Adafruit Feather nRF52840 Express Learn site:
https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/

.. _pinouts:
https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/pinouts

.. _schematic:
https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/downloads
Loading

0 comments on commit 41b883d

Please sign in to comment.