boards/snps/em_starterkit/doc/index.html · boards/snps/em_starterkit/doc/index.rst 공식 원문 ↗

Zephyr 3.7.0 · Boards · Synopsys · ARC EM

DesignWare ARC EM Starter Kit

EM7D·EM9D·EM11D FPGA configuration과 Pmod, SPI-FLASH, OpenOCD/GDB workflow를 다룹니다.

Official pathboards/snps/em_starterkit/doc/index.html
Source fileboards/snps/em_starterkit/doc/index.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

Firmware 2.2·2.3 지원, 세 core defconfig와 DIP 설정, CCM/DDR 실행과 SPI-FLASH 배포를 구분합니다.

Default core

EM9D

Firmware

2.2 · 2.3

Pmod

6

Persistent

SPI-FLASH

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 D01F51F9204246858E08BF0B1C177D7E2F79D499FCC225679A0C66CDEDE9A4BA
.. _em_starterkit:

DesignWare(R) ARC(R) EM Starter Kit
###################################

Overview
********

The DesignWare(R) ARC(R) EM Starter Kit is a low-cost, versatile solution
enabling rapid software development and software debugging, and profiling
for the ARC EM Family of processors. The EM Family includes the EM4, EM6,
EM5D, EM7D, EM9D, and EM11D cores. The Zephyr RTOS can be used with the
EM Starter Kit.

.. image:: ../../../../../../../boards/snps/em_starterkit/doc/em_starterkit.jpg
   :align: center
   :alt: DesignWare(R) ARC(R) EM Starter Kit (synopsys.com)

The ARC EM Starter Kit consists of a hardware platform, including pre-installed
FPGA images of different ARC EM processor configurations with peripherals.
Documentation for this board can be found at `embARC website`_.

See also this URL for details about the board:
`Designware ARC EM Starter Kit website`_ .

The latest version of EM Starter Kit is 2.3, developer can upgrade from
2.0/2.1/2.2 to 2.3 using latest firmware.
The default configuration for EM Starter Kit boards can be found in
:zephyr_file:`boards/snps/em_starterkit/em_starterkit_defconfig`.

The default SoC for this board supported in Zephyr is the EM9D.
This configuration is a Harvard Architecture, with a separate
instruction bus and data bus. Instruction memory is called ICCM
and data memory is called DCCM. The configuration file for EM9D
is found in :zephyr_file:`soc/snps/emsk/Kconfig.defconfig.em9d`.

If you have a larger program, you can select the EM7D or EM11D, which gives
access to 128KB DRAM with i-cache and d-cache. The configuration file for EM7D
is found in :zephyr_file:`soc/snps/emsk/Kconfig.defconfig.em7d` and EM11D is
found in :zephyr_file:`soc/snps/emsk/Kconfig.defconfig.em11d`.


Hardware
********
Board Layout
============

The ARC EM Starter Kit main board has 6 Pmod connectors. These can be configured
to support attachment of GPIO, I2C, UART or SPI devices.

The board also has a 16MB SPI-FLASH and an SDCard for storage. There are 9 LEDs,
3 buttons, and 4 dip switches that can be used with GPIO.

The Xilinx Spartan(R)-6 LX150 FPGA can auto-load one of 3 FPGA SoC bit files
which have the EM7D, EM9D, or EM11D SoC.

Documentation and general information for the board can be found at the
`embARC website`_, which also includes some free sample software.


Supported Firmware Versions
===========================

The EM Starter Kit has different versions, such as 1.0, 1.1, 2.0, 2.1,
2.2 and 2.3.
In Zephyr, only firmware versions 2.2 and 2.3 are supported.

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

The Zephyr kernel supports multiple hardware features on the EM Starter Kit
through the use of device drivers.

The EM Starter Kit supports 6 Digilent Pmod(TM) Interfaces, which enables the
use of a large variety of pluggable modules for storage, communications,
sensors, displays, etc. With the Pmod interface, you can prototype your
applications using the Zephyr RTOS.

The table below shows which drivers are supported and which functionality can
be found on which architectures:

