boards/phytec/mimx8mm_phyboard_polis/doc/index.html · boards/phytec/mimx8mm_phyboard_polis/doc/index.rst 공식 원문 ↗

Zephyr 3.7.0 · Boards · PHYTEC · i.MX8M Mini · M4

PhyBOARD Polis (NXP i.MX8M Mini)

A53 Linux와 M4 Zephyr를 함께 운용하며 U-Boot 또는 remoteproc로 M4 image를 적재하는 산업용 SBC입니다.

Official pathboards/phytec/mimx8mm_phyboard_polis/doc/index.html
Source fileboards/phytec/mimx8mm_phyboard_polis/doc/index.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

보드 interface, M4 전용 UART4, 네 memory region과 두 boot 경로, PEB-EVAL-01 JTAG 절차를 설명합니다.

SoC

i.MX8M Mini · A53 + M4

M4 clock

400 MHz

Boot

U-Boot · Linux remoteproc

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 9E06C1341A3ADCE188F48C0DC048C1F376BA5FA9F911E5E7A09CF802574DA9BB
.. _mimx8mm_phyboard_polis:

PhyBOARD Polis (NXP i.MX8M Mini)
################################

Overview
********

The phyBOARD-Polis, either a development platform for the
phyCORE-i.MX 8M Mini/Nano, or a powerful, industry-compatible single-board
computer for immediate implementation of your product idea. As a development
platform, the phyBOARD-Polis serves as reference design for your
customer-specific application and enables parallel development of the software
and carrier board for the phyCORE-i.MX 8M Mini/Nano.


As a powerful, industrial single-board computer (SBC), the phyBOARD-Polis is
equipped with a variety of standard interfaces which are available on standard
or socket/pin header connectors, while interesting extensions of the
phyCORE-i.MX 8M Mini/Nano features such as CAN FD, WLAN and an integrated
TPM chip further extend the range of applications that can be developed with
the phyCORE-i.MX 8M Mini/Nano.

- Board features:

  - RAM: 512MB - 4GB (LPDDR4)
  - Storage:

    - 4GB - 128GB eMMC
    - 8MB - 128MB SPI NOR Flash
    - microSD Interfacce
    - 4kB EEPROM
  - Wireless:

    - WiFi: 802.11 b/g/n (ac) 2,4 GHz / 5 GHz
    - BLE 4.2
  - USB:

    - 1x USB2.0 OTG
    - 1x USB2.0
  - Ethernet: 1x 10/100/1000BASE-T
  - Interfaces:
    - 1x RS232 / RS485
    - 2x UART
    - 3x I²C
    - 2x SPI
    - Up to 4x PWM
    - 4x SAI
    - 1x MIPI CSI-2
    - 1x MIPI DSI-2
    - 2x MMC/SD/SDIO
    - 1x PCIe (mini PCIE)
  - LEDs:

    - 1x Status LED (3 Color LED)
    - 1x Debug UART LED
  - Debug

    - JTAG 20-pin connector
    - MicroUSB for UART debug, two COM ports for A53 and M4

.. image:: ../../../../../../../boards/phytec/mimx8mm_phyboard_polis/doc/img/phyBOARD-Polis.jpg
   :align: center
   :alt: PhyBOARD Polis
   :width: 500

More information about the board can be found at the
`PHYTEC website`_.

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

The Zephyr ``mimx8mm_phyboard_polis/mimx8mm6/m4`` board configuration supports the following
hardware features:

+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component                    |
+===========+============+=====================================+
| NVIC      | on-chip    | nested vector interrupt controller  |
+-----------+------------+-------------------------------------+
| SYSTICK   | on-chip    | systick                             |
+-----------+------------+-------------------------------------+
| CLOCK     | on-chip    | clock_control                       |
+-----------+------------+-------------------------------------+
| PINMUX    | on-chip    | pinmux                              |
+-----------+------------+-------------------------------------+
| UART      | on-chip    | serial port-polling;                |
|           |            | serial port-interrupt               |
+-----------+------------+-------------------------------------+
| GPIO      | on-chip    | GPIO output                         |
|           |            | GPIO input                          |
+-----------+------------+-------------------------------------+

The default configuration can be found in the defconfig file:
:zephyr_file:`boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis_mimx8mm6_m4_defconfig`.

It is recommended to disable peripherals used by the M4 core on the Linux host.

