1.. zephyr:board:: samr34_xpro
2
3Overview
4********
5
6The SAM R34 Xplained Pro evaluation kit is ideal for evaluation and
7prototyping with the SAM R34 Cortex®-M0+ processor-based
8microcontrollers. The kit includes Atmel’s Embedded Debugger (EDBG),
9which provides a full debug interface without the need for additional
10hardware.
11
12The SAMR34 and SAMR35 parts are produced as a System-in-Package (SiP),
13including both a SAML21 die, and a Semtech SX1276 LoRa radio die.
14
15This board is also referred to as DM320111.
16
17Hardware
18********
19
20- SAMR34J18 ARM Cortex-M0+ processor at 48 MHz
21- 32.768 kHz crystal oscillator
22- 256 KiB flash memory, 32 KiB of SRAM, 8KB Low Power SRAM
23- One yellow user LED
24- One mechanical user push button
25- One reset button
26- On-board USB based EDBG unit with serial console
27
28Supported Features
29==================
30
31.. zephyr:board-supported-hw::
32
33Pin Mapping
34===========
35
36The SAM R34 Xplained Pro evaluation kit has 3 GPIO controllers. These
37controllers are responsible for pin muxing, input/output, pull-up, etc.
38
39For more details please refer to `SAM R34 Family Datasheet`_ and the `SAM R34
40Xplained Pro Schematic`_.
41
42.. image:: img/atsamr34-xpro-pinout.jpg
43     :align: center
44     :alt: SAMR34-XPRO-pinout
45
46Default Zephyr Peripheral Mapping:
47----------------------------------
48- SERCOM0 UART TX  : PA04
49- SERCOM0 UART RX  : PA05
50- SERCOM1 I2C SDA  : PA16
51- SERCOM1 I2C SCL  : PA17
52- SERCOM4 SPI MISO : PC19
53- SERCOM4 SPI MOSI : PB30
54- SERCOM4 SPI SCK  : PC18
55- SERCOM4 GPIO CS  : PB31
56- SERCOM5 SPI MISO : PB02
57- SERCOM5 SPI MOSI : PB22
58- SERCOM5 SPI SCK  : PB23
59- SERCOM5 GPIO CS0 : PA23
60- SERCOM5 GPIO CS1 : PA14
61- USB DP           : PA25
62- USB DM           : PA24
63- GPIO/PWM LED0    : PA19
64
65System Clock
66============
67
68The SAMR34 MCU is configured to use the 32.768 kHz external oscillator
69with the on-chip PLL generating the 48 MHz system clock.
70
71Serial Port
72===========
73
74The SAMR34 MCU has six SERCOM based USARTs with one configured as USART in
75this BSP. SERCOM0 is the default Zephyr console.
76
77- SERCOM0 115200 8n1 - connected to the onboard Atmel Embedded Debugger (EDBG)
78
79PWM
80===
81
82The SAMR34 MCU has 3 TCC based PWM units with up to 4 outputs each and a period
83of 24 bits or 16 bits.  If :code:`CONFIG_PWM_SAM0_TCC` is enabled then LED0 is
84driven by TCC0 instead of by GPIO.
85
86SPI Port
87========
88
89The SAMR34 MCU has 6 SERCOM based SPIs, with two configured as SPI in this BSP.
90
91- SERCOM4 - connected to the internal LoRa radio
92- SERCOM5 - connected to EXT1 and EXT3
93
94Programming and Debugging
95*************************
96
97The SAM R34 Xplained Pro comes with a Atmel Embedded Debugger (EDBG).  This
98provides a debug interface to the SAMR34 chip and is supported by
99OpenOCD.
100
101Flashing
102========
103
104#. Build the Zephyr kernel and the ``hello_world`` sample application:
105
106   .. zephyr-app-commands::
107      :zephyr-app: samples/hello_world
108      :board: samr34_xpro
109      :goals: build
110      :compact:
111
112#. Connect the SAM R34 Xplained Pro to your host computer using the USB debug
113   port.
114
115#. Run your favorite terminal program to listen for output. Under Linux the
116   terminal should be :code:`/dev/ttyACM0`. For example:
117
118   .. code-block:: console
119
120      $ picocom -b 115200 /dev/ttyACM0
121
122   - Speed: 115200
123   - Data: 8 bits
124   - Parity: None
125   - Stop bits: 1
126
127#. To flash an image:
128
129   .. zephyr-app-commands::
130      :zephyr-app: samples/hello_world
131      :board: samr34_xpro
132      :goals: flash
133      :compact:
134
135   You should see "Hello World! samr34_xpro" in your terminal.
136
137References
138**********
139
140.. target-notes::
141
142.. _Microchip website:
143    https://www.microchip.com/en-us/development-tool/dm320111
144
145.. _SAM L21 Family Datasheet:
146    https://ww1.microchip.com/downloads/en/DeviceDoc/SAM_L21_Family_DataSheet_DS60001477C.pdf
147
148.. _SAM R34 Family Datasheet:
149    https://ww1.microchip.com/downloads/en/DeviceDoc/SAM-R34-R35-Low-Power-LoRa-Sub-GHz-SiP-Data-Sheet-DS70005356C.pdf
150
151.. _SAM R34 Xplained Pro Schematic:
152    https://ww1.microchip.com/downloads/Secure/en/DeviceDoc/SAMR34_SiP_Reference_Design_Package_V3.0.exe
153
154.. _Semtech SX1276:
155    https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1276
156