Boot Loaders

Introduction

OpenTX v2.x has one very significant improvement over previous versions. It’s now possible to flash new firmware to your Taranis from the transmitter itself after you’ve gotten v2.x on it for the first time. That gives you two ways to flash firmware.

OpenTX v2.x uses a bootloader to allow us to do this. In fact, the bootloader (contributed by Mike Blandford, I believe) is one of the coolest things about v2.x. You use bootloader mode to flash the firmware and update the bootloader itself from the TX without using OpenTX Companion. However, we can’t use it until we get the OpenTX bootloader flashed to the STM chip.

For a printable PDF of this course please click here: Understanding Boot Loaders.

Lesson Goals

The goal for this lesson is to develop a better understanding of what a boot loader is, how updating from the SD card is different from updating using OpenTX Companion, and how to update the firmware and the boot loader individually.

Prerequisites

To complete this lesson, you should:

  1. Know how to download files and save them to a specific folder on your computer
  2. Have OpenTX flashed to your Transmitter
  3. Know how to access Boot Loader mode

Background

A bootloader is already installed on the chip when you get it. Companion can use that bootloader if it can see it, but neither Windows or MacOS comes with a driver that can mount it and make it useable. You might remember that being able to talk to the chip is the reason we have to run Zadig. We need to install the correct driver for the STM BOOTLOADER. We also must use Companion 9X or OpenTX Companion to flash the firmware the first time. That’s how we get the OpenTX bootloader on the STM chip. The result is that we then have two boot loaders on the chip, the original and the OpenTX one. Once we do that, another way of flashing firmware opens up for us.

Why do we need a second bootloader if one comes already installed on the chip? The original bootloader works fine as long as you’re using OpenTX Companion. However, by having the second bootloader you can perform write functions directly from the TX without having to use OpenTX Companion.

Once we have v2.x on the transmitter, we can view and work with the mass storage areas of the Taranis. There are two of them. One is a drive called TARANIS-Don’t Mess With It!-and another additional external drive. In my particular case, it’s Drive H, but your results will vary depending upon what you’ve got stuffed into your computer. Once the drive is visible in Windows Explorer, you can treat it like any other external drive. We access all of these features by turning the transmitter on in bootloader mode.

Steps/Checklist

NOTE:

The following only works if you already have OpenTX v2.x installed on your transmitter.

To Enter Bootloader Mode

All you need to do is hold both the horizontal trim tabs (Rudder and Aileron) toward the switch (inside) while turning on the radio. You will boot into the following screen:

bootldrscn_w

If you’re going to be working with the EEPROM in OpenTX Companion or files on the SD card, once you’re in bootloader mode, plug a USB cord from the TX to the computer.

From the bootloader screen itself, you can use the arrow keys to move up and down, then use the “ENT” key to:

  • Write firmware: Use this option when you want to flash new firmware that you’ve copied to the SD card FIRMWARES folder.
  • Restore an EEPROM: Use this to restore an EEPROM you’ve backed up to the SD card.
  • Exit bootloader mode.
  • Flashing Firmware After the First Time

Flashing Firmware After the First Time

NOTE:
In the following text, “firmware.bin” is used to identify the new firmware file that OpenTX wants to download and install. In reality the name will be something different. As of this writing (06/2014), the current firmware download file name for my computer is: opentx-taranis-noheli-en-2.0.3.bin. The filename of the first firmware you download will probably be similar, but without the “noheli” segment. OpenTX Companion allows you to configure a custom tailored version of the firmware for your transmitter. Since I don’t fly heli’s, I’ve elected to not include helicopters in my world. The downloaded firmware filename reflects that."

There are two ways to flash firmware after you’ve flashed it for the first time:

Method #1:

Just as we did for this lesson. That is, through OpenTX Companion with the TX OFF and connected to the computer through a USB cable. This method also rewrites the bootloader, updating it if there have been any changes since the last firmware update. Most consider it to be the easiest, safest, most reliable method of updating the firmware.

Method #2:

With the radio ON in bootloader mode. This method does not update the bootloader, so if there have been any changes to it since the last upgrade, you must jump through a couple of extra hoops to get them. By choosing which method you wish to use (OpenTX Companion or updating from the TX), you have the option of updating both the firmware and bootloader at once, or just the firmware or bootloader individually. To update the firmware using bootloader mode:

  1. We must first copy the new firmware.bin file to the SD card:
    1. Download and save the new firmware to your computer.
    2. Power up the transmitter in bootloader mode. Remember, you already have v2.x on the transmitter, so the OpenTX bootloader is available to us.
    3. After you’re in bootloader mode, connect the transmitter to the computer with a USB cable. Give the computer a few seconds to recognize the transmitter. When it does, the SD card is visible in Windows Explorer.
    4. If you choose, you can remove the Micro SD card from your TX, place it in an appropriate card reader, and access the card in Windows Explorer without turning on the TX.
    5. Whether you choose to turn the TX on or remove the SD card, copy the new firmware.bin file to the FIRMWARES folder.
    6. Replace the card if you removed it, and turn the TX on in bootloader mode as described above.
  2. Highlight “WRITE FIRMWARE” to select it, and press “ENT”bootldrscn_w
  3. Highlight the firmware package you wish to flashbootldr_select_w
  4. Press “ENT” to move to the flash screen
  5. Press and Hold “ENT” to write the firmware.write_firm_w
  6. Press “Exit” as needed to return to the main bootloader screen. Note again that this method,does not update the bootloader, only the firmware.

 

To update only the bootloader using the TX:

  1. Turn the TX on and clear any warning screens.
  2. Long Press the MENU key (hold the key down apprx. 1 sec.) to access Radio Setup
  3. Short Press (tap) the PAGE key to move to the SD-HC card screen
  4. Highlight the FIRMWARES folder and press “ENT” to open it.firmware_hilite_w
  5. Select the firmware file that contains the bootloader you wish to update. Why would you want to use a bootloader that was different from the version of OpenTX that you’re running?
    1. Using the TX to upgrade the firmware doesn’t automatically apply any changes that the new bootloader may contain.
    2. Perhaps there’s a bug in the new bootloader, but the firmware itself works fine. By replacing the new, broken bootloader with an older reliable one, you’re still flying!
    3. Another reason is to retain features you liked in an older version of the bootloader that have been changed in the newer version. Another perfect example of how OpenTX allows you to configure your radio the way YOU want to!bootldr_select_w
  6. Press “ENT” to get to a “Flash Bootloader” screen, similar to the one you saw when flashing the firmware through the TX.
  7. Select “Flash Bootloader” and press “ENT” to replace the existing bootloader with the one you’ve selected.flash_btldr_w
  8. When completed, use “EXIT” to return to the main TX screen.

Well, now you know all there is to know about flashing….firmware, that is. Well, perhaps not everything, but you should have a much better understanding of the process than you had before. Believe it or not, after just a few times through this, it becomes as routine as locking the door of your residence when you leave, or waving at the neighbor on the way out.