+-----------+------------+-----+-------+-----------------------+
| Interface | Controller |EM9D | EM11D | Driver/Component      |
+===========+============+=====+=======+=======================+
| INT       | on-chip    | Y   | Y     | interrupt_controller  |
+-----------+------------+-----+-------+-----------------------+
| UART      | usb +      | Y   | Y     | serial port-polling;  |
|           | 2 Pmods    |     |       | serial port-interrupt |
+-----------+------------+-----+-------+-----------------------+
| SPI       | 2 Pmods    | Y   | Y     | spi                   |
+-----------+------------+-----+-------+-----------------------+
| ADC       | n/a        | N   | N     | adc (can add via Pmod)|
+-----------+------------+-----+-------+-----------------------+
| I2C       | 2 Pmods    | Y   | Y     | i2c                   |
+-----------+------------+-----+-------+-----------------------+
| GPIO      | 6 Pmods    | Y   | Y     | gpio                  |
+-----------+------------+-----+-------+-----------------------+
| PWM       | n/a        | N   | N     | pwm                   |
+-----------+------------+-----+-------+-----------------------+

The board has 3 (debounced and interrupting) buttons for use with GPIO, 4 dip
switches, 9 LEDs, SDCard on SPI, and a 16MB SPI-Flash memory.

The SPI-FLASH driver is supported with sample, which can be found in
``samples/drivers/spi_flash``.

The SPI-Flash also holds 3 (or 4) separate FPGA CPU bit files, selectable via
dip switch.

The SPI-Flash is also programmed with a bootloader. The bootloader can copy a
program image from SPI-Flash into executable memory. Zephyr initialization will
copy the initialized data section to the data memory if CONFIG_XIP is used.


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

Required Hardware and Software
==============================

To use Zephyr RTOS applications on the EM Starter Kit board, a few additional
pieces of hardware are required.

* USB Cable (delivered as part of the ARC EM Starter Kit)

* The USB cable provides power to the board; however, if the board is to run
  standalone, the universal switching power adaptor (110-240V AC to 5V DC),
  provided in the package, can be used to power the board.

* :ref:`The Zephyr SDK <toolchain_zephyr_sdk>`

* Terminal emulator software for use with the USB-UART. Suggestion:
  `Putty Website`_.

* (optional) A collection of Pmods.
  See `Digilent Pmod Modules`_ or develop your custom interfaces to attach
  to the Pmod connector.

Set up the ARC EM Starter Kit
=============================

To run Zephyr application on correct arc core of EM Starter Kit, you need to
setup the board correctly.

* Connect the digilent usb cable from your host to the board.

* Connect the 5V DC power supply to your board.

* Select the core configuration of the board by choosing correct dip switch
  SW1 settings, then press then FPGA configure button located above the letter
  'C' of the ARC logo on the board.

* Then the board will be reconfigured with selected core configuration, you
  can download and debug Zephyr application now.

* If you want to know more about how to use this board, you can take a look
  at the `ARC EM Starter Kit User Guide`_.

Set up Zephyr Software
======================

Since there are different firmware versions of EM Starter Kit, you need to
choose the proper firmware version supported in Zephyr.

Three different configurations exist for this board:

* EM7D: em_starterkit_em7d_defconfig
* EM9D: em_starterkit_defconfig
* EM11D: em_starterkit_em11d_defconfig


Building Sample Applications
==============================

You can try many of the sample applications or tests, but let us discuss
the one called :ref:`hello_world`.
It is found in :zephyr_file:`samples/hello_world`.

Configuring
-----------

You may need to write a prj_arc.conf file if the sample doesn't have one.
Next, you can use the menuconfig rule to configure the target. By
specifying ``em_starterkit`` as the board configuration, you can select the ARC
EM Starter Kit board support for Zephyr.

.. zephyr-app-commands::
   :board: em_starterkit
   :zephyr-app: samples/hello_world
   :goals: menuconfig

On this board you will also need to consider the "ARC SoC Selection" and set
it either to EM9D or EM11D. To boot up the EM9D on the board, all dip
switches should be UP except for switch 1. Other configuration choices
are made in the normal way. To boot up the EM11D on the board,
all dip switches should be UP except for switch 2. Next press the button
above the letter C in the "ARC" logo on the silkscreen.

Building
--------

You can build application in the usual way.  Refer to
:ref:`build_an_application` for more details. Here is an example for
:ref:`hello_world`.

.. zephyr-app-commands::
   :board: em_starterkit
   :zephyr-app: samples/hello_world
   :maybe-skip-config:
   :goals: build

Connecting Serial Output
=========================

In the default configuration, Zephyr's EM Starter Kit images support
serial output via the UART1 on the board.  To enable serial output:

On your development environment, you will need to:

