StackChan: Flash Firmware & Run Code
1. UiFlow2 Firmware Flashing
- Refer to the UiFlow2 Web IDE Tutorial to learn the basic workflow of UiFlow2 and complete the installation of the M5Burner firmware flashing tool.
- Download the firmware for
StackChan in M5Burner, as shown below.
- Connect the computer and StackChan with a USB-C cable. Both the USB-C port on the main unit and the USB-C port on the base support data transfer. It is recommended to use the base port to avoid accidents caused by motor movement. Press and hold the
RST reset button for 3 seconds. When the indicator next to the button turns green, the device has entered download mode and you can release the button.
- In M5Burner, click the
Burn button for the corresponding firmware, select the device port, and click Start.
- Enter the Wi-Fi configuration required by the device, including Wi-Fi SSID and Wi-Fi Password, as well as any other device configuration that needs to be added or modified, then click
Next to start flashing.
Configuration information:
- COM: Select the serial port corresponding to the device
- BaudRate: Baud rate for serial communication
- Server: Server address the device connects to
- WIFI SSID/WIFI Password: Wi-Fi name and password used by the device
- SNTP Server:
- SNTP0: Alibaba Cloud NTP server (China)
- SNTP1: Japan NTP server pool
- SNTP2: Global public NTP server pool
- Timezone: Time zone setting
- Boot Option: Set the device boot mode after firmware flashing is complete
- run main.py directly: After flashing is complete, run the program in main.py directly without connecting to the network or displaying the UiFlow2 startup screen
- show startup menu and network setup: The device connects to the network, and devices with a screen will display the UiFlow2 startup screen
- only net work setup: The device only performs network setup and does not display the UiFlow2 startup screen
- When
Burn successfully, click here to return is displayed, flashing is successful. Reset the device at this point.
- After firmware flashing is complete, if you need to modify the device configuration, keep the USB connection, restart the device, click
Configure, and modify the settings according to the prompts.
2. Device Connection
The device supports connecting to UiFlow2 via Access Code (wireless network) or USB (wired connection to a computer) for program pushing and debugging. Refer to the following steps:
Access Code Wireless Connection
- Before connecting, check the Wi-Fi icon on the screen to make sure the device is connected to the network. If the network connection fails, check whether the Wi-Fi name and password entered during firmware flashing are correct, then modify them through the
Configure option in M5Burner and flash again.


- Check the current valid
Access Code on the device's UiFlow2 startup screen.
- Visit uiflow2.m5stack.com to open the UiFlow2 Web IDE.
- Click
Select Your Controller on the page (shown on first entry) or the Controller button to enter the Select Device page.
- Click
Connect Device, enter the access code and a custom device name, then click Confirm to connect StackChan to UiFlow2.
Access Code Description
1. Changing browsers, using private/incognito mode, or clearing the UiFlow website cache will invalidate the original pairing state.
2. Closing only the tab, restarting the browser, or logging in or out of the account will not affect the existing pairing relationship.
3. Once the device is paired by another browser, the original browser's pairing relationship becomes invalid immediately.
USB Wired Connection
- Visit uiflow2.m5stack.com to open the UiFlow2 Web IDE, and connect StackChan to the computer with a USB cable.
- Click
Select Your Controller on the page (shown on first entry) or the Controller button to enter the Select Device page.
- Select StackChan from the device list, then click
Confirm.
- Click the
WebTerminal button, select the serial port for StackChan in the dialog, and click Connect.
When the WebTerminal screen displays Connected to Serial Port!, the USB connection is successful.
3. Program Run and Download
After the device is connected to UiFlow2, you can drag Blockly blocks to edit programs.
After editing the program, click the Run Once button in the lower-right corner to run the program once for testing. Click Run Always to download the program to the device.
You can also run once or download the program in the WebTerminal window.