Other hardware features are not currently supported with Zephyr on the
M4-Core.

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

The following components are tested and working correctly.

UART:
-----

Zephyr is configured to use UART4 on the PhyBoard Polis by default to minimize
problems with the A53-Core because UART4 is only accessible from the M4-Core.

+---------------+-----------------+-----------------------------------+
| Board Name    | SoM Name        | Usage                             |
+===============+=================+===================================+
| RS232/485     | UART1           | RS232 / RS485 with flow-control   |
+---------------+-----------------+-----------------------------------+
| To WiFi Module| UART2           | UART to WiFi/BLE Module           |
+---------------+-----------------+-----------------------------------+
| Debug USB(A53)| UART3           | UART Debug Console via USB        |
+---------------+-----------------+-----------------------------------+
| Debug USB(M4) | UART4           | UART Debug Console via USB        |
+---------------+-----------------+-----------------------------------+

.. note::
  Please note, that the to UART2 connected Wifi/BLE Module isn't working with
  Zephyr yet.

.. warning::
  On Boards with the version number 1532.1 UART4 isn't connected to the Debug
  USB. UART4 connects to pin 10(RX) and 12(TX) on the X8 pinheader.


LEDs:
-----

Zephyr has the 3-color status LED configured. The led0 alias (the standard
Zephyr led) is configured to be the blue led. The LED can also light up in red
and green.

GPIO:
-----

The pinmuxing for the GPIOs is the standard pinmuxing of the mimx8mm devicetree
created by NXP. You can find it here:

:zephyr_file:`dts/arm/nxp/nxp_imx8m_m4.dtsi`.

The Pinout of the PhyBOARD Polis can be found here:

`PHYTEC website`_

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

The M4 Core is configured to run at a 400 MHz clock speed.


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

The i.MX8MM does not have a separate flash for the M4-Core. Because of this
the A53-Core has to load the program for the M4-Core to the right memory
address, set the PC and start the processor.
This can be done with U-Boot or Phytec's Linux BSP via remoteproc.

Because remoteproc in Phytec's BSP only writes to the TCM memory area,
everything was tested in this memory area.

You can read more about remoteproc in Phytec's BSP here: `Remoteproc BSP`_

These are the memory mapping for A53 and M4:

+------------+-------------------------+------------------------+-----------------------+----------------------+
| Region     | Cortex-A53              | Cortex-M4 (System Bus) | Cortex-M4 (Code Bus)  | Size                 |
+============+=========================+========================+=======================+======================+
| OCRAM      | 0x00900000-0x0093FFFF   | 0x20200000-0x2023FFFF  | 0x00900000-0x0093FFFF | 256KB                |
+------------+-------------------------+------------------------+-----------------------+----------------------+
| TCMU       | 0x00800000-0x0081FFFF   | 0x20000000-0x2001FFFF  |                       | 128KB                |
+------------+-------------------------+------------------------+-----------------------+----------------------+
| TCML       | 0x007E0000-0x007FFFFF   |                        | 0x1FFE0000-0x1FFFFFFF | 128KB                |
+------------+-------------------------+------------------------+-----------------------+----------------------+
| OCRAM_S    | 0x00180000-0x00187FFF   | 0x20180000-0x20187FFF  | 0x00180000-0x00187FFF | 32KB                 |
+------------+-------------------------+------------------------+-----------------------+----------------------+

For more information about memory mapping see the
`i.MX 8M Applications Processor Reference Manual`_  (section 2.1.2 and 2.1.3)

At compilation time you have to choose which RAM will be used. This
configuration is done in
:zephyr_file:`boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis_mimx8mm6_m4.dts`
with "zephyr,flash" (when CONFIG_XIP=y) and "zephyr,sram" properties.

You also have to set XIP=n or edit the boards defconfig file, if you don't want
the TCM memory area to be used. You can find the defconf file here:

:zephyr_file:`boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis_mimx8mm6_m4_defconfig`.

The following configurations are possible for the flash and sram chosen nodes
to change the used memory area:

.. code-block:: none

   "zephyr,flash"
   - &tcml_code
   - &ocram_code
   - &ocram_s_code

   "zephyr,sram"
   - &tcmu_sys
   - &ocram_sys
   - &ocram_s_sys


Starting the M4-Core via U-Boot
===============================

Load the compiled zephyr.bin to memory address 0x4800000.
This should output something like this:

.. code-block:: console

   u-boot=> tftp 0x48000000 192.168.3.10:zephyr.bin
   Using ethernet@30be0000 device
   TFTP from server 192.168.3.10; our IP address is 192.168.3.11
   Filename 'zephyr.bin'.
   Load address: 0x48000000
   Loading: ##
            2 KiB/s
   done
   Bytes transferred = 27240 (6a68 hex)

Because it's not possible to load directly to the TCM memory area you have to
copy the binaries. The last argument given is the size of the file in bytes,
you can copy it from the output of the last command.

.. code-block:: console

   u-boot=> cp.b 0x48000000 0x7e0000 27240

And finaly starting the M4-Core at the right memory address:

.. code-block:: console

   u-boot=> bootaux 0x7e0000
   ## Starting auxiliary core stack = 0x20003A58, pc = 0x1FFE1905...


Starting the M4-Core via remoteproc
===================================

Copy the zephyr.elf to ``/lib/firmware`` on the target. Maybe a Zephyr sample
will be included in a future BSP release.

.. note::
   In order to use remoteproc you have to add ``imx8mm-phycore-rpmsg.dtbo`` at
   the end of the line in the ``/boot/bootenv.txt``, then reboot the target.

.. warning::
   Remoteproc only reads firmware files from the ``/lib/firmware`` directory!
   If you try to load a binary from another location unexpected errors will
   occur!

To load and start a firmware use this commands:

.. code-block:: console

   target$ echo /lib/firmware/zephyr.elf > /sys/class/remoteproc/remoteproc0/firmware
   target$ echo start > /sys/class/remoteproc/remoteproc0/state
   [   90.700611] remoteproc remoteproc0: powering up imx-rproc
   [   90.706114] remoteproc remoteproc0: Direct firmware load for /lib/firmware/zephyr.elf failed w2
   [   90.716571] remoteproc remoteproc0: Falling back to sysfs fallback for: /lib/firmware/zephyr.elf
   [   90.739280] remoteproc remoteproc0: Booting fw image /lib/firmware/zephyr.elf, size 599356
   [   90.804448] remoteproc remoteproc0: remote processor imx-rproc is now up


The M4-Core is now started up and running. You can see the output from Zephyr
on UART4.

Debugging
=========

The PhyBOARD Polis can be debugged using a JTAG Debugger.
The easiest way to do that is to use a SEGGER JLink Debugger and Phytec's
``PEB-EVAL-01`` Shield, which can be directly connected to the JLink.
You can find the JLink Software package here: `JLink Software`_

.. figure:: ../../../../../../../boards/phytec/mimx8mm_phyboard_polis/doc/img/PEB-EVAL-01.jpg
   :alt: PEB-EVAL-01
   :width: 350

   PEB-EVAL-01

To debug efficiently you should use multiple terminals:

(But its also possible to use ``west debug``)

After connecting everything and building with west use this command while in
the directory of the program you build earlier to start a debug server:

.. code-block:: console

   host$ west debugserver

West automatically connects via the JLink to the Target. And keeps open a
debug server.

Use another terminal, start gdb, connect to target and load Zephyr on the
target:

.. code-block:: console

   host$ gdb-multiarch build/zephyr/zephyr.elf -tui
   (gdb) targ rem :2331
   Remote debugging using :2331
   0x1ffe0008 in _vector_table ()
   (gdb) mon halt
   (gdb) mon reset
   (gdb) c
   Continuing.

The program can be debugged using standard gdb techniques.

.. _PHYTEC website:
   https://www.phytec.de/produkte/single-board-computer/phyboard-polis-imx8m-mini/

.. _PhyBOARD Polis pinout:
   https://download.phytec.de/Products/phyBOARD-Polis-iMX8M_Mini/TechData/phyCORE-i.MX8M_MINI_Pin_Muxing_Table.A1.xlsx?_ga=2.237582016.1177557183.1660563641-1900651135.1634193918

.. _Remoteproc BSP:
   https://wiki.phytec.com/pages/releaseview.action?pageId=472257137#L1002e.A3i.MX8MMini/NanoBSPManual-RunningExamplesfromLinuxusingRemoteproc

.. _i.MX 8M Applications Processor Reference Manual:
   https://www.nxp.com/webapp/Download?colCode=IMX8MMRM

.. _JLink Software:
   https://www.segger.com/downloads/jlink/

Part 3

한국어 전문 번역

개요