* Open a serial port emulator (i.e. on Linux minicom, putty, screen, etc)
* Specify the tty driver name, for example, on Linux this may be :file:`/dev/ttyUSB1`
* Set the communication settings to:


========= =====
Parameter Value
========= =====
Baud:     115200
Data:     8 bits
Parity:    None
Stopbits:  1
========= =====

Debugging
==========

Using the latest version of Zephyr SDK(>=0.9), you can debug and flash
EM Starterkit directly.

One option is to build and debug the application using the usual
Zephyr build system commands.

.. zephyr-app-commands::
   :board: em_starterkit
   :app: <my app>
   :goals: debug

At this point you can do your normal debug session. Set breakpoints and then
'c' to continue into the program.

The other option is to launch a debug server, as follows.

.. zephyr-app-commands::
   :board: em_starterkit
   :app: <my app>
   :goals: debugserver

Then connect to the debug server at the EM Starter Kit from a second
console, from the build directory containing the output :file:`zephyr.elf`.

.. code-block:: console

   $ cd <my app>
   $ $ZEPHYR_SDK_INSTALL_DIR/arc-zephyr-elf/bin/arc-zephyr-elf-gdb zephyr.elf
   (gdb) target remote localhost:3333
   (gdb) load
   (gdb) b main
   (gdb) c

Flashing
========

If you just want to download the application to the EM Starter Kit's CCM
or DDR and run, you can do so in the usual way.

.. zephyr-app-commands::
   :board: em_starterkit
   :goals: flash

This command still uses openocd and gdb to load application elf file
to EM Starter Kit, but it will load application and then run immediately.
If power is lost, the application will also lost due to power loss.

Most of the time you will not be flashing your program but will instead
debug it using openocd and gdb. The program can be download via the USB
cable into the code and data memories.

When you are ready to deploy the program so that it boots up automatically
on reset or power-up, you can follow the steps to place the program on
SPI-FLASH.

For instructions on how to write your program to SPI-FLASH,
refer to the documentation on the ARC EM Starter Kit at the
`embARC website`_, which includes instructions for how to place an
executable image onto the SPI-FLASH in such a way that it is understood
by the bootloader.

Release Notes
*************

The following is a list of TODO items:

* ``GH-2647``: Zephyr needs i-cache API (all targets)
* ``GH-2230``: Zephyr ARC port doesn't yet support nested regular interrupts.
* pinmux driver: Possibly it can be written to configure PMods too.

References
**********

.. _embARC website: https://www.embarc.org

.. _Designware ARC EM Starter Kit website: https://www.synopsys.com/dw/ipdir.php?ds=arc_em_starter_kit

.. _Digilent Pmod Modules: http://store.digilentinc.com/pmod-modules

.. _Putty website: http://www.putty.org

.. _ARC EM Starter Kit User Guide: https://www.synopsys.com/dw/ipdir.php?ds=arc_em_starter_kit

Part 3

한국어 전문 번역

개요

DesignWare ARC EM Starter Kit는 ARC EM processor family의 빠른 software 개발·debugging·profiling을 위한 저비용 범용 플랫폼입니다. EM family에는 EM4, EM6, EM5D, EM7D, EM9D, EM11D core가 있으며 Zephyr RTOS를 사용할 수 있습니다.

DesignWare ARC EM Starter Kit

Hardware platform에는 peripheral과 여러 ARC EM processor configuration의 FPGA image가 미리 설치됩니다. Board 문서는 embARC와 Synopsys ARC EM Starter Kit에서 확인할 수 있습니다.

최신 kit version은 2.3이며 최신 firmware로 2.0·2.1·2.2에서 2.3으로 upgrade할 수 있습니다. 기본 board 설정은 boards/snps/em_starterkit/em_starterkit_defconfig입니다.

Zephyr의 기본 SoC는 Harvard architecture EM9D입니다. Instruction bus와 data bus가 분리되고 instruction memory는 ICCM, data memory는 DCCM이라고 합니다. EM9D 설정은 soc/snps/emsk/Kconfig.defconfig.em9d입니다. 더 큰 program에는 i-cache·d-cache와 128KB DRAM을 제공하는 EM7D 또는 EM11D를 선택할 수 있으며 설정은 각각 Kconfig.defconfig.em7d와 Kconfig.defconfig.em11d입니다.

하드웨어

Board layout

