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.


Comments

Boot Loaders — 24 Comments

  1. Hello there ,

    really sorry about this post im sure iv made some stupid error as i was obviously excited to get into the new radio asap…

    I recently bought a U.S.A radio that had been flashed with a German language. (im based in Germany)

    everything was working fine but the menus were all in german etc..

    serial as follows

    X9E001120A01
    C02 HKHK
    9/10/2015

    I quickly looked online for language changing setting and instantly found i had to flash the radio with the new firmware to change the menu text to english

    so i tried 1st on my mac with the 2.1.7 companion and firmware from this page
    http://www.open-tx.org/2016/01/04/opentx-2.1.7

    with the horizontal trim to centre and power on method.

    the firmware seemed to flash correctly and i rebooted the radio.

    then i got vibration motors at full , and voice throttle warning switch warning , with the lower display going threw a list of warnings also.

    i then tried the power off method on both osx and windows//////

    next i got the same issue only this time NO SCREEN DISPLAY , just voice warning and vibrating….

    aghhhhhhhhhhhhh

    and now the horizontal trim to centre and power on method does nothing …… ……

    please help and please dont tell me its bricked , really hoping someone here can help me out or lead me to where i can find help !!
    many many thanks !!!

    : eek:

    • sorted , so sorry … the companion was in frsky taranis mode instead of frsky taranis x9e , in the settings tab so yeah i was clearly trying to install the firmware from another radio … sorry for this stupid errror…

      thanks

  2. I tried to follow the guide. But when I plug the USB cable into my radio while it is switched of or from the bootloader mode a permanent vibration (alarm) kicks off. Not pretty what is wrong. I tried it with different cables and computer on linux and windows. Always the same.
    Any idea what is wrong?

    Help is very much appreciated as I cannot use Companion at the moment.The HW is brand new, just unpacked.
    Many thanks in advance, Lars

  3. I’m new here – I am trying to figure out why I can not turn on my Taranis X9D (original) since flashing the new firmware through Companion 2.0.17. Win 8.1 64 bit – followed the instruction from the video – flashed okay but now it will not turn on. I’ve unhooked the battery, removed the sd card – connected unconnected, tried to reflash , checked the battery, checked connections – no luck.

    Is there a rest or steps I can take to get this turned back on? Yes I did the 3 finger boot but nothing.
    Thanks

    • Did you happen to flash the TX with “OpenTX for the FrSky Taranis” instead of the version for the “OpenTX for the FrSky Taranis Plus? That may be the problem. If so, you may have to install the Zadig driver and re-flash with the TX off. Just for kicks, open Companion and see which version is selected int the Settings –> Settings window.

      Hope this helps!

      Leonard (mac44mag)

    • Hi,
      Trying to flash 2.1.8 on to Taranis X9e form 2.1.6, I went through similar experience. TC was reading some data from the Radio before upgrade, but totally bricked after the write. This was after Zadig driver install etc. Have posted the failure log at the end of this. The reason seems to be driver incompatibility with Windows 10! May be Win 8.1 too. Multiple tries with other drivers in place of STM boot loader did not work, dfu-Util error.

      I repeated the same process (same s/w, WinUsb from Zadig STM substitute driver) on a Vista 64 PC and it worked like magic. Looks like a USB driver compatibility issue in higher versions of Windows (not sure of Win 7).
      Btw, Zadig may time out during install and abort, just repeat and install the WinUSB driver.

      Vista saved the day.

      Good luck.
      ————————
      Below is the error log:
      C:/Program Files (x86)/OpenTX/Companion 2.1/dfu-util.exe -a 0 –dfuse-address 0x08000000 -d 0483:df11 -DC:/Users/Mohan/Downloads/Open-TX Taranis/opentx-taranisx9e-en.bin
      =================================================================================
      dfu-util 0.7

      Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
      Copyright 2010-2012 Tormod Volden and Stefan Schmidt
      This program is Free Software and has ABSOLUTELY NO WARRANTY
      Please report bugs to dfu-util@lists.gnumonks.org

      Filter on vendor = 0x0483 product = 0xdf11
      Opening DFU capable USB device… ID 0483:df11
      Run-time device DFU version 011a
      Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=0, name=”UNDEFINED”
      Claiming USB DFU Interface…
      Setting Alternate Setting #0 …
      Determining device status: error get_status

      =================================================================================

  4. Leonard,
    I am using taranis x9d v 1.1.02. I was told by aloft hobbies where I bought the transmitter that it is an older version and does not enter eeprom using the 3 finger method. He said just connect with usb. He also said I needed to use the correct companion program with my transmitter. I have no idea which one that is. I am not so interested in upgrading the firmware but it would be nice to be able to use the computer to set up models and share back to transmitter. He said that was possible but I still need to use the correct companion version. Again I have no idea what version I should use. I have two on my computer now, one is open tx companion and the other is companion 9x. I did use zidig to upgrade to the stm bootloader and that worked, but I do want to go any further until I no the correct version.
    Thanks, Charles

    • Hi, Charles!

      OK, now it makes sense….I think.

      The developer changed the title/name of the GUI used to work with the EEPE data from “Companion9X” to “OpenTX Companion) when OpenTX went from V1.+ to v2.+. Don’t feel alone. There were others (myself included) that tripped over that one.

      One of the biggest advantages of having either the FrSky OEM version or the Developer’s version v2.+ is that v2.+ already has the bootloader installed, therefore you can enter bootloader mode with the “three finger boot” method. With version 1.+ (such as you have), that doesn’t happen. Another major difference is that beginning with v2.0, the current version of OpenTX Companion won’t work with versions prior to it. So, the good news is that you’re not doing anything wrong, nor is there anything wrong with your TX. You’re both just not on the same page. More good news is that if all you wish to do is work with the EEPE data, the bootloader isn’t required. From what I understand, it’s only needed when upgrading the firmware.

      The bad news is that you need Companion9X (not OpenTX Companion) to talk to your v1.+ transmitter. I believe, but don’t take this to the bank, that Companion 9X will talk with the FrSky version of OpenTX that you’re running. You’ll need Companion9X v1.52. You can download a copy from: https://code.google.com/p/companion9x/downloads/list .

      My recommendation would be to download and install the v1.52 of Companion9X, open it, turn your TX on, and plug your radio into your computer via USB. Click the “Read Files from Radio” (or something similar) icon in the toolbar and see what happens. If it opens your EEPE data, then you’re good to go for setting up and editing model profiles. If it doesn’t you might try going back and reviewing the lessons in Undergraduate –> Fun. of Windows. There are some configurations and settings in there that you may wish to check. You will also have to install the Zadig drivers if you wish to flash the firmware to a newer version.

      Hope that helps, and let me know how it turns out.

      Take care!

      Leonard (mac44mag)

      • Leonard,
        Yes I can talk to companion 9x read/write eeprom. If I decide to upgrade the firmware using companion 9x is there a significant difference, rather than just leaving it stock?
        Charles

        • Leonard,
          It turns out I can use optnn tx companion to upgrade my firmware. I just did not need to do the 3 finger bootup to save my eeprom. Everything else worked just fine as I went step by step through the opentx univ. lessons. I now have my taranis with the 2.1.15 fireware installed and the eeprom has updated and moving on to understanding the bootloader. Aat this point everything seems to work fine.
          Charles52

          • Charles:

            Cool! It appears as if you were able to get the Zadig bootloader installed on your machine which then let you address the EEPROM directly. Most excellent!

            Happy to hear that you got it fixed!

            Leonard

  5. I was trying to look at anything on my Taranis (‘b’) with usb connected but power off, per “Method #1” above, but in my PC (Dell 17R, Win7 USB2 ports), there’s no indication of USB connection and Companion indicates thusly. For me to do anything with Companion I need the TX powered on with trims to the inside, and the USB is plugged in *after* the power-on.

    Perhaps something changed?

    • As I understand it, you’ll only see the radio with the TX off when you’ve got the correct USB driver installed. Most of us just run Zadig and go from there (Undergraduate –> Fund. of Windows –> Using Zadig).

      Hope this helps!

      Leonard (mac44mag)

      • That seems to be the case. I went through the Zadig stuff to get the TX up to OpenTx2.0 on my main PC. On this laptop which will act as a ground station for ArduPilot stuff, it seemed to correctly install the right driver when I hooked it up initially. But a look at Device Manager showed a caution icon next to STM Bootloader, so I went ahead and Zadig’ed it. Now I can work with firmware without turning on the radio.

        A further confusion point is that I tried to read models within Companion while hooked up with power off, and that appears to require power-on-with-trims-held in order to work regardless of the driver — if the radio wasn’t on, Companion would tell me to turn it on with trims held.

        At any rate, thanks for the suggestion and clarification.

        • Yes, you need to be in Bootloader mode (power on using 3-finger boot) in order to read the profile data from the transmitter. Nice work getting Zadig up and running!

          Leonard (mac44mag)

          • My taranis x9d will not enter bootloader mode using the 3 finger process. I am at the backup eeprom stage of flashing the opentx firmware. Any other way to enter bootloader mode?

          • Hi, Charles!

            Sorry to hear about the confusion. Couple of questions: A) What version are you using? B) Have you ever been able to access Bootloader with the three finger boot?

            Not sure that I can help, much, but we’ll see what happens. If you get it figured out, please post here so that others may benefit.

            Take care!

            Leonard (mac44mag)

  6. Hi Leonard,
    thanks for taking in account my comment. To me, the confusing part (at least it confused me a lot) is: “Select the file that contains the bootloader you wish to use”.
    I think that “Select the firmware file that contains the bootloader version you wish to use” would be more meaningful. Maybe you could add a note somewhere such as (with a better English, since I’m a froggy 😉 ):
    NOTE: the “firmware.bin” contain 2 parts:
    – a firmware part used by Companion or the Taranis to update the firmware of the TX (in fact the OS of the radio), when it is powered-up in Bootloader mode.
    – a bootloader part used by the Tarnis to update its bootloader when the radio is powered-up in normal mode.
    – both (firmware + bootloader) can be updated at the same time when the Taranis is OFF and plugged to the USB port of a PC using the Zadig driver.
    End of the NOTE.

    Concerning the last point, (I just checked it), the total number of character is (as you guessed) 32 including the extension file name. So max length is 28 and “.bin” = 4 (dot is counted as 1 character).

  7. In the section “To update the bootloader using the TX”, when you said “5- Select the file that contains the bootloader” it is confusing. The bootloader file is indeed the Firmware file (same file)! The Taranis will extract the bootloader from the firmware and update ONLY the bootloader.
    I think this point should be clarify. Another comment: the length of the firmware name in the FIRMWARE SD card folder must be NOT too long, otherwise the Taranis will not see it. For ex in my case: “opentx-taranisplus-lua-fr-2.0.12.bin” was too long, but “taranisplus-lua-fr-2.0.12.bin” was fine.

    • I’ve changed the section header to indicate only the bootloader is uploaded using this method. The length of the firmware name is listed in another lesson, but I don’t have an actual character limit. Do you? My guess, and it’s just a guess, would be 32. In your example, the original has 36 characters and was too long, while the successful name had 29.

Leave a Reply