Welcome to MicroROS Self-balancing Car repository
1.Write firmware
Write firmware
Write firmware1. write ESP32 communication board firmware1. Install CP2102 serial port driver2. Download Flash Tool3. Configure the writeing tool4. Clear chip data (optional)5. Start writeing firmware6. writeing completed7. Check the factory firmware2. write the STM32 control board firmware1. Hardware connection2. Program download
Note: The ESP32 communication board and STM32 control board have factory firmware writeed in. If you have not writeed other firmware, you do not need to write the factory firmware again.
The factory firmware of the ESP32 communication board only provides bin file writeing, and the factory firmware of the STM32 control board only provides hex file writeing, and does not provide program source code.
The factory firmware is stored in the [Source Code Summary]->[Factory-Firmware] directory in the document
1. write ESP32 communication board firmware
1. Install CP2102 serial port driver
If the Windows system has already installed the CP2102 serial port driver, you can skip this step.
The CP2102 serial port driver file path is in the [Hardware Information]->[CP2102 Serial Port Chip]->[CP2102-Windows driver file.zip] of the supporting information.
After decompression, you will get the [CP2102-Windows-driver] folder. Select x64 and x86 according to the system version. Here, take 64-bit Win10 as an example. Double-click to open the [CP210xVCPInstaller_x64.exe] file and click Next to start the installation.


After the driver is installed, the prompt status is [Ready to use], click Finish.

After connecting the computer to the ESP32 communication board, open the [Device Manager] of the Windows system. If you see a CP210x device in [Port], it means that the driver has been installed successfully.


2. Download Flash Tool
Download URL:
https://www.espressif.com.cn/zh-hans/support/download/other-tools

Unzip to get flash_download_tool, double-click to open.
As shown in the figure below, select serial port to write ESP32-S3. Click OK to open the writeing tool.

3. Configure the writeing tool
In ‘SPIDownload’, select the firmware microROS_Balance_Car.bin to be writeed to ESP32S3, enter 0x0 for the firmware address, and make sure to check the box on the left of the bin file, and both the file and address have a green background.
Check DoNotChgBin, select the connected COM port, and keep other configurations as default.
| Firmware name | Firmware address | Remarks |
|---|---|---|
| microROS_Balance_Car.bin | 0x0 | Factory firmware bin file |

4. Clear chip data (optional)
Note: Clearing the flash chip data is not necessary. Under normal circumstances, the chip data does not need to be cleared.
If the chip data is cleared, after writeing the factory firmware, the robot needs to be reconfigured according to the actual situation before it can be used normally.
Under normal circumstances, it is not necessary to clear the robot's configuration data when writeing the factory firmware. If you need to clear the configuration data, please clear the flash chip first.
Click the ERASE button, and the tool starts to clear all the data on the flash chip.

Wait for the prompt to complete and proceed to the next step.

5. Start writeing firmware
Click the START button and the tool will automatically start writeing the firmware.
Note: If the firmware does not start writeing automatically, please press and hold the boot0 key, then press the reset key, release the boot0 key, manually enter the writeing mode, and then click the START button.

6. writeing completed
After the download is complete, the blue FINISH logo is prompted. At this time, power off and restart the MCU or press the reset button to start the program, and close the writeing tool.

7. Check the factory firmware
The storage path of the serial port assistant software is in the [Software Tools]->[UartAssist 5.0.3.zip] of the supporting materials.
Open the serial port assistant, as shown in the figure below, select the serial port number of the ESP32 communication board, the baud rate is 115200, 8-bit data, 1-bit stop, no check, and no flow control.
Press the reset button of the ESP32 communication board, find the hello Yahboom prompt in the printed debugging information, and check the firmware version number in the line below. If the information is correct, it means that the factory firmware has been writeed successfully.

2. write the STM32 control board firmware
1. Hardware connection
Use the Type-C data cable to connect the computer USB interface and the Type-C writeing interface of the development board:

2. Program download
After connecting the computer with the Type-C data cable, you can view the serial port number of the corresponding device in the device manager: port.

write the firmware mircrRos_Balance_STM32.hex file in the data to the STM32 control board through the FlyMCU software:

After clicking Start Programming, press the reset button of the STM32 control board to automatically write.