Mainboard의 Pmod connector 6개에는 GPIO, I2C, UART, SPI device를 연결할 수 있습니다. Storage용 16MB SPI-FLASH와 SD card, GPIO용 LED 9개·button 3개·DIP switch 4개가 있습니다. Xilinx Spartan-6 LX150 FPGA는 EM7D·EM9D·EM11D SoC bit file 세 개 중 하나를 자동 load할 수 있습니다.

지원 firmware version

Kit version은 1.0, 1.1, 2.0, 2.1, 2.2, 2.3이지만 Zephyr는 firmware 2.2와 2.3만 지원합니다.

지원 기능

Zephyr device driver가 지원하는 EM9D·EM11D 기능은 다음과 같습니다.

InterfaceControllerEM9DEM11DDriver/Component
INTon-chipYYinterrupt_controller
UARTusb + 2 PmodsYYserial port-polling; serial port-interrupt
SPI2 PmodsYYspi
ADCn/aNNadc (can add via Pmod)
I2C2 PmodsYYi2c
GPIO6 PmodsYYgpio
PWMn/aNNpwm

Debounce·interrupt가 적용된 button 3개, DIP switch 4개, LED 9개, SPI SD card, 16MB SPI-Flash가 있습니다. SPI-FLASH driver sample은 samples/drivers/spi_flash입니다. SPI-Flash에는 DIP switch로 고르는 FPGA CPU bit file 3개 또는 4개와 bootloader도 저장됩니다. Bootloader는 SPI-Flash의 program image를 executable memory로 복사하며 CONFIG_XIP를 사용하면 Zephyr initialization이 initialized data section을 data memory로 복사합니다.

Programming and debugging

필요 hardware와 software

  • Kit에 포함된 USB cable
  • Standalone 동작 시 110-240V AC를 5V DC로 변환하는 universal adaptor
  • Zephyr SDK
  • USB-UART용 terminal emulator(PuTTY 등)
  • 선택 사항인 Digilent Pmod module 또는 custom interface

Board 설정

  • Host와 board를 Digilent USB cable로 연결
  • 5V DC power supply 연결
  • SW1 DIP switch로 core configuration 선택
  • ARC logo의 C 위에 있는 FPGA configure button 누르기
  • 선택 core로 reconfiguration된 뒤 application download·debug

Zephyr 설정

Board configuration은 EM7D em_starterkit_em7d_defconfig, EM9D em_starterkit_defconfig, EM11D em_starterkit_em11d_defconfig 세 종류입니다.

Sample configure

Sample에 없으면 prj_arc.conf를 작성하고 em_starterkit target으로 menuconfig를 실행합니다.

west build -b em_starterkit samples/hello_world -t menuconfig

ARC SoC Selection을 EM9D 또는 EM11D로 설정합니다. EM9D는 switch 1만 제외하고 모든 DIP switch를 UP, EM11D는 switch 2만 제외하고 모두 UP으로 둔 뒤 ARC logo의 C 위 button을 누릅니다.

Build

west build -b em_starterkit samples/hello_world

Serial output

기본 image는 board UART1로 출력합니다. Linux에서는 예를 들어 /dev/ttyUSB1을 terminal emulator에서 열고 다음 값으로 설정합니다.

ParameterValue
Baud115200
Data8 bits
ParityNone
Stop bits1

Debugging

Zephyr SDK 0.9 이상이면 직접 debug·flash할 수 있습니다.

west build -b em_starterkit <my app>
west debug

또는 debug server를 시작합니다.

west build -b em_starterkit <my app>
west debugserver

두 번째 console에서 zephyr.elf가 있는 build directory의 GDB를 연결합니다.

cd <my app>
$ZEPHYR_SDK_INSTALL_DIR/arc-zephyr-elf/bin/arc-zephyr-elf-gdb zephyr.elf
(gdb) target remote localhost:3333
(gdb) load
(gdb) b main
(gdb) c

Flashing

Application을 CCM 또는 DDR로 내려받아 즉시 실행합니다.

west build -b em_starterkit <my app>
west flash

OpenOCD와 GDB가 ELF를 load해 실행하므로 power가 끊기면 application도 사라집니다. 보통 USB로 code/data memory에 내려받아 debug합니다. Reset·power-up에서 자동 boot하려면 embARC 지침에 따라 bootloader가 이해하는 executable image를 SPI-FLASH에 기록해야 합니다.

Release notes

  • GH-2647: 모든 target용 i-cache API 필요
  • GH-2230: Zephyr ARC port는 nested regular interrupt 미지원
  • Pinmux driver로 Pmod 구성 가능성

참고 자료

Source

출처

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