Skip to content

Waveshare nRF52840 Eval Kit

Support for the Waveshare nRF52840 Eval Kit @author Gunar Schorcht gunar@schorcht.net

Overview

The Waveshare nRF52840 Eval Kit is an evaluation board for the nRF52840 SoC with the following on-board components:

  1. Arduino headers for connecting Arduino shields
  2. Raspberry Pi GPIO header for connecting Raspberry Pi HATs
  3. USB TO UART interface
  4. USB port of nRF52840
  5. 4PIN SWD debugging interface for connecting ARM Debugger to program / debug
  6. 3.3V/5V power input/output provides power output OR powered from external power supply
  7. Waveshare Core52840: nRF52840 core module
  8. CP2102: USB TO UART converter
  9. Buzzer
  10. RT9193-33: 3.3V voltage regulator
  11. Optical sensor
  12. RESET and USER KEY
  13. 4 User LEDs
  14. Power switch: USB powered - OFF - Battery powered
  15. NFC antenna connector
  16. TF card slot
  17. CR2032 battery holder

Waveshare nRF52840 Eval Kit

Using the onboard Arduino and Raspberry Pi compatible headers, both Arduino shields and Raspberry Pi HATs can be used at the same time.

Hardware:

MCUNRF52840
FamilyARM Cortex-M4
VendorNordic Semiconductor
RAM256 kByte
Flash1 MByte
Frequency64 MHz
FPUyes
GPIOs48
Timers5 x 32-bit counter
RTC3 x Real Time Counter
ADCs1 x 12-bit 200 ksps with 8 channels
UARTs2
SPIs1 x QSPI, 3 x SPI master/slave
I2Cs2
I2S1
PWM4 * 4 Channels
CryptoAES-128, SHA1/2, RSA, Chacha20/Poly1305, ECC
Radio2.4 GHz transceiver, Bluetooth 5, IEEE 802.15.4
Vcc1.7V - 5.5V
DatasheetDatasheet
Reference ManualReference Manual
Board ManualBoard Manual
Board SchematicBoard Schematic

Pin Layout / Configuration

The following table shows the connection of the on-board components with the MCU pins. All these connections are jumpered and can be removed.

MCU PinMCU PeripheralRIOT PeripheralBoard FunctionArduino HeaderRasperry Pi (*)
P0.02ADCADC_LINE(0)AREF
P0.03ADCADC_LINE(1)A0P26 (32)
P0.04ADCADC_LINE(2)A1P27 (36)
P0.05ADCADC_LINE(3)Optical sensor (LDR)P7 (7)
P0.06UARTE0 RXUART_DEV(0) RXUART RXP21 (29)
P0.07UARTE0 CTSUART_DEV(0) CTSUART CTSP6 (22)
P0.08UARTE0 TXUART_DEV(0) TXUART TXP3 (15)
P0.09NFC Antenna ConnectorP1 (12)
P0.10NFC Antenna ConnectorP25 (37)
P0.11BTN0Button KEY1P2 (13)
P0.12SPI_DEV(1) CSSD Card CSCIE1 (26)
P0.13PWMPWM_DEV(1).0 / LED1LED1P24 (35)
P0.14PWM_DEV(1).1 / LED2LED2P23 (33)
P0.15PWM_DEV(2).0BuzzerP22 (31)
P0.16PWM_DEV(1).3 / LED4LED4ID_SD (27)
P0.17SPI1 SCKSPI_DEV(1) SCKSD Card SCLKSCLK (23)
P0.18BTN1Button RESET
P0.19TXD0 (8)
P0.20SPI1 MISOSPI_DEV(1) MISOSD Card MISOMISO (21)
P0.21RXD0 (10)
P0.22I2C0 SCLI2C_DEV(1) SCLSCL (5)
P0.23CIE0 (24)
P0.24SPI1 MOSISPI_DEV(1) MOSISD Card MOSIMOSI (19)
P0.25UARTE0 RTSUART_DEV(0) RTSUART RTSP0 (11)
P0.26I2C1 SDAI2C_DEV(0) SDAI2C SDASDA
P0.27I2C1 SCLI2C_DEV(0) SCLI2C SCLSCL
P0.28ADCADC_LINE(4)A2P28 (38)
P0.29ADCADC_LINE(5)A3P29 (40)
P0.30ADCADC_LINE(6)A4
P0.31ADCADC_LINE(7)A5
P1.00I2C0 SDAI2C_DEV(1) SDASDA (3)
P1.01UARTE1 RXUART_DEV(1) RXD0 / RX
P1.02UARTE1 TXUART_DEV(1) TXD1 / TX
P1.03D2
P1.04PWM_DEV(0).0D3 / PWM
P1.05D4
P1.06PWM_DEV(0).1D5 / PWM
P1.07PWM_DEV(0).2D6 / PWM
P1.08D7
P1.09PWM_DEV(1).2 / LED3LED3ID_SC (28)
P1.10D8
P1.11PWM_DEV(0).3D9 / PWM
P1.12D10 / SS
P1.13SPI0 MOSISPI_DEV(0) MOSID11 / MOSI
P1.14SPI0 MISOSPI_DEV(0) MISOD12 / MISO
P1.15SPI0 SCKSPI_DEV(0)SCKD13 / SCK

(*) Raspberry Pi header pins are given by the labels as used on the board. These labels correspond to the pins and names as used by the ‘WiringPi’ library. For detailed information on how these numbers are mapped to the GPIOs of the BCM SoCs, see this document. The numbers in the brackets are the pin numbers of the 40-pin header.

Flash the board

See the Flashing section in boards_common_nrf52.

The easiest way is to use a Segger J-Link and connect it to the SWD header of the board as follows:

  • Segger J-Link Pin 7 with SWD Header pin DIN
  • Segger J-Link Pin 9 with SWD Header pin CLK

Accessing STDIO via UART

The stdio is directly accessible via the on-board CP2102 USB to UART bridge. On a Linux host, this interface is mapped to /dev/ttyUSB<n> where <n> is the index of the UART interface which is 0 by default.

Use the term target to connect to the board serial port using /dev/ttyUSB0:

make BOARD=waveshare-nrf52840-eval-kit -C examples/basic/hello-world term

If the UART interface index of board’s USB to UART bridge is not 0, use the following command to connect to the board serial port:

make BOARD=waveshare-nrf52840-eval-kit -C examples/basic/hello-world PORT=/dev/ttyUSB<n> term

RESET Pin Configuration

On nRF52840 boards, the RESET pin is not configured out-of-the box. This means, that simply nothing happens if the RESET button is pressed. To change this, RIOT provides a little tool in dist/tools/nrf52_resetpin_cfg:

RESET_PIN='GPIO_PIN\(0,18\)' make BOARD=waveshare-nrf52840-eval-kit -C dist/tools/nrf52_resetpin_cfg/ flash

Simply compile, flash, and run that tool on your board, and the reset pin should work for the time being.