boards/nxp/s32z2xxdc2/doc/index.html · boards/nxp/s32z2xxdc2/doc/index.rst 공식 원문 ↗

Zephyr 3.7.0 · Boards · NXP · S32Z2

NXP X-S32Z27X-DC (DC2)

RTU 2개에 Cortex-R52 core를 각각 4개 배치하고 split/lock 구성을 지원하는 차량용 real-time processor 보드입니다.

Official pathboards/nxp/s32z2xxdc2/doc/index.html
Source fileboards/nxp/s32z2xxdc2/doc/index.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

지원 기능 9종과 pad mapping 15행, NETC·CANXL 제약, PCB revision, SRAM 실행과 RTU/core runner 이름을 설명합니다.

Real-time units

2 RTU · 각 4x Cortex-R52

Execution

단일 core · SRAM-only

Core modes

Lock-step · split-lock

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 0ECE0174B787DD93CF4D1140C86408F7443018E3BA047C2D0093102AE2C7E2F1
.. _s32z2xxdc2:

NXP X-S32Z27X-DC (DC2)
######################

Overview
********

The X-S32Z27X-DC (DC2) board is based on the NXP S32Z2 Real-Time Processor,
which includes two Real-Time Units (RTU) composed of four ARM Cortex-R52 cores
each, with flexible split/lock configurations.

There is one Zephyr board per SoC/RTU:

- ``s32z2xxdc2/s32z270/rtu0``, for S32Z270/RTU0
- ``s32z2xxdc2/s32z270/rtu1``, for S32Z270/RTU1.

Hardware
********

Information about the hardware and design resources can be found at
`NXP S32Z2 Real-Time Processors website`_.

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

The boards support the following hardware features:

+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component                    |
+===========+============+=====================================+
| Arm GIC   | on-chip    | interrupt_controller                |
+-----------+------------+-------------------------------------+
| Arm Timer | on-chip    | timer                               |
+-----------+------------+-------------------------------------+
| LINFlexD  | on-chip    | serial                              |
+-----------+------------+-------------------------------------+
| MRU       | on-chip    | mbox                                |
+-----------+------------+-------------------------------------+
| NETC      | on-chip    | ethernet                            |
|           |            |                                     |
|           |            | mdio                                |
+-----------+------------+-------------------------------------+
| SIUL2     | on-chip    | pinctrl                             |
|           |            |                                     |
|           |            | gpio                                |
|           |            |                                     |
|           |            | external interrupt controller       |
+-----------+------------+-------------------------------------+
| SPI       | on-chip    | spi                                 |
+-----------+------------+-------------------------------------+
| SWT       | on-chip    | watchdog                            |
+-----------+------------+-------------------------------------+
| CANEXCEL  | on-chip    | can                                 |
+-----------+------------+-------------------------------------+

Other hardware features are not currently supported by the port.

Connections and IOs
===================

The SoC's pads are grouped into ports and pins for consistency with GPIO driver
and the HAL drivers used by this Zephyr port. The following table summarizes
the mapping between pads and ports/pins. This must be taken into account when
using GPIO driver or configuring the pinmuxing for the device drivers.

+-------------------+-------------+
| Pads              | Port/Pins   |
+===================+=============+
| PAD_000 - PAD_015 | PA0 - PA15  |
+-------------------+-------------+
| PAD_016 - PAD_030 | PB0 - PB14  |
+-------------------+-------------+
| PAD_031           | PC15        |
+-------------------+-------------+
| PAD_032 - PAD_047 | PD0 - PD15  |
+-------------------+-------------+
| PAD_048 - PAD_063 | PE0 - PE15  |
+-------------------+-------------+
| PAD_064 - PAD_079 | PF0 - PF15  |
+-------------------+-------------+
| PAD_080 - PAD_091 | PG0 - PG11  |
+-------------------+-------------+
| PAD_092 - PAD_095 | PH12 - PH15 |
+-------------------+-------------+
| PAD_096 - PAD_111 | PI0 - PI15  |
+-------------------+-------------+
| PAD_112 - PAD_127 | PJ0 - PJ15  |
+-------------------+-------------+
| PAD_128 - PAD_143 | PK0 - PK15  |
+-------------------+-------------+
| PAD_144 - PAD_145 | PL0 - PL1   |
+-------------------+-------------+
| PAD_146 - PAD_159 | PM2 - PM15  |
+-------------------+-------------+
| PAD_160 - PAD_169 | PN0 - PN9   |
+-------------------+-------------+
| PAD_170 - PAD_173 | PO10 - PO13 |
+-------------------+-------------+

