1.. _rak4631_nrf52840:
2
3RAK4631
4#######
5
6Overview
7********
8
9RAK4631 is a WisBlock Core module for RAK WisBlock.
10It extends the WisBlock series with a powerful
11Nordic nRF52840 MCU that supports Bluetooth 5.0
12(Bluetooth Low Energy) and the newest LoRa transceiver
13from Semtech, the SX1262. The Semtech SX1262 has compared
14to the older SX127x series a lower power consumption at
15the same TX power. This makes the RAK4631 an ultra-low
16power communication solution. RAK4631 can be comfortably
17programmed with ZephyrRTOS.
18
19.. image:: img/rak4631-front-parts.jpg
20     :align: center
21     :alt: RAK4631-NRF52840
22
23Hardware
24********
25
26To use a RAK4631, you need at least a WisBlock Base
27to plug the module in. WisBlock Base is the power
28supply for the RAK4631 module and has the
29programming/debug interface.
30
31- nRF52840 ARM Cortex-M4F Processor
32- 64 MHz CPU clock
33- 1 Micro-AB USB OTG host/device
34- Semtech SX1262 low power high range LoRa transceiver
35- iPEX connectors for the LORA antenna and BLE antenna.
36- Multiple interfaces, I2C, UART, GPIO, ADC
37- 2 user LEDs on RAK5005 mother Board
38- Powered by either Micro USB, 3.7V rechargeable battery or a 5V Solar Panel Port
39
40Supported Features
41==================
42
43The rak4631_nrf52840 board configuration supports the following hardware features:
44
45+-----------+------------+----------------------+
46| Interface | Controller | Driver/Component     |
47+===========+============+======================+
48| ADC       | on-chip    | adc                  |
49+-----------+------------+----------------------+
50| CLOCK     | on-chip    | clock_control        |
51+-----------+------------+----------------------+
52| FLASH     | on-chip    | flash                |
53+-----------+------------+----------------------+
54| GPIO      | on-chip    | gpio                 |
55+-----------+------------+----------------------+
56| I2C(M)    | on-chip    | i2c                  |
57+-----------+------------+----------------------+
58| MPU       | on-chip    | arch/arm             |
59+-----------+------------+----------------------+
60| NVIC      | on-chip    | arch/arm             |
61+-----------+------------+----------------------+
62| PWM       | on-chip    | pwm                  |
63+-----------+------------+----------------------+
64| RADIO     | on-chip    | Bluetooth,           |
65|           |            | ieee802154           |
66+-----------+------------+----------------------+
67| RADIO     | on-board   | LoRa (SX1262)        |
68+-----------+------------+----------------------+
69| RTC       | on-chip    | system clock         |
70+-----------+------------+----------------------+
71| SPI(M/S)  | on-chip    | spi                  |
72+-----------+------------+----------------------+
73| UART      | on-chip    | serial               |
74+-----------+------------+----------------------+
75| USB       | on-chip    | usb                  |
76+-----------+------------+----------------------+
77| WDT       | on-chip    | watchdog             |
78+-----------+------------+----------------------+
79
80The default board configuration can be found in the defconfig file:
81
82        ``boards/arm/rak4631_nrf52840/rak4631_nrf52840_defconfig``
83
84Connections and IOs
85===================
86
87LED
88---
89
90* LED1 (green) = P1.3
91* LED2 (blue) = P1.4
92
93Programming and Debugging
94*************************
95
96The RAK4631 board shall be connected to a Segger Embedded Debugger Unit
97`J-Link OB <https://www.segger.com/jlink-ob.html>`_.  This provides a debug
98interface to the NRF52840 chip. You can use JLink to communicate with
99the NRF52840.
100
101Flashing
102========
103
104#. Download JLink from the Segger `JLink Downloads Page`_.  Go to the section
105   "J-Link Software and Documentation Pack" and install the "J-Link Software
106   and Documentation pack for Linux".  The application JLinkExe needs to be
107   accessible from your path.
108
109#. Run your favorite terminal program to listen for output.  Under Linux the
110   terminal should be :code:`/dev/ttyACM0`. For example:
111
112   .. code-block:: console
113
114      $ minicom -D /dev/ttyACM0 -o
115
116   The -o option tells minicom not to send the modem initialization string.
117   Connection should be configured as follows:
118
119   - Speed: 115200
120   - Data: 8 bits
121   - Parity: None
122   - Stop bits: 1
123
124#. Connect the RAK4631 board to your host computer using the USB debug port.
125   Then build and flash the :ref:`hello_world` application.
126
127   .. zephyr-app-commands::
128      :zephyr-app: samples/hello_world
129      :board: rak4631_nrf52840
130      :goals: build flash
131
132   You should see "Hello World! rak4631_nrf52840" in your terminal.
133
134Debugging
135=========
136
137You can debug an application in the usual way.  Here is an example for the
138:ref:`hello_world` application.
139
140.. zephyr-app-commands::
141   :zephyr-app: samples/hello_world
142   :board: rak4631_nrf52840
143   :maybe-skip-config:
144   :goals: debug
145
146References
147**********
148
149.. target-notes::
150
151.. _RAK4631 Product Description:
152    https://docs.rakwireless.com/Product-Categories/WisBlock/RAK4631/Datasheet/#overview
153
154.. _JLink Downloads Page:
155    https://www.segger.com/downloads/jlink
156