boards: 96b_carbon_nrf51: add support for 96Boards Carbon nRF51 chip

This adds support for the nRF51 chip on the board.

If you'd like to run Zephyr on the STM32F4 chip on Carbon, you need to
use the 96b_carbon board instead.

The current SPI Bluetooth protocol only uses 5 wires, so we use the
remaining pin as UART TX.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
This commit is contained in:
Ricard Salveti 2016-09-23 18:43:13 +05:30 committed by Anas Nashif
commit 6c2eff6066
10 changed files with 246 additions and 0 deletions

View file

@ -0,0 +1,34 @@
CONFIG_ARM=y
CONFIG_SOC_FAMILY_NRF5=y
CONFIG_SOC_SERIES_NRF51X=y
CONFIG_SOC_NRF51822_QFAC=y
CONFIG_BOARD_96B_CARBON_NRF51=y
# enable uart driver
CONFIG_SERIAL=y
CONFIG_UART_NRF5=y
CONFIG_UART_NRF5_GPIO_TX_PIN=29
CONFIG_UART_NRF5_GPIO_RX_PIN=11
# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# bluetooth
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_CONTROLLER=y
# spi
CONFIG_SPI=y
CONFIG_SPI_1=y
CONFIG_SPI_1_NAME="SPI_1"
CONFIG_SPI_1_IRQ_PRI=1
CONFIG_SPI_NRF5=y
CONFIG_SPIS1_NRF5=y
CONFIG_SPIS1_NRF5_GPIO_SCK_PIN=7
CONFIG_SPIS1_NRF5_GPIO_MOSI_PIN=0
CONFIG_SPIS1_NRF5_GPIO_MISO_PIN=30
CONFIG_SPIS1_NRF5_GPIO_CSN_PIN=25
#enable DTS
CONFIG_HAS_DTS=y

View file

@ -0,0 +1,9 @@
# Kconfig - 96Boards Carbon nRF51 board configuration
#
# Copyright (c) 2016, 2017 Linaro Limited.
#
# SPDX-License-Identifier: Apache-2.0
config BOARD_96B_CARBON_NRF51
bool "96Boards Carbon (nRF51)"
depends on SOC_NRF51822_QFAC

View file

@ -0,0 +1,25 @@
# Kconfig - 96Boards Carbon nRF51 board default configuration
#
# Copyright (c) 2016, 2017 Linaro Limited.
#
# SPDX-License-Identifier: Apache-2.0
if BOARD_96B_CARBON_NRF51
config BOARD
default 96b_carbon_nrf51
if UART_NRF5
config GPIO
default y
config GPIO_NRF5
default y
config GPIO_NRF5_P0
default y
endif # UART_NRF5
endif # BOARD_96B_CARBON_NRF51

View file

@ -0,0 +1 @@
obj- += dummy.o

View file

@ -0,0 +1,12 @@
/*
* Copyright (c) 2016, 2017 Linaro Limited.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __INC_BOARD_H
#define __INC_BOARD_H
#include <soc.h>
#endif /* __INC_BOARD_H */

View file

