samples/boards/mimxrt595_evk/system_off/README.html · samples/boards/mimxrt595_evk/system_off/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Boards · NXP i.MX RT595

RT595 System Off와 OTP Fuse

DPD에서 flash 동기화를 복원하도록 PIO4_5 reset fuse를 one-time program합니다.

Official pathsamples/boards/mimxrt595_evk/system_off/README.html
Source filesamples/boards/mimxrt595_evk/system_off/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

Warm reset, PMIC/VDDCORE 관찰, blhost USB HID fuse programming 8단계를 설명합니다.

Power

Deep Power Down

Flash

FlexSPI0 XIP reset

Fuse

BOOT_CFG1 · 0x164000

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 9B5EA18E1DBF8571D4E17BD4E070DF072401C72111778B88B0E8B8F51333A1D1
.. _mimxrt595_evk-system-off-sample:

RT595 System Off demo
#####################

Overview
********

This sample can be used for basic power measurement and as an example of
soft off on NXP i.MX RT platforms. The functional behavior is:

* Busy-wait for 2 seconds
* Turn the system off after enabling wakeup through RTC and set alarm
  10 seconds in the future to wake up the processor

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

This application uses MIMXRT595-EVK for the demo.

Building, Flashing and Running
******************************

.. zephyr-app-commands::
   :zephyr-app: samples/boards/mimxrt595_evk/system_off
   :board: mimxrt595_evk/mimxrt595s/cm33
   :goals: build flash
   :compact:

Running:

1. Open UART terminal.
2. Power Cycle Device.
3. Device will turn on and idle for 2 seconds
4. Device will turn itself off using deep power down mode. RTC alarm
   will wake device and restart the application from a warm reset.

Sample Output
=================
MIMXRT595-EVK core output
--------------------------

.. code-block:: console

   *** Booting Zephyr OS build zephyr-v3.2.0-1045-g07228f716c78  ***

   Wake-up alarm set for 10 seconds
   Powering off

OTP Fuse setting to wake from Deep Power Down and reset flash
#############################################################

Background
**********

This sample will not resume the application after waking from Deep Power
Down (DPD) mode on an EVK with default settings. The reason is that the
flash is not normally reset when waking from DPD. This sample
eXecutes-In-Place (XIP) from the external flash. When the MCU wakes from
DPD, it wakes through the reset flow. But if the external flash is not
reset, the MCU and flash are no longer in sync, and the MCU cannot XIP.
In this default state, one can confirm the RTC is waking the MCU from
DPD because the MCU will set the PMIC_MODE pins to 0b00 requesting the
PMIC to enter the default boot mode, and the PMIC will enable the
regulator driving the VDDCORE rail at 1.0V. However, the MCU will not be
able to XIP from the flash to resume. One can press the Reset button in
this state to restart the app.

To wake from DPD and resume XIP from the flash, the MCU needs to be
configured to reset the external flash. This can be done by programming
the One-Time-Programmable (OTP) fuses in the MCU. The steps below detail
how program the OTP BOOT_CFG1 fuses to use GPIO pin PIO4_5 as the flash
reset. This fuse setting instructs the ROM bootloader to toggle PIO4_5
when resetting the flash. Note that the MIMXRT595-EVK board is designed
to have PIO4_5 drive the octal flash reset pin on FlexSPI0. Other boards
using this MCU may use a different GPIO pin, and the setting in the OTP
fuses must match the GPIO pin connected to reset. Before programming
fuses, it is best to write the OTP shadow registers first and confirm
the operation. Then program the OTP fuses after confirming the correct
settings. For more details on OTP fuses and shadow registers, refer to
the Reference Manual for this MCU, and the OTP Fuse Map spreadsheet
included as an attachment in the Reference Manual PDF.

Tools needed
************
These steps use the blhost tool that runs on a host computer running
Linux, Windows, or MacOS. Download blhost, find the appropriate blhost
executable for your host OS, and use the command-line steps below to
program the OTP fuses. To download, go to https://www.nxp.com/mcuboot,
and find the Blhost package under Downloads.

