samples/boards/nxp_s32/netc/README.html · samples/boards/nxp_s32/netc/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Boards · NXP S32 Network

NXP S32 NETC Sample

PSI 단독 또는 PSI+VSI interface를 활성화하고 Linux·Windows host와 연결합니다.

Official pathsamples/boards/nxp_s32/netc/README.html
Source filesamples/boards/nxp_s32/netc/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

NETC use case, Telnet/net/mdio shell과 양쪽 host route 설정을 설명합니다.

Station

PSI · Virtual SI 1

PHY

EMDIO · 1 Gb full duplex

Host

IPv4 · IPv6

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 6E2AF3123D71C56109B99D721E40C61D862017DDBB1B78C9906E1F798122891B
.. _nxp_s32_netc-samples:

NXP S32 NETC Sample Application
###############################

Overview
********

The sample application shows how to configure NXP S32 Network Controller (NETC)
for the different use-cases:

1. Zephyr application controls the Physical Station Interface (PSI) and the
   Ethernet PHY through EMDIO.

2. Zephyr application controls the PSI, Virtual SI 1, and the Ethernet PHY
   through EMDIO.

The sample enables the net-shell and mdio-shell (only available when Zephyr
controls PSI) to allow users visualize the networking settings. Telnet shell
and backend is also enabled.

The source code for this sample application can be found at:
:zephyr_file:`samples/boards/nxp_s32/netc`.

Requirements
************

To run this sample is needed to set-up a host machine running GNU/Linux or Windows
with a network adapter connected to the target board ETH0 port through an Ethernet
cable.

Building and Running
********************

To build and run the sample application for use-case 1:

.. zephyr-app-commands::
   :zephyr-app: samples/boards/nxp_s32/netc
   :board: s32z2xxdc2/s32z270/rtu0
   :goals: build flash

Once started, you should see the network interface details, for example:

.. code-block:: console

   [00:00:00.051,000] <inf> phy_mii: PHY (7) ID 1CC916

   [00:00:00.052,000] <inf> nxp_s32_eth_psi: SI0 MAC: 00:00:00:01:02:00
   [00:00:00.058,000] <inf> shell_telnet: Telnet shell backend initialized
   [00:00:00.058,000] <inf> nxp_s32_netc_sample: Starting sample
   [00:00:00.058,000] <inf> nxp_s32_netc_sample: Waiting for iface 1 to come up
   [00:00:07.595,000] <inf> phy_mii: PHY (7) Link speed 1000 Mb, full duplex

   [00:00:07.595,000] <inf> nxp_s32_netc_sample: Configuring iface 1 (0x318008f0)
   [00:00:07.595,000] <inf> nxp_s32_netc_sample: IPv6 address: 2001:db8::1
   [00:00:07.595,000] <inf> nxp_s32_netc_sample: IPv4 address: 192.0.2.1

To build and run the sample application for use-case 2:

.. zephyr-app-commands::
   :zephyr-app: samples/boards/nxp_s32/netc
   :board: s32z2xxdc2/s32z270/rtu0
   :goals: build flash
   :gen-args: -DDTC_OVERLAY_FILE="./vsi-and-psi.overlay"

Once started, you should see the network interfaces details, for example:

.. code-block:: console

   [00:00:00.051,000] <inf> phy_mii: PHY (7) ID 1CC916

   [00:00:00.052,000] <inf> nxp_s32_eth_psi: SI0 MAC: 00:00:00:01:02:00
   [00:00:00.052,000] <inf> nxp_s32_eth_vsi: SI1 MAC: 00:00:00:01:02:11
   [00:00:00.058,000] <inf> shell_telnet: Telnet shell backend initialized
   [00:00:00.058,000] <inf> nxp_s32_netc_sample: Starting sample
   [00:00:00.058,000] <inf> nxp_s32_netc_sample: Waiting for iface 1 to come up
   [00:00:07.595,000] <inf> phy_mii: PHY (7) Link speed 1000 Mb, full duplex

   [00:00:07.595,000] <inf> nxp_s32_netc_sample: Configuring iface 1 (0x3182f31c)
   [00:00:07.595,000] <inf> nxp_s32_netc_sample: IPv6 address: 2001:db8::1
   [00:00:07.595,000] <inf> nxp_s32_netc_sample: IPv4 address: 192.0.2.1
   [00:00:07.595,000] <inf> nxp_s32_netc_sample: Configuring iface 2 (0x3182f328)
   [00:00:07.595,000] <inf> nxp_s32_netc_sample: IPv6 address: 2001:db8::2
   [00:00:07.595,000] <inf> nxp_s32_netc_sample: IPv4 address: 192.0.2.2

Setting up Host
***************

To be able to reach the board from the host, it's needed to configure the host
network interface IP's and default routes. This guide assumes the host IPv4 and
IPv6 addresses are `192.0.2.3` and `2001:db8::3`, respectively. For example,
using a network interface named `enp1s0` in a GNU/Linux host or `Ethernet` in
a Windows host, this can be done with the following commands:

.. tabs::

   .. group-tab:: Linux

      .. code-block:: console

         ip -4 addr add 192.0.2.3/24 dev enp1s0
         ip -6 addr add 2001:db8::3/128 dev enp1s0
         route -A inet6 add default dev enp1s0

   .. group-tab:: Windows

      .. code-block:: console

         netsh interface ipv4 set address "Ethernet" static 192.0.2.3 255.255.255.0
         netsh interface ipv6 add address "Ethernet" 2001:db8::3/128
         netsh interface ipv6 add route ::/0 "Ethernet" ::

