boards/atmel/sam0/samr21_xpro/doc/index.html · boards/atmel/sam0/samr21_xpro/doc/index.rst 공식 원문 ↗

Zephyr 3.7.0 · Atmel SAM R21 · IEEE 802.15.4

SAM R21 Xplained Pro

Cortex-M0+와 AT86RF233 2.4 GHz IEEE 802.15.4 radio를 결합한 compact evaluation board입니다.

Official pathboards/atmel/sam0/samr21_xpro/doc/index.html
Source fileboards/atmel/sam0/samr21_xpro/doc/index.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

SAMR21G18A SoC는 Cortex-M0+와 AT86RF233 radio를 결합합니다. radio는 내부 SERCOM4 SPI와 GPIO에 연결되며 WPAN·IPv6 sample로 검증할 수 있습니다.

SAM R21 Xplained Pro
SAM R21 Xplained Pro. 이미지 출처: Microchip, Zephyr 3.7.0.
CPU

SAMR21G18A Cortex-M0+ · 48 MHz

Radio

AT86RF233 · 2.4 GHz IEEE 802.15.4

Console

SERCOM0 · 115200 8N1 · EDBG

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 3AAD7242A3FDF654B7C3D181B49D8325B604973DE39714DB88F9009D62E15511
.. _samr21_xpro:

SAM R21 Xplained Pro Evaluation Kit
###################################

Overview
********

The SAM R21 Xplained Pro is a compact evaluation board by Atmel featuring a
SAMR21G18A SoC. The SoC includes a SAMR21 ARM Cortex-M0+ micro-controller
bundled with Atmel's AT86RF233, a 2.4GHz IEEE802.15.4 compatible radio.
The kit includes Atmel’s Embedded Debugger (EDBG), which provides a full
debug interface without the need for additional hardware.

.. image:: ../../../../../../../../boards/atmel/sam0/samr21_xpro/doc/img/atsamr21_xpro.jpg
     :align: center
     :alt: SAMR21-XPRO

Hardware
********

- SAMR21G18A ARM Cortex-M0+ processor at 48 MHz
- 32.768 kHz crystal oscillator
- 256 KiB flash memory and 32 KiB of RAM
- One yellow user LED
- One mechanical user push button
- One reset button
- On-board USB based EDBG unit with serial console

Supported Features
==================

The samr21_xpro board configuration supports the following hardware
features:

+-----------+------------+--------------------------------------+
| Interface | Controller | Driver/Component                     |
+===========+============+======================================+
| NVIC      | on-chip    | nested vector interrupt controller   |
+-----------+------------+--------------------------------------+
| SYSTICK   | on-chip    | systick                              |
+-----------+------------+--------------------------------------+
| WDT       | on-chip    | Watchdog                             |
+-----------+------------+--------------------------------------+
| GPIO      | on-chip    | I/O ports                            |
+-----------+------------+--------------------------------------+
| PWM       | on-chip    | Pulse Width Modulation               |
+-----------+------------+--------------------------------------+
| USART     | on-chip    | Serial ports                         |
+-----------+------------+--------------------------------------+
| SPI       | on-chip    | Serial Peripheral Interface ports    |
+-----------+------------+--------------------------------------+
| I2C       | on-chip    | I2C Peripheral Interface ports       |
+-----------+------------+--------------------------------------+

Other hardware features are not currently supported by Zephyr.

The default configuration can be found in the Kconfig
:zephyr_file:`boards/atmel/sam0/samr21_xpro/samr21_xpro_defconfig`.

Pin Mapping
===========

The SAM R21 Xplained Pro evaluation kit has 3 GPIO controllers. These
controllers are responsible for pin muxing, input/output, pull-up, etc.

For more details please refer to `SAM R21 Family Datasheet`_ and the `SAM R21
Xplained Pro Schematic`_.

.. image:: ../../../../../../../../boards/atmel/sam0/samr21_xpro/doc/img/ATSAMR21-XPRO-pinout.jpg
     :align: center
     :alt: SAMR21-XPRO-pinout

Default Zephyr Peripheral Mapping:
----------------------------------
- SERCOM0 USART TX : PA5
- SERCOM0 USART RX : PA4
- SERCOM1 I2C SDA  : PA16
- SERCOM1 I2C SCL  : PA17
- SERCOM5 SPI MISO : PB02
- SERCOM5 SPI MOSI : PB22
- SERCOM5 SPI SCK  : PB23
- GPIO SPI CS      : PB03
- GPIO/PWM LED0    : PA19

System Clock
============

The SAMR21 MCU is configured to use the 32.768 kHz external oscillator
with the on-chip PLL generating the 48 MHz system clock.

Serial Port
===========