@ -0,0 +1,136 @@
.. _96b_carbon_nrf51_board:
96Boards Carbon nRF51
#####################
.. note::
If you're looking to reprogram the main STMicro part, see
:ref:`96b_carbon_board`. Users should not use this configuration
unless they want to reprogram the secondary chip which provides
Bluetooth connectivity.
Overview
********
Zephyr applications use the 96b_carbon_nrf51 configuration to run on
the secondary nRF51822 chip on the 96Boards Carbon. This chip provides
Bluetooth functionality to the main STM32F401RET chip via SPI.
Hardware
********
The 96Boards Carbon nRF51 has two external oscillators. The frequency
of the slow clock is 32.768 kHz. The frequency of the main clock is 16
MHz.
See :ref:`96b_carbon_board` for other general information about the
board; that configuration is for the same physical board, just a
different chip.
Supported Features
==================
+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+-------------------------------------+
| RTC | on-chip | system clock |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port |
+-----------+------------+-------------------------------------+
| GPIO | on-chip | gpio |
+-----------+------------+-------------------------------------+
| FLASH | on-chip | flash |
+-----------+------------+-------------------------------------+
| SPIS | on-chip | SPI slave |
+-----------+------------+-------------------------------------+
| RADIO | on-chip | bluetooth |
+-----------+------------+-------------------------------------+
The default configuration can be found in the defconfig file:
``boards/arm/96b_carbon_nrf51/96b_carbon_nrf51_defconfig``
Connections and IOs
===================
The SWD debug pins are broken out to an external header; all other
connected pins are to the main STM32F401RET chip.
Programming and Debugging
*************************
Flashing
========
The 96Boards Carbon nRF51 can be flashed using an external SWD
debugger, via the debug header labeled "BLE" on the board's
silkscreen. The header is not populated; 0.1" male header must be
soldered on first.
.. figure:: img/96b-carbon-nrf51-debug.png
:align: center
:alt: 96Boards Carbon nRF51 Debug
96Boards Carbon nRF51 Debug
The following example assumes a Zephyr binary ``zephyr.elf`` will be
flashed to the board.
It uses the `Black Magic Debug Probe`_ as an SWD programmer, which can
be connected to the BLE debug header using flying leads and its 20 Pin
JTAG Adapter Board Kit. When plugged into your host PC, the Black
Magic Debug Probe enumerates as a USB serial device as documented on
its `Getting started page`_.
It also uses the GDB binary provided with the Zephyr SDK,
``arm-zephyr-eabi-gdb``. Other GDB binaries, such as the GDB from GCC
ARM Embedded, can be used as well.
.. code-block:: console
$ arm-zephyr-eabi-gdb -q zephyr.elf
(gdb) target extended-remote /dev/ttyACM0
Remote debugging using /dev/ttyACM0
(gdb) monitor swdp_scan
Target voltage: 3.3V
Available Targets:
No. Att Driver
1 nRF51
(gdb) attach 1
Attaching to Remote target
0xabcdef12 in ?? ()
(gdb) load
Debugging
=========
After you've flashed the chip, you can keep debugging using the same
GDB instance. To reattach, just follow the same steps above, but don't
run "load". You can then debug as usual with GDB. In particular, type
"run" at the GDB prompt to restart the program you've flashed.
As an aid to debugging, this board configuration directs a console
output to a currently unused pin connected to the STM32F401RET. Users
who are experienced in electronics rework can remove a resistor (R22)
on the board and attach a wire to the nRF51822's UART output.
References
**********
- `Board documentation from 96Boards`_
- `nRF51822 information from Nordic Semiconductor`_
.. _Black Magic Debug Probe:
https://github.com/blacksphere/blackmagic/wiki
.. _Getting started page:
https://github.com/blacksphere/blackmagic/wiki/Getting-Started
.. _Board documentation from 96Boards:
http://www.96boards.org/product/carbon/
.. _nRF51822 information from Nordic Semiconductor:
https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

View file

@ -0,0 +1,25 @@
/*
* Copyright (c) 2017 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <nordic/nrf51822.dtsi>
/ {
model = "Seeed Studio Carbon nRF51 96board";
compatible = "seeed,carbon_nrf51", "nordic,nrf51822-qfac",
"nordic,nrf51822";
chosen {
zephyr,console = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
};
&uart0 {
current-speed = <115200>;
status = "ok";
};

View file

@ -0,0 +1,3 @@
#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
#define CONFIG_UART_NRF5_IRQ_PRI NORDIC_NRF_UART_40002000_IRQ_0_PRIORITY
#define CONFIG_UART_NRF5_BAUD_RATE NORDIC_NRF_UART_40002000_CURRENT_SPEED

View file

@ -13,6 +13,7 @@ dtb-$(CONFIG_BOARD_V2M_BEETLE) = v2m_beetle.dts_compiled
dtb-$(CONFIG_BOARD_MPS2_AN385) = mps2_an385.dts_compiled
dtb-$(CONFIG_BOARD_OLIMEXINO_STM32) = olimexino_stm32.dts_compiled
dtb-$(CONFIG_BOARD_96B_CARBON) = 96b_carbon.dts_compiled
dtb-$(CONFIG_BOARD_96B_CARBON_NRF51) = 96b_carbon_nrf51.dts_compiled
dtb-$(CONFIG_BOARD_NUCLEO_F401RE) = nucleo_f401re.dts_compiled
dtb-$(CONFIG_BOARD_NUCLEO_F411RE) = nucleo_f411re.dts_compiled
dtb-$(CONFIG_BOARD_NUCLEO_F103RB) = nucleo_f103rb.dts_compiled