Flashing Guide

warning

Flashing custom firmware is only recommended for advanced users. A flashing failure may result in a bricked board or even hardware damage.

Required hardware

  • PhotonDrive ESC 150
  • ST-Link V2 programmer dongle
  • Flight controller
  • BLDC motor
  • Battery or other power source (6S-15S LiPo recommended)
  • Power leads (8-12 AWG cable recommended)
  • Signal wire
info

We strongly recommend using high-quality silicone-insulated wire for all power connections.

Required software

Binaries for the pre-installed firmware can be found below:

Download original ESCape32 bootloader Download original ESCape32 firmware

Bootloader flashing

info

This guide uses the ESCape32 firmware as an example. We recommend searching for guides specific to your firmware on the internet.

Before flashing the custom firmware, its bootloader must be installed onto the ESC over SWD. The bootloader is a small program that allows the ESC to be flashed using the input signal pin.

ESC 150 SWD Pinout
ESC 150 SWD Pinout
  1. Connect the ST-Link V2 programmer to the ESC’s SWD connector.

    • 3.3V to 3
    • GND to G
    • RST to R
    • SWDIO to D
    • SWCLK to C
    warning

    Though the flashing connector pins have ESD protection, be careful when attaching the programmer not to cause damage.

  2. Connect the ST-Link V2 programmer to your computer.

  3. Start the STM32CubeProgrammer and select your ST-Link V2 programmer in the right sidebar using the Serial number field.

  4. Click Connect and wait for the connection to be established.

  5. In the right sidebar, click Full chip erase (2nd to last option) to erase the ESC’s ROM.

  6. Next, click on Erasing & Programming (2nd option) and select the bootloader binary (preferably .hex file).

  7. If the bootloader only comes as a .bin file, set the Start address to 0x08000000.

  8. Click Start programming and wait for the process to finish.

    Bootloader Flashing
    Bootloader Flashing

  9. Lastly, click Option bytes (3rd option) and make sure the BOOT_LOCK bit (under Secure Protection) is set, then click Apply.

Once the bootloader is flashed, unplug the ST-Link V2 programmer and proceed with flashing the firmware itself.

Firmware flashing

This section heavily relies on the firmware you are using. Please refer to the firmware’s documentation for specific instructions.

For ESCape32, you will need the ESCape32 Tools.

  1. Connect a generic USB-Serial adapter to the ESC’s input signal pin via a diode-transistor circuit.

    • RX to Collector
    • TX to Base via a 1kΩ resistor
    • Emitter to ESC Input Signal
    • Emitter to TX via a diode
    • GND to ESC GND
    Firmware Flashing Adapter Schematic
    Firmware Flashing Adapter Schematic
  2. Flash the ESCape32 firmware using the ESCape32 Tools.

     ./escape32-update -p <serial-port> <path-to-firmware-file>
    

    On Windows, use serial port format /dev/ttyS# where # is the COM port number minus one (e.g., COM4/dev/ttyS3).

    For more information, check out the ESCape32 installation guide.

    ESCape32 Tools
    ESCape32 Tools

  3. Test the ESC with the ESCape32 CLI tool.

    ./escape32-cli -p <serial-port>
    

    Start by typing throt 0 to arm the ESC, then use throt <value> to set the throttle (0-2000).

    warning

    Be extremely cautious when operating the ESC. Make sure the motor is well mounted and won’t move before setting the throttle.

    warning

    Do not run the motor at high power or for extended periods of time without a propeller, the ESC may overheat.

    ESCape32 Tools CLI
    ESCape32 Tools CLI

And just like that, you’re done!

Happy flying!