The SAMR21 MCU has six SERCOM based USARTs with two configured as USARTs in
this BSP. SERCOM0 is the default Zephyr console.

- SERCOM0 115200 8n1 connected to the onboard Atmel Embedded Debugger (EDBG)

PWM
===

The SAMR21 MCU has 3 TCC based PWM units with up to 4 outputs each and a
period of 24 bits or 16 bits.  If :code:`CONFIG_PWM_SAM0_TCC` is enabled then
LED0 is driven by TCC0 instead of by GPIO.

SPI Port
========

The SAMR21 MCU has 6 SERCOM based SPIs.

- SERCOM5 is exposed via Xplained Pro Standard Extension Header

I2C Port
========

When connecting an I2C device and a logic analyzer to an I2C port at the same
time, the internal pull-up resistors are not sufficient for stable bus
operation. You probably have to connect external pull-ups to both bus lines. 10K
is a good value to start with.

- SERCOM1 is exposed via Xplained Pro Standard Extension Header

Radio
=====

The SAMR21 SoC includes an on-chip AT86RF233 radio. It is internally
connected via SPI and some GPIO pins and behaves the same way as
externally connected SPI devices.

+-------------+------------------------------------------------------------------------------------------+
| Sensor      | AT86RF233                                                                                |
+=============+==========================================================================================+
| Type        | 2.4GHz IEEE802.15.4 radio                                                                |
+-------------+------------------------------------------------------------------------------------------+
| Vendor      | Atmel                                                                                    |
+-------------+------------------------------------------------------------------------------------------+
| Datasheet   |`Datasheet <http://www.atmel.com/images/atmel-8351-mcu_wireless-at86rf233_datasheet.pdf>`_|
+-------------+------------------------------------------------------------------------------------------+
| connected to| SPI_0                                                                                    |
+-------------+------------------------------------------------------------------------------------------+
| Pin Config:                                                                                            |
+-------------+------------------------------------------------------------------------------------------+
| Device      | SERCOM4                                                                                  |
+-------------+------------------------------------------------------------------------------------------+
| MOSI        | PB30 (OUT, SPI MOSI)                                                                     |
+-------------+------------------------------------------------------------------------------------------+
| MISO        | PC19 (IN, SPI MISO)                                                                      |
+-------------+------------------------------------------------------------------------------------------+
| SCLK        | PC18 (OUT, SPI SCLK)                                                                     |
+-------------+------------------------------------------------------------------------------------------+
| CS          | PB31 (OUT, GPIO output)                                                                  |
+-------------+------------------------------------------------------------------------------------------+
| IRQ         | PB00 (IN, GPIO external interrupt)                                                       |
+-------------+------------------------------------------------------------------------------------------+
| RSTN        | PB15 (OUT, GPIO output)                                                                  |
+-------------+------------------------------------------------------------------------------------------+
| SLP_TR      | PA20 (OUT, GPIO output)                                                                  |
+-------------+------------------------------------------------------------------------------------------+

Zephyr provide several samples that can use this technology. You can check
:zephyr:code-sample:`wpan-usb` and :zephyr:code-sample:`wpan-serial` examples as starting
points. Another good test can be done with IPv6 by using the server/client
echo demo. More information at :zephyr:code-sample:`sockets-echo-server` and
:zephyr:code-sample:`sockets-echo-client`.

Programming and Debugging
*************************

The SAM R21 Xplained Pro comes with a Atmel Embedded Debugger (EDBG).  This
provides a debug interface to the SAMR21 chip and is supported by
OpenOCD.

Flashing
========

#. Build the Zephyr kernel and the :ref:`hello_world` sample application:

   .. zephyr-app-commands::
      :zephyr-app: samples/hello_world
      :board: samr21_xpro
      :goals: build
      :compact:

#. Connect the SAM R21 Xplained Pro to your host computer using the USB debug
   port.

#. Run your favorite terminal program to listen for output. Under Linux the
   terminal should be :code:`/dev/ttyACM0`. For example:

   .. code-block:: console

      $ minicom -D /dev/ttyACM0 -o

   The -o option tells minicom not to send the modem initialization
   string. Connection should be configured as follows:

   - Speed: 115200
   - Data: 8 bits
   - Parity: None
   - Stop bits: 1

#. To flash an image:

   .. zephyr-app-commands::
      :zephyr-app: samples/hello_world
      :board: samr21_xpro
      :goals: flash
      :compact:

   You should see "Hello World! samr21_xpro" in your terminal.

References
**********

.. target-notes::

.. _Microchip website:
    http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=ATSAMR21-XPRO

.. _SAM R21 Family Datasheet:
    http://ww1.microchip.com/downloads/en/devicedoc/sam-r21_datasheet.pdf

