boards/arduino/due/doc/index.html · boards/arduino/due/doc/index.rst 공식 원문 ↗

Zephyr 3.7.0 · Arduino · SAM3X8E

Arduino Due

84 MHz Atmel SAM3X8E Cortex-M3와 BOSSA-compatible SAM-BA bootloader를 사용하는 Arduino board입니다.

Official pathboards/arduino/due/doc/index.html
Source fileboards/arduino/due/doc/index.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

arduino_due configuration은 SAM3X8E Cortex-M3의 NVIC, SYSTICK, USB serial, GPIO, I2C와 watchdog을 지원합니다. 이 Zephyr configuration은 Arduino가 공식 지원하는 구성이 아닙니다.

Arduino Due
Arduino Due. 이미지 출처: Arduino, Zephyr 3.7.0.
MCU

Atmel SAM3X8E Cortex-M3, 최대 84 MHz

Console

UART → ATmega16U2 USB-TTL

Flasher

BOSSA bossac, arduino branch

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 01EDE463DB3A853BD6336FB3CCC09FD95C5836A29FEB3E338869D6CD2432614E
.. _arduino_due:

Arduino Due
###########

Overview
********

The arduino_due board configuration is used by Zephyr applications
that run on the Arduino Due board. It provides support for the Atmel
SAM3X8E ARM Cortex-M3 CPU and the following devices:

* Nested Vectored Interrupt Controller (NVIC)

* System Tick System Clock (SYSTICK)

* Serial Port over USB (ATMEL_SAM3)

More information about the board can be found at the `Arduino Due website`_.
The `Atmel SAM3X8E Datasheet`_ has the information and the datasheet about
the processor.

.. note::
   This configuration is not supported by Arduino.

.. image:: ../../../../../../../boards/arduino/due/doc/img/arduino_due.jpg
     :align: center
     :alt: Arduino Due

Hardware
********
Supported Features
==================

The arduino_due board configuration supports the following hardware features:

+-----------+------------+----------------------+
| Interface | Controller | Driver/Component     |
+===========+============+======================+
| NVIC      | on-chip    | nested vectored      |
|           |            | interrupt controller |
+-----------+------------+----------------------+
| SYSTICK   | on-chip    | system clock         |
+-----------+------------+----------------------+
| UART      | on-chip    | serial port          |
+-----------+------------+----------------------+
| GPIO      | on-chip    | gpio                 |
+-----------+------------+----------------------+
| I2C       | on-chip    | i2c                  |
+-----------+------------+----------------------+
| Watchdog  | on-chip    | watchdog             |
+-----------+------------+----------------------+

Other hardware features are not currently supported by the Zephyr kernel.
See `Arduino Due website`_ and `Atmel SAM3X8E Datasheet`_ for a complete
list of Arduino Due board hardware features.

The default configuration can be found in the Kconfig
:zephyr_file:`boards/arduino/due/arduino_due_defconfig`.

.. note::
   For I2C, pull-up resistors are required for using SCL1 and SDA1 (near IO13).

Interrupt Controller
====================

There are 15 fixed exceptions including exceptions 12 (debug monitor) and 15
(SYSTICK) that behave more as interrupts than exceptions. In addition, there can
be a variable number of IRQs. Exceptions 7-10 and 13 are reserved. They don't
need handlers.

A Cortex-M3/4-based board uses vectored exceptions. This means each exception
calls a handler directly from the vector table.

Handlers are provided for exceptions 1-6, 11-12, and 14-15.  The table here
identifies the handlers used for each exception.

+------+------------+----------------+-----------------------+
| Exc# | Name       | Remarks        | Used by Zephyr Kernel |
+======+============+================+=======================+
| 1    | Reset      |                | system initialization |
+------+------------+----------------+-----------------------+
| 2    | NMI        |                | system fatal error    |
+------+------------+----------------+-----------------------+
| 3    | Hard fault |                | system fatal error    |
+------+------------+----------------+-----------------------+
| 4    | MemManage  | MPU fault      | system fatal error    |
+------+------------+----------------+-----------------------+
| 5    | Bus        |                | system fatal error    |
+------+------------+----------------+-----------------------+
| 6    | Usage      | undefined      | system fatal error    |
|      | fault      | instruction,   |                       |
|      |            | or switch      |                       |
|      |            | attempt to ARM |                       |
|      |            | mode           |                       |
+------+------------+----------------+-----------------------+
| 11   | SVC        |                | system calls, kernel  |
|      |            |                | run-time exceptions,  |
|      |            |                | and IRQ offloading    |
+------+------------+----------------+-----------------------+
| 12   | Debug      |                | system fatal error    |
|      | monitor    |                |                       |
+------+------------+----------------+-----------------------+
| 14   | PendSV     |                | context switch        |
+------+------------+----------------+-----------------------+
| 15   | SYSTICK    |                | system clock          |
+------+------------+----------------+-----------------------+

.. note::
   After a reset, all exceptions have a priority of 0. Interrupts cannot run
   at priority 0 for the interrupt locking mechanism and exception handling
   to function properly.

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

Arduino Due has two external oscillators/resonators. The slow clock is
32.768 kHz, and the main clock is 12 MHz. The processor can set up PLL to drive
the master clock, which can be set as high as 84 MHz.

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

