> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update RTSS software images from APSS

This topic explain the available methods for updating the RTSS software images from APSS using the Mailbox interface.

## **Update software images using the Fastboot method**

Flash the RTSS software image on the device using the [Fastboot](https://developer.android.com/tools/releases/platform-tools) method.

### **Prerequisites**

1. The device must be in the bootup state.
2. [Set up debug UART](https://docs.qualcomm.com/doc/80-70033-261/topic/iq9-ug-set-up-the-device.html#set-up-debug-uart).

### **Procedure**

1. Place the device in the Fastboot mode by running the command in the APSS UART console:
   > ```text theme={null}
   > reboot bootloader
   > ```
2. Run the following fastboot command to flash the `sailhyp.elf` and `sailsw1.elf` images to the RTSS partitions:
   > ```text theme={null}
   > fastboot flash <partition_name> <software image path>
   > ```
   >
   > For example,
   >
   > ```text theme={null}
   > linuxhost@machine:~$ fastboot flash sail_hyp_a  <path name>/qcs9075-iq-9075-evk/qcom-multimedia-image/sail_nor/sailhyp.elf
   > Sending 'sail_hyp_a' (632 KB)                      OKAY [  0.123s]
   > Writing 'sail_hyp_a'                               OKAY [  8.500s]
   > Finished. Total time: 8.756s
   > ```
   >
   > ```text theme={null}
   > linuxhost@machine:~$ fastboot flash sail_sw1_a  <path name>/qcs9075-iq-9075-evk/qcom-multimedia-image/sail_nor/sailsw1.elf
   > Sending 'sail_sw1_a' (1710 KB)                     OKAY [  0.123s]
   > Writing 'sail_sw1_a'                               OKAY [ 20.185s]
   > Finished. Total time: 20.448s
   > ```
   >
   > <Note>
   >   **Note**
   >
   >   The `sailhyp.elf` and `sailsw1.elf` images are at `<Path name>\qualcomm-linux-spf-1-0_ap_standard_oem_sail\SAIL.SI.1.2\sail_proc\build\ms\bin\SAIL_RTOS\DEBUG\lemans\signed\`.
   > </Note>

<Note>
  **Note**<br />`sail_hyp_a` maps to the `SAIL_HYP` partition and `sail_sw1_a` maps to the `SAIL_SW1` partition defined in `nor_partition_frtos.xml`. Similarly, `sail_hyp_b` is mapped to `SAIL_HYP_BKUP` and `sail_sw1_b` is mapped to `SAIL_SW1_BKIP`.
</Note>

After the RTSS software images are successfully updated, the following logs appear:

* APSS logs:
  > ```text theme={null}
  > - > Flashing partition sail_hyp_a (647720 bytes)<br />slMailBox_Init: Handshake 1 Done<br />slMailBox_Init: Handshake 2 Done<br />MailboxClientReg: Callback registered successfully for client 4<br />Flashing partition sail_hyp_a done — 647720 bytes in 8379 ms (75 KB/s)
  >     >
  >     > Flashing partition sail_sw1_a (1751936 bytes)<br />Flashing partition sail_sw1_a done — 1751936 bytes in 20120 ms (85 KB/s)
  > ```
* RTSS logs:
  > ```text theme={null}
  > c0[   239.571062s] vSailUpdaterTask: Queue Item received
  > c0[   239.571197s] vSAILUpdaterMsgProcessReqMsg: Processing MSG ID Flash Image
  > c0[   239.571242s] xSAILUpdaterCoreProcessFlashImg: FLASH_IMAGE Request —
  > :::::::
  > c0[   247.791305s] xSAILUpdaterCoreProcessFlashImg: FLASH_IMAGE Response —
  > c0[   247.791703s] vSAILUpdaterMsgSendResponse: Sent Response success [Flash Image: SAIL_HYP]
  > :::::::
  > c0[   281.640997s] vSailUpdaterTask: Queue Item received
  > c0[   281.641132s] vSAILUpdaterMsgProcessReqMsg: Processing MSG ID Flash Image
  > c0[   281.641177s] xSAILUpdaterCoreProcessFlashImg: FLASH_IMAGE Request —
  > :::::::
  > c0[   301.331897s] xSAILUpdaterCoreProcessFlashImg: FLASH_IMAGE Response —
  > :::::::
  > ```

## **Update software images using the sail\_updater tool**

### **Prerequisites**

1. The device must be in the bootup state.
2. [Set up debug UART](https://docs.qualcomm.com/doc/80-70033-261/topic/iq9-ug-set-up-the-device.html#set-up-debug-uart).

### **Procedure**

1. Create a test folder to copy the `sailhyp.elf` and `sailsw1.elf` images by running the following commands in the APSS UART console:
   > ```text theme={null}
   > mount -o rw,remount /
   > ```
   ```text theme={null}
   cd tmp/
   ```
   ```text theme={null}
   mkdir test
   ```
2. Push the `sailhyp.elf` and `sailsw1.elf` image files into the `/tmp/test` directory.

   For example,

   > ```text theme={null}
   > adb push sailhyp.elf /tmp/test
   > 268 KB/s (645792 bytes in 2.346s)
   > ```
   >
   > ```text theme={null}
   > adb push sailsw1.elf /tmp/test
   > 295 KB/s (950144 bytes in 3.138s)
   > ```
3. Enable access to the `sailhyp.elf` and `sailsw1.elf` images.
   > ```text theme={null}
   > chmod 777 /tmp/test/*.elf
   > ```
4. Program the `sailhyp.elf` and `sailsw1.elf` images.
   > ```text theme={null}
   > sail_updater -r 0 -p /tmp/test
   > ```
   >
   > APSS logs:
   >
   > ```text theme={null}
   > :::::
   > sau_flashimg: /tmp/test/sailhyp.elf | fileLen: 647720 | alignment: bytesToAlign 24, byteAlign 40
   > sau_flashimg: SAIL_HYP | FlashPartition: 1 | FlashGptId: 0 | bufLen: 0x0009E240
   > :::::
   > sau_flashimg: /tmp/test/sailsw1.elf | fileLen: 1751936 | alignment: already aligned
   > sau_flashimg: SAIL_SW1 | FlashPartition: 1 | FlashGptId: 0 | bufLen: 0x001ABB80
   > sau:sau_flashimg:ok
   > :::::
   > sau_updategpt: SAIL_HYP, SAIL_SW1
   > sau:sau_updategpt:ok
   > sau:sau_memDeInit:ok
   > Initiate reboot
   > ```
   >
   > ```text theme={null}
   > sail_updater -r 1
   > ```
   >
   > APSS logs:
   >
   > ```text theme={null}
   > root@qcs9075-iq-9075-evk:~# sail_updater -r 1
   > sau:sau_getopt_parser:ok
   > :::::
   > sau_getblinfo: crc ok
   > primaryGpt   (header/entry): ok | size: 0x00002080
   > secondaryGpt (header/entry): ok | size: 0x00002080
   > num_images: 2
   > SAIL_HYP — boot partition: 0 | GPT Id: 0 | size A/B: 0x000E1000 | entries matching: 0
   > SAIL_SW1 — boot partition: 0 | GPT Id: 0 | size A/B: 0x00200000 | entries matching: 0
   > :::::
   > sau_readimg:  SAIL_HYP | partition: 0 | GPT Id: 0 | bufLen: 0x000E1000
   > sau:sau_readimg:ok
   > sau_flashimg: SAIL_HYP | FlashPartition: 1 | FlashGptId: 0 | bufLen: 0x000E1000
   > sau:sau_flashimg:ok
   > :::::
   > sau_readimg:  SAIL_SW1 | partition: 0 | GPT Id: 0 | bufLen: 0x00200000
   > sau:sau_readimg:ok
   > sau_flashimg: SAIL_SW1 | FlashPartition: 1 | FlashGptId: 0 | bufLen: 0x00200000
   > sau:sau_flashimg:ok
   > :::::
   > sail_updater Flashing and On-reboot loading of Images Success
   > ```
   >
   > RTSS logs:
   >
   > ```text theme={null}
   > c0[    98.878469s] vSailUpdaterTask: Queue Item received
   > :::::
   > c0[   109.249244s] vSAILUpdaterMsgSendResponse: Sent Response success [Read Image: SAIL_SW1]
   > :::::
   > c0[   109.266607s] vSailUpdaterTask: Queue Item received
   > :::::
   > c0[   130.313926s] vSAILUpdaterMsgSendResponse: Sent Response success [Flash Image: SAIL_SW1]
   > :::::
   > c0[   130.315479s] vSailUpdaterTask: Queue Item received
   > c0[   130.316120s] vSAILUpdaterMsgProcessReqMsg: Processing MSG ID Set OTA Metadata
   > :::::
   > c0[   130.432138s] vSAILUpdaterMsgSendResponse: Sent Response success [Set OTA Metadata]
   > ```
