> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/api-and-command-reference/scra-dynafamily-programmers-manual/commands/process-files-command-group-0xd9nn/commit-firmware-from-file-command-0xd901.md).

# Commit Firmware from File - Command 0xD901

The host uses this command to commit a file previously uploaded using Command 0xD801 - Load (Firmware File) into the device’s permanent memory after the device has authenticated the file.

Sequence of events:

{% stepper %}
{% step %}

### Compose and send request

The host composes a command request in the format below, and sends it to the device.
{% endstep %}

{% step %}

### Device acknowledges request

The device sends a response in the format below.
{% endstep %}

{% step %}

### Device writes image

The device writes the image file to permanent storage.
{% endstep %}

{% step %}

### Device notifies host and resets

If the commit operation was successful, the device sends Firmware Update Successful - Notification 0x0905 to the host. If the commit operation was not successful, the device sends Firmware Update Failed - Notification 0x0906 to the host. In both cases, the device automatically resets.
{% endstep %}
{% endstepper %}

## Table CFF-1 - Request Data for Command 0xD901 - Commit Firmware from File

<table><thead><tr><th width="182">Tag</th><th width="74.66668701171875">Len</th><th>Value / Description</th><th width="73.66668701171875">Typ</th><th width="76.66668701171875">Req</th><th width="97.333251953125">Default</th></tr></thead><tbody><tr><td>Beginning of any wrappers, at minimum including Request Message</td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td>D901</td><td>—</td><td>Command 0xD901 - Commit Firmware from File</td><td>—</td><td>—</td><td>—</td></tr><tr><td>81</td><td>01</td><td>Progress Indicator. Reserved for future use. Populate with 0x03.</td><td>B</td><td>R</td><td></td></tr><tr><td>82</td><td>01</td><td>Operation Options. Reserved for future use. Populate with 0x00.</td><td>B</td><td>R</td><td></td></tr><tr><td>85</td><td>02</td><td><p>Image Type</p><ul><li>0x0000 = Boot Loader 1 image</li><li>0x0001 = Main App image</li><li>0x0002 = WiFi Module image</li><li>0x0003 = BLE Module image </li></ul></td><td>B</td><td>R</td><td></td></tr><tr><td>86</td><td>20</td><td><p>Hash Checksum</p><p>This is a SHA-256 hash of the entire Firmware File Type object being uploaded.</p></td><td>B</td><td>R</td><td></td></tr><tr><td>End of any wrappers, at minimum including Request Message</td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

## Table CFF-2 - Response Data for Command 0xD901 - Commit Firmware from File

| Tag                                                              | Len | Value / Description                        | Typ | Req | Default |
| ---------------------------------------------------------------- | --- | ------------------------------------------ | --- | --- | ------- |
| Beginning of any wrappers, at minimum including Response Message | —   | —                                          | —   | —   | —       |
| D901                                                             | —   | Commit Firmware from File - Command 0xD901 | —   | —   | —       |
| No parameters                                                    |     |                                            |     |     |         |
| End of any wrappers, at minimum including Response Message       |     |                                            |     |     |         |

If the request started successfully, the Request Status in the message wrapper is: OK, Started / Running, All good / requested operation was successful.

## Table CFF-3 - Request Example

{% code title="Example (Hex)" %}

```
AA 00 81 04 01 02 D9 01 84 2E D9 01 81 01 03 82 01 00 85 02 00 01 86 20 DF C7 1E 09 
A3 CE 8E 86 B0 F5 B6 75 BE B7 7A 0E 82 33 BF F1 8A CD 8F 38 34 B0 DB 20 D9 40 4B 28
```

{% endcode %}

## Table CFF-4 - Response Example

{% code title="Example (Hex)" %}

```
AA 00 81 04 82 02 D9 01 82 04 00 00 00 00
```

{% endcode %}

## Table CFF-5 - Notification Example

{% code title="Example (hex)" %}

```
AA 00 81 04 83 00 09 05 82 04 08 01 0A 03
```

{% endcode %}


---

# 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://developer.magtek.com/api-and-command-reference/scra-dynafamily-programmers-manual/commands/process-files-command-group-0xd9nn/commit-firmware-from-file-command-0xd901.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.