Steps to program OTP fuses on MIMXRT595-EVK
*******************************************
These steps detail using USB as the interface between blhost and the
ROM bootloader. UART is another option, for more details see the
blhost documentation and the Boot ROM chapter in the MCU Reference
Manual.

 1. Power the EVK and connect USB J38 to host computer. J38 is for the
    USB peripheral of the MCU, and will also power the EVK.

 2. Set the DIP switches of SW7 to On-Off-On (123) to boot in ISP USB
    HID mode.

 3. Press the Reset button SW3 to boot in ISP mode. The EVK should
    enumerate as a USB HID device in the host computer.

 4. This command confirms the current settings of BOOT_CFG1 fuses:
    blhost -u 0x1fc9,0x0023 -- efuse-read-once 0x61

 5. This command programs BOOT_CFG1 to enable the flash reset pin using
    PIO4_5:
    blhost -u 0x1fc9,0x0023 -- efuse-program-once 0x61 0x164000

 6. This command confirms the programmed fuses in BOOT_CFG1:
    blhost -u 0x1fc9,0x0023 -- efuse-read-once 0x61

 7. Set the DIP switches of SW7 to Off-Off-On (123) to boot from the
    external flash on FlexSPI0.

 8. Press the Reset button SW3 to boot from flash and run the app.

Expected results from blhost
****************************

>blhost -u 0x1fc9,0x0023 -- efuse-read-once 0x61
Inject command 'efuse-read-once'
Response status = 0 (0x0) Success.
Response word 1 = 4 (0x4)
Response word 2 = 0 (0x0)

>blhost -u 0x1fc9,0x0023 -- efuse-program-once 0x61 0x164000
Inject command 'efuse-program-once'
Successful generic response to command 'efuse-program-once'
Response status = 0 (0x0) Success.

>blhost -u 0x1fc9,0x0023 -- efuse-read-once 0x61
Inject command 'efuse-read-once'
Response status = 0 (0x0) Success.
Response word 1 = 4 (0x4)
Response word 2 = 1458176 (0x164000)

Part 3

한국어 전문 번역

개요

이 sample은 기본 power 측정과 NXP i.MX RT platform의 soft-off 예제로 사용할 수 있습니다. 기능 동작은 다음과 같습니다.

  • 2초 동안 busy-wait합니다.
  • RTC wake-up을 활성화하고 10초 뒤 processor를 깨울 alarm을 설정한 다음 system을 끕니다.

요구사항

이 application은 MIMXRT595-EVK에서 demo를 실행합니다.

Build, flash와 실행

west build -b mimxrt595_evk/mimxrt595s/cm33 samples/boards/mimxrt595_evk/system_off
west flash

실행 절차:

  1. UART terminal을 엽니다.
  2. Device 전원을 껐다가 다시 켭니다.
  3. Device가 켜지고 2초 동안 idle 상태로 머뭅니다.
  4. Device가 deep power-down mode로 스스로 꺼집니다. RTC alarm이 device를 깨우고 warm reset부터 application을 재시작합니다.

Sample 출력

MIMXRT595-EVK core 출력

*** Booting Zephyr OS build zephyr-v3.2.0-1045-g07228f716c78  ***

Wake-up alarm set for 10 seconds
Powering off

Deep Power Down에서 깨우고 flash를 reset하기 위한 OTP Fuse 설정

배경

기본 설정의 EVK에서는 이 sample이 Deep Power Down(DPD) mode에서 깨어난 뒤 application을 재개하지 못합니다. DPD에서 깨어날 때 flash가 보통 reset되지 않기 때문입니다. 이 sample은 external flash에서 XIP(eXecute-In-Place)합니다. MCU는 DPD에서 reset flow를 통해 깨어나지만 external flash가 reset되지 않으면 MCU와 flash의 상태가 더 이상 동기화되지 않아 MCU가 XIP할 수 없습니다.

