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