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 31The samr34_xpro board configuration supports the following hardware 32features: 33 34.. list-table:: 35 :header-rows: 1 36 37 * - Interface 38 - Controller 39 - Driver / Component 40 * - NVIC 41 - on-chip 42 - nested vector interrupt controller 43 * - Flash 44 - on-chip 45 - Can be used with LittleFS to store files 46 * - SYSTICK 47 - on-chip 48 - systick 49 * - WDT 50 - on-chip 51 - Watchdog 52 * - GPIO 53 - on-chip 54 - I/O ports 55 * - PWM 56 - on-chip 57 - Pulse Width Modulation 58 * - USART 59 - on-chip 60 - Serial ports 61 * - I2C 62 - on-chip 63 - I2C ports 64 * - SPI 65 - on-chip 66 - Serial Peripheral Interface ports 67 * - TRNG 68 - on-chip 69 - True Random Number Generator 70 71The following hardware features are supported by Zephyr, but not yet fully 72supported by the SOC: 73 74.. list-table:: 75 :header-rows: 1 76 77 * - Interface 78 - Controller 79 - Driver / Component 80 * - LoRa Radio 81 - on-chip 82 - Internal SX1276 LoRa Radio 83 84Other hardware features are not currently supported by Zephyr. 85 86The default configuration can be found in the Kconfig 87:zephyr_file:`boards/atmel/sam0/samr34_xpro/samr34_xpro_defconfig`. 88 89Pin Mapping 90=========== 91 92The SAM R34 Xplained Pro evaluation kit has 3 GPIO controllers. These 93controllers are responsible for pin muxing, input/output, pull-up, etc. 94 95For more details please refer to `SAM R34 Family Datasheet`_ and the `SAM R34 96Xplained Pro Schematic`_. 97 98.. image:: img/atsamr34-xpro-pinout.jpg 99 :align: center 100 :alt: SAMR34-XPRO-pinout 101 102Default Zephyr Peripheral Mapping: 103---------------------------------- 104- SERCOM0 UART TX : PA04 105- SERCOM0 UART RX : PA05 106- SERCOM1 I2C SDA : PA16 107- SERCOM1 I2C SCL : PA17 108- SERCOM4 SPI MISO : PC19 109- SERCOM4 SPI MOSI : PB30 110- SERCOM4 SPI SCK : PC18 111- SERCOM4 GPIO CS : PB31 112- SERCOM5 SPI MISO : PB02 113- SERCOM5 SPI MOSI : PB22 114- SERCOM5 SPI SCK : PB23 115- SERCOM5 GPIO CS0 : PA23 116- SERCOM5 GPIO CS1 : PA14 117- USB DP : PA25 118- USB DM : PA24 119- GPIO/PWM LED0 : PA19 120 121System Clock 122============ 123 124The SAMR34 MCU is configured to use the 32.768 kHz external oscillator 125with the on-chip PLL generating the 48 MHz system clock. 126 127Serial Port 128=========== 129 130The SAMR34 MCU has six SERCOM based USARTs with one configured as USART in 131this BSP. SERCOM0 is the default Zephyr console. 132 133- SERCOM0 115200 8n1 - connected to the onboard Atmel Embedded Debugger (EDBG) 134 135PWM 136=== 137 138The SAMR34 MCU has 3 TCC based PWM units with up to 4 outputs each and a period 139of 24 bits or 16 bits. If :code:`CONFIG_PWM_SAM0_TCC` is enabled then LED0 is 140driven by TCC0 instead of by GPIO. 141 142SPI Port 143======== 144 145The SAMR34 MCU has 6 SERCOM based SPIs, with two configured as SPI in this BSP. 146 147- SERCOM4 - connected to the internal LoRa radio 148- SERCOM5 - connected to EXT1 and EXT3 149 150Programming and Debugging 151************************* 152 153The SAM R34 Xplained Pro comes with a Atmel Embedded Debugger (EDBG). This 154provides a debug interface to the SAMR34 chip and is supported by 155OpenOCD. 156 157Flashing 158======== 159 160#. Build the Zephyr kernel and the ``hello_world`` sample application: 161 162 .. zephyr-app-commands:: 163 :zephyr-app: samples/hello_world 164 :board: samr34_xpro 165 :goals: build 166 :compact: 167 168#. Connect the SAM R34 Xplained Pro to your host computer using the USB debug 169 port. 170 171#. Run your favorite terminal program to listen for output. Under Linux the 172 terminal should be :code:`/dev/ttyACM0`. For example: 173 174 .. code-block:: console 175 176 $ picocom -b 115200 /dev/ttyACM0 177 178 - Speed: 115200 179 - Data: 8 bits 180 - Parity: None 181 - Stop bits: 1 182 183#. To flash an image: 184 185 .. zephyr-app-commands:: 186 :zephyr-app: samples/hello_world 187 :board: samr34_xpro 188 :goals: flash 189 :compact: 190 191 You should see "Hello World! samr34_xpro" in your terminal. 192 193References 194********** 195 196.. target-notes:: 197 198.. _Microchip website: 199 https://www.microchip.com/en-us/development-tool/dm320111 200 201.. _SAM L21 Family Datasheet: 202 https://ww1.microchip.com/downloads/en/DeviceDoc/SAM_L21_Family_DataSheet_DS60001477C.pdf 203 204.. _SAM R34 Family Datasheet: 205 https://ww1.microchip.com/downloads/en/DeviceDoc/SAM-R34-R35-Low-Power-LoRa-Sub-GHz-SiP-Data-Sheet-DS70005356C.pdf 206 207.. _SAM R34 Xplained Pro Schematic: 208 https://ww1.microchip.com/downloads/Secure/en/DeviceDoc/SAMR34_SiP_Reference_Design_Package_V3.0.exe 209 210.. _Semtech SX1276: 211 https://www.semtech.com/products/wireless-rf/lora-transceivers/sx1276 212