This board does not include user LED's or switches, which are needed for some
of the samples such as :zephyr:code-sample:`blinky` or :zephyr:code-sample:`button`.
Follow the steps described in the sample description to enable support for this
board.

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

The Cortex-R52 cores are configured to run at 800 MHz.

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

The SoC has 12 LINFlexD instances that can be used in UART mode. The console can
be accessed by default on the USB micro-B connector `J119`.

Watchdog
========

The watchdog driver only supports triggering an interrupt upon timer expiration.
Zephyr is currently running from SRAM on this board, thus system reset is not
supported.

Ethernet
========

NETC driver supports to manage the Physical Station Interface (PSI0) and/or a
single Virtual SI (VSI). The rest of the VSI's shall be assigned to different
cores of the system. Refer to :ref:`nxp_s32_netc-samples` to learn how to
configure the Ethernet network controller.

Controller Area Network (CAN)
=============================

Currently, the CANXL transceiver is not populated in this board. So CAN transceiver
connection is required for running external traffic. We can use any CAN transceiver,
which supports CAN 2.0 and CAN FD protocol.

CAN driver supports classic (CAN 2.0) and CAN FD mode. Remote transmission request is
not supported as this feature is not available on NXP S32 CANXL HAL.

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

Applications for the ``s32z2xxdc2`` boards can be built in the usual way as
documented in :ref:`build_an_application`.

Currently is only possible to load and execute a Zephyr application binary on
this board from the core internal SRAM.

This board supports West runners for the following debug tools:

- :ref:`NXP S32 Debug Probe <nxp-s32-debug-probe>` (default)
- :ref:`Lauterbach TRACE32 <lauterbach-trace32-debug-host-tools>`

Follow the installation steps of the debug tool you plan to use before loading
your firmware.

Set-up the Board
================

Connect the external debugger probe to the board's JTAG connector (``J134``)
and to the host computer via USB or Ethernet, as supported by the probe.

For visualizing the serial output, connect the board's USB/UART port (``J119``) to
the host computer and run your favorite terminal program to listen for output.
For example, using the cross-platform `pySerial miniterm`_ terminal:

.. code-block:: console

   python -m serial.tools.miniterm <port> 115200

Replace ``<port>`` with the port where the board can be found. For example,
under Linux, ``/dev/ttyUSB0``.

Debugging
=========

You can build and debug the :ref:`hello_world` sample for the board
``s32z2xxdc2/s32z270/rtu0`` with:

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: s32z2xxdc2/s32z270/rtu0
   :goals: build debug

In case you are using a newer PCB revision, you have to use an adapted board
definition as the default PCB revision is B. For example, if using revision D:

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: s32z2xxdc2@D/s32z270/rtu0
   :goals: build debug
   :compact:

At this point you can do your normal debug session. Set breakpoints and then
:kbd:`c` to continue into the program. You should see the following message in
the terminal:

.. code-block:: console

   Hello World! s32z2xxdc2

To debug with Lauterbach TRACE32 softare run instead:

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: s32z2xxdc2/s32z270/rtu0
   :goals: build debug -r trace32
   :compact:

Flashing
========

Follow these steps if you just want to download the application to the board
SRAM and run.

``flash`` command is supported only by the Lauterbach TRACE32 runner:

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: s32z2xxdc2/s32z270/rtu0
   :goals: build flash -r trace32
   :compact:

.. note::
   Currently, the Lauterbach start-up scripts executed with ``flash`` and
   ``debug`` commands perform the same steps to initialize the SoC and
   load the application to SRAM. The difference is that ``flash`` hides the
   Lauterbach TRACE32 interface, executes the application and exits.

To imitate a similar behavior using NXP S32 Debug Probe runner, you can run the
``debug`` command with GDB in batch mode:

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: s32z2xxdc2/s32z270/rtu0
   :goals: build debug --tool-opt='--batch'
   :compact:

RTU and Core Configuration
==========================

This Zephyr port can only run single core in any of the Cortex-R52 cores,
either in lock-step or split-lock mode. By default, Zephyr runs on the first
core of the RTU chosen and in lock-step mode (which is the reset
configuration).

To build for split-lock mode, the :kconfig:option:`CONFIG_DCLS` must be
disabled from your application Kconfig file.

By default the board configuration will set the runner arguments according to
the build configuration. To debug for a core different than the default use:

.. tabs::

   .. group-tab:: lockstep configuration

      .. code-block:: console

         west debug --core-name='R52_<rtu_id>_<core_id>_LS'

   .. group-tab:: split-lock configuration

      .. code-block:: console

         west debug --core-name='R52_<rtu_id>_<core_id>'

