Upload Code To ESP32

There are two ways to flash the firmware. If you have already installed the Arduino IDE and CH340 drivers and successfully downloaded the ESP32 core package and necessary libraries, you can continue to flash the firmware in the Arduino IDE by following the steps below.

If you want to experience the features of this kit more quickly or encounter problems during the Arduino IDE installation, you can also click this link to use Espressif’s official flashing tool to flash the firmware to the ESP32 development board, which is simpler and faster. Option 2: Flash Download Tool.


Option 1: Arduino IDE

After completing the previous steps, ensure that the CH340 serial port driver has been installed, the ESP32 core package has been downloaded and installed, and the required library files have been imported. At this point, you can upload the code to the ESP32 development board and start running the program.


Download the Code

1. Click the link below to download the code we prepared. The complete code path is: Code and Libraries → Code → 11.COM_Code/11.SmartHome. Download Code

_images/51.code2.png

Note

The example code examples numbered 1–10 are step-by-step tutorials, with each example demonstrating the functionality of 1–3 modules. If you wish to experience the full functionality of all modules, please directly use example code example number 11 for flashing.

  1. Cick File → Open in Arduino IDE.

  2. In the pop-up window, locate the downloaded code, select the corresponding folder or file, and click Open.

_images/36.upload.png
_images/37.upload2.png

Select a Development Board

Select Tools → Board → ESP32 → ESP32 Dev Module in Arduino IDE.

_images/33.upload1.png

Select the Serial Port

Select the correct serial port: Tools → Port → COMx. COMx should match the port of the connected ESP32 development board.

_images/34.port.png

Check Board and Port Selection

  • Please refer to the diagram to verify whether the selected board and serial port are correct.

  • If the selection is incorrect or missing, return to the previous steps to set it again.

_images/35.upload.png

Upload Code

  1. Click the Upload icon in Arduino IDE. The system will automatically compile and upload the code to the ESP32 development board.

_images/39.upload1.png
  1. The Output window will display the compilation and upload progress. The process may be slow, so please wait patiently until the code is successfully uploaded.

_images/40.upload.png
  1. When the message ā€œLeaving… Hard resetting via RTS pinā€¦ā€ appears in the Output window, the code has been uploaded successfully. Press the RST button on the ESP32 board to start running the program.

_images/41.upload.png

Note

  • If the code fails to upload, follow these troubleshooting steps:

  • Confirm that the selected port in Tools → Port corresponds to the connected ESP32 board.

  • Confirm that the correct ESP32 board model is selected in Tools → Board.

  • Ensure that the CH340 serial driver (or other required USB driver)is installed and the board is recognized in the device manager.

  • Try changing the USB port or using a different USB data cable that supports data transfer.

  • Confirm that the ESP32 core package is installed and all required libraries are imported.

  • Use the recommended library versions; mismatched versions may cause compilation or upload errors.

  • Make sure no other program is using the serial port, such as Serial Monitor or other tools.

  • If upload fails, press the RST button on the ESP32 board and try again.


Option 2: Flash Download Tool

Of course, if you find the above steps cumbersome or encounter unresolved errors during the Arduino IDE flashing process, you can also use Espressif’s official flashing tool.We’ve packaged the complete program as a bin file. You can flash the firmware directly to your ESP32 development board without importing libraries or downloading the ESP32 core package, helping you quickly and conveniently experience the full capabilities of this kit.


Install CH340 Driver

  • Similarly, before using Espressif’s official flashing tool, you must first install the CH340 driver so that the ESP32 development board can communicate properly with your computer. If the CH340 driver is not installed, please see the CH340 driver installation tutorial page: See 2.Install CH340 Driver for detailed instructions.


Download burning tools

  1. You can directly click this link to download the burning tool installation package we prepared. Burning tool installation package, Or refer to the following steps to download the latest installation package provided by Espressif’s official website

  2. Click this link to enter Espressif’s official burning tool download page. Espressif Burning Tool

_images/42.TOOL.png
  1. Click the Download button in the image to automatically download Espressif’s official programming tool. The tool’s features and instructions are also provided at the bottom of the page. If you’re interested, please read and learn more.

_images/43.TOOL.png
  1. After decompressing the downloaded compressed file, you will see several files contained in it, as shown in the figure below.

_images/44.TOOL.png
  1. Click this link to download the bin firmware file we prepared for you. Download firmware

  2. Move the downloaded bin firmware file to the bin folder in the previously downloaded and unzipped burning tool directory.


Burn firmware

  1. Connect the ESP32 development board to the computer via a USB cable and make sure the computer can correctly identify the corresponding serial port.

  2. Double-click to open the burning tool.

_images/45.TOOL.png
  1. On the pop-up page, select ESP32 from the ā€œChip Typeā€ drop-down menu, select Develop from the ā€œWorkModeā€ drop-down menu, and leave UART as the default setting for ā€œLoadModeā€. Click OK when finished.

_images/46.TOOL1.png
  1. Follow the instructions in the picture to import the downloaded firmware named ā€œ.10.SmartHome_CompleteCodeā€, check the firmware file in the box on the left of the software interface, and enter ā€œ0ā€ in the box on the right to complete the settings for importing the firmware.

_images/47.TOOL.png
_images/63.bin.png
  1. Set the parameters as shown in the picture: SPI SPEED select 80MHz, SPI MODE select DIO, COM select the serial port actually connected to the computer, and BAUD set to 921600.

_images/48.TOOL.png
  1. After completing the above settings, click the START button and the system will automatically start burning the firmware. Please wait patiently for the burning to complete.

_images/49.TOOL.png
  1. After the burning is completed, the interface will display the FINISH prompt. At this time, press the RST reset button on the ESP32 development board and the system will start running.

_images/50.TOOL.png

Note

If the flashing process fails, please follow these steps:

  • Confirm that the ESP32 development board is properly connected to the computer via a USB cable and that the CH340 driver is installed.

  • Check that COMx in the flashing tool is the actual serial port number.

  • Confirm that the firmware file is correctly placed in the BIN folder and check the box on the left.

  • Verify the flashing parameter settings: SPI SPEED = 80MHz, SPI MODE = DIO, BAUD = 921600.

  • Try changing the USB cable or USB port to eliminate communication issues.

  • If flashing still fails, restart the computer and development board and try again.