Flashing LiteWing Firmware

Published  January 1, 2025   0
Flashing LiteWing Firmware
Flashing LiteWing Firmware

Setting Up ESP-IDF

To develop and upload firmware for the LiteWing drone, you need to set up ESP-IDF on your system. The LiteWing firmware is based on ESP-IDF v4.4, so installing this version ensures compatibility. Follow the official ESP-IDF Programming Guide for installation and setup instructions for the ESP-IDF. You can either build the firmware from scratch using the source provided at the Github repo below, or you can just flash the binary file provided within the same repo if you don’t want the hassle. Make sure to use the source code provided within the below GitHub, because there are many modifications on the Espressif’s code to fix several issues..

Building from Source using ESP-IDF

The LiteWing firmware is hosted on GitHub and can be cloned as per your needs. To start with, clone the LiteWing repository to your PC and navigate to the firmware folder using the following commands:

git clone https://github.com/Circuit-Digest/LiteWing.git 
cd LiteWing

Once you are in the firmware folder set the build target to ESP32-S3 using the following command. This is only needed to be done once.

idf.py set-target esp32s3

If you want, you can change all the firmware configurations using menuconfig. For our use case, the current configuration is enough, and you don’t need to change anything. To use the menuconfig, navigate to the LiteWing Firmware folder as instructed above and then use the following command, which will open up the menuconfig menu.

idf.py menuconfig

To flash the firmware binary to the LiteWing you can use the following command. The flash command will automatically build and flash the binary to the ESP32-S3, so running idf.py build is not necessary.

idf.py -p PORT flash

Replace PORT with LiteWing’s serial port name. And if you face any issues during the flashing, such as the flashing fails in the middle, use -b 115200 with the previous command to reduce the download speed.

Flashing LiteWing Firmware from Binary

If you don’t want to modify the firmware, and just need to reflash or update the firmware, download the latest firmware binary files from the following link.
https://github.com/jobitjoseph/LiteWing/tree/main/LiteWing%20Firmware%20binary%20files 

Once the firmware file is downloaded, download the Flash download tool from the following link and extract it into a folder. https://www.espressif.com/en/support/download/other-tools

Downloading Firmware File for LiteWing Drone

Run the exe file and select ESP32-S3 as chip type, and all other options as per the image below.

Selecting ESP32-S3 as Chip Type

In the flash download tool, select the 3 firmware files, select the corresponding check box and enter their correct address. Now connect the LiteWing to the PC via a USB Type-C cable and select the correct COM port. Click on the START  button.

Choosing The Correct COM Port

If everything is correct, the flashing process will start and the progress bar will show the flash progress.

LiteWing firmware upload status - Process Bar

Once the flashing is finished, you can start using the LiteWing.

Firmware Upload Status Completed in LiteWing Drone

If you don’t want to install the Flash Download Tool, or you don’t have a Windows PC, you can use the online flashing tools to flash the firmware binaries. The first best online tool to use is the ESPtool.js. To use it, go to the ESPTool.js website.

ESPtool.js web interface for LiteWing

Once the LiteWing is connected to the PC, click on the Connect button.

LiteWing Drone Connected to a PC for Firmware Flashing

This will open up a new pop up with a list of all available serial ports. Select the USB Serial (cu.wchusbserial110).

Selecting the USB Serial Port

After LiteWing is successfully connected, the webpage will give you the option to add the binary files. Click on add to add files. Make sure to provide the correct flash address for the corresponding binary file. Once all the files are added, click on the Program button to start the flashing process. Sometimes the ESP32-S3 won’t be automatically reset after the flashing is completed, due to the web api bug. In that case, manually reset the LiteWing using the Reset button onboard. 

Once the firmware is flashed successfully, you are ready to fly the LiteWing. Follow the instructions provided in the Start Flying With LiteWing section to start flying the LiteWing.

Have any question realated to this Article?

Ask Our Community Members