Where:

- ``<rtu_id>`` is the zero-based RTU index
- ``<core_id>`` is the zero-based core index relative to the RTU on which to
  run the Zephyr application (0, 1, 2 or 3)

For example, to build the :ref:`hello_world` sample for the board
``s32z2xxdc2/s32z270/rtu0`` with split-lock core configuration:

.. zephyr-app-commands::
   :zephyr-app: samples/hello_world
   :board: s32z2xxdc2/s32z270/rtu0
   :goals: build
   :gen-args: -DCONFIG_DCLS=n
   :compact:

To execute this sample in the second core of RTU0 in split-lock mode:

.. code-block:: console

   west debug --core-name='R52_0_1'

If using Lauterbach TRACE32, all runner parameters must be overridden from command
line:

.. code-block:: console

   west debug --startup-args elfFile=<elf_path> rtu=<rtu_id> core=<core_id> lockstep=<yes/no>

Where ``<elf_path>`` is the path to the Zephyr application ELF in the output
directory.

References
**********

.. target-notes::

.. _NXP S32Z2 Real-Time Processors website:
   https://www.nxp.com/products/processors-and-microcontrollers/s32-automotive-platform/s32z-and-s32e-real-time-processors/s32z2-safe-and-secure-high-performance-real-time-processors:S32Z2

.. _pySerial miniterm:
   https://pyserial.readthedocs.io/en/latest/tools.html#module-serial.tools.miniterm

Part 3

한국어 전문 번역

개요

X-S32Z27X-DC(DC2) 보드는 NXP S32Z2 Real-Time Processor를 기반으로 합니다. Processor에는 RTU(Real-Time Unit)가 2개 있고, 각 RTU는 flexible split/lock 구성이 가능한 Arm Cortex-R52 core 4개로 구성됩니다.

SoC/RTU 조합마다 Zephyr board target이 하나씩 있습니다.

  • s32z2xxdc2/s32z270/rtu0: S32Z270/RTU0
  • s32z2xxdc2/s32z270/rtu1: S32Z270/RTU1

하드웨어와 지원 기능

인터페이스컨트롤러드라이버/컴포넌트
Arm GICon-chipinterrupt_controller
Arm Timeron-chiptimer
LINFlexDon-chipserial
MRUon-chipmbox
NETCon-chipethernet; mdio
SIUL2on-chippinctrl; gpio; external interrupt controller
SPIon-chipspi
SWTon-chipwatchdog
CANEXCELon-chipcan

표 밖의 하드웨어 기능은 현재 port에서 지원하지 않습니다.

연결과 I/O

이 Zephyr port의 GPIO driver와 HAL driver가 같은 표현을 쓰도록 SoC pad를 port와 pin으로 묶습니다. GPIO를 사용하거나 device driver pinmux를 설정할 때 다음 mapping을 고려해야 합니다.

PadsPort/Pins
PAD_000 - PAD_015PA0 - PA15
PAD_016 - PAD_030PB0 - PB14
PAD_031PC15
PAD_032 - PAD_047PD0 - PD15
PAD_048 - PAD_063PE0 - PE15
PAD_064 - PAD_079PF0 - PF15
PAD_080 - PAD_091PG0 - PG11
PAD_092 - PAD_095PH12 - PH15
PAD_096 - PAD_111PI0 - PI15
PAD_112 - PAD_127PJ0 - PJ15
PAD_128 - PAD_143PK0 - PK15
PAD_144 - PAD_145PL0 - PL1
PAD_146 - PAD_159PM2 - PM15
PAD_160 - PAD_169PN0 - PN9
PAD_170 - PAD_173PO10 - PO13

보드에는 user LED나 switch가 없습니다. 따라서 blinky나 button sample을 사용하려면 각 sample 설명의 절차에 따라 보드 지원을 추가해야 합니다.

시스템 클록

Cortex-R52 core는 800 MHz로 동작하도록 구성됩니다.

직렬 포트

SoC에는 UART mode로 쓸 수 있는 LINFlexD instance가 12개 있습니다. 기본 console은 USB micro-B connector J119에서 사용할 수 있습니다.

Watchdog

Watchdog driver는 timer 만료 시 interrupt 발생만 지원합니다. 현재 Zephyr가 이 보드의 SRAM에서 실행되므로 system reset은 지원하지 않습니다.

Ethernet

