# OTA Firmware Upgrade Using mcumgr

Source: [https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html](https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html)

The `mcumgr` tool enables over-the-air (OTA) firmware upgrades over the device’s Wi-Fi interface. The QCC730 acts as the simple management protocol (SMP) server, and the `mcumgr` tool runs on the host PC as the client. To perform an OTA update, ensure that the device is connected to a secure network, and then use `mcumgr` commands to upload the new firmware image. This process allows for seamless and reliable updates without the need for physical access and simplifies ongoing maintenance.

## Set up the `mcumgr` tool on the host PC

Source: [https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html](https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html)

The `mcumgr` tool is free. It's built using Go. You must set up the Go environment on the host PC before using the `mcumgr` tool. Follow the instructions in the following sections to setup the environment and build the `mcumgr` tool on a PC.

### Prepare the Go environment

Source: [https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html](https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html)

Follow these steps to prepare the Go environment on the host PC:

1. Download the latest Go windows installer for 64bit system from the following website:

                [https://go.dev/dl/](https://go.dev/dl/)
2. Run the downloaded .MSI file and follow the installation wizard to install Go.
    Accept the default installation path: C:\Program Files\Go.

    The installer automatically adds Go to the `Path` environment variable.
3. Verify the installation by running the following command in Command Prompt or PowerShell:

        go versionCopy to clipboard

    The following is an example output that indicates the installation is successful:

        go version go1.25.6 windows/amd64Copy to clipboard
4. Run the following commands to check Go environment:

        go env GOPATH
        go env GOROOTCopy to clipboard

    Typically,

    - `GOPATH` is C:\Users\&lt;YourUsername&gt;\go
    - `GOROOT` is C:\Program Files\Go

### Install Git

Source: [https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html](https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html)

Follow these steps to install Git:

1. Download Git for Windows (Git-2.x.x-64-bit.exe) from the following website:

                [https://git-scm.com/download/win](https://git-scm.com/download/win)
2. Run downloaded .EXE file to install Git and select the following options in the installation wizard:
    - **Use Git from the Windows Command Prompt**
    - **Checkout Windows-style, commit Unix-style line endings**
    - **Use Windows' default console window**
3. After the installation is complete, run the following command to verify the installation:

        git --versionCopy to clipboard

The following is an example output that indicates the installation is successful:

        git version 2.x.x.windows.1Copy to clipboard

### Build mcumgr

Source: [https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html](https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html)

Follow these steps to build the `mcumgr` tool:

1. Run the following command to clone the `mcumgr` repository:

        git clone https://github.com/apache/mynewt-mcumgr-cli.gitCopy to clipboard
2. Go to the mynewt-mcumgr-cli folder and build `mcumgr` by using the following commands:

        cd mynewt-mcumgr-cli
        go buildCopy to clipboard

Note: Make sure the Go environment is set up before running these commands.
3. Add the location of the generated `mcumgr` executable to the `Path` environment variable.

## Prepare OTA images for QCC730

Source: [https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html](https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html)

You can use the gen\_fw\_upgrade\_img.py script to combine the SBL and APP images. The following table lists the options of this command.

| Options | Description |
| --- | --- |
| --xml XML | The XML file for the firmware upgrade image generator.<br><br><br>                            <br>The project path is: modules\hal\qcom\qfdt\fw\_upgrade.xml |
| --output OUTPUT | The output file. |
| -d BUILD\_DIR | Build directory to search for ELF files, similar with the `west build` options |
| -b BOARD | Board name (for example, qcc730mi, qcc730evbx) to determine SBL filename, similar with the `west build` options. |
| --secure-boot | List current image status. |
| -v {0,1,2,3,4,5} | Verbosity levels. A higher level includes all lower levels.<br><br><br>                            <br>For example, selecting level 3 includes messages from levels 0, 1, 2, and 3.<br><br><br>                            <br>`0`: Critical<br><br><br>                            <br>`1`: Error<br><br><br>                            <br>`2`: Warning<br><br><br>                            <br>`3`: Info [Default]<br><br><br>                            <br>`4`: Debug<br><br><br>                            <br>`5`: Everything |

**Examples**:

- In qapp\qcli\_app, use the following command to generate all needed files:

        west build -b qcc730mi -d build/qcc730miCopy to clipboard
- To generate normal SBL/APP images, use the following command:

        python ..\..\modules\hal\qcom\qfdt\gen_fw_upgrade_img.py –xml ..\..\modules\hal\qcom\qfdt\fw_upgrade.xml -b qcc730mi -d build/qcc730mi –output build\qcc730mi\zephyr\ota.bin -v 5Copy to clipboard
- To generate secure SBL/APP images, use the following command:

        python ..\..\modules\hal\qcom\qfdt\gen_fw_upgrade_img.py –xml ..\..\modules\hal\qcom\qfdt\fw_upgrade.xml -b qcc730mi -d build/qcc730mi –output build\qcc730mi\zephyr\ota.bin -v 5 –secure-bootCopy to clipboard

## Use `mcumgr` for OTA firmware upgrade

Source: [https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html](https://docs.qualcomm.com/doc/80-Y8730-5/topic/ota_firmware_upgrade_using_mcumgr.html)

The following procedure shows how to use the `mcumgr` tool to perform OTA firmware upgrade for QCC730:

1. Connect both the QCC730 and the host PC to the same AP.
    You can use the following shell commands to connect QCC730 to an AP:

    - For an open Wi-Fi system:

            wifi connect <ssid> -b <band>Copy to clipboard
    - For an AP that uses WPA2 with PSK:

            wifi connect -s <ssid> -b <band> -k 1 -p <password>Copy to clipboard

    In these commands:

    - `<ssid>`: The SSID of the AP you are trying to connect to
    - `<band>`: 2.4 GHz or 5 GHz band

        - `2`: 2.4 GHz
        - `5`: 5 GHz
    - `<password>`: Passphrase of the AP

 For more information about the `wifi connect` command, see connect.
2. Ensure the IP addresses are assigned to both QCC730 and host PC.
3. Perform OTA firmware upgrade for QCC730. Follow the examples in Table : OTA firmware upgrade command examples
Note:
    - In these examples, the QCC730 IP address is 192.168.1.15 for demonstration purpose.
    - Ensure QCC730 reconnects to the AP after reboot.

Table : OTA firmware upgrade command examples

| Options | Description | Example |
| --- | --- | --- |
| conn add | Add the connection profile | mcumgr.exe conn add udp15 type=udp connstring="[192.168.1.15]:1337"Copy to clipboard |
| Echo | A simple test to verify the connection with the target | mcumgr.exe -c udp15 echo helloCopy to clipboard |
| Image upload | Upload the `ota.bin` to the target. The QCC730 reboots automatically after the upload is complete. | mcumgr.exe -c udp15 image upload build\qcc730mi\zephyr\ota.bin<br>    880.86 KiB / 880.86 KiB [===================================================================] 100.00% 3.91 KiB/s 3m45s<br>    DoneCopy to clipboard |
| Image confirm | Confirm the trial image. The QCC730 reboots automatically after the command is done. | mcumgr.exe -c udp15 image confirm<br>    DoneCopy to clipboard |
| image list | List current image status. | mcumgr.exe -c udp15 image list<br>    Images:<br>     image=0 slot=0<br>        version: 4.0.0<br>        bootable: true<br>        flags: active confirmed<br>        hash: Unavailable<br>     image=0 slot=1<br>        version:<br>        bootable: false<br>        flags:<br>        hash: Unavailable<br>    Split status: N/A (0)Copy to clipboard |

Last Published: Apr 27, 2026

Previous Topic
 
QCLI app Next Topic

Peripheral tests