.. _SAM R21 Xplained Pro Schematic:
    http://ww1.microchip.com/downloads/en/DeviceDoc/SAMR21-Xplained-Pro_Design-Documentation.zip

Part 3

한국어 전문 번역

개요

SAM R21 Xplained Pro는 SAMR21G18A SoC를 탑재한 compact evaluation board입니다. SoC는 SAMR21 Arm Cortex-M0+ microcontroller와 Atmel AT86RF233 2.4 GHz IEEE 802.15.4 radio를 결합합니다. EDBG가 추가 hardware 없는 full debug interface를 제공합니다.

SAMR21 Xplained Pro board
SAM R21 Xplained Pro 보드.

하드웨어

  • 48 MHz SAMR21G18A Arm Cortex-M0+
  • 32.768 kHz crystal
  • flash 256 KiB, RAM 32 KiB
  • yellow user LED, mechanical user button, reset button 각 1개
  • serial console을 포함한 USB EDBG

지원 기능

InterfaceControllerDriver/Component
NVICon-chipnested vector interrupt controller
SYSTICKon-chipsystick
WDTon-chipWatchdog
GPIOon-chipI/O ports
PWMon-chipPulse Width Modulation
USARTon-chipSerial ports
SPIon-chipSerial Peripheral Interface ports
I2Con-chipI2C Peripheral Interface ports

다른 hardware는 현재 지원하지 않습니다. 기본 구성은 boards/atmel/sam0/samr21_xpro/samr21_xpro_defconfig입니다.

Pin mapping

GPIO controller 3개가 pin muxing, input/output, pull-up 등을 담당합니다.

SAMR21 Xplained Pro pinout
SAM R21 Xplained Pro pinout.
PeripheralPin
SERCOM0 USART TXPA5
SERCOM0 USART RXPA4
SERCOM1 I2C SDAPA16
SERCOM1 I2C SCLPA17
SERCOM5 SPI MISOPB02
SERCOM5 SPI MOSIPB22
SERCOM5 SPI SCKPB23
GPIO SPI CSPB03
GPIO/PWM LED0PA19

System clock과 console

external 32.768 kHz oscillator와 on-chip PLL로 48 MHz system clock을 생성합니다. SERCOM 기반 USART는 6개이며 BSP에서 2개를 USART로 구성합니다. 기본 console은 on-board EDBG에 연결된 SERCOM0 115200 8N1입니다.

PWM과 SPI

TCC PWM unit 3개가 각각 최대 output 4개와 24-bit 또는 16-bit period를 제공합니다. CONFIG_PWM_SAM0_TCC를 활성화하면 LED0은 GPIO 대신 TCC0이 구동합니다. SERCOM 기반 SPI는 6개이며 SERCOM5가 Xplained Pro Standard Extension Header에 노출됩니다.

I2C

I2C device와 logic analyzer를 동시에 연결하면 internal pull-up만으로 bus가 불안정할 수 있습니다. 두 bus line에 external pull-up을 연결해야 할 수 있으며 시작값으로 10 kΩ가 적절합니다. SERCOM1이 standard extension header에 노출됩니다.

Radio

on-chip AT86RF233 radio는 내부 SPI와 GPIO pin에 연결되며 external SPI device와 같은 방식으로 동작합니다.

항목값
Type2.4 GHz IEEE 802.15.4 radio
VendorAtmel
SPISPI_0 / SERCOM4
MOSIPB30 (OUT)
MISOPC19 (IN)
SCLKPC18 (OUT)
CSPB31 (GPIO OUT)
IRQPB00 (GPIO interrupt IN)
RSTNPB15 (GPIO OUT)
SLP_TRPA20 (GPIO OUT)

시작점으로 wpan-usb, wpan-serial sample을 사용할 수 있습니다. IPv6는 sockets-echo-server와 sockets-echo-client로 시험할 수 있습니다.

프로그래밍과 디버깅

SAM R21 Xplained Pro에는 Atmel Embedded Debugger(EDBG)가 내장되어 있습니다. 추가 hardware 없이 SAMR21 debug interface를 제공하며 OpenOCD가 지원합니다.

Flashing

  1. Zephyr kernel과 hello_world sample을 build합니다.
  2. USB debug port로 보드를 host에 연결합니다.
  3. Linux에서는 /dev/ttyACM0 terminal을 엽니다.
  4. image를 flash합니다.
west build -b samr21_xpro samples/hello_world
minicom -D /dev/ttyACM0 -o
west flash

terminal은 115200 baud, 8 data bit, parity none, 1 stop bit로 설정합니다. -o는 modem initialization string을 보내지 않게 합니다. 출력으로 Hello World! samr21_xpro가 나타납니다.

참고 자료

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.