The Atmel SAM3X8E processor has a single UART that is used by the SAM-BA
bootloader. This UART has only two wires for RX/TX and does not have flow
control (CTS/RTS) or FIFO. The RX/TX pins are connected to the ATmega16U2,
which provides USB-to-TTL serial function. The Zephyr console output, by
default, is utilizing this controller.


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

Flashing
========

BOSSA Tool
----------

Flashing the Zephyr kernel onto Arduino Due requires the `bossa tool`_.

There are GUI and command line versions of the bossa tool. The following
section provides the steps to build the command line version. Please
refer to the bossa tool's README file on how to build the GUI version.

To build the bossa tool, follow these steps:

#. Checkout the bossa tool's code from the repository.

   .. code-block:: console

     $ git clone https://github.com/shumatech/BOSSA.git
     $ cd BOSSA

#. Checkout the arduino branch. The code on the master branch does not
   work with Arduino Due.

   .. code-block:: console

     $ git checkout arduino

#. Build the command line version of the bossa tool.

   .. code-block:: console

     $ make bin/bossac

#. The resulting binary is available at :file:`bin/bossac`.


Flashing an Application to Arduino Due
--------------------------------------

Applications for the ``arduino_due`` board configuration can be built
and flashed in the usual way (see :ref:`build_an_application` and
:ref:`application_run` for more details).

Here is an example for the :ref:`hello_world` application. After
building the application, press the Reset button before running the
flash command, so the board will boot into the SAM-BA bootloader and
be prepared to receive the new program.

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: arduino_due
   :goals: build flash

After flashing the application, run your favorite terminal program to
listen for output. For example, under Linux, the terminal should be
:code:`/dev/ttyACM0`. For example:

.. code-block:: console

   $ sudo minicom -D /dev/ttyACM0 -o

The -o option tells minicom not to send the modem initialization
string.

Now press the Reset button and you should see "Hello World! arduino_due" in your terminal.

.. note::
   Make sure your terminal program is closed before flashing the binary image,
   or it will interfere with the flashing process.

References
**********

.. _Arduino Due website: https://www.arduino.cc/en/Main/ArduinoBoardDue

.. _Atmel SAM3X8E Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11057-32-bit-Cortex-M3-Microcontroller-SAM3X-SAM3A_Datasheet.pdf

.. _bossa tool: https://github.com/shumatech/BOSSA

.. _bossa arduino branch: https://github.com/shumatech/BOSSA/tree/arduino

Part 3

한국어 전문 번역

개요

arduino_due는 Arduino Due의 Atmel SAM3X8E Arm Cortex-M3 application을 위한 configuration입니다. NVIC, SYSTICK와 ATMEL_SAM3 USB serial을 지원합니다. board 정보와 processor 사양은 Arduino Due website와 SAM3X8E datasheet를 참고합니다.

Arduino Due
Arduino Due.

지원 기능

InterfaceControllerDriver/Component
NVICon-chipnested vectored interrupt controller
SYSTICKon-chipsystem clock
UARTon-chipserial port
GPIOon-chipgpio
I2Con-chipi2c
Watchdogon-chipwatchdog

다른 hardware는 현재 Zephyr kernel에서 지원하지 않습니다. 기본 설정은 boards/arduino/due/arduino_due_defconfig입니다. SCL1·SDA1(IO13 근처)을 I2C로 사용할 때 external pull-up resistor가 필요합니다.

Interrupt controller

debug monitor 12와 SYSTICK 15를 포함한 fixed exception 15개가 있으며 추가 IRQ 수는 device에 따라 달라집니다. exception 7~10과 13은 reserved라 handler가 필요 없습니다. Cortex-M3/4는 vector table에서 각 handler를 직접 호출합니다.

Exc#NameRemarksZephyr 사용
1Resetsystem initialization
2NMIsystem fatal error
3Hard faultsystem fatal error
4MemManageMPU faultsystem fatal error
5Bussystem fatal error
6Usage faultundefined instruction 또는 ARM mode 전환 시도system fatal error
11SVCsystem call, run-time exception, IRQ offloading
12Debug monitorsystem fatal error
14PendSVcontext switch
15SYSTICKsystem clock

Clock·serial

slow external oscillator는 32.768 kHz, main clock은 12 MHz이며 PLL로 master clock을 최대 84 MHz로 설정합니다. SAM3X8E UART 하나는 SAM-BA bootloader와 Zephyr console이 사용합니다. RX/TX 2-wire 방식으로 CTS/RTS flow control과 FIFO가 없으며 ATmega16U2가 USB-to-TTL serial을 제공합니다.

프로그래밍과 디버깅

BOSSA tool 준비

master branch는 Arduino Due에서 동작하지 않으므로 반드시 arduino branch를 build합니다.

$ git clone https://github.com/shumatech/BOSSA.git
$ cd BOSSA
$ git checkout arduino
$ make bin/bossac

binary는 bin/bossac에 생성됩니다.

Application flash

build 후 Reset을 눌러 SAM-BA bootloader로 진입한 다음 flash합니다.

west build -b arduino_due samples/hello_world
west flash
$ sudo minicom -D /dev/ttyACM0 -o

-o는 minicom modem initialization string 전송을 막습니다. 다시 Reset하면 Hello World! arduino_due가 표시됩니다.

참고 자료

Source

출처

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