.. note::
   The above commands must be run as priviledged user.

If everything is configured correctly, you will be able to successfully execute
the following commands from the Zephyr shell:

.. code-block:: console

   net ping -I<iface> 192.0.2.3
   net ping -I<iface> 2001:db8::3

Where `<iface>` is the interface number starting from 1.

Part 3

한국어 전문 번역

개요

NXP S32 Network Controller(NETC)를 서로 다른 use case에 맞게 구성하는 방법을 보여주는 sample application입니다.

  1. Zephyr application이 Physical Station Interface(PSI)와 EMDIO를 통한 Ethernet PHY를 제어합니다.
  2. Zephyr application이 PSI, Virtual SI 1, EMDIO를 통한 Ethernet PHY를 제어합니다.

Sample은 사용자가 network 설정을 확인할 수 있도록 net-shell과 mdio-shell을 활성화합니다. mdio-shell은 Zephyr가 PSI를 제어할 때만 사용할 수 있습니다. Telnet shell과 backend도 활성화됩니다.

Source code는 Zephyr tree의 samples/boards/nxp_s32/netc에 있습니다.

요구 사항

GNU/Linux 또는 Windows를 실행하는 host machine이 필요합니다. Host의 network adapter와 target board의 ETH0 port를 Ethernet cable로 연결해야 합니다.

Build와 실행

Use case 1용 sample application은 다음과 같이 build하고 실행합니다.

# From the root of the zephyr repository
west build -b s32z2xxdc2/s32z270/rtu0 samples/boards/nxp_s32/netc
west flash

시작되면 다음과 같은 network interface 상세 정보가 표시됩니다.

[00:00:00.051,000] <inf> phy_mii: PHY (7) ID 1CC916

[00:00:00.052,000] <inf> nxp_s32_eth_psi: SI0 MAC: 00:00:00:01:02:00
[00:00:00.058,000] <inf> shell_telnet: Telnet shell backend initialized
[00:00:00.058,000] <inf> nxp_s32_netc_sample: Starting sample
[00:00:00.058,000] <inf> nxp_s32_netc_sample: Waiting for iface 1 to come up
[00:00:07.595,000] <inf> phy_mii: PHY (7) Link speed 1000 Mb, full duplex

[00:00:07.595,000] <inf> nxp_s32_netc_sample: Configuring iface 1 (0x318008f0)
[00:00:07.595,000] <inf> nxp_s32_netc_sample: IPv6 address: 2001:db8::1
[00:00:07.595,000] <inf> nxp_s32_netc_sample: IPv4 address: 192.0.2.1

Use case 2용 sample application은 vsi-and-psi.overlay를 지정해 다음과 같이 build하고 실행합니다.

# From the root of the zephyr repository
west build -b s32z2xxdc2/s32z270/rtu0 samples/boards/nxp_s32/netc -- -DDTC_OVERLAY_FILE="./vsi-and-psi.overlay"
west flash

시작되면 PSI의 interface 1과 Virtual SI 1의 interface 2를 포함한 다음과 같은 상세 정보가 표시됩니다.

[00:00:00.051,000] <inf> phy_mii: PHY (7) ID 1CC916

[00:00:00.052,000] <inf> nxp_s32_eth_psi: SI0 MAC: 00:00:00:01:02:00
[00:00:00.052,000] <inf> nxp_s32_eth_vsi: SI1 MAC: 00:00:00:01:02:11
[00:00:00.058,000] <inf> shell_telnet: Telnet shell backend initialized
[00:00:00.058,000] <inf> nxp_s32_netc_sample: Starting sample
[00:00:00.058,000] <inf> nxp_s32_netc_sample: Waiting for iface 1 to come up
[00:00:07.595,000] <inf> phy_mii: PHY (7) Link speed 1000 Mb, full duplex

[00:00:07.595,000] <inf> nxp_s32_netc_sample: Configuring iface 1 (0x3182f31c)
[00:00:07.595,000] <inf> nxp_s32_netc_sample: IPv6 address: 2001:db8::1
[00:00:07.595,000] <inf> nxp_s32_netc_sample: IPv4 address: 192.0.2.1
[00:00:07.595,000] <inf> nxp_s32_netc_sample: Configuring iface 2 (0x3182f328)
[00:00:07.595,000] <inf> nxp_s32_netc_sample: IPv6 address: 2001:db8::2
[00:00:07.595,000] <inf> nxp_s32_netc_sample: IPv4 address: 192.0.2.2

Host 설정

Host에서 board에 접근하려면 host network interface의 IP address와 default route를 구성해야 합니다. 이 안내는 host IPv4 address가 192.0.2.3, IPv6 address가 2001:db8::3이라고 가정합니다. GNU/Linux의 enp1s0 또는 Windows의 Ethernet interface를 사용하는 예는 다음과 같습니다.

GNU/Linux:

ip -4 addr add 192.0.2.3/24 dev enp1s0
ip -6 addr add 2001:db8::3/128 dev enp1s0
route -A inet6 add default dev enp1s0

Windows:

netsh interface ipv4 set address "Ethernet" static 192.0.2.3 255.255.255.0
netsh interface ipv6 add address "Ethernet" 2001:db8::3/128
netsh interface ipv6 add route ::/0 "Ethernet" ::

모든 설정이 올바르면 Zephyr shell에서 다음 명령을 성공적으로 실행할 수 있습니다.

net ping -I<iface> 192.0.2.3
net ping -I<iface> 2001:db8::3

여기서 <iface>는 1부터 시작하는 interface 번호입니다.

Source

출처

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