이 기본 상태에서도 RTC가 MCU를 DPD에서 깨운 사실은 확인할 수 있습니다. MCU가 PMIC_MODE pin을 0b00으로 설정해 PMIC에 default boot mode 진입을 요청하고, PMIC는 VDDCORE rail을 1.0 V로 구동하는 regulator를 활성화합니다. 하지만 MCU가 flash에서 XIP해 실행을 재개할 수는 없습니다. 이 상태에서 Reset button을 누르면 application을 다시 시작할 수 있습니다.

DPD에서 깨어나 flash XIP를 재개하려면 MCU가 external flash를 reset하도록 구성해야 합니다. MCU의 OTP(One-Time-Programmable) fuse를 program하면 됩니다. 아래 절차는 GPIO PIO4_5를 flash reset으로 사용하도록 OTP BOOT_CFG1 fuse를 program합니다. 이 설정은 ROM bootloader가 flash reset 과정에서 PIO4_5를 toggle하도록 지시합니다.

MIMXRT595-EVK는 PIO4_5가 FlexSPI0의 octal flash reset pin을 구동하도록 설계되었습니다. 같은 MCU를 사용하는 다른 board는 다른 GPIO pin을 사용할 수 있으므로 OTP fuse 설정은 실제 reset 연결 pin과 일치해야 합니다. Fuse를 program하기 전에 OTP shadow register에 먼저 값을 쓰고 동작을 확인하는 것이 좋습니다. 올바른 설정을 확인한 뒤 OTP fuse를 program하십시오. 자세한 내용은 MCU Reference Manual과 그 PDF에 첨부된 OTP Fuse Map spreadsheet를 참조하십시오.

필요한 tool

이 절차는 Linux, Windows 또는 macOS host에서 실행되는 blhost tool을 사용합니다. NXP MCU Boot 페이지에서 Blhost package를 내려받고 host OS에 맞는 executable을 찾은 뒤 아래 command-line 절차로 OTP fuse를 program하십시오.

MIMXRT595-EVK OTP fuse programming 절차

이 절차는 blhost와 ROM bootloader 사이의 interface로 USB를 사용합니다. UART도 사용할 수 있으며 자세한 내용은 blhost documentation과 MCU Reference Manual의 Boot ROM chapter를 참조하십시오.

  1. EVK에 전원을 공급하고 USB J38을 host computer에 연결합니다. J38은 MCU의 USB peripheral용이며 EVK에도 전원을 공급합니다.
  2. ISP USB HID mode로 boot하도록 SW7 DIP switch를 On-Off-On(123)으로 설정합니다.
  3. Reset button SW3을 눌러 ISP mode로 boot합니다. EVK가 host computer에서 USB HID device로 enumerate되어야 합니다.
  4. 다음 명령으로 현재 BOOT_CFG1 fuse 설정을 확인합니다: blhost -u 0x1fc9,0x0023 -- efuse-read-once 0x61
  5. 다음 명령으로 PIO4_5 flash reset pin을 활성화하도록 BOOT_CFG1을 program합니다: blhost -u 0x1fc9,0x0023 -- efuse-program-once 0x61 0x164000
  6. 다음 명령으로 program된 BOOT_CFG1 fuse를 확인합니다: blhost -u 0x1fc9,0x0023 -- efuse-read-once 0x61
  7. FlexSPI0 external flash에서 boot하도록 SW7 DIP switch를 Off-Off-On(123)으로 설정합니다.
  8. Reset button SW3을 눌러 flash에서 boot하고 application을 실행합니다.

blhost 예상 결과

>blhost -u 0x1fc9,0x0023 -- efuse-read-once 0x61
Inject command 'efuse-read-once'
Response status = 0 (0x0) Success.
Response word 1 = 4 (0x4)
Response word 2 = 0 (0x0)

>blhost -u 0x1fc9,0x0023 -- efuse-program-once 0x61 0x164000
Inject command 'efuse-program-once'
Successful generic response to command 'efuse-program-once'
Response status = 0 (0x0) Success.

>blhost -u 0x1fc9,0x0023 -- efuse-read-once 0x61
Inject command 'efuse-read-once'
Response status = 0 (0x0) Success.
Response word 1 = 4 (0x4)
Response word 2 = 1458176 (0x164000)

Source

출처

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