phyBOARD-Polis는 phyCORE-i.MX 8M Mini/Nano용 development platform이자 제품에 바로 적용할 수 있는 산업 호환 single-board computer입니다. Development platform으로 사용할 때는 고객별 application의 reference design이 되며, phyCORE-i.MX 8M Mini/Nano용 software와 carrier board를 병렬로 개발할 수 있게 합니다.

산업용 SBC로서는 표준 connector와 socket/pin header에 여러 interface를 제공하고, CAN FD, WLAN, integrated TPM chip 같은 phyCORE-i.MX 8M Mini/Nano 확장 기능으로 적용 범위를 넓힙니다.

보드 기능

  • RAM: LPDDR4 512MB~4GB
  • Storage: eMMC 4GB~128GB, SPI NOR Flash 8MB~128MB, microSD interface, EEPROM 4kB
  • Wireless: 2.4/5 GHz 802.11 b/g/n(ac) Wi-Fi, BLE 4.2
  • USB: USB 2.0 OTG 1개, USB 2.0 1개
  • Ethernet: 10/100/1000BASE-T 1개
  • Interface: RS232/RS485 1개, UART 2개, I²C 3개, SPI 2개, PWM 최대 4개, SAI 4개, MIPI CSI-2 1개, MIPI DSI-2 1개, MMC/SD/SDIO 2개, mini PCIe 1개
  • LED: 3-color status LED 1개, debug UART LED 1개
  • Debug: 20-pin JTAG connector, A53와 M4용 COM port 두 개를 제공하는 MicroUSB
PhyBOARD Polis
PhyBOARD Polis. 출처: Zephyr v3.7.0 공식 문서.

보드 정보는 PHYTEC 웹사이트에서 더 확인할 수 있습니다.

지원 기능

Zephyr mimx8mm_phyboard_polis/mimx8mm6/m4 구성은 다음 기능을 지원합니다.

인터페이스컨트롤러드라이버/컴포넌트
NVICon-chipnested vector interrupt controller
SYSTICKon-chipsystick
CLOCKon-chipclock_control
PINMUXon-chippinmux
UARTon-chipserial port-polling; serial port-interrupt
GPIOon-chipGPIO output; GPIO input

기본 구성 파일은 boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis_mimx8mm6_m4_defconfig입니다. M4 core가 사용하는 peripheral은 Linux host에서 비활성화하는 것을 권장합니다. 표 밖의 다른 하드웨어 기능은 현재 M4용 Zephyr port에서 지원하지 않습니다.

연결과 I/O

다음 component는 시험되어 정상 동작합니다.

UART

Zephyr는 A53 core와의 충돌을 최소화하기 위해 기본적으로 UART4를 사용합니다. UART4는 M4 core에서만 접근할 수 있습니다.

보드 이름SoM 이름용도
RS232/485UART1flow-control을 포함한 RS232 / RS485
WiFi module 연결UART2WiFi/BLE module용 UART
Debug USB(A53)UART3USB UART debug console
Debug USB(M4)UART4USB UART debug console

LED

3-color status LED가 구성되어 있습니다. 표준 Zephyr LED인 led0 alias는 blue LED이며 red와 green으로도 켤 수 있습니다.

GPIO

GPIO pinmux는 NXP가 만든 i.MX8MM devicetree의 표준 설정이며 dts/arm/nxp/nxp_imx8m_m4.dtsi에서 확인할 수 있습니다. 보드 pinout은 PHYTEC pin muxing table을 참고합니다.

System clock

M4 core는 400 MHz로 실행되도록 구성됩니다.

프로그래밍과 디버깅

i.MX8MM에는 M4 core 전용 flash가 없습니다. 따라서 A53 core가 M4 program을 알맞은 memory address에 적재하고 PC를 설정한 뒤 processor를 시작해야 합니다. 이 작업은 U-Boot 또는 PHYTEC Linux BSP의 remoteproc로 할 수 있습니다.

PHYTEC BSP의 remoteproc는 TCM memory area에만 기록하므로 공식 문서의 모든 시험도 이 영역에서 수행됐습니다. 자세한 설명은 Remoteproc BSP를 참고합니다.

A53와 M4의 memory mapping

