samples/drivers/watchdog/README.html · samples/drivers/watchdog/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Drivers · Watchdog

Watchdog

Watchdog을 다섯 번 feed한 뒤 pre-reset callback과 board restart를 확인합니다.

Official pathsamples/drivers/watchdog/README.html
Source filesamples/drivers/watchdog/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

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

Part 1

요약·해설

DTS 설정, board overlay, Nucleo F091RC build와 반복 sequence를 보존합니다.

Feeds

5

Callback

Pre-reset

Result

Board reset

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 89FE146C513A9AB997C2B9EAA95B7D981EF9B901091BF675214D183115AA2586
.. zephyr:code-sample:: watchdog
   :name: Watchdog
   :relevant-api: watchdog_interface

   Use the watchdog driver API to reset the board when it gets stuck in an infinite loop.

Overview
********

This sample demonstrates how to use the watchdog driver API.

A typical use case for a watchdog is that the board is restarted in case some piece of code
is kept in an infinite loop.

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

In this sample, a watchdog callback is used to handle a timeout event once. This functionality is used to request an action before the board
restarts due to a timeout event in the watchdog driver.

The watchdog peripheral is configured in the board's ``.dts`` file. Make sure that the watchdog is enabled
using the configuration file in ``boards`` folder.

Building and Running for ST Nucleo F091RC
=========================================

The sample can be built and executed for the
:ref:`nucleo_f091rc_board` as follows:

.. zephyr-app-commands::
	:zephyr-app: samples/drivers/watchdog
	:board: nucleo_f091rc
	:goals: build flash
	:compact:

To build for another board, change "nucleo_f091rc" to the name of that board and provide a corresponding devicetree overlay.

Sample output
=============

You should get a similar output as below:

.. code-block:: console

	Watchdog sample application
	Attempting to test pre-reset callback
	Feeding watchdog 5 times
	Feeding watchdog...
	Feeding watchdog...
	Feeding watchdog...
	Feeding watchdog...
	Feeding watchdog...
	Waiting for reset...
	Handled things..ready to reset

.. note:: After the last message, the board will reset and the sequence will start again

Part 3

한국어 전문 번역

개요

이 sample은 watchdog driver API를 사용하는 방법을 보여줍니다.

Watchdog의 일반적인 용도는 code 일부가 무한 loop에 갇혔을 때 board를 다시 시작하는 것입니다.

Build와 실행

이 sample은 timeout event를 한 번 처리하기 위해 watchdog callback을 사용합니다. Watchdog driver의 timeout으로 board가 restart되기 전에 필요한 action을 요청하는 데 이 기능을 사용합니다.

Watchdog peripheral은 board의 .dts file에 설정합니다. boards folder의 configuration file을 사용해 watchdog이 활성화되어 있는지 확인하십시오.

ST Nucleo F091RC용 Build와 실행

다음과 같이 nucleo_f091rc board용 sample을 build하고 실행할 수 있습니다.

west build -b nucleo_f091rc samples/drivers/watchdog
west flash

다른 board용으로 build하려면 nucleo_f091rc를 해당 board 이름으로 바꾸고 대응하는 devicetree overlay를 제공하십시오.

Sample 출력

다음과 비슷한 출력이 나타납니다.

Watchdog sample application
Attempting to test pre-reset callback
Feeding watchdog 5 times
Feeding watchdog...
Feeding watchdog...
Feeding watchdog...
Feeding watchdog...
Feeding watchdog...
Waiting for reset...
Handled things..ready to reset

마지막 message 뒤에 board가 reset되고 같은 sequence가 다시 시작됩니다.

Source

출처

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