NETC driver는 Physical Station Interface PSI0과 단일 Virtual SI(VSI)를 관리할 수 있습니다. 나머지 VSI는 system의 다른 core에 할당해야 합니다. Ethernet network controller 구성은 NXP S32 NETC sample을 참고하십시오.

Controller Area Network

현재 이 보드에는 CANXL transceiver가 장착되지 않았으므로 external traffic을 사용하려면 별도 CAN transceiver가 필요합니다. CAN 2.0과 CAN FD protocol을 지원하는 transceiver를 사용할 수 있습니다.

CAN driver는 classic CAN 2.0과 CAN FD mode를 지원합니다. NXP S32 CANXL HAL에 기능이 없으므로 remote transmission request는 지원하지 않습니다.

프로그래밍과 디버깅

s32z2xxdc2 application은 일반 방식으로 build합니다. 현재는 core 내부 SRAM에만 Zephyr application binary를 load하고 실행할 수 있습니다.

지원 runner는 기본 NXP S32 Debug Probe와 Lauterbach TRACE32입니다. 사용 전에 해당 host tool 설치 절차를 완료합니다.

보드 설정

External debugger probe를 JTAG connector J134에 연결하고, probe가 지원하는 USB 또는 Ethernet으로 host computer에 연결합니다. Serial output은 board USB/UART port J119를 host에 연결해 확인합니다. pySerial miniterm 예는 다음과 같습니다.

python -m serial.tools.miniterm <port> 115200

<port>를 보드가 나타나는 port로 바꿉니다. Linux 예시는 /dev/ttyUSB0입니다.

디버깅

RTU0용 hello_world를 build하고 debug합니다.

# Zephyr 저장소 루트에서
west build -b s32z2xxdc2/s32z270/rtu0 samples/hello_world
west debug

기본 PCB revision은 B입니다. 예를 들어 더 최신 revision D에서는 다음 board definition을 사용합니다.

# Zephyr 저장소 루트에서
west build -b s32z2xxdc2@D/s32z270/rtu0 samples/hello_world
west debug

Breakpoint를 설정하고 c로 program을 계속하면 terminal에 다음 메시지가 표시됩니다.

Hello World! s32z2xxdc2

Lauterbach TRACE32로 debug하려면 runner를 지정합니다.

# Zephyr 저장소 루트에서
west build -b s32z2xxdc2/s32z270/rtu0 samples/hello_world
west debug -r trace32

Flash 명령으로 SRAM에 download·실행

flash command는 Lauterbach TRACE32 runner에서만 지원됩니다.

# Zephyr 저장소 루트에서
west build -b s32z2xxdc2/s32z270/rtu0 samples/hello_world
west flash -r trace32

NXP S32 Debug Probe runner로 비슷한 동작을 만들려면 GDB batch mode의 debug를 사용합니다.

# Zephyr 저장소 루트에서
west build -b s32z2xxdc2/s32z270/rtu0 samples/hello_world
west debug --tool-opt='--batch'

RTU와 core 구성

이 Zephyr port는 lock-step 또는 split-lock mode에서 Cortex-R52 core 하나만 실행할 수 있습니다. 기본값은 선택한 RTU의 첫 번째 core이며 reset configuration인 lock-step mode입니다.

Split-lock mode로 build하려면 application Kconfig에서 CONFIG_DCLS를 비활성화합니다. Board configuration은 build 설정에 따라 runner argument를 자동으로 설정하지만, 기본 core가 아닌 core를 debug하려면 다음 이름을 사용합니다.

Lock-step 구성

west debug --core-name='R52_<rtu_id>_<core_id>_LS'

Split-lock 구성

west debug --core-name='R52_<rtu_id>_<core_id>'
  • <rtu_id>: 0부터 시작하는 RTU index
  • <core_id>: 해당 RTU에서 Zephyr를 실행할 0부터 시작하는 core index, 0·1·2·3 중 하나

RTU0 board에서 split-lock으로 hello_world를 build하는 예입니다.

# Zephyr 저장소 루트에서
west build -b s32z2xxdc2/s32z270/rtu0 samples/hello_world -- -DCONFIG_DCLS=n

이 sample을 RTU0의 두 번째 core에서 split-lock mode로 실행합니다.

west debug --core-name='R52_0_1'

Lauterbach TRACE32를 사용하면 모든 runner parameter를 command line에서 override해야 합니다.

west debug --startup-args elfFile=<elf_path> rtu=<rtu_id> core=<core_id> lockstep=<yes/no>

<elf_path>는 output directory의 Zephyr application ELF 경로입니다.

참고 자료

Source

출처

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