영역Cortex-A53Cortex-M4 System BusCortex-M4 Code Bus크기
OCRAM0x00900000-0x0093FFFF0x20200000-0x2023FFFF0x00900000-0x0093FFFF256KB
TCMU0x00800000-0x0081FFFF0x20000000-0x2001FFFF128KB
TCML0x007E0000-0x007FFFFF0x1FFE0000-0x1FFFFFFF128KB
OCRAM_S0x00180000-0x00187FFF0x20180000-0x20187FFF0x00180000-0x00187FFF32KB

Memory mapping의 자세한 내용은 i.MX 8M Applications Processor Reference Manual 2.1.2와 2.1.3절에 있습니다.

Compile할 때 사용할 RAM을 선택해야 합니다. boards/phytec/mimx8mm_phyboard_polis/mimx8mm_phyboard_polis_mimx8mm6_m4.dts의 zephyr,flash(CONFIG_XIP=y일 때)와 zephyr,sram chosen property로 정합니다. TCM을 쓰지 않으려면 XIP=n을 설정하거나 앞서 언급한 board defconfig를 수정해야 합니다.

사용할 memory area를 바꾸는 데 가능한 flash와 SRAM chosen node는 다음과 같습니다.

"zephyr,flash"
- &tcml_code
- &ocram_code
- &ocram_s_code

"zephyr,sram"
- &tcmu_sys
- &ocram_sys
- &ocram_s_sys

U-Boot로 M4 core 시작

Compile된 zephyr.bin을 먼저 0x48000000에 적재합니다. 원문은 다음과 같은 출력을 예로 듭니다.

u-boot=> tftp 0x48000000 192.168.3.10:zephyr.bin
Using ethernet@30be0000 device
TFTP from server 192.168.3.10; our IP address is 192.168.3.11
Filename 'zephyr.bin'.
Load address: 0x48000000
Loading: ##
         2 KiB/s
done
Bytes transferred = 27240 (6a68 hex)

TCM으로 직접 적재할 수 없으므로 binary를 복사합니다. 마지막 인자는 byte 단위 file size이며 앞 명령의 출력에서 가져옵니다.

u-boot=> cp.b 0x48000000 0x7e0000 27240

마지막으로 올바른 주소에서 M4 core를 시작합니다.

u-boot=> bootaux 0x7e0000
## Starting auxiliary core stack = 0x20003A58, pc = 0x1FFE1905...

remoteproc로 M4 core 시작

zephyr.elf를 target의 /lib/firmware에 복사합니다.

다음 명령으로 firmware를 지정하고 시작합니다.

target$ echo /lib/firmware/zephyr.elf > /sys/class/remoteproc/remoteproc0/firmware
target$ echo start > /sys/class/remoteproc/remoteproc0/state
[   90.700611] remoteproc remoteproc0: powering up imx-rproc
[   90.706114] remoteproc remoteproc0: Direct firmware load for /lib/firmware/zephyr.elf failed w2
[   90.716571] remoteproc remoteproc0: Falling back to sysfs fallback for: /lib/firmware/zephyr.elf
[   90.739280] remoteproc remoteproc0: Booting fw image /lib/firmware/zephyr.elf, size 599356
[   90.804448] remoteproc remoteproc0: remote processor imx-rproc is now up

M4 core가 시작되며 Zephyr 출력은 UART4에서 볼 수 있습니다.

JTAG 디버깅

PhyBOARD Polis는 JTAG debugger로 debug할 수 있습니다. 가장 간단한 조합은 SEGGER J-Link debugger와 J-Link에 바로 연결할 수 있는 PHYTEC PEB-EVAL-01 shield입니다. J-Link software package가 필요합니다.

PEB-EVAL-01
PHYTEC PEB-EVAL-01 JTAG shield. 출처: Zephyr v3.7.0 공식 문서.

west debug도 가능하지만, 효율적인 debug를 위해 여러 terminal을 사용할 수 있습니다. 연결과 build를 마친 뒤 이전에 build한 program directory에서 debug server를 시작합니다.

host$ west debugserver

West가 J-Link를 통해 target에 연결하고 debug server를 열린 상태로 유지합니다. 다른 terminal에서 GDB를 시작해 target에 연결합니다.

host$ gdb-multiarch build/zephyr/zephyr.elf -tui
(gdb) targ rem :2331
Remote debugging using :2331
0x1ffe0008 in _vector_table ()
(gdb) mon halt
(gdb) mon reset
(gdb) c
Continuing.

이후 표준 GDB 기법으로 program을 debug할 수 있습니다.

Source

출처

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