Cardputer-Adv: Flash Firmware & Run Code
1. Preparation
- Refer to the UIFlow2 Web IDE Tutorial to understand the basic workflow of using UiFlow2 and complete the installation of the M5Burner firmware burning tool.
- Log in or register on M5Burner. After the device is successfully burned, the device information will be bound to the account.
2. Burning Firmware
- Set the power switch on the side of the Cardputer-Adv to the
OFF position, then before powering on, press and hold the G0 button, release it after powering the device from the back, and the device will then enter download mode.
- In M5Burner, download the firmware adapted for
Cardputer-Adv as shown below.
- Select the port. Connect the device to the computer via a USB cable, click the Burn button for the corresponding firmware in M5Burner, select the port for the device, and click
Start.
- Fill in the Wi-Fi configuration that the device needs to connect to, including Wi-Fi SSD and Wi-Fi Password, as well as any other device configurations that need to be added or modified, then click
Next to start burning.
Note
If your device is connecting for the first time, you need to bind it to this account.
- When prompted with
Burn successfully, click here to return, the burning process is complete. At this point, restart the device to apply the burning information.
- COM: Serial port
- BaudRate: Baud rate for serial communication
- Server: Server address the device connects to
- WIFI SSID/WIFI Password: Wi-Fi name and password for device connection
- SNTP Server
- SNTP0: Alibaba Cloud NTP server (China)
- SNTP1: Japan NTP server pool
- SNTP2: Global public NTP server pool
- Timezone: Timezone setting
- Boot Option
- run main.py directly: Run main.py directly
- show startup menu and network setup: Display the startup interface (NEMU) and network setup
- only network setup: Network setup only
3. Modifying Device Configuration
After completing the firmware burning, if you need to modify the device configuration, keep the USB connection, restart the device, use M5Burner to click the Configure option, make the changes in the pop-up configuration window, then click Next to re-modify and burn the configuration information.
4. Logging into UiFlow2
Go to the UiFlow2 page and click the user icon in the upper right corner to log in to your UiFlow2 account.
UiFlow2 Account
This account must be the same as the one used to log in to M5Burner. After successfully logging in, devices under this account that are connected to a valid Wi-Fi network can be viewed by clicking Select Device. To change the device owner, you need to unbind the device from the account.
5. Entering the Programming Page
You can connect the device to UiFlow2 via Wi-Fi or USB to enter the programming page. The methods are as follows:
Wi-Fi Method
Note
Ensure Wi-Fi has been configured: During the burning process, configure Wi-Fi and other information in the Configure section of M5Burner.
Enter the device list.
Select the online device and click Confirm.
Successfully enter the UiFlow2 programming page for the device.
USB Method
- Connect Cardputer-Adv to your computer using a USB cable, select the Cardputer-Adv device module from the device list, and click
Confirm.
- Click the
WebTerminal button.
- In the pop-up dialog, select the serial port for
Cardputer-Adv and click Connect.
When the WebTerminal screen displays Connected to Serial Port!, the USB connection is successful and you can enter the UiFlow2 programming page for the device.
6. RUN
After completing the above steps, you can start programming with UiFlow2.
7. UiFlow2 Firmware Main Interface Function Module Description
UiFlow2 program includes five functional modules
DEVELOP:Displays basic information of the current device, including the MAC address and the bound user account.
APP.RUN:Configures the running mode for UiFlow2 downloaded programs.
APP.LIST:Manages the list of saved user programs.
EZDATA:Provides cloud data interaction capabilities, supporting data upload and synchronization.
SETTING:Centralized management of common device system settings, such as screen brightness adjustment and Wi-Fi network configuration.
After the device (Cardputer-Adv) boots up, the keyboard defaults to a low-power sleep state. To enable keyboard input functionality, the user must perform the following actions simultaneously:
Hold down the fn key on the keyboard with the left hand to wake up the keyboard; use the right hand to press the desired key on the keyboard. This operation ensures the keyboard is successfully activated and responsive to subsequent inputs.
- DEVELOP
- MAC address
- The account bound during the M5Burner burning process, used for offline development
- APP.RUN
- When you use UiFlow2 to download the edited program to the device, the system will automatically write the program into the main.py file under the APP.RUN directory (overwriting the existing content) and immediately run it
- If you add a program named main.py to the APP.RUN directory through other methods (such as manual import), you can also run it on the device by selecting RUN(ONCE) for a one-time run or RUN(ALWAYS) for continuous running options
Note: The main.py file must not be deleted. If it is deleted, when entering the APP.RUN program, the device will freeze. After executing the UiFlow2 program for burning or running the main.py program, it is impossible to return to the main interface of UiFlow2. You need to use M5Burner again to perform Config configuration and update the firmware.
- APP.LIST
- After you become familiar with UiFlow2 development, you can manually write Python programs (using any code editor). Click the WebTerminal at the lower left corner of the UiFlow2 interface, connect the device via USB, click the "file" folder, and import the program files into the /flash/apps directory on the device. Place the files in the directory. Once the device is powered on, you can test and run the program at any time
- SETTING
- Configure Wi-Fi
- Adjust the screen brightness