> For the complete documentation index, see [llms.txt](https://twelite.gitbook.io/mw-pug-uart/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://twelite.gitbook.io/mw-pug-uart/other-features/custom-defaults.md).

# カスタムデフォルト

カスタムデフォルト機能の解説を行います。ファームウェアバイナリに設定情報を付記した設定済みファームウェアバイナリが利用できます。例えば、ボーレートを最初から設定したファームウェアを作成しておけば、毎回インタラクティブモードなどで設定する必要がなくなります。

※ 本機能はApp\_Uart、App\_IOに対応しています。

## 1. モジュールで設定を済ませておく

インタラクティブモードで必要な設定を済ませ、動作確認を行っておきます。

## 2. 設定をダウンロードする

TeraTerm など xmodem プロトコルのダウンロード可能なターミナルソフトを用います。インタラクティブモードの入力待ち状態で (何か入力して設定待ち状態では動作しません）、xmodem のダウンロードを行います。(xmodem はチェックサム、128バイトパケットで、後に拡張された 1KB や CRC ではありません)

TeraTerm では、以下の操作を行います。

* File->Transfer->XMODEM->Receive... を選択します。
* Option を Checksum、Binary を選択しておきます。
* 書き出すファイル名を指定します。
* Open (開く) ボタンを押します。

成功すれば、指定したファイル名のファイルが出来上がり、サイズが128バイトになっているはずです。xmodem の実装によってはこれより小さいサイズになることもあります。

## 3. ファイルの末尾に連結する

ダウンロードした設定ファイルをファームウェアの末尾に連結します。コマンドライン、ファイル連結ツールなどを利用します。

```
  Windows でのコマンドラインの実行例：
     C:\work> copy App_Uart_Master_JN5164_1_2_X.bin App_Uart_custom_1_2_X.bin
     C:\work> type conf.bin >> App_Uart_custom_1_2_X.bin
  Linux, macOS では、
     $ cat App_Uart_Master_JN5164_1_2_X.bin conf.bin > App_Uart_custom_1_2_X.bin
```

## 4. カスタムファイルを書き込む

出来あがったカスタムファイルを TWELITE に書き込みます。上記の例では App\_Uart\_custom\_1\_2\_X.bin です。

起動してインタラクティブモードでは、最後の方に C- と出ます。この C はカスタム設定がロードされたことを意味します。

```
     --- CONFIG/TWE UART APP V1-02-2/SID=0x81001f1c/LID=0x78 C- ---
```

モジュール始動時にカスタム設定を読み込み、続いて不揮発領域に保存された設定を読み出します。保存された設定情報が存在する場合は、インタラクティブモードでは以下のように CE と表示されます。動作確認時は必ず保存された設定を消去してください。

※ 保存された設定を消去するには、インタラクティブモードで R 入力後、S を入力します。

```
     --- CONFIG/TWE UART APP V1-02-2/SID=0x81001f1c/LID=0x78 CE ---
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://twelite.gitbook.io/mw-pug-uart/other-features/custom-defaults.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
