samples/subsys/console/echo/README.html · samples/subsys/console/echo/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Console · UART

Console echo

Keyboard character를 UART console에서 읽고 같은 terminal에 즉시 돌려보냅니다.

Official pathsamples/subsys/console/echo/README.html
Source filesamples/subsys/console/echo/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

UART 요구 사항, board 교체·QEMU 대안과 diagnostic prompt를 설명합니다.

Input

console_getchar

Output

console_putchar

Device

UART console

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 DEA28764FB63C557EF4ABA4A11EF59D5793748BD45BFF81055F7D77A9E284C1A
.. zephyr:code-sample:: console_echo
   :name: Console echo
   :relevant-api: console_api

   Echo an input character back to the output using the Console API.

Overview
********

This example shows how the :c:func:`console_getchar` and
:c:func:`console_putchar` functions can be used to echo an input character
back to the console.

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

UART console is required to run this sample.

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

Build and flash the sample as follows, changing ``nucleo_f401re`` for your
board. Alternatively you can run this using QEMU, as described in
:zephyr:code-sample:`console_getchar`.

.. zephyr-app-commands::
   :zephyr-app: samples/subsys/console/echo
   :host-os: unix
   :board: nucleo_f401re
   :goals: build flash
   :compact:

Following the initial prompt given by the firmware, start pressing keys on a
keyboard, and they will be echoed back to the terminal program you are using.

Sample Output
=============

.. code-block:: console

    You should see another line with instructions below. If not,
    the (interrupt-driven) console device doesn't work as expected:
    Start typing characters to see them echoed back

Part 3

한국어 전문 번역

개요

Console API의 console_getchar()로 입력 character 하나를 받고 console_putchar()로 같은 character를 console에 다시 출력하는 echo example입니다. 관련 API는 console_api입니다.

요구 사항

이 sample을 실행하려면 UART console이 필요합니다.

빌드 및 실행

다음 command의 nucleo_f401re를 실제 board target으로 바꾸어 build하고 flash합니다. 또는 console_getchar sample에 설명된 방식으로 QEMU에서 실행할 수 있습니다.

west build -b nucleo_f401re samples/subsys/console/echo
west flash

Firmware의 initial prompt가 나타나면 keyboard key를 누릅니다. 입력한 character는 현재 사용하는 terminal program으로 되돌아옵니다.

출력 예

You should see another line with instructions below. If not,
the (interrupt-driven) console device doesn't work as expected:
Start typing characters to see them echoed back

첫 두 줄은 interrupt-driven console device가 정상인지 확인하는 안내입니다. 마지막 prompt가 보이면 typing한 character가 그대로 echo되어야 합니다.

Source

출처

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