CoreP4X: Flash Firmware & Run Code
1. UiFlow2 Firmware Flashing
- Connect CoreP4X to the computer using a USB Type-C cable. After connecting, press and hold the power button until the green LED flashes, indicating that the device has entered download mode.
- Open the CoreP4X UiFlow2 firmware page on the M5Burner website, then click
Burn to device in the interface to start flashing the UiFlow2 firmware.
- In the pop-up window, select the baud rate for serial communication, then click
Select COM.
- Select the port corresponding to the device, then click
Connect.
When the interface displays Connected to xxx, the port is connected successfully.
- Click
Burn, then click Start in the pop-up window.
- Fill in the Wi-Fi configuration required for the device, including the Wi-Fi SSID, Wi-Fi Password, and any other device settings that need to be added or modified, then click
Next.
Configuration information:
- COM: Select the serial port corresponding to the device
- Baud rate: 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
- Run main.py directly: After flashing, directly run the program in main.py 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 screens display the UiFlow2 startup screen
- Only network setup: The device only connects to the network and does not display the UiFlow2 startup screen
When Burn successfully is displayed, flashing is successful. Please 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
Configuration, and modify the settings according to the on-screen instructions.
2. Device Connection
CoreP4X 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 tutorial:
Access Code Wireless Connection
- Before connecting, confirm on the device screen that it is connected to the network. If the network connection fails, check that the Wi-Fi name and password entered during firmware flashing are correct. Then click
Configuration on the firmware flashing page, update the configuration, and flash the firmware again.


- Check the currently 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 CoreP4X to UiFlow2.
Access Code Description
1. Changing browsers, using private / incognito mode, or clearing the UiFlow2 website cache will invalidate the original pairing state.
2. Closing only the tab, restarting the browser, logging in, or logging out will not affect a bound pairing relationship.
3. Once the device is bound and paired by another browser, the original browser's pairing relationship becomes invalid immediately.
- On the
Select Device page, select the connected CoreP4X device, then click Confirm to enter the UiFlow2 programming interface.
USB Wired Connection
- Visit uiflow2.m5stack.com to open the UiFlow2 Web IDE, then connect CoreP4X to the computer using a USB Type-C cable.
- Click
Select Your Controller on the page (shown on first entry) or the Controller button to enter the Select Device page.
- Select CoreP4X from the device list, then click
Confirm.
- Click the
WebTerminal button, select the serial port for CoreP4X in the dialog, and click Connect.
When the WebTerminal window displays Connected to Serial Port!, the USB connection is successful.
3. Program Run and Download
After the device is connected to UiFlow2, you can edit programs by dragging Blockly blocks.
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 the program once or download it in the WebTerminal window.